hpp-manipulation  4.9.0
Classes for manipulation planning.
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 // This file is part of hpp-manipulation.
5 // hpp-manipulation is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 //
10 // hpp-manipulation is distributed in the hope that it will be
11 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Lesser Public License for more details. You should have
14 // received a copy of the GNU Lesser General Public License along with
15 // hpp-manipulation. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HPP_MANIPULATION_MANIPULATION_PLANNER_HH
18 # define HPP_MANIPULATION_MANIPULATION_PLANNER_HH
19 
20 #include <hpp/core/path-planner.hh>
21 
22 #include <hpp/statistics/success-bin.hh>
23 
25 
26 #include "hpp/manipulation/config.hh"
29 #include "hpp/manipulation/fwd.hh"
30 
31 namespace hpp {
32  namespace manipulation {
35 
36  class HPP_MANIPULATION_DLLAPI ManipulationPlanner :
38  {
39  public:
40  typedef std::list<std::size_t> ErrorFreqs_t;
41 
44  const core::RoadmapPtr_t& roadmap);
45 
51  virtual void oneStep ();
52 
59  bool extend (RoadmapNodePtr_t q_near,
60  const ConfigurationPtr_t &q_rand, core::PathPtr_t& validPath);
61 
65  ErrorFreqs_t getEdgeStat (const graph::EdgePtr_t& edge) const;
66 
70  static StringList_t errorList ();
71 
72  protected:
75  const RoadmapPtr_t& roadmap);
76 
78  void init (const ManipulationPlannerWkPtr_t& weak);
79 
80  private:
83  std::size_t tryConnectToRoadmap (const core::Nodes_t nodes);
86  std::size_t tryConnectNewNodes (const core::Nodes_t nodes);
87 
91  const Problem& problem_;
93  RoadmapPtr_t roadmap_;
95  ManipulationPlannerWkPtr_t weakPtr_;
96 
99  typedef ::hpp::statistics::SuccessStatistics SuccessStatistics;
100  typedef ::hpp::statistics::SuccessBin SuccessBin;
101  typedef ::hpp::statistics::SuccessBin::Reason Reason;
102  SuccessStatistics& edgeStat (const graph::EdgePtr_t& edge);
103  std::vector<size_type> indexPerEdgeStatistics_;
104  std::vector<SuccessStatistics> perEdgeStatistics_;
105 
107  enum TypeOfFailure {
108  PATH_PROJECTION_SHORTER = 0,
109  PATH_VALIDATION_SHORTER = 1,
110  REACHED_DESTINATION_NODE = 2,
111  FAILURE = 3,
112  PROJECTION = 4,
113  STEERING_METHOD = 5,
114  PATH_VALIDATION_ZERO = 6,
115  PATH_PROJECTION_ZERO = 7
116  };
117  static const std::vector<Reason> reasons_;
118 
119  value_type extendStep_;
120 
121  mutable Configuration_t qProj_;
122  };
124  } // namespace manipulation
125 } // namespace hpp
126 
127 #endif // HPP_MANIPULATION_MANIPULATION_PLANNER_HH
boost::shared_ptr< Path > PathPtr_t
core::ConfigurationShooterPtr_t ConfigurationShooterPtr_t
Definition: fwd.hh:115
std::list< std::size_t > ErrorFreqs_t
Definition: manipulation-planner.hh:40
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:37
Definition: manipulation-planner.hh:36
Definition: problem.hh:32
core::value_type value_type
Definition: fwd.hh:79
boost::shared_ptr< ManipulationPlanner > ManipulationPlannerPtr_t
Definition: fwd.hh:86
boost::shared_ptr< Roadmap > RoadmapPtr_t
Definition: fwd.hh:57
void init(const ConfigurationShooterWkPtr_t &weak)
std::list< NodePtr_t > Nodes_t
const Problem & problem() const
static GradientBasedPtr_t create(const Problem &problem)
boost::shared_ptr< Edge > EdgePtr_t
Definition: fwd.hh:37
std::list< std::string > StringList_t
Definition: fwd.hh:132
boost::shared_ptr< Roadmap > RoadmapPtr_t
Definition: roadmap-node.hh:32
core::ConfigurationPtr_t ConfigurationPtr_t
Definition: fwd.hh:40