Main MRPT website > C++ reference for MRPT 1.4.0
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-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 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  /** \addtogroup nav_holo Holonomic navigation methods
23  * \ingroup mrpt_nav_grp
24  * @{ */
25 
26  /** A class for storing extra information about the execution of
27  * CHolonomicVFF navigation.
28  * \sa CHolonomicVFF, CHolonomicLogFileRecord
29  */
31  {
33  public:
34 
35  };
37 
38 
39  /** A holonomic reactive navigation method, based on Virtual Force Fields (VFF).
40  *
41  * 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).
42  *
43  * \code
44  * [VFF_CONFIG]
45  * TARGET_SLOW_APPROACHING_DISTANCE = 0.10 // For stopping gradually
46  * TARGET_ATTRACTIVE_FORCE = 20 // Dimension-less (may have to be tuned depending on the density of obstacle sampling)
47  * \endcode
48  *
49  * \sa CAbstractHolonomicReactiveMethod,CReactiveNavigationSystem
50  */
52  {
53  public:
55  public:
56  /** Initialize the parameters of the navigator, from some configuration file, or default values if set to NULL.
57  */
58  CHolonomicVFF(const mrpt::utils::CConfigFileBase *INI_FILE=NULL);
59 
60  /** This method performs the holonomic navigation itself.
61  * \param target [IN] The relative location (x,y) of target point.
62  * \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.
63  * \param maxRobotSpeed [IN] Maximum robot speed, in "pseudometers/sec". See note below.
64  * \param desiredDirection [OUT] The desired motion direction, in the range [-PI,PI]
65  * \param desiredSpeed [OUT] The desired motion speed in that direction, in "pseudometers"/sec. (See note below)
66  * \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.
67  *
68  * NOTE: With "pseudometers" we refer to the distance unit in TP-Space, thus:
69  * <br><center><code>pseudometer<sup>2</sup>= meter<sup>2</sup> + (rad * r)<sup>2</sup></code><br></center>
70  */
71  void navigate( const mrpt::math::TPoint2D &target,
72  const std::vector<float> &obstacles,
73  double maxRobotSpeed,
74  double &desiredDirection,
75  double &desiredSpeed,
76  CHolonomicLogFileRecordPtr &logRecord );
77 
78  /** Initialize the parameters of the navigator from section "VFF_CONFIG" of a config file. \sa options */
79  void initialize( const mrpt::utils::CConfigFileBase &INI_FILE )
80  {
81  options.loadFromConfigFile(INI_FILE, std::string("VFF_CONFIG"));
82  }
83 
84  /** Algorithm options */
86  {
87  double TARGET_SLOW_APPROACHING_DISTANCE; //!< For stopping gradually (Default: 0.10)
88  double TARGET_ATTRACTIVE_FORCE; //!< Dimension-less (may have to be tuned depending on the density of obstacle sampling) (Default: 20)
89 
90  TOptions();
91  void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source,const std::string &section) MRPT_OVERRIDE; // See base docs
92  void saveToConfigFile(mrpt::utils::CConfigFileBase &cfg ,const std::string &section) const MRPT_OVERRIDE; // See base docs
93  };
94 
95  TOptions options; //!< Parameters of the algorithm (can be set manually or loaded from CHolonomicVFF::initialize or options.loadFromConfigFile(), etc.)
96 
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:51
#define MRPT_MAKE_ALIGNED_OPERATOR_NEW
Definition: memory.h:112
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
A class for storing extra information about the execution of CHolonomicVFF navigation.
Definition: CHolonomicVFF.h:30
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:79
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:88
TOptions options
Parameters of the algorithm (can be set manually or loaded from CHolonomicVFF::initialize or options...
Definition: CHolonomicVFF.h:95
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:87



Page generated by Doxygen 1.8.11 for MRPT 1.4.0 SVN:Unversioned directory at Mon Jul 4 10:31:07 UTC 2016