libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
PRM.hpp
1 #ifndef PRM_HPP
2 #define PRM_HPP
3 
4 #include "planner/planner.hpp"
5 #include <iostream>
6 
12 class PRM : public Planner
13 {
14 public:
16  PRM(Robot * robot, Graph * graph) : Planner(robot, graph), m_nbConscutiveFailures(0) {
17  std::cout << "Construct the PRM" << std::endl;
18  }
19 
21  ~PRM() {};
22 
23  int getNumberOfExpansion() const { return m_nbExpansions; }
24 
29  virtual unsigned init();
30 
35  bool checkStopConditions();
36 
41  bool preConditions();
42 
44  virtual void expandOneStep();
45 
50  unsigned int run();
51 
56  bool trajFound();
57 
60 
61 private:
68  double TPSbyExhaustiveSearch(std::vector<std::vector<double> > & distances,
69  std::vector<unsigned> & solution);
70 
72  void loadWaypoints();
73 
74 protected:
75  unsigned m_nbAddedNode;
76  int m_nbConscutiveFailures;
77  int m_nbExpansions;
78 
80  std::vector<confPtr_t> waypoints;
81 
83  std::vector<Node *> waypointNodes;
84 };
85 
86 #endif
PRM(Robot *robot, Graph *graph)
Constructor.
Definition: PRM.hpp:16
unsigned int run()
Main function of the PRM.
Definition: PRM.cpp:126
Classe représentant l'algorithme PRM.
Definition: PRM.hpp:12
Definition: graph.hpp:28
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
virtual unsigned init()
Initialize the PRM.
Definition: PRM.cpp:28
std::vector< Node * > waypointNodes
nodes containing the waypoints
Definition: PRM.hpp:83
std::vector< confPtr_t > waypoints
waypoints through which the solution path should go
Definition: PRM.hpp:80
Definition: trajectory.hpp:40
~PRM()
Destructor.
Definition: PRM.hpp:21
bool preConditions()
Check the pre-conditions of PRM.
Definition: PRM.cpp:81
Base class for planning algorithms.
Definition: planner.hpp:28
virtual void expandOneStep()
Perform a single expansion step of PRM.
Definition: PRM.cpp:104
bool checkStopConditions()
Check the stopping conditions of PRM.
Definition: PRM.cpp:47
API::Trajectory * extractTrajectory()
Extract a trajectory going through all the waypoints.
Definition: PRM.cpp:210
bool trajFound()
Check whether PRM has found a trajectory.
Definition: PRM.cpp:191