26 hasEncodersInfo(false),
30 velocityLocal(.0, .0, .0)
38 out << odometry << sensorLabel << timestamp
41 if (hasEncodersInfo) out << encoderLeftTicks << encoderRightTicks;
43 if (hasVelocities) out << velocityLocal;
56 in >> odometry >> sensorLabel >> timestamp;
60 in >> hasEncodersInfo;
61 if (hasEncodersInfo || version < 2)
62 in >> encoderLeftTicks >> encoderRightTicks;
69 velocityLocal.vx = vx;
70 velocityLocal.vy = .0;
71 velocityLocal.omega =
w;
75 if (hasVelocities)
in >> velocityLocal;
80 hasEncodersInfo =
false;
81 encoderLeftTicks = encoderRightTicks = 0;
82 hasVelocities =
false;
95 o << std::endl <<
"Odometry reading: " << odometry << std::endl;
101 " Encoder info: deltaL=%i deltaR=%i\n", encoderLeftTicks,
105 o <<
"Encoder info: Not available!\n";
109 o <<
format(
"Velocity info: %s\n", velocityLocal.asString().c_str());
112 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)
This must be inserted in 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.