Main MRPT website > C++ reference for MRPT 1.5.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-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 CPoses3DSequence_H
10 #define CPoses3DSequence_H
11 
12 #include <mrpt/poses/CPose3D.h>
14 
15 namespace mrpt
16 {
17 namespace poses
18 {
19 
20  // This must be added to any CSerializable derived class:
22 
23  /** This class stores a sequence of relative, incremental 3D poses. It is useful as the bases storing unit for more complex probability particles and for computing the absolute pose of any intermediate pose.
24  *
25  * \sa CPose3D, CMultiMetricMap
26  * \ingroup poses_grp
27  */
28  class BASE_IMPEXP CPoses3DSequence : public mrpt::utils::CSerializable
29  {
30  // This must be added to any CSerializable derived class:
32  public:
33  /** Default constructor
34  */
36 
37 
38  /** Returns the poses count in the sequence:
39  */
40  size_t posesCount();
41 
42  /** Reads the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1"
43  * \exception std::exception On invalid index value
44  */
45  void getPose(unsigned int ind, CPose3D &outPose);
46 
47  /** Changes the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1"
48  * \exception std::exception On invalid index value
49  */
50  void changePose(unsigned int ind, CPose3D &inPose);
51 
52  /** Appends a new pose at the end of sequence. Remember that poses are relative, incremental to the last one.
53  */
54  void appendPose(CPose3D &newPose);
55 
56  /** Clears the sequence.
57  */
58  void clear();
59 
60  /** Returns the absolute pose of a robot after moving "n" poses, so for "n=0" the origin pose (0,0,0deg) is returned, for "n=1" the first pose is returned, and for "n=posesCount()", the pose
61  * of robot after moving ALL poses is returned, all of them relative to the starting pose.
62  * \exception std::exception On invalid index value
63  * \sa absolutePoseAfterAll
64  */
65  CPose3D absolutePoseOf(unsigned int n);
66 
67  /** A shortcut for "absolutePoseOf( posesCount() )".
68  * \sa absolutePoseOf, posesCount
69  */
70  CPose3D absolutePoseAfterAll();
71 
72  /** Returns the traveled distance after moving "n" poses, so for "n=0" it returns 0, for "n=1" the first traveled distance, and for "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  */
83  float computeTraveledDistanceAfterAll();
84 
85  private:
86  /** The internal sequence of poses, stored as relative, incremental poses, thus each one is situated just at the end point of last one, where the first one is referenced to (0,0,0deg)
87  */
88  std::vector<mrpt::math::TPose3D> m_poses;
89 
90  }; // End of class def.
92 
93 
94  } // End of namespace
95 } // End of namespace
96 
97 #endif
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:39
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:4618
void clear()
Clear the contents of this container.
Definition: ts_hash_map.h:113
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE(class_name, base_name)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
This class stores a sequence of relative, incremental 3D poses.
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 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:72
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE(class_name, base_name)



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020