27 velocityLocal(.0, .0, .0)
35 out << odometry << sensorLabel
39 if (hasEncodersInfo)
out << encoderLeftTicks << encoderRightTicks;
41 if (hasVelocities)
out << velocityLocal;
53 in >> odometry >> sensorLabel >> timestamp;
57 in >> hasEncodersInfo;
58 if (hasEncodersInfo || version < 2)
59 in >> encoderLeftTicks >> encoderRightTicks;
66 velocityLocal.vx = vx;
67 velocityLocal.vy = .0;
68 velocityLocal.omega = w;
72 if (hasVelocities) in >> velocityLocal;
77 hasEncodersInfo =
false;
78 encoderLeftTicks = encoderRightTicks = 0;
79 hasVelocities =
false;
92 o << std::endl <<
"Odometry reading: " << odometry << std::endl;
98 " Encoder info: deltaL=%i deltaR=%i\n", encoderLeftTicks,
102 o <<
"Encoder info: Not available!\n";
106 o <<
format(
"Velocity info: %s\n", velocityLocal.asString().c_str());
109 o <<
"Velocity info: Not available!\n";
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
std::string std::string format(std::string_view fmt, ARGS &&... args)
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
This namespace contains representation of robot actions and observations.
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Virtual base class for "archives": classes abstracting I/O streams.
mrpt::vision::TStereoCalibResults out
Declares a class that represents any robot's observation.
An observation of the current (cumulative) odometry for a wheeled robot.
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...