Main MRPT website > C++ reference
MRPT logo
CAbstractHolonomicReactiveMethod.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 CAbstractHolonomicReactiveMethod_H
10 #define CAbstractHolonomicReactiveMethod_H
11 
13 #include <mrpt/utils/TEnumType.h>
15 
17 
18 namespace mrpt
19 {
20  namespace nav
21  {
22  /** The implemented reactive navigation methods. This enum works with mrpt::utils::TEnumType
23  * \ingroup mrpt_nav_grp
24  */
26  {
29  };
30 
31  /** A base class for holonomic reactive navigation methods.
32  * \sa CHolonomicVFF,CHolonomicND, CReactiveNavigationSystem
33  * \ingroup mrpt_nav_grp
34  */
36  {
37  public:
38  /** This method performs the holonomic navigation itself.
39  * \param target [IN] The relative location (x,y) of target point.
40  * \param obstacles [IN] Distance to obstacles from robot location (0,0). First index refers to -PI direction, and last one to +PI direction. Distances can be dealed as "meters", although they are "pseudometers", see note below, but normalized in the range [0,1]
41  * \param maxRobotSpeed [IN] Maximum robot speed, in "pseudometers/sec". See note below.
42  * \param desiredDirection [OUT] The desired motion direction, in the range [-PI,PI]
43  * \param desiredSpeed [OUT] The desired motion speed in that direction, in "pseudometers"/sec. (See note below)
44  * \param logRecord [IN/OUT] A placeholder for a pointer to a log record with extra info about the execution. Set to NULL if not required. User <b>must free memory</b> using "delete logRecord" after using it.
45  *
46  * NOTE: With "pseudometers" we refer to the distance unit in TP-Space, thus:
47  * <br><center><code>pseudometer<sup>2</sup>= meter<sup>2</sup> + (rad ยท r)<sup>2</sup></code><br></center>
48  */
49  virtual void navigate(const mrpt::math::TPoint2D &target,
50  const std::vector<float> &obstacles,
51  double maxRobotSpeed,
52  double &desiredDirection,
53  double &desiredSpeed,
54  CHolonomicLogFileRecordPtr &logRecord) = 0;
55 
56  /** Virtual destructor
57  */
59 
60  /** Initialize the parameters of the navigator.
61  */
62  virtual void initialize( const mrpt::utils::CConfigFileBase &INI_FILE ) = 0;
63 
64  };
65  }
66  // Specializations MUST occur at the same namespace:
67  namespace utils
68  {
69  template <>
71  {
73  static void fill(bimap<enum_t,std::string> &m_map)
74  {
75  m_map.insert(nav::hmVIRTUAL_FORCE_FIELDS, "hmVIRTUAL_FORCE_FIELDS");
76  m_map.insert(nav::hmSEARCH_FOR_BEST_GAP, "hmSEARCH_FOR_BEST_GAP");
77  }
78  };
79  } // End of namespace
80 }
81 
82 
83 #endif
84 
A base class for holonomic reactive navigation methods.
Only specializations of this class are defined for each enum type of interest.
Definition: TEnumType.h:23
This class allows loading and storing values and vectors of different types from a configuration text...
A bidirectional version of std::map, declared as bimap and which actually contains two std...
Definition: bimap.h:27
THolonomicMethod
The implemented reactive navigation methods.
static void fill(bimap< enum_t, std::string > &m_map)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void insert(const KEY &k, const VALUE &v)
Insert a new pair KEY<->VALUE in the bi-map.
Definition: bimap.h:68
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