Main MRPT website > C++ reference for MRPT 1.4.0
nav/reactive/CReactiveNavigationSystem.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-2016, 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#ifndef CReactiveNavigationSystem_H
10#define CReactiveNavigationSystem_H
11
13
14namespace mrpt
15{
16 namespace nav
17 {
18 /** \defgroup nav_reactive Reactive navigation classes
19 * \ingroup mrpt_nav_grp
20 */
21
22 /** See base class CAbstractPTGBasedReactive for a description and instructions of use.
23 * This particular implementation assumes a 2D robot shape.
24 *
25 * Publications:
26 * - Blanco, Jose-Luis, Javier Gonzalez, and Juan-Antonio Fernandez-Madrigal. "[Extending obstacle avoidance methods through multiple parameter-space transformations](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.190.4672&rep=rep1&type=pdf)." Autonomous Robots 24.1 (2008): 29-48.
27 *
28 * Class history:
29 * - 17/JUN/2004: First design.
30 * - 16/SEP/2004: Totally redesigned, according to document "MultiParametric Based Space Transformation for Reactive Navigation"
31 * - 29/SEP/2005: Totally rewritten again, for integration into MRPT library and according to the ICRA paper.
32 * - 17/OCT/2007: Whole code updated to accomodate to MRPT 0.5 and make it portable to Linux.
33 * - DEC/2013: Code refactoring between this class and CAbstractHolonomicReactiveMethod
34 *
35 * This class requires a number of parameters which are usually provided via an external config (".ini") file.
36 * Alternatively, a memory-only object can be used to avoid physical files, see mrpt::utils::CConfigFileMemory.
37 *
38 * Next we provide a self-documented template config file:
39 * \verbinclude reactive2d_config.ini
40 *
41 * \sa CAbstractReactiveNavigationSystem, CParameterizedTrajectoryGenerator, CAbstractHolonomicReactiveMethod
42 * \ingroup nav_reactive
43 */
45 {
46 public:
48 public:
49 /** See docs in ctor of base class */
51 CReactiveInterfaceImplementation &react_iterf_impl,
52 bool enableConsoleOutput = true,
53 bool enableLogFile = false);
54
55 /** Destructor
56 */
58
59 /** Reload the configuration from a file. See details in CReactiveNavigationSystem docs.
60 * \param[in] ini The main source of configuration parameters.
61 * \param[in] robotIni Deprecated (kept for backwards compatibility). It is recommended to use the newer loadConfigFile() method with one argument in new code.
62 */
64
65 /** Reload the configuration from a file. See details in CReactiveNavigationSystem docs. */
67
68 /** Change the robot shape, which is taken into account for collision
69 * grid building.
70 */
71 void changeRobotShape( const math::CPolygon &shape );
72
73 /** Returns the number of different PTGs that have been setup */
74 virtual size_t getPTG_count() const { return PTGs.size(); }
75
76 /** Gets the i'th PTG */
78 {
79 ASSERT_(i<PTGs.size())
80 return PTGs[i];
81 }
82
83
84 private:
85 // ------------------------------------------------------
86 // PRIVATE VARIABLES
87 // ------------------------------------------------------
88 float minObstaclesHeight, maxObstaclesHeight; // The range of "z" coordinates for obstacles to be considered
89
90 /** The robot 2D shape model */
92
93 /** The set of transformations to be used:
94 */
95 std::vector<CParameterizedTrajectoryGenerator*> PTGs;
96
97 // Steps for the reactive navigation sytem.
98 // ----------------------------------------------------------------------------
100
101 // See docs in parent class
102 virtual bool STEP2_SenseObstacles();
103
104 // See docs in parent class
105 virtual void STEP3_WSpaceToTPSpace(const size_t ptg_idx,std::vector<float> &out_TPObstacles);
106
107 /** Generates a pointcloud of obstacles, and the robot shape, to be saved in the logging record for the current timestep */
109
110
111 mrpt::maps::CSimplePointsMap m_WS_Obstacles; //!< The obstacle points, as seen from the local robot frame.
112
113 }; // end class
114 }
115}
116
117
118#endif
119
120
121
122
123
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans.
A wrapper of a TPolygon2D class, implementing CSerializable.
Definition: CPolygon.h:26
Base class for reactive navigator systems based on TP-Space, with an arbitrary holonomic reactive met...
A class for storing, saving and loading a reactive navigation log record for the CReactiveNavigationS...
This is the base class for any user-defined PTG.
The pure virtual class that a user of CAbstractReactiveNavigationSystem-derived classes must implemen...
See base class CAbstractPTGBasedReactive for a description and instructions of use.
virtual void loggingGetWSObstaclesAndShape(CLogFileRecord &out_log)
Generates a pointcloud of obstacles, and the robot shape, to be saved in the logging record for the c...
CReactiveNavigationSystem(CReactiveInterfaceImplementation &react_iterf_impl, bool enableConsoleOutput=true, bool enableLogFile=false)
See docs in ctor of base class.
virtual void STEP3_WSpaceToTPSpace(const size_t ptg_idx, std::vector< float > &out_TPObstacles)
Builds TP-Obstacles from Workspace obstacles for the given PTG.
void loadConfigFile(const mrpt::utils::CConfigFileBase &ini)
Reload the configuration from a file.
std::vector< CParameterizedTrajectoryGenerator * > PTGs
The set of transformations to be used:
virtual ~CReactiveNavigationSystem()
Destructor.
mrpt::maps::CSimplePointsMap m_WS_Obstacles
The obstacle points, as seen from the local robot frame.
void changeRobotShape(const math::CPolygon &shape)
Change the robot shape, which is taken into account for collision grid building.
virtual CParameterizedTrajectoryGenerator * getPTG(size_t i)
Gets the i'th PTG.
virtual size_t getPTG_count() const
Returns the number of different PTGs that have been setup.
virtual bool STEP2_SenseObstacles()
Return false on any fatal error.
void loadConfigFile(const mrpt::utils::CConfigFileBase &ini, const mrpt::utils::CConfigFileBase &robotIni)
Reload the configuration from a file.
math::CPolygon m_robotShape
The robot 2D shape model.
This class allows loading and storing values and vectors of different types from a configuration text...
#define MRPT_MAKE_ALIGNED_OPERATOR_NEW
Definition: memory.h:112
#define ASSERT_(f)
Definition: mrpt_macros.h:261
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.



Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Tue Jan 17 22:40:29 UTC 2023