Main MRPT website > C++ reference for MRPT 1.9.9
CPTG_DiffDrive_C.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-2018, 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 #pragma once
10 
12 
13 namespace mrpt
14 {
15 namespace nav
16 {
17 /** A PTG for circular paths ("C" type PTG in papers).
18  * - **Compatible kinematics**: differential-driven / Ackermann steering
19  * - **Compatible robot shape**: Arbitrary 2D polygon
20  * - **PTG parameters**: Use the app `ptg-configurator`
21  *
22  * This PT generator functions are:
23  *
24  * \f[ v(\alpha) = V_{MAX} sign(K) \f]
25  * \f[ \omega(\alpha) = \dfrac{\alpha}{\pi} W_{MAX} sign(K) \f]
26  *
27  * So, the radius of curvature of each trajectory is constant for each "alpha"
28  * value (the trajectory parameter):
29  *
30  * \f[ R(\alpha) = \dfrac{v}{\omega} = \dfrac{V_{MAX}}{W_{MAX}}
31  * \dfrac{\pi}{\alpha} \f]
32  *
33  * from which a minimum radius of curvature can be set by selecting the
34  * appropriate values of V_MAX and W_MAX,
35  * knowning that \f$ \alpha \in (-\pi,\pi) \f$.
36  *
37  * ![C-PTG path examples](PTG1_paths.png)
38  *
39  * \note [Before MRPT 1.5.0 this was named CPTG1]
40  * \ingroup nav_tpspace
41  */
43 {
45  public:
46  CPTG_DiffDrive_C() : K(0) {}
48  const mrpt::config::CConfigFileBase& cfg, const std::string& sSection)
49  {
50  loadFromConfigFile(cfg, sSection);
51  }
52  virtual void loadFromConfigFile(
54  const std::string& sSection) override;
55  virtual void saveToConfigFile(
57  const std::string& sSection) const override;
58 
59  std::string getDescription() const override;
60  bool inverseMap_WS2TP(
61  double x, double y, int& out_k, double& out_d,
62  double tolerance_dist = 0.10) const override;
63  bool PTG_IsIntoDomain(double x, double y) const override;
65  float alpha, float t, float x, float y, float phi, float& v,
66  float& w) const override;
67  void loadDefaultParams() override;
68 
69  protected:
70  /** A generation parameter */
71  double K;
72 };
73 }
74 }
t
GLdouble GLdouble t
Definition: glext.h:3689
mrpt::nav::CPTG_DiffDrive_C::K
double K
A generation parameter.
Definition: CPTG_DiffDrive_C.h:71
mrpt::nav::CPTG_DiffDrive_C::CPTG_DiffDrive_C
CPTG_DiffDrive_C()
Definition: CPTG_DiffDrive_C.h:46
mrpt::nav::CPTG_DiffDrive_C::inverseMap_WS2TP
bool inverseMap_WS2TP(double x, double y, int &out_k, double &out_d, double tolerance_dist=0.10) const override
The default implementation in this class relies on a look-up-table.
Definition: CPTG_DiffDrive_C.cpp:90
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
w
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:4178
alpha
GLclampf GLclampf GLclampf alpha
Definition: glext.h:3525
v
const GLdouble * v
Definition: glext.h:3678
mrpt::nav::CPTG_DiffDrive_C
A PTG for circular paths ("C" type PTG in papers).
Definition: CPTG_DiffDrive_C.h:42
mrpt::config::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: config/CConfigFileBase.h:44
mrpt::nav::CPTG_DiffDrive_C::PTG_IsIntoDomain
bool PTG_IsIntoDomain(double x, double y) const override
Returns the same than inverseMap_WS2TP() but without any additional cost.
Definition: CPTG_DiffDrive_C.cpp:83
mrpt::nav::CPTG_DiffDrive_CollisionGridBased
Base class for all PTGs suitable to non-holonomic, differentially-driven (or Ackermann) vehicles base...
Definition: CPTG_DiffDrive_CollisionGridBased.h:52
mrpt::nav::CPTG_DiffDrive_C::loadDefaultParams
void loadDefaultParams() override
Loads a set of default parameters; provided exclusively for the PTG-configurator tool.
Definition: CPTG_DiffDrive_C.cpp:158
mrpt::nav::CPTG_DiffDrive_C::saveToConfigFile
virtual 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.
Definition: CPTG_DiffDrive_C.cpp:29
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:102
CPTG_DiffDrive_CollisionGridBased.h
mrpt::nav::CPTG_DiffDrive_C::loadFromConfigFile
virtual void loadFromConfigFile(const mrpt::config::CConfigFileBase &cfg, const std::string &sSection) override
Possible values in "params" (those in CParameterizedTrajectoryGenerator, which is called internally,...
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::nav::CPTG_DiffDrive_C::CPTG_DiffDrive_C
CPTG_DiffDrive_C(const mrpt::config::CConfigFileBase &cfg, const std::string &sSection)
Definition: CPTG_DiffDrive_C.h:47
mrpt::nav::CPTG_DiffDrive_C::ptgDiffDriveSteeringFunction
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...
Definition: CPTG_DiffDrive_C.cpp:70
mrpt::nav::CPTG_DiffDrive_C::getDescription
std::string getDescription() const override
Gets a short textual description of the PTG and its parameters.
Definition: CPTG_DiffDrive_C.cpp:65
y
GLenum GLint GLint y
Definition: glext.h:3538
x
GLenum GLint x
Definition: glext.h:3538



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST