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