MRPT  2.0.4
CPTG_DiffDrive_alpha.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
12 
13 namespace mrpt::nav
14 {
15 /** The "a(symptotic)-alpha PTG", as named in PTG papers.
16  * - **Compatible kinematics**: differential-driven / Ackermann steering
17  * - **Compatible robot shape**: Arbitrary 2D polygon
18  * - **PTG parameters**: Use the app `ptg-configurator`
19  *
20  * This PT generator functions are:
21  *
22  * \f[ v(\alpha) = V_{MAX} e^{ -\left( \dfrac{\alpha-\phi}{cte_{a0v}} \right)^2}
23  * \f]
24  * \f[ \omega(\alpha) = W_{MAX} \left( -\dfrac{1}{2} +\dfrac{1}{1+ e^{ -
25  * \dfrac{\alpha-\phi}{cte_{a0w}} } } \right) \f]
26  *
27  * So, the radius of curvature of each trajectory is NOT constant for each
28  * "alpha" value in this PTG:
29  *
30  * ![C-PTG path examples](PTG2_paths.png)
31  *
32  * \note [Before MRPT 1.5.0 this was named CPTG2]
33  * \ingroup nav_tpspace
34  */
36 {
38  public:
39  CPTG_DiffDrive_alpha() = default;
41  const mrpt::config::CConfigFileBase& cfg, const std::string& sSection)
42  {
43  loadFromConfigFile(cfg, sSection);
44  }
45  void loadFromConfigFile(
47  const std::string& sSection) override;
48  void saveToConfigFile(
50  const std::string& sSection) const override;
51 
52  std::string getDescription() const override;
54  float alpha, float t, float x, float y, float phi, float& v,
55  float& w) const override;
56  void loadDefaultParams() override;
57 
58  protected:
59  double cte_a0v{0}, cte_a0w{0};
60 };
61 } // namespace mrpt::nav
CPTG_DiffDrive_alpha(const mrpt::config::CConfigFileBase &cfg, const std::string &sSection)
void loadDefaultParams() override
Loads a set of default parameters; provided exclusively for the PTG-configurator tool.
This class allows loading and storing values and vectors of different types from a configuration text...
The "a(symptotic)-alpha PTG", as named in PTG papers.
void ptgDiffDriveSteeringFunction(float alpha, float t, float x, float y, float phi, float &v, float &w) const override
The main method to be implemented in derived classes: it defines the differential-driven differential...
Base class for all PTGs suitable to non-holonomic, differentially-driven (or Ackermann) vehicles base...
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
void saveToConfigFile(mrpt::config::CConfigFileBase &cfg, const std::string &sSection) const override
This method saves the options to a ".ini"-like file or memory-stored string list. ...
void loadFromConfigFile(const mrpt::config::CConfigFileBase &cfg, const std::string &sSection) override
Parameters accepted by this base class:
std::string getDescription() const override
Gets a short textual description of the PTG and its parameters.



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020