Main MRPT website > C++ reference for MRPT 1.4.0
nav/reactive/CReactiveNavigationSystem3D.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 CReactiveNavigationSystem3D_H
10 #define CReactiveNavigationSystem3D_H
11 
13 
14 namespace mrpt
15 {
16  namespace nav
17  {
18  /** A 3D robot shape stored as a "sliced" stack of 2D polygons, used for CReactiveNavigationSystem3D */
19  struct TRobotShape {
20  std::vector<math::CPolygon> polygons; // The polygonal bases
21  std::vector<float> heights; // Heights of the prisms
22  };
23 
24  /** See base class CAbstractPTGBasedReactive for a description and instructions of use.
25  * This particular implementation assumes a 3D (or "2.5D") robot shape model, build as a vertical stack of "2D slices".
26  *
27  * Paper describing the method:
28  * - M. Jaimez-Tarifa, J. Gonzalez-Jimenez, J.L. Blanco,
29  * "Efficient Reactive Navigation with Exact Collision Determination for 3D Robot Shapes",
30  * International Journal of Advanced Robotic Systems, 2015.
31  *
32  * Class history:
33  * - SEP/2012: First design.
34  * - JUL/2013: Integrated into MRPT library.
35  * - DEC/2013: Code refactoring between this class and CAbstractHolonomicReactiveMethod
36  *
37  * This class requires a number of parameters which are usually provided via an external config (".ini") file.
38  * Alternatively, a memory-only object can be used to avoid physical files, see mrpt::utils::CConfigFileMemory.
39  *
40  * Next we provide a self-documented template config file:
41  * \verbinclude reactive3d_config.ini
42  *
43  * \sa CAbstractReactiveNavigationSystem, CParameterizedTrajectoryGenerator, CAbstractHolonomicReactiveMethod
44  * \ingroup nav_reactive
45  */
47  {
48  public:
50  public:
51  /** See docs in ctor of base class */
53  CReactiveInterfaceImplementation &react_iterf_impl,
54  bool enableConsoleOutput = true,
55  bool enableLogFile = false);
56 
57  /** Destructor */
59 
60  /** Reload the configuration from a file. See CReactiveNavigationSystem3D for details. */
62 
63  /** Change the robot shape, which is taken into account for collision grid building. */
64  void changeRobotShape( TRobotShape robotShape );
65 
66  /** Returns the number of different PTGs that have been setup */
67  virtual size_t getPTG_count() const { return m_ptgmultilevel.size(); }
68 
69  /** Gets the i'th PTG */
71  {
72  ASSERT_(i<m_ptgmultilevel.size() && !m_ptgmultilevel[i].PTGs.empty())
73  return m_ptgmultilevel[i].PTGs[0]; // Return the 0'th because the PTG itself is the same, what changes is the collision grid.
74  }
75 
76  private:
77  // ------------------------------------------------------
78  // PRIVATE DEFINITIONS
79  // ------------------------------------------------------
80 
81  /** A set of PTGs of the same type, one per "height level" */
83  {
84  std::vector<CParameterizedTrajectoryGenerator*> PTGs;
87 
90  };
91 
92  // ------------------------------------------------------
93  // PRIVATE VARIABLES
94  // ------------------------------------------------------
95  mrpt::maps::CSimplePointsMap m_WS_Obstacles_unsorted; //!< The unsorted set of obstacles from the sensors
96  std::vector<mrpt::maps::CSimplePointsMap> m_WS_Obstacles_inlevels; //!< One point cloud per 2.5D robot-shape-slice, coordinates relative to the robot local frame
97 
98 
99  /** The robot 3D shape model */
101 
102  /** The set of PTG-transformations to be used: */
103  std::vector <TPTGmultilevel> m_ptgmultilevel;
104 
105 
106  // Steps for the reactive navigation sytem.
107  // ----------------------------------------------------------------------------
109 
110  // See docs in parent class
111  virtual bool STEP2_SenseObstacles();
112 
113  // See docs in parent class
114  virtual void STEP3_WSpaceToTPSpace(const size_t ptg_idx,std::vector<float> &out_TPObstacles);
115 
116  /** Generates a pointcloud of obstacles, and the robot shape, to be saved in the logging record for the current timestep */
118 
119 
120 
121  }; // end class
122  }
123 }
124 
125 
126 #endif
127 
128 
129 
130 
131 
mrpt::nav::CReactiveNavigationSystem3D::loadConfigFile
void loadConfigFile(const mrpt::utils::CConfigFileBase &ini)
Reload the configuration from a file.
mrpt::nav::CReactiveNavigationSystem3D::changeRobotShape
void changeRobotShape(TRobotShape robotShape)
Change the robot shape, which is taken into account for collision grid building.
mrpt::nav::CLogFileRecord
A class for storing, saving and loading a reactive navigation log record for the CReactiveNavigationS...
Definition: CLogFileRecord.h:31
mrpt::nav::CReactiveNavigationSystem3D
See base class CAbstractPTGBasedReactive for a description and instructions of use.
Definition: nav/reactive/CReactiveNavigationSystem3D.h:47
CAbstractPTGBasedReactive.h
mrpt::nav::CReactiveNavigationSystem3D::loggingGetWSObstaclesAndShape
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...
mrpt::nav::CAbstractPTGBasedReactive
Base class for reactive navigator systems based on TP-Space, with an arbitrary holonomic reactive met...
Definition: CAbstractPTGBasedReactive.h:47
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CParticleFilter.h:17
mrpt::nav::CReactiveNavigationSystem3D::STEP3_WSpaceToTPSpace
virtual void STEP3_WSpaceToTPSpace(const size_t ptg_idx, std::vector< float > &out_TPObstacles)
Builds TP-Obstacles from Workspace obstacles for the given PTG.
mrpt::nav::CReactiveNavigationSystem3D::TPTGmultilevel
A set of PTGs of the same type, one per "height level".
Definition: nav/reactive/CReactiveNavigationSystem3D.h:83
mrpt::nav::CReactiveNavigationSystem3D::TPTGmultilevel::~TPTGmultilevel
~TPTGmultilevel()
mrpt::nav::CReactiveNavigationSystem3D::TPTGmultilevel::TPTGmultilevel
TPTGmultilevel()
mrpt::nav::CReactiveNavigationSystem3D::getPTG_count
virtual size_t getPTG_count() const
Returns the number of different PTGs that have been setup.
Definition: nav/reactive/CReactiveNavigationSystem3D.h:67
mrpt::nav::CAbstractPTGBasedReactive::THolonomicMovement
The structure used for storing a movement generated by a holonomic-method.
Definition: CAbstractPTGBasedReactive.h:134
MRPT_MAKE_ALIGNED_OPERATOR_NEW
#define MRPT_MAKE_ALIGNED_OPERATOR_NEW
Definition: memory.h:112
mrpt::nav::CReactiveNavigationSystem3D::TPTGmultilevel::TP_Target
mrpt::math::TPoint2D TP_Target
Definition: nav/reactive/CReactiveNavigationSystem3D.h:85
mrpt::nav::TRobotShape::heights
std::vector< float > heights
Definition: nav/reactive/CReactiveNavigationSystem3D.h:21
mrpt::utils::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: CConfigFileBase.h:31
mrpt::nav::CReactiveNavigationSystem3D::m_WS_Obstacles_inlevels
std::vector< mrpt::maps::CSimplePointsMap > m_WS_Obstacles_inlevels
One point cloud per 2.5D robot-shape-slice, coordinates relative to the robot local frame.
Definition: nav/reactive/CReactiveNavigationSystem3D.h:96
mrpt::maps::CSimplePointsMap
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans.
Definition: maps/CSimplePointsMap.h:34
mrpt::nav::CReactiveNavigationSystem3D::TPTGmultilevel::holonomicmov
THolonomicMovement holonomicmov
Definition: nav/reactive/CReactiveNavigationSystem3D.h:86
mrpt::math::TPoint2D
Lightweight 2D point.
Definition: lightweight_geom_data.h:33
mrpt::nav::CReactiveNavigationSystem3D::m_ptgmultilevel
std::vector< TPTGmultilevel > m_ptgmultilevel
The set of PTG-transformations to be used:
Definition: nav/reactive/CReactiveNavigationSystem3D.h:103
mrpt::nav::CReactiveNavigationSystem3D::~CReactiveNavigationSystem3D
virtual ~CReactiveNavigationSystem3D()
Destructor.
mrpt::nav::CReactiveNavigationSystem3D::m_robotShape
TRobotShape m_robotShape
The robot 3D shape model.
Definition: nav/reactive/CReactiveNavigationSystem3D.h:100
mrpt::nav::CReactiveInterfaceImplementation
The pure virtual class that a user of CAbstractReactiveNavigationSystem-derived classes must implemen...
Definition: CAbstractReactiveNavigationSystem.h:31
mrpt::nav::CReactiveNavigationSystem3D::CReactiveNavigationSystem3D
CReactiveNavigationSystem3D(CReactiveInterfaceImplementation &react_iterf_impl, bool enableConsoleOutput=true, bool enableLogFile=false)
See docs in ctor of base class.
mrpt::nav::TRobotShape::polygons
std::vector< math::CPolygon > polygons
Definition: nav/reactive/CReactiveNavigationSystem3D.h:20
mrpt::nav::CReactiveNavigationSystem3D::m_WS_Obstacles_unsorted
mrpt::maps::CSimplePointsMap m_WS_Obstacles_unsorted
The unsorted set of obstacles from the sensors.
Definition: nav/reactive/CReactiveNavigationSystem3D.h:95
mrpt::nav::CReactiveNavigationSystem3D::STEP1_CollisionGridsBuilder
virtual void STEP1_CollisionGridsBuilder()
ASSERT_
#define ASSERT_(f)
Definition: mrpt_macros.h:261
mrpt::nav::CReactiveNavigationSystem3D::STEP2_SenseObstacles
virtual bool STEP2_SenseObstacles()
Return false on any fatal error.
mrpt::nav::CReactiveNavigationSystem3D::TPTGmultilevel::PTGs
std::vector< CParameterizedTrajectoryGenerator * > PTGs
Definition: nav/reactive/CReactiveNavigationSystem3D.h:84
mrpt::nav::CParameterizedTrajectoryGenerator
This is the base class for any user-defined PTG.
Definition: CParameterizedTrajectoryGenerator.h:57
mrpt::nav::CReactiveNavigationSystem3D::getPTG
virtual CParameterizedTrajectoryGenerator * getPTG(size_t i)
Gets the i'th PTG.
Definition: nav/reactive/CReactiveNavigationSystem3D.h:70
mrpt::nav::TRobotShape
A 3D robot shape stored as a "sliced" stack of 2D polygons, used for CReactiveNavigationSystem3D.
Definition: nav/reactive/CReactiveNavigationSystem3D.h:19



Page generated by Doxygen 1.8.20 for MRPT 1.4.0 SVN: at Thu Aug 27 02:40:23 UTC 2020