Main MRPT website > C++ reference for MRPT 1.5.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 
20  // This must be added to any CSerializable derived class:
22 
23  /** This class stores a sequence of relative, incremental 2D 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 CPose2D, CMultiMetricMap
26  * \ingroup poses_grp
27  */
28  class BASE_IMPEXP CPoses2DSequence : public mrpt::utils::CSerializable
29  {
30  // This must be added to any CSerializable derived class:
32  public:
33  /** Default constructor
34  */
36 
37  /** Returns the poses count in the sequence:
38  */
39  size_t posesCount();
40 
41  /** Reads the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1"
42  * \exception std::exception On invalid index value
43  */
44  void getPose(unsigned int ind, CPose2D &outPose);
45 
46  /** Changes the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1"
47  * \exception std::exception On invalid index value
48  */
49  void changePose(unsigned int ind, CPose2D &inPose);
50 
51  /** Appends a new pose at the end of sequence. Remember that poses are 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 "n=0" the origin pose (0,0,0deg) is returned, for "n=1" the first pose is returned, and for "n=posesCount()", the pose
60  * of robot after moving ALL poses is returned, all of them relative to the starting pose.
61  * \exception std::exception On invalid index value
62  * \sa absolutePoseAfterAll
63  */
64  CPose2D absolutePoseOf(unsigned int n);
65 
66  /** A shortcut for "absolutePoseOf( posesCount() )".
67  * \sa absolutePoseOf, posesCount
68  */
69  CPose2D absolutePoseAfterAll();
70 
71  /** 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
72  * distance after ALL movements.
73  * \exception std::exception On invalid index value
74  * \sa computeTraveledDistanceAfterAll
75  */
76  float computeTraveledDistanceAfter(unsigned int n);
77 
78  /** Returns the traveled distance after ALL movements.
79  * A shortcut for "computeTraveledDistanceAfter( posesCount() )".
80  * \sa computeTraveledDistanceAfter
81  */
82  float computeTraveledDistanceAfterAll();
83 
84  private:
85  /** 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)
86  */
88 
89  }; // End of class def.
91 
92 
93  } // End of namespace
94 } // End of namespace
95 
96 #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:39
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...
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:36
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE(class_name, base_name)
std::vector< TYPE1, Eigen::aligned_allocator< TYPE1 > > vector_t



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