Main MRPT website > C++ reference
MRPT logo
CPoses3DSequence.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | The Mobile Robot Programming Toolkit (MRPT) C++ library |
3  | |
4  | http://www.mrpt.org/ |
5  | |
6  | Copyright (C) 2005-2012 University of Malaga |
7  | |
8  | This software was written by the Machine Perception and Intelligent |
9  | Robotics Lab, University of Malaga (Spain). |
10  | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> |
11  | |
12  | This file is part of the MRPT project. |
13  | |
14  | MRPT is free software: you can redistribute it and/or modify |
15  | it under the terms of the GNU General Public License as published by |
16  | the Free Software Foundation, either version 3 of the License, or |
17  | (at your option) any later version. |
18  | |
19  | MRPT is distributed in the hope that it will be useful, |
20  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
21  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22  | GNU General Public License for more details. |
23  | |
24  | You should have received a copy of the GNU General Public License |
25  | along with MRPT. If not, see <http://www.gnu.org/licenses/>. |
26  | |
27  +---------------------------------------------------------------------------+ */
28 #ifndef CPoses3DSequence_H
29 #define CPoses3DSequence_H
30 
31 #include <mrpt/poses/CPose3D.h>
33 
34 namespace mrpt
35 {
36 namespace poses
37 {
38 
39  // This must be added to any CSerializable derived class:
41 
42  /** 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.
43  *
44  * \sa CPose3D, CMultiMetricMap
45  * \ingroup poses_grp
46  */
47  class BASE_IMPEXP CPoses3DSequence : public mrpt::utils::CSerializable
48  {
49  // This must be added to any CSerializable derived class:
51  public:
52  /** Default constructor
53  */
55 
56 
57  /** Returns the poses count in the sequence:
58  */
59  size_t posesCount();
60 
61  /** Reads the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1"
62  * \exception std::exception On invalid index value
63  */
64  void getPose(unsigned int ind, CPose3D &outPose);
65 
66  /** Changes the stored pose at index "ind", where the first one is 0, the last "posesCount() - 1"
67  * \exception std::exception On invalid index value
68  */
69  void changePose(unsigned int ind, CPose3D &inPose);
70 
71  /** Appends a new pose at the end of sequence. Remember that poses are relative, incremental to the last one.
72  */
73  void appendPose(CPose3D &newPose);
74 
75  /** Clears the sequence.
76  */
77  void clear();
78 
79  /** 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
80  * of robot after moving ALL poses is returned, all of them relative to the starting pose.
81  * \exception std::exception On invalid index value
82  * \sa absolutePoseAfterAll
83  */
84  CPose3D absolutePoseOf(unsigned int n);
85 
86  /** A shortcut for "absolutePoseOf( posesCount() )".
87  * \sa absolutePoseOf, posesCount
88  */
89  CPose3D absolutePoseAfterAll();
90 
91  /** 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
92  * distance after ALL movements.
93  * \exception std::exception On invalid index value
94  * \sa computeTraveledDistanceAfterAll
95  */
96  float computeTraveledDistanceAfter(unsigned int n);
97 
98  /** Returns the traveled distance after ALL movements.
99  * A shortcut for "computeTraveledDistanceAfter( posesCount() )".
100  * \sa computeTraveledDistanceAfter
101  */
102  float computeTraveledDistanceAfterAll();
103 
104  private:
105  /** 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)
106  */
107  std::vector<mrpt::math::TPose3D> m_poses;
108 
109  }; // End of class def.
110 
111 
112  } // End of namespace
113 } // End of namespace
114 
115 #endif



Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013