MRPT  2.0.1
CPTG_DiffDrive_C.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 /** A PTG for circular paths ("C" type PTG in 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} sign(K) \f]
23  * \f[ \omega(\alpha) = \dfrac{\alpha}{\pi} W_{MAX} sign(K) \f]
24  *
25  * So, the radius of curvature of each trajectory is constant for each "alpha"
26  * value (the trajectory parameter):
27  *
28  * \f[ R(\alpha) = \dfrac{v}{\omega} = \dfrac{V_{MAX}}{W_{MAX}}
29  * \dfrac{\pi}{\alpha} \f]
30  *
31  * from which a minimum radius of curvature can be set by selecting the
32  * appropriate values of V_MAX and W_MAX,
33  * knowning that \f$ \alpha \in (-\pi,\pi) \f$.
34  *
35  * ![C-PTG path examples](PTG1_paths.png)
36  *
37  * \note [Before MRPT 1.5.0 this was named CPTG1]
38  * \ingroup nav_tpspace
39  */
41 {
43  public:
44  CPTG_DiffDrive_C() = default;
46  const mrpt::config::CConfigFileBase& cfg, const std::string& sSection)
47  {
48  loadFromConfigFile(cfg, sSection);
49  }
50  void loadFromConfigFile(
52  const std::string& sSection) override;
53  void saveToConfigFile(
55  const std::string& sSection) const override;
56 
57  std::string getDescription() const override;
58  bool inverseMap_WS2TP(
59  double x, double y, int& out_k, double& out_d,
60  double tolerance_dist = 0.10) const override;
61  bool PTG_IsIntoDomain(double x, double y) const override;
63  float alpha, float t, float x, float y, float phi, float& v,
64  float& w) const override;
65  void loadDefaultParams() override;
66 
67  protected:
68  /** A generation parameter */
69  double K{0};
70 };
71 } // namespace mrpt::nav
bool PTG_IsIntoDomain(double x, double y) const override
Returns the same than inverseMap_WS2TP() but without any additional cost.
void loadDefaultParams() override
Loads a set of default parameters; provided exclusively for the PTG-configurator tool.
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 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...
std::string getDescription() const override
Gets a short textual description of the PTG and its parameters.
This class allows loading and storing values and vectors of different types from a configuration text...
CPTG_DiffDrive_C(const mrpt::config::CConfigFileBase &cfg, const std::string &sSection)
double K
A generation parameter.
bool inverseMap_WS2TP(double x, double y, int &out_k, double &out_d, double tolerance_dist=0.10) const override
Computes the closest (alpha,d) TP coordinates of the trajectory point closest to the Workspace (WS) C...
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 loadFromConfigFile(const mrpt::config::CConfigFileBase &cfg, const std::string &sSection) override
Parameters accepted by this base class:
A PTG for circular paths ("C" type PTG in papers).



Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020