MRPT
2.0.4
mrpt
nav
planners
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-2020, 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
12
#include <
mrpt/maps/CSimplePointsMap.h
>
13
#include <
mrpt/nav/planners/PlannerRRT_common.h
>
14
#include <
mrpt/nav/planners/TMoveTree.h
>
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
*/
66
class
PlannerRRT_SE2_TPS
:
public
PlannerTPS_VirtualBase
67
{
68
public
:
69
/** The type of poses at nodes */
70
using
node_pose_t
=
mrpt::math::TPose2D
;
71
72
struct
TPlannerInput
:
public
TPlannerInputTempl
<node_pose_t, node_pose_t>
73
{
74
TPlannerInput
()
75
{
76
start_pose
=
mrpt::math::TPose2D
(0, 0, 0);
77
goal_pose
=
mrpt::math::TPose2D
(0, 0, 0);
78
world_bbox_min
=
mrpt::math::TPose2D
(-10., -10.0, -
M_PI
);
79
world_bbox_max
=
mrpt::math::TPose2D
(10., 10.0,
M_PI
);
80
}
81
};
82
83
struct
TPlannerResult
:
public
TPlannerResultTempl
<TMoveTreeSE2_TP>
84
{
85
};
86
87
/** Constructor */
88
PlannerRRT_SE2_TPS
();
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
mrpt::nav::TPlannerInputTempl< node_pose_t, node_pose_t >::goal_pose
node_pose_t goal_pose
Definition:
PlannerRRT_common.h:30
mrpt::nav::PlannerRRT_SE2_TPS::TPlannerInput::TPlannerInput
TPlannerInput()
Definition:
PlannerRRT_SE2_TPS.h:74
mrpt::nav::TPlannerInputTempl< node_pose_t, node_pose_t >::world_bbox_min
node_pose_t world_bbox_min
Bounding box of the world, used to draw uniform random pose samples.
Definition:
PlannerRRT_common.h:32
mrpt::nav
Definition:
CAbstractHolonomicReactiveMethod.h:20
mrpt::nav::PlannerRRT_SE2_TPS::initialize
void initialize()
Must be called after setting all params (see loadConfig()) and before calling solve()
Definition:
PlannerRRT_SE2_TPS.cpp:36
mrpt::nav::PlannerRRT_SE2_TPS::TPlannerResult
Definition:
PlannerRRT_SE2_TPS.h:83
PlannerRRT_common.h
mrpt::config::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition:
config/CConfigFileBase.h:44
mrpt::nav::TPlannerInputTempl< node_pose_t, node_pose_t >::start_pose
node_pose_t start_pose
Definition:
PlannerRRT_common.h:30
mrpt::nav::TPlannerResultTempl
Definition:
PlannerRRT_common.h:38
mrpt::math::TPose2D
Lightweight 2D pose.
Definition:
TPose2D.h:22
mrpt::nav::PlannerRRT_SE2_TPS
TP Space-based RRT path planning for SE(2) (planar) robots.
Definition:
PlannerRRT_SE2_TPS.h:66
mrpt::nav::TPlannerInputTempl< node_pose_t, node_pose_t >::world_bbox_max
node_pose_t world_bbox_max
Definition:
PlannerRRT_common.h:32
TMoveTree.h
M_PI
#define M_PI
Definition:
core/include/mrpt/core/bits_math.h:43
mrpt::nav::TPlannerInputTempl
Definition:
PlannerRRT_common.h:28
mrpt::nav::PlannerRRT_SE2_TPS::TPlannerInput
Definition:
PlannerRRT_SE2_TPS.h:72
mrpt::nav::PlannerRRT_SE2_TPS::solve
void solve(const TPlannerInput &pi, TPlannerResult &result)
The main API entry point: tries to find a planned path from 'goal' to 'target'.
Definition:
PlannerRRT_SE2_TPS.cpp:45
mrpt::nav::PlannerRRT_SE2_TPS::loadConfig
void loadConfig(const mrpt::config::CConfigFileBase &cfgSource, const std::string &sSectionName=std::string("PTG_CONFIG"))
Load all params from a config file source.
Definition:
PlannerRRT_SE2_TPS.cpp:28
mrpt::nav::PlannerRRT_SE2_TPS::PlannerRRT_SE2_TPS
PlannerRRT_SE2_TPS()
Constructor.
CSimplePointsMap.h
mrpt::nav::PlannerRRT_SE2_TPS::m_initialized
bool m_initialized
Definition:
PlannerRRT_SE2_TPS.h:104
mrpt::nav::PlannerTPS_VirtualBase
Virtual base class for TP-Space-based path planners.
Definition:
PlannerRRT_common.h:131
Page generated by
Doxygen 1.8.17
for MRPT 2.0.4 at Fri Jul 17 08:43:33 UTC 2020