Main MRPT website > C++ reference
MRPT logo
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  * Publications:
28  * - "Reactive Navigation of a 3D-shape Robot in a 3D World" (Submitted)
29  *
30  * Class history:
31  * - SEP/2012: First design.
32  * - JUL/2013: Integrated into MRPT library.
33  * - DEC/2013: Code refactoring between this class and CAbstractHolonomicReactiveMethod
34  *
35  * \sa CAbstractReactiveNavigationSystem, CParameterizedTrajectoryGenerator, CAbstractHolonomicReactiveMethod
36  * \ingroup mrpt_nav_grp
37  */
39  {
40  public:
42  public:
43  /** See docs in ctor of base class */
45  CReactiveInterfaceImplementation &react_iterf_impl,
46  bool enableConsoleOutput = true,
47  bool enableLogFile = false);
48 
49  /** Destructor */
50  virtual ~CReactiveNavigationSystem3D();
51 
52  /** Reload the configuration from a file */
53  void loadConfigFile(const mrpt::utils::CConfigFileBase &ini);
54 
55  /** Change the robot shape, which is taken into account for collision grid building. */
56  void changeRobotShape( TRobotShape robotShape );
57 
58  /** Returns the number of different PTGs that have been setup */
59  virtual size_t getPTG_count() const { return m_ptgmultilevel.size(); }
60 
61  /** Gets the i'th PTG */
63  {
64  ASSERT_(i<m_ptgmultilevel.size() && !m_ptgmultilevel[i].PTGs.empty())
65  return m_ptgmultilevel[i].PTGs[0]; // Return the 0'th because the PTG itself is the same, what changes is the collision grid.
66  }
67 
68  private:
69  // ------------------------------------------------------
70  // PRIVATE DEFINITIONS
71  // ------------------------------------------------------
72 
73  /** A set of PTGs of the same type, one per "height level" */
75  {
76  std::vector<CParameterizedTrajectoryGenerator*> PTGs;
79 
81  ~TPTGmultilevel();
82  };
83 
84  // ------------------------------------------------------
85  // PRIVATE VARIABLES
86  // ------------------------------------------------------
87  mrpt::maps::CSimplePointsMap m_WS_Obstacles_unsorted; //!< The unsorted set of obstacles from the sensors
88  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
89 
90 
91  /** The robot 3D shape model */
93 
94  /** The set of PTG-transformations to be used: */
95  std::vector <TPTGmultilevel> m_ptgmultilevel;
96 
97 
98  // Steps for the reactive navigation sytem.
99  // ----------------------------------------------------------------------------
100  virtual void STEP1_CollisionGridsBuilder();
101 
102  // See docs in parent class
103  virtual bool STEP2_SenseObstacles();
104 
105  // See docs in parent class
106  virtual void STEP3_WSpaceToTPSpace(const size_t ptg_idx,std::vector<float> &out_TPObstacles);
107 
108  /** Generates a pointcloud of obstacles, and the robot shape, to be saved in the logging record for the current timestep */
109  virtual void loggingGetWSObstaclesAndShape(CLogFileRecord &out_log);
110 
111 
112 
113  }; // end class
114  }
115 }
116 
117 
118 #endif
119 
120 
121 
122 
123 
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'th PTG.
Lightweight 2D point.



Page generated by Doxygen 1.8.9.1 for MRPT 1.3.0 SVN: at Sun Sep 13 03:55:12 UTC 2015