27 velocityLocal(.0, .0, .0)
35 out << odometry << sensorLabel
39 if (hasEncodersInfo) out << encoderLeftTicks << encoderRightTicks;
41 if (hasVelocities) out << velocityLocal;
54 in >> odometry >> sensorLabel >> timestamp;
58 in >> hasEncodersInfo;
59 if (hasEncodersInfo || version < 2)
60 in >> encoderLeftTicks >> encoderRightTicks;
67 velocityLocal.vx = vx;
68 velocityLocal.vy = .0;
69 velocityLocal.omega =
w;
73 if (hasVelocities)
in >> velocityLocal;
78 hasEncodersInfo =
false;
79 encoderLeftTicks = encoderRightTicks = 0;
80 hasVelocities =
false;
93 o << std::endl <<
"Odometry reading: " << odometry << std::endl;
99 " Encoder info: deltaL=%i deltaR=%i\n", encoderLeftTicks,
103 o <<
"Encoder info: Not available!\n";
107 o <<
format(
"Velocity info: %s\n", velocityLocal.asString().c_str());
110 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.
#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.
GLubyte GLubyte GLubyte GLubyte w
#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.
Declares a class that represents any robot's observation.
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
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...
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.