Main MRPT website > C++ reference
MRPT logo
planner_rrt.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2015, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 
10 #pragma once
11 
12 //#include <mrpt/utils.h>
13 
14 namespace mrpt
15 {
16  namespace nav
17  {
18  /** This class implement an header-only RRT algorithm for hybrid navigation
19  *
20  * <b>Usage:</b><br>
21  * - write me
22  *
23  *
24  * <b>About the algorithm:</b><br>
25  * - write me
26  *
27  * <b>Changes history</b>
28  * - 06/MAR/2014: Creation (MB)
29  * \ingroup mrpt_nav_grp
30  */
31 
32  template <class POSE, class MOTIONS> //this is to be used for any pose and any motion, how to define POSE and MOTIONS??
33  class RRT
34  {
35  public:
36 
37  RRT ()
38  {
39  //define default values for the goalBias and maxLength in RRT
40  goalBias_ = 0.05;
41  maxLength_ = 0.0; //the setting of maxLength should be mandatory for the user
42  } /** Constr */
43 
44  // do we need the destrctor to free memory alfter the solver? ~RRT()
45 
46 
47  /** \brief Set the goal bias */
48  inline void setGoalBias (double goalBias) { goalBias_ = goalBias; }
49 
50  /** \brief Get the goal bias */
51  inline double getGoalBias () { return goalBias_; }
52 
53  /** \brief Set the max length of edges for RRT algorithm */
54  inline void setLength (double maxLength) { maxLength_ = maxLength; }
55 
56  /** \brief Get the goal bias */
57  inline double getLength () { return maxLength_; }
58 
59  /** \brief Setup operation befor the planner start */
60  void setup ();
61 
62 
63  /** \brief Planning using RRT
64  * Algorithm as expressed in karaman-frazzoli 2011
65  * 1. V <-- {x_init}; E<-0
66  * 2. for i=1, ... n do
67  * 3. x_ran <-- SampleFree_i
68  * 4. x_nearest <-- Nearest (G=(V,E), x_rand)
69  * 5. x_new <-- Steer (x_nearest, x_rand)
70  * 6. if ObstacleFree (x_nearest, x_new) then
71  * 7. V <-- V U {x_new}; E <--E U {(x_nearest, x_new)}
72  * 8. return (G= (V,E)
73  **/ //TODO implement this into the cpp file
74  void plan();//just for know (const POSE &start_pose, const POSE &goal_pose);
75  // {
76  // Like in the RRT pseudocode,
77  // try to be as generic as possible,
78  // assuming the existence of methods to be implemented by the “user” in derived classes
79  // e.g.:
80  // this->addEdge(start_pose, start_pose);
81  // };
82 
83 
84  /** \brief The goalBias_ is the probability to pick the target as the next random state */
85  double goalBias_;
86 
87  /** \brief The max leght of edges */
88  double maxLength_;
89 
92  };
93  }
94 }
mrpt::poses::CPose2D start_pose
Definition: planner_rrt.h:90
void setup()
Setup operation befor the planner start.
void plan()
Planning using RRT Algorithm as expressed in karaman-frazzoli 2011.
void setLength(double maxLength)
Set the max length of edges for RRT algorithm.
Definition: planner_rrt.h:54
double goalBias_
The goalBias_ is the probability to pick the target as the next random state.
Definition: planner_rrt.h:85
mrpt::poses::CPose2D goal_pose
Definition: planner_rrt.h:91
double getGoalBias()
Get the goal bias.
Definition: planner_rrt.h:51
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
double getLength()
Get the goal bias.
Definition: planner_rrt.h:57
This class implement an header-only RRT algorithm for hybrid navigation.
Definition: planner_rrt.h:33
A class used to store a 2D pose.
Definition: CPose2D.h:36
void setGoalBias(double goalBias)
Constr.
Definition: planner_rrt.h:48
double maxLength_
The max leght of edges.
Definition: planner_rrt.h:88



Page generated by Doxygen 1.8.9.1 for MRPT 1.3.0 SVN: at Sun Sep 13 03:55:12 UTC 2015