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::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() : K(0) {}
46  const mrpt::config::CConfigFileBase& cfg, const std::string& sSection)
47  {
48  loadFromConfigFile(cfg, sSection);
49  }
50  virtual void loadFromConfigFile(
52  const std::string& sSection) override;
53  virtual 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;
70 };
71 }
72 
GLclampf GLclampf GLclampf alpha
Definition: glext.h:3525
GLdouble GLdouble t
Definition: glext.h:3689
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.
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. ...
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...
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:4178
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...
virtual void loadFromConfigFile(const mrpt::config::CConfigFileBase &cfg, const std::string &sSection) override
Possible values in "params" (those in CParameterizedTrajectoryGenerator, which is called internally...
CPTG_DiffDrive_C(const mrpt::config::CConfigFileBase &cfg, const std::string &sSection)
GLsizei const GLchar ** string
Definition: glext.h:4101
double K
A generation parameter.
const GLdouble * v
Definition: glext.h:3678
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
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.
Base class for all PTGs suitable to non-holonomic, differentially-driven (or Ackermann) vehicles base...
GLenum GLint GLint y
Definition: glext.h:3538
GLenum GLint x
Definition: glext.h:3538
A PTG for circular paths ("C" type PTG in papers).



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020