Main MRPT website > C++ reference
MRPT logo
CObservationBeaconRanges.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 CObservationBeaconRanges_H
29 #define CObservationBeaconRanges_H
30 
32 #include <mrpt/slam/CObservation.h>
33 #include <mrpt/poses/CPoint3D.h>
34 #include <mrpt/poses/CPose2D.h>
35 #include <mrpt/poses/CPose3D.h>
36 
37 namespace mrpt
38 {
39 namespace slam
40 {
42 
43  /** Declares a class derived from "CObservation" that represents one (or more) range measurements to labeled beacons.
44  * \sa CObservation
45  * \ingroup mrpt_obs_grp
46  */
48  {
49  // This must be added to any CSerializable derived class:
51 
52  public:
53  /** Default constructor.
54  */
56 
57  /** Information about the sensor:
58  */
59  float minSensorDistance, maxSensorDistance;
60 
61  /** The "sigma" of the sensor, assuming a zero-mean Gaussian noise model.
62  */
63  float stdError;
64 
65  /** Each one of the measurements:
66  */
68  {
69  TMeasurement() : sensorLocationOnRobot(), sensedDistance(0),beaconID(INVALID_BEACON_ID)
70  {}
71 
72  /** The position of the sensor on the robot.
73  */
75 
76  /** The sensed range itself (in meters).
77  */
79 
80  /** The ID of the sensed beacon (or INVALID_BEACON_ID)
81  */
82  int32_t beaconID;
83  };
84 
85  /** The list of observed ranges:
86  */
87  std::deque<TMeasurement> sensedData;
88 
89  /** The (X,Y,PHI) pose estimated by the UWB software, for comparison purposes (Added in streamming version 1)
90  */
92 
93 
94  /** Prints out the contents of the object.
95  */
96  void debugPrintOut();
97 
98  /** A general method to retrieve the sensor pose on the robot.
99  * Note that most sensors will return a full (6D) CPose3D, but see the derived classes for more details or special cases.
100  * \sa setSensorPose
101  */
102  void getSensorPose( CPose3D &out_sensorPose ) const;
103 
104 
105  /** A general method to change the sensor pose on the robot.
106  * Note that most sensors will use the full (6D) CPose3D, but see the derived classes for more details or special cases.
107  * \sa getSensorPose
108  */
109  void setSensorPose( const CPose3D &newSensorPose );
110 
111  /** Easy look-up into the vector sensedData, returns the range for a given beacon, or 0 if the beacon is not observed.
112  */
113  float getSensedRangeByBeaconID(int32_t beaconID);
114 
115  }; // End of class def.
116 
117 
118  } // End of namespace
119 } // End of namespace
120 
121 #endif



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