hpp-manipulation  5.0.0
Classes for manipulation planning.
transition-planner.hh
Go to the documentation of this file.
1 // Copyright (c) 2023 CNRS
2 // Authors: Florent Lamiraux
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_PATH_PLANNER_TRANSITION_PLANNER_HH
30 #define HPP_MANIPULATION_PATH_PLANNER_TRANSITION_PLANNER_HH
31 
32 #include <hpp/core/path-planner.hh>
33 #include <hpp/manipulation/fwd.hh>
34 
35 namespace hpp {
36 namespace manipulation {
37 namespace pathPlanner {
38 
41 
67 class HPP_MANIPULATION_DLLAPI TransitionPlanner : public core::PathPlanner {
68  public:
69  typedef core::PathPlannerPtr_t PathPlannerPtr_t;
71  typedef core::PathPtr_t PathPtr_t;
73  typedef core::PathVector PathVector;
74  typedef core::PathVectorPtr_t PathVectorPtr_t;
75  typedef core::Parameter Parameter;
76 
79  const core::ProblemConstPtr_t& problem,
80  const core::RoadmapPtr_t& roadmap);
82  PathPlannerPtr_t innerPlanner() const { return innerPlanner_; }
84  void innerPlanner(const PathPlannerPtr_t& planner) {
85  innerPlanner_ = planner;
86  }
88  core::ProblemPtr_t innerProblem() const { return innerProblem_; }
91  virtual void startSolve();
92 
95  virtual void oneStep();
96 
102  bool resetRoadmap);
112  bool validate, bool& success, std::string& status);
117 
123 
126  void setEdge(std::size_t id);
127 
129  void setReedsAndSheppSteeringMethod(double turningRadius);
130 
132  void pathProjector(const PathProjectorPtr_t pathProjector);
133 
136 
138  void addPathOptimizer(const PathOptimizerPtr_t& pathOptimizer);
139 
141  void setParameter(const std::string& key, const Parameter& value);
142 
143  protected:
154  const core::RoadmapPtr_t& roadmap);
156  void init(TransitionPlannerWkPtr_t weak);
157 
158  private:
160  core::ProblemPtr_t innerProblem_;
162  PathPlannerPtr_t innerPlanner_;
164  std::vector<PathOptimizerPtr_t> pathOptimizers_;
166  TransitionPlannerWkPtr_t weakPtr_;
167 }; // class TransitionPlanner
168 } // namespace pathPlanner
169 } // namespace manipulation
170 } // namespace hpp
171 #endif // HPP_MANIPULATION_PATH_PLANNER_TRANSITION_PLANNER_HH
Definition: transition-planner.hh:67
#define HPP_MANIPULATION_DLLAPI
Definition: config.hh:88
core::PathProjectorPtr_t PathProjectorPtr_t
Definition: transition-planner.hh:70
TransitionPlanner(const core::ProblemConstPtr_t &problem, const core::RoadmapPtr_t &roadmap)
void setReedsAndSheppSteeringMethod(double turningRadius)
Create a Reeds and Shepp steering method and path it to the problem.
core::PathVector PathVector
Definition: transition-planner.hh:73
PathPlannerPtr_t innerPlanner() const
Get the inner planner.
Definition: transition-planner.hh:82
void clearPathOptimizers()
Clear path optimizers.
core::PathPlannerPtr_t PathPlannerPtr_t
Definition: transition-planner.hh:69
core::PathVectorPtr_t PathVectorPtr_t
Definition: transition-planner.hh:74
void init(TransitionPlannerWkPtr_t weak)
store weak pointer to itself
static TransitionPlannerPtr_t createWithRoadmap(const core::ProblemConstPtr_t &problem, const core::RoadmapPtr_t &roadmap)
Create instance and return share pointer.
void addPathOptimizer(const PathOptimizerPtr_t &pathOptimizer)
Add a path optimizer.
void innerPlanner(const PathPlannerPtr_t &planner)
Set the inner planner.
Definition: transition-planner.hh:84
core::ProblemPtr_t innerProblem() const
Get the inner problem.
Definition: transition-planner.hh:88
core::Parameter Parameter
Definition: transition-planner.hh:75
PathPtr_t directPath(ConfigurationIn_t q1, ConfigurationIn_t q2, bool validate, bool &success, std::string &status)
core::PathPtr_t PathPtr_t
Definition: transition-planner.hh:71
PathVectorPtr_t planPath(const Configuration_t qInit, matrixIn_t qGoals, bool resetRoadmap)
void setParameter(const std::string &key, const Parameter &value)
Set parameter to the inner problem.
PathVectorPtr_t timeParameterization(const PathVectorPtr_t &path)
void pathProjector(const PathProjectorPtr_t pathProjector)
Set the path projector.
core::PathOptimizerPtr_t PathOptimizerPtr_t
Definition: transition-planner.hh:72
PathVectorPtr_t optimizePath(const PathPtr_t &path)
shared_ptr< TransitionPlanner > TransitionPlannerPtr_t
Definition: fwd.hh:107
shared_ptr< Problem > ProblemPtr_t
Definition: fwd.hh:65
core::PathProjectorPtr_t PathProjectorPtr_t
Definition: fwd.hh:123
shared_ptr< Roadmap > RoadmapPtr_t
Definition: fwd.hh:68
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:48
core::PathOptimizerPtr_t PathOptimizerPtr_t
Definition: fwd.hh:118
core::matrixIn_t matrixIn_t
Definition: fwd.hh:147
shared_ptr< const Problem > ProblemConstPtr_t
Definition: fwd.hh:66
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:49
Definition: main.hh:1