hpp-core  4.12.0
Implement basic classes for canonical path planning for kinematic chains.
path-planner.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2014 CNRS
3 // Authors: Florent Lamiraux
4 //
5 // This file is part of hpp-core
6 // hpp-core is free software: you can redistribute it
7 // and/or modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation, either version
9 // 3 of the License, or (at your option) any later version.
10 //
11 // hpp-core is distributed in the hope that it will be
12 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Lesser Public License for more details. You should have
15 // received a copy of the GNU Lesser General Public License along with
16 // hpp-core If not, see
17 // <http://www.gnu.org/licenses/>.
18 
19 #ifndef HPP_CORE_PATH_PLANNER_HH
20 # define HPP_CORE_PATH_PLANNER_HH
21 
22 # include <hpp/core/fwd.hh>
23 # include <hpp/core/config.hh>
24 
25 namespace hpp {
26  namespace core {
29 
35  public:
36  virtual ~PathPlanner ();
37 
39  virtual const RoadmapPtr_t& roadmap () const;
45  virtual void startSolve ();
54  virtual PathVectorPtr_t solve ();
56  virtual void tryConnectInitAndGoals ();
57 
59  virtual void oneStep () = 0;
63  void interrupt ();
65  void maxIterations (const unsigned long int& n);
67  void timeOut(const double& timeOut);
72  void stopWhenProblemIsSolved(bool enable);
73 
76  protected:
80  PathPlanner (const ProblemConstPtr_t& problem);
84  PathPlanner (const ProblemConstPtr_t& problem,
85  const RoadmapPtr_t& roadmap);
87  void init (const PathPlannerWkPtr_t& weak);
88  private:
90  const ProblemConstWkPtr_t problem_;
92  const RoadmapPtr_t roadmap_;
93  bool interrupt_;
96  unsigned long int maxIterations_;
98  double timeOut_;
100  bool stopWhenProblemIsSolved_;
101 
103  PathPlannerWkPtr_t weakPtr_;
104  }; // class PathPlanner
106  } // namespace core
107 } // namespace hpp
108 #endif // HPP_CORE_PATH_PLANNER_HH
Definition: path-planner.hh:34
virtual const RoadmapPtr_t & roadmap() const
Get roadmap.
PathPlanner(const ProblemConstPtr_t &problem, const RoadmapPtr_t &roadmap)
virtual void oneStep()=0
User implementation of one step of resolution.
void stopWhenProblemIsSolved(bool enable)
PathPlanner(const ProblemConstPtr_t &problem)
virtual PathVectorPtr_t finishSolve(const PathVectorPtr_t &path)
Post processing of the resulting path.
virtual PathVectorPtr_t solve()
void timeOut(const double &timeOut)
set time out (in seconds)
virtual void tryConnectInitAndGoals()
Try to connect initial and goal configurations to existing roadmap.
void init(const PathPlannerWkPtr_t &weak)
Store weak pointer to itself.
void maxIterations(const unsigned long int &n)
Set maximal number of iterations.
ProblemConstPtr_t problem() const
Get problem.
PathVectorPtr_t computePath() const
Find a path in the roadmap and transform it in trajectory.
virtual void startSolve()
void interrupt()
Interrupt path planning.
#define HPP_CORE_DLLAPI
Definition: config.hh:64
shared_ptr< PathVector > PathVectorPtr_t
Definition: fwd.hh:176
shared_ptr< Roadmap > RoadmapPtr_t
Definition: fwd.hh:182
shared_ptr< const Problem > ProblemConstPtr_t
Definition: fwd.hh:180
Definition: bi-rrt-planner.hh:24