46 for (i = 0; i <
n; i++) out << poses[i];
65 for (i = 0; i < n; i++) in >> poses[i];
92 *((&(poses[ind])) + ind) = inPose;
101 poses.push_back(newPose);
123 for (i = 0; i <
n; i++) ret = ret + poses[i];
133 return absolutePoseOf(posesCount());
149 for (i = 0; i <
n; i++) dist += poses[i].
norm();
160 return computeTraveledDistanceAfter(posesCount());
This class stores a sequence of relative, incremental 2D poses.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
CPose2D absolutePoseOf(unsigned int n)
Returns the absolute pose of a robot after moving "n" poses, so for "n=0" the origin pose (0...
#define THROW_EXCEPTION(msg)
void getPose(unsigned int ind, CPose2D &outPose)
Reads the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1"...
size_t posesCount()
Returns the poses count in the sequence:
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const override
Introduces a pure virtual method responsible for writing to a CStream.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
This base provides a set of functions for maths stuff.
float computeTraveledDistanceAfterAll()
Returns the traveled distance after ALL movements.
void clear()
Clears the sequence.
void changePose(unsigned int ind, CPose2D &inPose)
Changes the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1"...
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
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...
unsigned __int32 uint32_t
void appendPose(CPose2D &newPose)
Appends a new pose at the end of sequence.
CONTAINER::Scalar norm(const CONTAINER &v)
float computeTraveledDistanceAfter(unsigned int n)
Returns the traveled distance after moving "n" poses, so for "n=0" it returns 0, for "n=1" the first ...
CPose2D absolutePoseAfterAll()
A shortcut for "absolutePoseOf( posesCount() )".