33 const int WN = 25, WV = 30;
37 sSection,
"K", K, WN, WV,
38 "K=+1 forward paths; K=-1 for backwards paths.");
76 float alpha,
float t,
float x,
float y,
float phi,
float&
v,
float&
w)
const 96 double x,
double y,
int& k_out,
double& d_out,
double tolerance_dist)
const 102 double R = (
x *
x +
y *
y) / (2 *
y);
103 const double Rmin = std::abs(V_MAX / W_MAX);
110 theta = atan2((
double)
x, fabs(
R) -
y);
112 theta = atan2((
double)
x,
y + fabs(
R));
117 theta = atan2(-(
double)
x, fabs(
R) -
y);
119 theta = atan2(-(
double)
x,
y + fabs(
R));
126 d_out = (float)(theta * (fabs(
R) + turningRadiusReference));
128 if (std::abs(
R) < Rmin)
135 const double a =
M_PI * V_MAX / (W_MAX *
R);
136 k_out = alpha2index((
float)
a);
142 k_out = alpha2index(0);
148 k_out = m_alphaValuesCount - 1;
155 d_out = d_out / refDistance;
virtual void saveToConfigFile(mrpt::utils::CConfigFileBase &cfg, const std::string &sSection) const override
This method saves the options to a ".ini"-like file or memory-stored string list. ...
GLclampf GLclampf GLclampf alpha
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
bool PTG_IsIntoDomain(double x, double y) const override
Returns the same than inverseMap_WS2TP() but without any additional cost.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
void loadDefaultParams() override
Loads a set of default parameters; provided exclusively for the PTG-configurator tool.
#define ASSERT_BELOW_(__A, __B)
void internal_readFromStream(mrpt::utils::CStream &in) override
int sign(T x)
Returns the sign of X as "1" or "-1".
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
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...
void readFromStream(mrpt::utils::CStream &in, int version) override
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
This is the base class for any user-defined PTG.
virtual void loadFromConfigFile(const mrpt::utils::CConfigFileBase &cfg, const std::string &sSection) override
Possible values in "params" (those in CParameterizedTrajectoryGenerator, which is called internally...
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const override
Introduces a pure virtual method responsible for writing to a CStream.
GLsizei const GLchar ** string
int sign(T x)
Returns the sign of X as "1" or "-1".
void wrapTo2PiInPlace(T &a)
Modifies the given angle to translate it into the [0,2pi[ range.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
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.
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())
#define ASSERT_ABOVEEQ_(__A, __B)
IMPLEMENTS_SERIALIZABLE(CPTG_DiffDrive_C, CParameterizedTrajectoryGenerator, mrpt::nav) void CPTG_DiffDrive_C
void internal_writeToStream(mrpt::utils::CStream &out) const override
virtual void saveToConfigFile(mrpt::utils::CConfigFileBase &cfg, const std::string &sSection) const override
This method saves the options to a ".ini"-like file or memory-stored string list. ...
#define MRPT_LOAD_CONFIG_VAR_NO_DEFAULT( variableName, variableType, configFileObject, sectionNameStr)
virtual void loadDefaultParams() override
Loads a set of default parameters; provided exclusively for the PTG-configurator tool.
A PTG for circular paths ("C" type PTG in papers).
virtual void loadFromConfigFile(const mrpt::utils::CConfigFileBase &cfg, const std::string &sSection) override
Possible values in "params" (those in CParameterizedTrajectoryGenerator, which is called internally...
GLubyte GLubyte GLubyte a