36 return m_poses.size();
54 for (i=0;i<
n;i++) out << m_poses[i];
73 for (i=0;i<n;i++) in >> m_poses[i];
86 if (ind>=m_poses.size())
THROW_EXCEPTION(
"getPose: Index out of range!!");
88 outPose =
CPose3D(m_poses[ind]);
96 if (ind>=m_poses.size())
THROW_EXCEPTION(
"getPose: Index out of range!!");
97 m_poses[ind] = inPose;
105 m_poses.push_back( newPose );
126 if (
n>m_poses.size())
THROW_EXCEPTION(
"absolutePoseOf: Index out of range!!");
128 for (i=0;i<
n;i++) ret = ret +
CPose3D(m_poses[i]);
139 return absolutePoseOf( posesCount() );
151 if (
n>m_poses.size())
THROW_EXCEPTION(
"computeTraveledDistanceAfter: Index out of range!!");
153 for (i=0;i<
n;i++) dist+= m_poses[i].
norm();
163 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)
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
CONTAINER::Scalar norm(const CONTAINER &v)
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.