33 const int WN = 25, WV = 30;
37 sSection,
"K", K, WN, WV,
38 "K=+1 forward paths; K=-1 for backwards paths.");
71 float alpha,
float t,
float x,
float y,
float phi,
float&
v,
float&
w)
const 91 double x,
double y,
int& k_out,
double& d_out,
double tolerance_dist)
const 97 double R = (
x *
x +
y *
y) / (2 *
y);
98 const double Rmin = std::abs(V_MAX / W_MAX);
105 theta = atan2((
double)
x, fabs(
R) -
y);
107 theta = atan2((
double)
x,
y + fabs(
R));
112 theta = atan2(-(
double)
x, fabs(
R) -
y);
114 theta = atan2(-(
double)
x,
y + fabs(
R));
121 d_out = (float)(theta * (fabs(
R) + turningRadiusReference));
123 if (std::abs(
R) < Rmin)
130 const double a =
M_PI * V_MAX / (W_MAX *
R);
131 k_out = alpha2index((
float)
a);
137 k_out = alpha2index(0);
143 k_out = m_alphaValuesCount - 1;
150 d_out = d_out / refDistance;
GLclampf GLclampf GLclampf alpha
bool PTG_IsIntoDomain(double x, double y) const override
Returns the same than inverseMap_WS2TP() but without any additional cost.
virtual void loadFromConfigFile(const mrpt::config::CConfigFileBase &cfg, const std::string &sSection) override
Possible values in "params" (those in CParameterizedTrajectoryGenerator, which is called internally...
void loadDefaultParams() override
Loads a set of default parameters; provided exclusively for the PTG-configurator tool.
#define ASSERT_BELOW_(__A, __B)
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 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.
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.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
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...
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_CONFIG_VAR_NO_DEFAULT( variableName, variableType, configFileObject, sectionNameStr)
#define ASSERT_ABOVEEQ_(__A, __B)
GLsizei const GLchar ** string
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
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())
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.
Virtual base class for "archives": classes abstracting I/O streams.
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
IMPLEMENTS_SERIALIZABLE(CPTG_DiffDrive_C, CParameterizedTrajectoryGenerator, mrpt::nav) void CPTG_DiffDrive_C
int sign(T x)
Returns the sign of X as "1" or "-1".
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. ...
A PTG for circular paths ("C" type PTG in papers).
GLubyte GLubyte GLubyte a
void internal_writeToStream(mrpt::serialization::CArchive &out) const override
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.