Main MRPT website > C++ reference for MRPT 1.3.2
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-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 #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 */
58  virtual ~CReactiveNavigationSystem3D();
59 
60  /** Reload the configuration from a file. See CReactiveNavigationSystem3D for details. */
61  void loadConfigFile(const mrpt::utils::CConfigFileBase &ini);
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 
89  ~TPTGmultilevel();
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  // ----------------------------------------------------------------------------
108  virtual void STEP1_CollisionGridsBuilder();
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 */
117  virtual void loggingGetWSObstaclesAndShape(CLogFileRecord &out_log);
118 
119 
120 
121  }; // end class
122  }
123 }
124 
125 
126 #endif
127 
128 
129 
130 
131 
virtual size_t getPTG_count() const
Returns the number of different PTGs that have been setup.
mrpt::maps::CSimplePointsMap m_WS_Obstacles_unsorted
The unsorted set of obstacles from the sensors.
#define MRPT_MAKE_ALIGNED_OPERATOR_NEW
Definition: memory.h:112
A 3D robot shape stored as a "sliced" stack of 2D polygons, used for CReactiveNavigationSystem3D.
A set of PTGs of the same type, one per "height level".
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans. ...
A class for storing, saving and loading a reactive navigation log record for the CReactiveNavigationS...
This class allows loading and storing values and vectors of different types from a configuration text...
This is the base class for any user-defined PTG.
The structure used for storing a movement generated by a holonomic-method.
std::vector< TPTGmultilevel > m_ptgmultilevel
The set of PTG-transformations to be used:
Base class for reactive navigator systems based on TP-Space, with an arbitrary holonomic reactive met...
See base class CAbstractPTGBasedReactive for a description and instructions of use.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
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...
#define ASSERT_(f)
The pure virtual class that a user of CAbstractReactiveNavigationSystem-derived classes must implemen...
virtual CParameterizedTrajectoryGenerator * getPTG(size_t i)
Gets the i&#39;th PTG.
Lightweight 2D point.



Page generated by Doxygen 1.8.11 for MRPT 1.3.2 SVN: at Wed May 25 02:34:21 UTC 2016