Go to the documentation of this file.
26 uint8_t
CPoint2D::serializeGetVersion()
const {
return 1; }
29 out << m_coords[0] << m_coords[1];
48 in >> m_coords[0] >> m_coords[1];
58 out[
"x"] = m_coords[0];
59 out[
"y"] = m_coords[1];
69 m_coords[0] =
static_cast<double>(in[
"x"]);
70 m_coords[1] =
static_cast<double>(in[
"y"]);
83 const double ccos = cos(b.
phi());
84 const double ssin = sin(b.
phi());
85 const double Ax = x() - b.
x();
86 const double Ay = y() - b.
y();
88 return CPoint2D(Ax * ccos + Ay * ssin, -Ax * ssin + Ay * ccos);
93 for (
int i = 0; i < 2; i++)
94 m_coords[i] = std::numeric_limits<double>::quiet_NaN();
104 o <<
"(" << p[0] <<
"," << p[1] <<
")";
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
double phi() const
Get the phi angle of the 2D pose (in radians)
Virtual base class for "schematic archives" (JSON, XML,...)
double x() const
Common members of all points & poses classes.
#define SCHEMA_DESERIALIZE_DATATYPE_VERSION()
For use inside serializeFrom(CSchemeArchiveBase) methods.
mrpt::vision::TStereoCalibResults out
std::ostream & operator<<(std::ostream &o, const CPoint2D &p)
Dumps a point as a string (x,y)
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Virtual base class for "archives": classes abstracting I/O streams.
CPoint2D operator-(const CPose2D &b) const
The operator D="this"-b is the pose inverse compounding operator, the resulting points "D" fulfils: "...
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
mrpt::math::TPoint2D asTPoint() const
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
void setToNaN() override
Set all data fields to quiet NaN.
TPoint2D_< double > TPoint2D
Lightweight 2D point.
This base provides a set of functions for maths stuff.
CPoint2D(double x=0, double y=0)
Constructor for initializing point coordinates.
A class used to store a 2D point.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
#define SCHEMA_SERIALIZE_DATATYPE_VERSION(ser_version)
For use inside all serializeTo(CSchemeArchiveBase) methods.
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 15 23:51:15 UTC 2020 | |