Main MRPT website > C++ reference for MRPT 1.4.0
CPoses3DSequence.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2016, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 #ifndef CPoses3DSequence_H
10 #define CPoses3DSequence_H
11 
12 #include <mrpt/poses/CPose3D.h>
14 
15 namespace mrpt
16 {
17 namespace poses
18 {
19 
20  // This must be added to any CSerializable derived class:
22 
23  /** This class stores a sequence of relative, incremental 3D poses. It is useful as the bases storing unit for more complex probability particles and for computing the absolute pose of any intermediate pose.
24  *
25  * \sa CPose3D, CMultiMetricMap
26  * \ingroup poses_grp
27  */
28  class BASE_IMPEXP CPoses3DSequence : public mrpt::utils::CSerializable
29  {
30  // This must be added to any CSerializable derived class:
32  public:
33  /** Default constructor
34  */
36 
37 
38  /** Returns the poses count in the sequence:
39  */
40  size_t posesCount();
41 
42  /** Reads the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1"
43  * \exception std::exception On invalid index value
44  */
45  void getPose(unsigned int ind, CPose3D &outPose);
46 
47  /** Changes the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1"
48  * \exception std::exception On invalid index value
49  */
50  void changePose(unsigned int ind, CPose3D &inPose);
51 
52  /** Appends a new pose at the end of sequence. Remember that poses are relative, incremental to the last one.
53  */
54  void appendPose(CPose3D &newPose);
55 
56  /** Clears the sequence.
57  */
58  void clear();
59 
60  /** Returns the absolute pose of a robot after moving "n" poses, so for "n=0" the origin pose (0,0,0deg) is returned, for "n=1" the first pose is returned, and for "n=posesCount()", the pose
61  * of robot after moving ALL poses is returned, all of them relative to the starting pose.
62  * \exception std::exception On invalid index value
63  * \sa absolutePoseAfterAll
64  */
65  CPose3D absolutePoseOf(unsigned int n);
66 
67  /** A shortcut for "absolutePoseOf( posesCount() )".
68  * \sa absolutePoseOf, posesCount
69  */
71 
72  /** Returns the traveled distance after moving "n" poses, so for "n=0" it returns 0, for "n=1" the first traveled distance, and for "n=posesCount()", the total
73  * distance after ALL movements.
74  * \exception std::exception On invalid index value
75  * \sa computeTraveledDistanceAfterAll
76  */
77  float computeTraveledDistanceAfter(unsigned int n);
78 
79  /** Returns the traveled distance after ALL movements.
80  * A shortcut for "computeTraveledDistanceAfter( posesCount() )".
81  * \sa computeTraveledDistanceAfter
82  */
84 
85  private:
86  /** The internal sequence of poses, stored as relative, incremental poses, thus each one is situated just at the end point of last one, where the first one is referenced to (0,0,0deg)
87  */
88  std::vector<mrpt::math::TPose3D> m_poses;
89 
90  }; // End of class def.
92 
93 
94  } // End of namespace
95 } // End of namespace
96 
97 #endif
mrpt::poses::CPoses3DSequence
This class stores a sequence of relative, incremental 3D poses.
Definition: CPoses3DSequence.h:29
mrpt::poses::CPoses3DSequence::absolutePoseAfterAll
CPose3D absolutePoseAfterAll()
A shortcut for "absolutePoseOf( posesCount() )".
mrpt::poses::CPoses3DSequence::absolutePoseOf
CPose3D absolutePoseOf(unsigned int n)
Returns the absolute pose of a robot after moving "n" poses, so for "n=0" the origin pose (0,...
DEFINE_SERIALIZABLE_POST_CUSTOM_BASE
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE(class_name, base_name)
Definition: CSerializable.h:182
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CParticleFilter.h:17
mrpt::poses::CPoses3DSequence::m_poses
std::vector< mrpt::math::TPose3D > m_poses
The internal sequence of poses, stored as relative, incremental poses, thus each one is situated just...
Definition: CPoses3DSequence.h:88
mrpt::poses::CPoses3DSequence::getPose
void getPose(unsigned int ind, CPose3D &outPose)
Reads the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1".
mrpt::poses::CPoses3DSequence::changePose
void changePose(unsigned int ind, CPose3D &inPose)
Changes the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1".
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:73
mrpt::poses::CPoses3DSequence::appendPose
void appendPose(CPose3D &newPose)
Appends a new pose at the end of sequence.
mrpt::poses::CPoses3DSequence::clear
void clear()
Clears the sequence.
mrpt::utils::CSerializable
The virtual base class which provides a unified interface for all persistent objects in MRPT.
Definition: CSerializable.h:40
CPose3D.h
mrpt::poses::CPoses3DSequence::posesCount
size_t posesCount()
Returns the poses count in the sequence:
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:147
mrpt::poses::CPoses3DSequence::CPoses3DSequence
CPoses3DSequence()
Default constructor.
mrpt::poses::CPoses3DSequence::computeTraveledDistanceAfterAll
float computeTraveledDistanceAfterAll()
Returns the traveled distance after ALL movements.
CSerializable.h
mrpt::poses::CPoses3DSequence::computeTraveledDistanceAfter
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 ...
DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE(class_name, base_name)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
Definition: CSerializable.h:178



Page generated by Doxygen 1.8.20 for MRPT 1.4.0 SVN: at Thu Aug 27 02:40:23 UTC 2020