Main MRPT website > C++ reference for MRPT 1.9.9
CPoses2DSequence.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 CPoses2DSequence_H
10 #define CPoses2DSequence_H
11 
12 #include <mrpt/poses/CPose2D.h>
14 
15 namespace mrpt
16 {
17 namespace poses
18 {
19 /** This class stores a sequence of relative, incremental 2D 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 CPose2D, 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, CPose2D& 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, CPose2D& 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(CPose2D& 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  CPose2D 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  */
95 
96 }; // End of class def.
97 } // End of namespace
98 } // End of namespace
99 
100 #endif
This class stores a sequence of relative, incremental 2D poses.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:44
CPose2D absolutePoseOf(unsigned int n)
Returns the absolute pose of a robot after moving "n" poses, so for "n=0" the origin pose (0...
GLenum GLsizei n
Definition: glext.h:5074
void getPose(unsigned int ind, CPose2D &outPose)
Reads the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1"...
size_t posesCount()
Returns the poses count in the sequence:
CPoses2DSequence()
Default constructor.
float computeTraveledDistanceAfterAll()
Returns the traveled distance after ALL movements.
void clear()
Clears the sequence.
void changePose(unsigned int ind, CPose2D &inPose)
Changes the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1"...
mrpt::aligned_containers< CPose2D >::vector_t poses
The internal sequence of poses, stored as relative, incremental poses, thus each one is situated just...
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 2D pose, including the 2D coordinate point and a heading (phi) angle...
Definition: CPose2D.h:40
void appendPose(CPose2D &newPose)
Appends a new pose at the end of sequence.
std::vector< TYPE1, Eigen::aligned_allocator< TYPE1 > > vector_t
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 ...
CPose2D absolutePoseAfterAll()
A shortcut for "absolutePoseOf( posesCount() )".



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