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-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 #pragma once
10 
11 #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  /** Returns the poses count in the sequence:
31  */
32  size_t posesCount();
33 
34  /** Reads the stored pose at index "ind", where the first one is 0, the last
35  * "posesCount() - 1"
36  * \exception std::exception On invalid index value
37  */
38  void getPose(unsigned int ind, CPose2D& outPose);
39 
40  /** Changes the stored pose at index "ind", where the first one is 0, the
41  * last "posesCount() - 1"
42  * \exception std::exception On invalid index value
43  */
44  void changePose(unsigned int ind, CPose2D& inPose);
45 
46  /** Appends a new pose at the end of sequence. Remember that poses are
47  * relative, incremental to the last one.
48  */
49  void appendPose(CPose2D& newPose);
50 
51  /** Clears the sequence.
52  */
53  void clear();
54 
55  /** Returns the absolute pose of a robot after moving "n" poses, so for
56  * "n=0" the origin pose (0,0,0deg) is returned, for "n=1" the first pose is
57  * returned, and for "n=posesCount()", the pose
58  * of robot after moving ALL poses is returned, all of them relative to the
59  * starting pose.
60  * \exception std::exception On invalid index value
61  * \sa absolutePoseAfterAll
62  */
63  CPose2D absolutePoseOf(unsigned int n);
64 
65  /** A shortcut for "absolutePoseOf( posesCount() )".
66  * \sa absolutePoseOf, posesCount
67  */
69 
70  /** Returns the traveled distance after moving "n" poses, so for "n=0" it
71  * returns 0, for "n=1" the first traveled distance, and for
72  * "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,
87  * thus each one is situated just at the end point of last one, where the
88  * first one is referenced to (0,0,0deg)
89  */
91 
92 }; // End of class def.
93 } // End of namespace
94 } // End of namespace
n
GLenum GLsizei n
Definition: glext.h:5074
mrpt::poses::CPoses2DSequence::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 ...
Definition: CPoses2DSequence.cpp:113
mrpt::poses::CPoses2DSequence::appendPose
void appendPose(CPose2D &newPose)
Appends a new pose at the end of sequence.
Definition: CPoses2DSequence.cpp:70
mrpt::poses::CPoses2DSequence::posesCount
size_t posesCount()
Returns the poses count in the sequence:
Definition: CPoses2DSequence.cpp:21
mrpt::poses::CPoses2DSequence::getPose
void getPose(unsigned int ind, CPose2D &outPose)
Reads the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1".
Definition: CPoses2DSequence.cpp:48
mrpt::poses::CPoses2DSequence::changePose
void changePose(unsigned int ind, CPose2D &inPose)
Changes the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1".
Definition: CPoses2DSequence.cpp:59
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
CPose2D.h
mrpt::poses::CPoses2DSequence::clear
void clear()
Clears the sequence.
Definition: CPoses2DSequence.cpp:78
mrpt::aligned_std_vector
std::vector< T, mrpt::aligned_allocator_cpp11< T > > aligned_std_vector
Definition: aligned_std_vector.h:15
mrpt::poses::CPose2D
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
Definition: CPose2D.h:40
mrpt::poses::CPoses2DSequence
This class stores a sequence of relative, incremental 2D poses.
Definition: CPoses2DSequence.h:26
mrpt::poses::CPoses2DSequence::absolutePoseOf
CPose2D absolutePoseOf(unsigned int n)
Returns the absolute pose of a robot after moving "n" poses, so for "n=0" the origin pose (0,...
Definition: CPoses2DSequence.cpp:87
aligned_std_vector.h
mrpt::serialization::CSerializable
The virtual base class which provides a unified interface for all persistent objects in MRPT.
Definition: CSerializable.h:32
mrpt::poses::CPoses2DSequence::computeTraveledDistanceAfterAll
float computeTraveledDistanceAfterAll()
Returns the traveled distance after ALL movements.
Definition: CPoses2DSequence.cpp:129
mrpt::poses::CPoses2DSequence::absolutePoseAfterAll
CPose2D absolutePoseAfterAll()
A shortcut for "absolutePoseOf( posesCount() )".
Definition: CPoses2DSequence.cpp:102
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:102
mrpt::poses::CPoses2DSequence::poses
mrpt::aligned_std_vector< CPose2D > poses
The internal sequence of poses, stored as relative, incremental poses, thus each one is situated just...
Definition: CPoses2DSequence.h:90
CSerializable.h



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST