hpp-manipulation 6.0.0
Classes for manipulation planning.
Loading...
Searching...
No Matches
manipulation-planner.hh
Go to the documentation of this file.
1// Copyright (c) 2014, LAAS-CNRS
2// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3//
4
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are
7// met:
8//
9// 1. Redistributions of source code must retain the above copyright
10// notice, this list of conditions and the following disclaimer.
11//
12// 2. Redistributions in binary form must reproduce the above copyright
13// notice, this list of conditions and the following disclaimer in the
14// documentation and/or other materials provided with the distribution.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
27// DAMAGE.
28
29#ifndef HPP_MANIPULATION_MANIPULATION_PLANNER_HH
30#define HPP_MANIPULATION_MANIPULATION_PLANNER_HH
31
32#include <hpp/core/path-planner.hh>
33#include <hpp/statistics/success-bin.hh>
34
40
41namespace hpp {
42namespace manipulation {
45
47 : public hpp::core::PathPlanner {
48 public:
49 typedef std::list<std::size_t> ErrorFreqs_t;
50
52 static ManipulationPlannerPtr_t create(const core::ProblemConstPtr_t& problem,
53 const core::RoadmapPtr_t& roadmap);
54
60 virtual void oneStep();
61
69 core::PathPtr_t& validPath);
70
75
80
81 protected:
84 const RoadmapPtr_t& roadmap);
85
87 void init(const ManipulationPlannerWkPtr_t& weak);
88
89 private:
92 std::size_t tryConnectToRoadmap(const core::Nodes_t nodes);
95 std::size_t tryConnectNewNodes(const core::Nodes_t nodes);
96
100 ProblemConstPtr_t problem_;
102 RoadmapPtr_t roadmap_;
104 ManipulationPlannerWkPtr_t weakPtr_;
105
108 typedef ::hpp::statistics::SuccessStatistics SuccessStatistics;
109 typedef ::hpp::statistics::SuccessBin SuccessBin;
110 typedef ::hpp::statistics::SuccessBin::Reason Reason;
111 SuccessStatistics& edgeStat(const graph::EdgePtr_t& edge);
112 std::vector<size_type> indexPerEdgeStatistics_;
113 std::vector<SuccessStatistics> perEdgeStatistics_;
114
116 enum TypeOfFailure {
117 PATH_PROJECTION_SHORTER = 0,
118 PATH_VALIDATION_SHORTER = 1,
119 REACHED_DESTINATION_NODE = 2,
120 FAILURE = 3,
121 PROJECTION = 4,
122 STEERING_METHOD = 5,
123 PATH_VALIDATION_ZERO = 6,
124 PATH_PROJECTION_ZERO = 7
125 };
126 static const std::vector<Reason> reasons_;
127
128 value_type extendStep_;
129
130 mutable Configuration_t qProj_;
131};
133} // namespace manipulation
134} // namespace hpp
135
136#endif // HPP_MANIPULATION_MANIPULATION_PLANNER_HH
Definition manipulation-planner.hh:47
ManipulationPlanner(const ProblemConstPtr_t &problem, const RoadmapPtr_t &roadmap)
Protected constructor.
std::list< std::size_t > ErrorFreqs_t
Definition manipulation-planner.hh:49
static ManipulationPlannerPtr_t create(const core::ProblemConstPtr_t &problem, const core::RoadmapPtr_t &roadmap)
Create an instance and return a shared pointer to the instance.
bool extend(RoadmapNodePtr_t q_near, ConfigurationIn_t q_rand, core::PathPtr_t &validPath)
ErrorFreqs_t getEdgeStat(const graph::EdgePtr_t &edge) const
void init(const ManipulationPlannerWkPtr_t &weak)
Store weak pointer to itself.
Definition roadmap-node.hh:42
#define HPP_MANIPULATION_DLLAPI
Definition config.hh:88
shared_ptr< Edge > EdgePtr_t
Definition fwd.hh:49
shared_ptr< ManipulationPlanner > ManipulationPlannerPtr_t
Definition fwd.hh:96
shared_ptr< Roadmap > RoadmapPtr_t
Definition fwd.hh:68
pinocchio::Configuration_t Configuration_t
Definition fwd.hh:48
shared_ptr< const Problem > ProblemConstPtr_t
Definition fwd.hh:66
std::list< std::string > StringList_t
Definition fwd.hh:158
core::value_type value_type
Definition fwd.hh:89
core::ConfigurationShooterPtr_t ConfigurationShooterPtr_t
Definition fwd.hh:141
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition fwd.hh:49
Definition main.hh:1