Main MRPT website > C++ reference for MRPT 1.4.0
CPTG1.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 CPTG1_H
10#define CPTG1_H
11
13
14namespace mrpt
15{
16 namespace nav
17 {
18
19 /** A PTG for circular paths ("C" type PTG in papers).
20 *
21 * Accepted parameters in the constructor:
22 * - params["ref_distance"]: Maximum trayectory distance (meters).
23 * - params["v_max"]: Maximum linear velocity (m/s)
24 * - params["w_max"]: Maximum angular velocity (rad/s)
25 * - params["K"]: Can be "+1" for forward paths, or "-1" for backward paths.
26 *
27 * This PT generator functions are:
28 *
29 * \f[ v(\alpha) = V_{MAX} sign(K) \f]
30 * \f[ \omega(\alpha) = \dfrac{\alpha}{\pi} W_{MAX} sign(K) \f]
31 *
32 * So, the radius of curvature of each trajectory is constant for each "alpha" value (the trajectory parameter):
33 *
34 * \f[ R(\alpha) = \dfrac{v}{\omega} = \dfrac{V_{MAX}}{W_{MAX}} \dfrac{\pi}{\alpha} \f]
35 *
36 * from which a minimum radius of curvature can be set by selecting the appropriate values of V_MAX and W_MAX,
37 * knowning that \f$ \alpha \in (-\pi,\pi) \f$.
38 *
39 * ![C-PTG path examples](PTG1_paths.png)
40 *
41 * \ingroup nav_tpspace
42 */
44 {
45 public:
46 /** Constructor: possible values in "params", those of CParameterizedTrajectoryGenerator plus:
47 * - K: Direction, +1 or -1
48 */
50
51 virtual bool inverseMap_WS2TP(float x, float y, int &out_k, float &out_d, float tolerance_dist = 0.10f) const;
52
53 /** Gets a short textual description of the PTG and its parameters. */
54 std::string getDescription() const;
55
56
57 bool PTG_IsIntoDomain( float x, float y );
58 void PTG_Generator( float alpha, float t,float x, float y, float phi, float &v, float &w );
59
60 protected:
61 /** A generation parameter */
62 float K;
63 };
64 }
65}
66
67
68#endif
69
A PTG for circular paths ("C" type PTG in papers).
Definition: CPTG1.h:44
bool PTG_IsIntoDomain(float x, float y)
To be implemented in derived classes.
std::string getDescription() const
Gets a short textual description of the PTG and its parameters.
virtual bool inverseMap_WS2TP(float x, float y, int &out_k, float &out_d, float tolerance_dist=0.10f) const
Computes the closest (alpha,d) TP coordinates of the trajectory point closest to the Workspace (WS) C...
CPTG1(const mrpt::utils::TParameters< double > &params)
Constructor: possible values in "params", those of CParameterizedTrajectoryGenerator plus:
float K
A generation parameter.
Definition: CPTG1.h:62
void PTG_Generator(float alpha, float t, float x, float y, float phi, float &v, float &w)
The main method to be implemented in derived classes.
This is the base class for any user-defined PTG.
EIGEN_STRONG_INLINE const AdjointReturnType t() const
Transpose.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
For usage when passing a dynamic number of (numeric) arguments to a function, by name.
Definition: TParameters.h:47



Page generated by Doxygen 1.9.5 for MRPT 1.4.0 SVN: at Sun Nov 27 02:56:26 UTC 2022