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-2018, 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::poses
16 {
17 /** This class stores a sequence of relative, incremental 3D poses. It is useful
18  * as the bases storing unit for more complex probability particles and for
19  * computing the absolute pose of any intermediate pose.
20  *
21  * \sa CPose3D, CMultiMetricMap
22  * \ingroup poses_grp
23  */
25 {
27  public:
28  /** Returns the poses count in the sequence:
29  */
30  size_t posesCount();
31 
32  /** Reads the stored pose at index "ind", where the first one is 0, the last
33  * "posesCount() - 1"
34  * \exception std::exception On invalid index value
35  */
36  void getPose(unsigned int ind, CPose3D& outPose);
37 
38  /** Changes the stored pose at index "ind", where the first one is 0, the
39  * last "posesCount() - 1"
40  * \exception std::exception On invalid index value
41  */
42  void changePose(unsigned int ind, CPose3D& inPose);
43 
44  /** Appends a new pose at the end of sequence. Remember that poses are
45  * relative, incremental to the last one.
46  */
47  void appendPose(CPose3D& newPose);
48 
49  /** Clears the sequence.
50  */
51  void clear();
52 
53  /** Returns the absolute pose of a robot after moving "n" poses, so for
54  * "n=0" the origin pose (0,0,0deg) is returned, for "n=1" the first pose is
55  * returned, and for "n=posesCount()", the pose
56  * of robot after moving ALL poses is returned, all of them relative to the
57  * starting pose.
58  * \exception std::exception On invalid index value
59  * \sa absolutePoseAfterAll
60  */
61  CPose3D absolutePoseOf(unsigned int n);
62 
63  /** A shortcut for "absolutePoseOf( posesCount() )".
64  * \sa absolutePoseOf, posesCount
65  */
67 
68  /** Returns the traveled distance after moving "n" poses, so for "n=0" it
69  * returns 0, for "n=1" the first traveled distance, and for
70  * "n=posesCount()", the total
71  * distance after ALL movements.
72  * \exception std::exception On invalid index value
73  * \sa computeTraveledDistanceAfterAll
74  */
75  float computeTraveledDistanceAfter(unsigned int n);
76 
77  /** Returns the traveled distance after ALL movements.
78  * A shortcut for "computeTraveledDistanceAfter( posesCount() )".
79  * \sa computeTraveledDistanceAfter
80  */
82 
83  private:
84  /** The internal sequence of poses, stored as relative, incremental poses,
85  * thus each one is situated just at the end point of last one, where the
86  * first one is referenced to (0,0,0deg)
87  */
88  std::vector<mrpt::math::TPose3D> m_poses;
89 
90 }; // End of class def.
91 }
92 #endif
93 
94 
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.
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:
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"...
#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:86
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:30
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: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020