MRPT  2.0.4
CPoses2DSequence.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <mrpt/poses/CPose2D.h>
13 #include <vector>
14 
15 namespace mrpt::poses
16 {
17 /** This class stores a sequence of relative, incremental 2D 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 CPose2D, 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, CPose2D& 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, CPose2D& 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(CPose2D& 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  CPose2D 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  double computeTraveledDistanceAfter(size_t 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<CPose2D> poses;
89 
90 }; // End of class def.
91 } // namespace mrpt::poses
std::vector< CPose2D > poses
The internal sequence of poses, stored as relative, incremental poses, thus each one is situated just...
This class stores a sequence of relative, incremental 2D poses.
double computeTraveledDistanceAfterAll()
Returns the traveled distance after ALL movements.
CPose2D absolutePoseOf(unsigned int n)
Returns the absolute pose of a robot after moving "n" poses, so for "n=0" the origin pose (0...
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:
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"...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
double computeTraveledDistanceAfter(size_t n)
Returns the traveled distance after moving "n" poses, so for "n=0" it returns 0, for "n=1" the first ...
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
Definition: CPose2D.h:39
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:30
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
void appendPose(CPose2D &newPose)
Appends a new pose at the end of sequence.
CPose2D absolutePoseAfterAll()
A shortcut for "absolutePoseOf( posesCount() )".



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020