28 cte_a0v_deg,
double, cte_a0v, cfg, sSection);
30 cte_a0w_deg,
double, cte_a0w, cfg, sSection);
36 const int WN = 25, WV = 30;
41 "Contant for vel profile [deg].");
44 "Contant for omega profile [deg].");
53 str, 100,
"CPTG_DiffDrive_alpha,av=%udeg,aw=%udeg",
66 in >> cte_a0v >> cte_a0w;
77 out << cte_a0v << cte_a0w;
83 float alpha,
float t,
float x,
float y,
float phi,
float&
v,
float&
w)
const 88 float At_a =
alpha - phi;
91 while (At_a < -
M_PI) At_a += (float)
M_2PI;
93 v = V_MAX * exp(-
square(At_a / cte_a0v));
94 w = W_MAX * (-0.5f + (1 / (1 + exp(-At_a / cte_a0w))));
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
GLclampf GLclampf GLclampf alpha
double RAD2DEG(const double x)
Radians to degrees.
virtual void loadFromConfigFile(const mrpt::config::CConfigFileBase &cfg, const std::string &sSection) override
Possible values in "params" (those in CParameterizedTrajectoryGenerator, which is called internally...
#define MRPT_LOAD_HERE_CONFIG_VAR_DEGREES_NO_DEFAULT( variableName, variableType, targetVariable, configFileObject, sectionNameStr)
double DEG2RAD(const double x)
Degrees to radians.
void internal_readFromStream(mrpt::serialization::CArchive &in) override
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
GLubyte GLubyte GLubyte GLubyte w
void loadDefaultParams() override
Loads a set of default parameters; provided exclusively for the PTG-configurator tool.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
T square(const T x)
Inline function for the square of a number.
This is the base class for any user-defined PTG.
This class allows loading and storing values and vectors of different types from a configuration text...
IMPLEMENTS_SERIALIZABLE(CPTG_DiffDrive_alpha, CParameterizedTrajectoryGenerator, mrpt::nav) void CPTG_DiffDrive_alpha
GLsizei const GLchar ** string
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
void write(const std::string §ion, const std::string &name, enum_t value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string())
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for "archives": classes abstracting I/O streams.
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...
virtual void loadFromConfigFile(const mrpt::config::CConfigFileBase &cfg, const std::string &sSection) override
Possible values in "params" (those in CParameterizedTrajectoryGenerator, which is called internally...
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. ...
virtual 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. ...
std::string getDescription() const override
Gets a short textual description of the PTG and its parameters.
int sprintf(char *buf, size_t bufSize, const char *format,...) noexcept MRPT_printf_format_check(3
An OS-independent version of sprintf (Notice the bufSize param, which may be ignored in some compiler...
void internal_writeToStream(mrpt::serialization::CArchive &out) const override
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.