MRPT  1.9.9
PlannerRRT_SE2_TPS.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #pragma once
11 
15 #include <numeric>
16 
17 namespace mrpt::nav
18 {
19 /** \addtogroup nav_planners Path planning
20  * \ingroup mrpt_nav_grp
21  * @{ */
22 
23 /** TP Space-based RRT path planning for SE(2) (planar) robots.
24  *
25  * This planner algorithm is described in the paper:
26  * - M. Bellone, J.L. Blanco, A. Gimenez, "TP-Space RRT: Kinematic path
27  * planning of non-holonomic any-shape vehicles", International Journal of
28  * Advanced Robotic Systems, 2015.
29  *
30  * Typical usage:
31  * \code
32  * mrpt::nav::PlannerRRT_SE2_TPS planner;
33  *
34  * // Set or load planner parameters:
35  * //planner.loadConfig( mrpt::config::CConfigFile("config_file.cfg") );
36  * //planner.params.... // See RRTAlgorithmParams
37  *
38  * // Set RRT end criteria (when to stop searching for a solution)
39  * //planner.end_criteria.... // See RRTEndCriteria
40  *
41  * planner.initialize(); // Initialize after setting the algorithm parameters
42  *
43  * // Set up planning problem:
44  * PlannerRRT_SE2_TPS::TPlannerResult planner_result;
45  * PlannerRRT_SE2_TPS::TPlannerInput planner_input;
46  * // Start & goal:
47  * planner_input.start_pose = mrpt::math::TPose2D(XXX,XXX,XXX);
48  * planner_input.goal_pose = mrpt::math::TPose2D(XXX,XXX,XXX);
49  * // Set obtacles: (...)
50  * // planner_input.obstacles_points ...
51  * // Set workspace bounding box for picking random poses in the RRT algorithm:
52  * planner_input.world_bbox_min = mrpt::math::TPoint2D(XX,YY);
53  * planner_input.world_bbox_max = mrpt::math::TPoint2D(XX,YY);
54  * // Do path planning:
55  * planner.solve( planner_input, planner_result);
56  * // Analyze contents of planner_result...
57  * \endcode
58  *
59  * - Changes history:
60  * - 06/MAR/2014: Creation (MB)
61  * - 06/JAN/2015: Refactoring (JLBC)
62  *
63  * \todo Factorize into more generic path planner classes! //template <class
64  * POSE, class MOTIONS>...
65  */
67 {
68  public:
69  /** The type of poses at nodes */
71 
72  struct TPlannerInput : public TPlannerInputTempl<node_pose_t, node_pose_t>
73  {
75  {
77  goal_pose = mrpt::math::TPose2D(0, 0, 0);
78  world_bbox_min = mrpt::math::TPose2D(-10., -10.0, -M_PI);
80  }
81  };
82 
83  struct TPlannerResult : public TPlannerResultTempl<TMoveTreeSE2_TP>
84  {
85  };
86 
87  /** Constructor */
89 
90  /** Load all params from a config file source */
91  void loadConfig(
92  const mrpt::config::CConfigFileBase& cfgSource,
93  const std::string& sSectionName = std::string("PTG_CONFIG"));
94 
95  /** Must be called after setting all params (see `loadConfig()`) and before
96  * calling `solve()` */
97  void initialize();
98 
99  /** The main API entry point: tries to find a planned path from 'goal' to
100  * 'target' */
101  void solve(const TPlannerInput& pi, TPlannerResult& result);
102 
103  protected:
104  bool m_initialized{false};
105 
106 }; // end class PlannerRRT_SE2_TPS
107 
108 /** @} */
109 } // namespace mrpt::nav
node_pose_t world_bbox_min
Bounding box of the world, used to draw uniform random pose samples.
void initialize()
Must be called after setting all params (see loadConfig()) and before calling solve() ...
This class allows loading and storing values and vectors of different types from a configuration text...
Virtual base class for TP-Space-based path planners.
PlannerRRT_SE2_TPS()
Constructor.
void loadConfig(const mrpt::config::CConfigFileBase &cfgSource, const std::string &sSectionName=std::string("PTG_CONFIG"))
Load all params from a config file source.
void solve(const TPlannerInput &pi, TPlannerResult &result)
The main API entry point: tries to find a planned path from &#39;goal&#39; to &#39;target&#39;.
Lightweight 2D pose.
Definition: TPose2D.h:22
TP Space-based RRT path planning for SE(2) (planar) robots.



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: d8fdc6279 Wed Feb 26 00:43:17 2020 +0100 at miƩ feb 26 00:45:09 CET 2020