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