Main MRPT website > C++ reference
MRPT logo
CHolonomicVFF.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 CHolonomicVFF_H
10 #define CHolonomicVFF_H
11 
15 
16 
17 namespace mrpt
18 {
19  namespace nav
20  {
21  DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CLogFileRecord_VFF, CHolonomicLogFileRecord, NAV_IMPEXP )
22 
23  /** A class for storing extra information about the execution of
24  * CHolonomicVFF navigation.
25  * \sa CHolonomicVFF, CHolonomicLogFileRecord
26  * \ingroup mrpt_nav_grp
27  */
29  {
31  public:
32 
33  /** Member data.
34  */
35 
36  };
38 
39 
40  /** A holonomic reactive navigation method, based on Virtual Force Fields (VFF).
41  *
42  * These are the optional parameters of the method which can be set by means of a configuration file passed to the constructor or to CHolonomicND::initialize (see also the field CHolonomicVFF::options).
43  *
44  * \code
45  * [VFF_CONFIG]
46  * TARGET_SLOW_APPROACHING_DISTANCE = 0.10 // For stopping gradually
47  * TARGET_ATTRACTIVE_FORCE = 20 // Dimension-less (may have to be tuned depending on the density of obstacle sampling)
48  * \endcode
49  *
50  * \sa CAbstractHolonomicReactiveMethod,CReactiveNavigationSystem
51  */
53  {
54  public:
56  public:
57  /** Initialize the parameters of the navigator, from some configuration file, or default values if set to NULL.
58  */
59  CHolonomicVFF(const mrpt::utils::CConfigFileBase *INI_FILE=NULL);
60 
61  /** This method performs the holonomic navigation itself.
62  * \param target [IN] The relative location (x,y) of target point.
63  * \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.
64  * \param maxRobotSpeed [IN] Maximum robot speed, in "pseudometers/sec". See note below.
65  * \param desiredDirection [OUT] The desired motion direction, in the range [-PI,PI]
66  * \param desiredSpeed [OUT] The desired motion speed in that direction, in "pseudometers"/sec. (See note below)
67  * \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.
68  *
69  * NOTE: With "pseudometers" we refer to the distance unit in TP-Space, thus:
70  * <br><center><code>pseudometer<sup>2</sup>= meter<sup>2</sup> + (rad ยท r)<sup>2</sup></code><br></center>
71  */
72  void navigate( const mrpt::math::TPoint2D &target,
73  const std::vector<float> &obstacles,
74  double maxRobotSpeed,
75  double &desiredDirection,
76  double &desiredSpeed,
77  CHolonomicLogFileRecordPtr &logRecord );
78 
79  /** Initialize the parameters of the navigator from section "VFF_CONFIG" of a config file. \sa options */
80  void initialize( const mrpt::utils::CConfigFileBase &INI_FILE )
81  {
82  options.loadFromConfigFile(INI_FILE, std::string("VFF_CONFIG"));
83  }
84 
85  /** Algorithm options */
87  {
88  double TARGET_SLOW_APPROACHING_DISTANCE; //!< For stopping gradually (Default: 0.10)
89  double TARGET_ATTRACTIVE_FORCE; //!< Dimension-less (may have to be tuned depending on the density of obstacle sampling) (Default: 20)
90 
91  TOptions();
92  virtual void saveToConfigFile(mrpt::utils::CConfigFileBase &cfg, const std::string &section) const;
93  virtual void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source,const std::string &section);
94  };
95 
96  TOptions options; //!< Parameters of the algorithm (can be set manually or loaded from CHolonomicVFF::initialize or options.loadFromConfigFile(), etc.)
97 
98  };
99  }
100 }
101 
102 
103 #endif
104 
105 
106 
A holonomic reactive navigation method, based on Virtual Force Fields (VFF).
Definition: CHolonomicVFF.h:52
#define MRPT_MAKE_ALIGNED_OPERATOR_NEW
Definition: memory.h:112
A class for storing extra information about the execution of CHolonomicVFF navigation.
Definition: CHolonomicVFF.h:28
void initialize(const mrpt::utils::CConfigFileBase &INI_FILE)
Initialize the parameters of the navigator from section "VFF_CONFIG" of a config file.
Definition: CHolonomicVFF.h:80
A base class for holonomic reactive navigation methods.
double TARGET_ATTRACTIVE_FORCE
Dimension-less (may have to be tuned depending on the density of obstacle sampling) (Default: 20) ...
Definition: CHolonomicVFF.h:89
TOptions options
Parameters of the algorithm (can be set manually or loaded from CHolonomicVFF::initialize or options...
Definition: CHolonomicVFF.h:96
This class allows loading and storing values and vectors of different types from a configuration text...
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
A base class for log records for different holonomic navigation methods.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
Lightweight 2D point.
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
double TARGET_SLOW_APPROACHING_DISTANCE
For stopping gradually (Default: 0.10)
Definition: CHolonomicVFF.h:88



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