Go to the documentation of this file.
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;
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())
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
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.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLubyte GLubyte GLubyte GLubyte w
GLclampf GLclampf GLclampf alpha
virtual void loadDefaultParams() override
Loads a set of default parameters; provided exclusively for the PTG-configurator tool.
Virtual base class for "archives": classes abstracting I/O streams.
#define MRPT_LOAD_CONFIG_VAR_NO_DEFAULT( variableName, variableType, configFileObject, sectionNameStr)
IMPLEMENTS_SERIALIZABLE(CPTG_DiffDrive_C, CParameterizedTrajectoryGenerator, mrpt::nav) void CPTG_DiffDrive_C
A PTG for circular paths ("C" type PTG in papers).
#define ASSERT_BELOW_(__A, __B)
void internal_writeToStream(mrpt::serialization::CArchive &out) const override
virtual void loadFromConfigFile(const mrpt::config::CConfigFileBase &cfg, const std::string &sSection) override
Possible values in "params" (those in CParameterizedTrajectoryGenerator, which is called internally,...
This class allows loading and storing values and vectors of different types from a configuration text...
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.
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 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 wrapTo2PiInPlace(T &a)
Modifies the given angle to translate it into the [0,2pi[ range.
#define ASSERT_ABOVEEQ_(__A, __B)
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.
virtual void loadFromConfigFile(const mrpt::config::CConfigFileBase &cfg, const std::string &sSection) override
Possible values in "params" (those in CParameterizedTrajectoryGenerator, which is called internally,...
GLsizei const GLchar ** string
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...
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
std::string getDescription() const override
Gets a short textual description of the PTG and its parameters.
int sign(T x)
Returns the sign of X as "1" or "-1".
This is the base class for any user-defined PTG.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
GLubyte GLubyte GLubyte a
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |