hpp-manipulation  4.12.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 
29 #include "hpp/manipulation/fwd.hh"
30 
31 namespace hpp {
32  namespace manipulation {
35 
37  public hpp::core::PathPlanner
38  {
39  public:
40  typedef std::list<std::size_t> ErrorFreqs_t;
41 
43  static ManipulationPlannerPtr_t create
44  (const core::ProblemConstPtr_t& problem,
45  const core::RoadmapPtr_t& roadmap);
46 
52  virtual void oneStep ();
53 
60  bool extend (RoadmapNodePtr_t q_near,
61  const ConfigurationPtr_t &q_rand, core::PathPtr_t& validPath);
62 
66  ErrorFreqs_t getEdgeStat (const graph::EdgePtr_t& edge) const;
67 
71  static StringList_t errorList ();
72 
73  protected:
75  ManipulationPlanner (const ProblemConstPtr_t& problem,
76  const RoadmapPtr_t& roadmap);
77 
79  void init (const ManipulationPlannerWkPtr_t& weak);
80 
81  private:
84  std::size_t tryConnectToRoadmap (const core::Nodes_t nodes);
87  std::size_t tryConnectNewNodes (const core::Nodes_t nodes);
88 
92  ProblemConstPtr_t problem_;
94  RoadmapPtr_t roadmap_;
96  ManipulationPlannerWkPtr_t weakPtr_;
97 
100  typedef ::hpp::statistics::SuccessStatistics SuccessStatistics;
101  typedef ::hpp::statistics::SuccessBin SuccessBin;
102  typedef ::hpp::statistics::SuccessBin::Reason Reason;
103  SuccessStatistics& edgeStat (const graph::EdgePtr_t& edge);
104  std::vector<size_type> indexPerEdgeStatistics_;
105  std::vector<SuccessStatistics> perEdgeStatistics_;
106 
108  enum TypeOfFailure {
109  PATH_PROJECTION_SHORTER = 0,
110  PATH_VALIDATION_SHORTER = 1,
111  REACHED_DESTINATION_NODE = 2,
112  FAILURE = 3,
113  PROJECTION = 4,
114  STEERING_METHOD = 5,
115  PATH_VALIDATION_ZERO = 6,
116  PATH_PROJECTION_ZERO = 7
117  };
118  static const std::vector<Reason> reasons_;
119 
120  value_type extendStep_;
121 
122  mutable Configuration_t qProj_;
123  };
125  } // namespace manipulation
126 } // namespace hpp
127 
128 #endif // HPP_MANIPULATION_MANIPULATION_PLANNER_HH
core::ConfigurationShooterPtr_t ConfigurationShooterPtr_t
Definition: fwd.hh:118
Definition: main.hh:1
std::list< std::size_t > ErrorFreqs_t
Definition: manipulation-planner.hh:40
shared_ptr< Roadmap > RoadmapPtr_t
Definition: fwd.hh:58
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:37
Definition: manipulation-planner.hh:36
shared_ptr< const Problem > ProblemConstPtr_t
Definition: fwd.hh:56
core::value_type value_type
Definition: fwd.hh:82
#define HPP_MANIPULATION_DLLAPI
Definition: config.hh:64
shared_ptr< ManipulationPlanner > ManipulationPlannerPtr_t
Definition: fwd.hh:89
std::list< std::string > StringList_t
Definition: fwd.hh:135
shared_ptr< Edge > EdgePtr_t
Definition: fwd.hh:37
Definition: roadmap-node.hh:32
core::ConfigurationPtr_t ConfigurationPtr_t
Definition: fwd.hh:40