27 hasEncodersInfo(false),
31 velocityLocal(.0, .0, .0)
47 out << odometry << sensorLabel << timestamp
50 if (hasEncodersInfo) out << encoderLeftTicks << encoderRightTicks;
53 if (hasVelocities) out << velocityLocal;
69 in >> odometry >> sensorLabel >> timestamp;
73 in >> hasEncodersInfo;
74 if (hasEncodersInfo || version < 2)
75 in >> encoderLeftTicks >> encoderRightTicks;
82 velocityLocal.vx = vx;
83 velocityLocal.vy = .0;
84 velocityLocal.omega =
w;
88 if (hasVelocities)
in >> velocityLocal;
93 hasEncodersInfo =
false;
94 encoderLeftTicks = encoderRightTicks = 0;
95 hasVelocities =
false;
108 o << std::endl <<
"Odometry reading: " << odometry << std::endl;
114 " Encoder info: deltaL=%i deltaR=%i\n", encoderLeftTicks,
118 o <<
"Encoder info: Not available!\n";
122 o <<
format(
"Velocity info: %s\n", velocityLocal.asString().c_str());
125 o <<
"Velocity info: Not available!\n";
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
GLubyte GLubyte GLubyte GLubyte w
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
This namespace contains representation of robot actions and observations.
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
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...
Declares a class that represents any robot's observation.
An observation of the current (cumulative) odometry for a wheeled robot.
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const override
Introduces a pure virtual method responsible for writing to a CStream.
void readFromStream(mrpt::utils::CStream &in, int version) override
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...