Main MRPT website > C++ reference for MRPT 1.9.9
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-2017, 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 /** This class stores a sequence of relative, incremental 3D poses. It is useful
20  * as the bases storing unit for more complex probability particles and for
21  * computing the absolute pose of any intermediate pose.
22  *
23  * \sa CPose3D, CMultiMetricMap
24  * \ingroup poses_grp
25  */
27 {
29  public:
30  /** Default constructor
31  */
33 
34  /** Returns the poses count in the sequence:
35  */
36  size_t posesCount();
37 
38  /** Reads the stored pose at index "ind", where the first one is 0, the last
39  * "posesCount() - 1"
40  * \exception std::exception On invalid index value
41  */
42  void getPose(unsigned int ind, CPose3D& outPose);
43 
44  /** Changes the stored pose at index "ind", where the first one is 0, the
45  * last "posesCount() - 1"
46  * \exception std::exception On invalid index value
47  */
48  void changePose(unsigned int ind, CPose3D& inPose);
49 
50  /** Appends a new pose at the end of sequence. Remember that poses are
51  * relative, incremental to the last one.
52  */
53  void appendPose(CPose3D& newPose);
54 
55  /** Clears the sequence.
56  */
57  void clear();
58 
59  /** Returns the absolute pose of a robot after moving "n" poses, so for
60  * "n=0" the origin pose (0,0,0deg) is returned, for "n=1" the first pose is
61  * returned, and for "n=posesCount()", the pose
62  * of robot after moving ALL poses is returned, all of them relative to the
63  * starting pose.
64  * \exception std::exception On invalid index value
65  * \sa absolutePoseAfterAll
66  */
67  CPose3D absolutePoseOf(unsigned int n);
68 
69  /** A shortcut for "absolutePoseOf( posesCount() )".
70  * \sa absolutePoseOf, posesCount
71  */
73 
74  /** Returns the traveled distance after moving "n" poses, so for "n=0" it
75  * returns 0, for "n=1" the first traveled distance, and for
76  * "n=posesCount()", the total
77  * distance after ALL movements.
78  * \exception std::exception On invalid index value
79  * \sa computeTraveledDistanceAfterAll
80  */
81  float computeTraveledDistanceAfter(unsigned int n);
82 
83  /** Returns the traveled distance after ALL movements.
84  * A shortcut for "computeTraveledDistanceAfter( posesCount() )".
85  * \sa computeTraveledDistanceAfter
86  */
88 
89  private:
90  /** The internal sequence of poses, stored as relative, incremental poses,
91  * thus each one is situated just at the end point of last one, where the
92  * first one is referenced to (0,0,0deg)
93  */
94  std::vector<mrpt::math::TPose3D> m_poses;
95 
96 }; // End of class def.
97 } // End of namespace
98 } // End of namespace
99 
100 #endif
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 ...
void clear()
Clears the sequence.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:44
float computeTraveledDistanceAfterAll()
Returns the traveled distance after ALL movements.
std::vector< mrpt::math::TPose3D > m_poses
The internal sequence of poses, stored as relative, incremental poses, thus each one is situated just...
GLenum GLsizei n
Definition: glext.h:5074
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:
CPoses3DSequence()
Default constructor.
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.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
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"...



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019