Main MRPT website > C++ reference
MRPT logo
CObservationBearingRange.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 CObservationBearingRange_H
29 #define CObservationBearingRange_H
30 
32 #include <mrpt/slam/CObservation.h>
33 #include <mrpt/poses/CPose3D.h>
34 
35 namespace mrpt
36 {
37 namespace slam
38 {
40 
41  /** This observation represents a number of range-bearing value pairs, each one for a detected landmark, which optionally can have identification IDs.
42  * This class can manage sensors that detect landmarks in a 2D plane (e.g. a laser scanner) or in the 3D space (e.g. a camera). There are
43  * two direction angles: yaw (azimuth) and pitch (negative elevation). For 2D sensors, the pitch must be always set to 0.
44  * See CObservationBearingRange::validCovariances for the instructions to fill the uncertainty covariances.
45  * \sa CObservation
46  * \ingroup mrpt_obs_grp
47  */
49  {
50  // This must be added to any CSerializable derived class:
52 
53  public:
54  /** Default constructor.
55  */
57 
58  float minSensorDistance, maxSensorDistance; //! Information about the sensor: Ranges, in meters (0: there is no limits)
59  float fieldOfView_yaw; //!< Information about the sensor: The "field-of-view" of the sensor, in radians (for yaw ).
60  float fieldOfView_pitch; //!< Information about the sensor: The "field-of-view" of the sensor, in radians (for pitch ).
61 
62  /** The position of the sensor on the robot.
63  */
64  CPose3D sensorLocationOnRobot;
65 
66  /** Each one of the measurements:
67  */
69  {
70  /** The sensed landmark distance, in meters. */
71  float range;
72 
73  /** The sensed landmark direction, in radians, measured as the yaw (azimuth) and pitch (negative elevation).
74  * Set pitch to zero for 2D sensors.
75  * See mrpt::poses::CPose3D for a definition of the 3D angles.
76  */
77  float yaw,pitch;
78 
79  /** The ID of the sensed beacon, or INVALID_LANDMARK_ID (-1) if the sensor does not identify the landmark. */
80  int32_t landmarkID;
81 
82  /** The covariance matrix of the landmark, with variable indices [0,1,2] being [range,yaw,pitch]. */
84  };
85 
86  typedef std::vector<TMeasurement> TMeasurementList;
87 
88  /** The list of observed ranges: */
89  TMeasurementList sensedData;
90 
91  /** True: The individual 3x3 covariance matrices must be taken into account, false (default): All the measurements have identical, diagonal 3x3 covariance matrices given by the values sensor_std_range,sensor_std_yaw,sensor_std_pitch.
92  */
94 
95  /** Taken into account only if validCovariances=false: the standard deviation of the sensor noise model for range,yaw and pitch (in meters and radians).
96  * If validCovariances=true, these 3 values are ignored and the individual 3x3 covariance matrices contain the actual uncertainties for each of the detected landmarks.
97  */
98  float sensor_std_range,sensor_std_yaw,sensor_std_pitch;
99 
100  /** Prints out the contents of the object.
101  */
102  void debugPrintOut();
103 
104  /** A general method to retrieve the sensor pose on the robot.
105  * Note that most sensors will return a full (6D) CPose3D, but see the derived classes for more details or special cases.
106  * \sa setSensorPose
107  */
108  void getSensorPose( CPose3D &out_sensorPose ) const { out_sensorPose = sensorLocationOnRobot; }
109 
110 
111  /** A general method to change the sensor pose on the robot.
112  * Note that most sensors will use the full (6D) CPose3D, but see the derived classes for more details or special cases.
113  * \sa getSensorPose
114  */
115  void setSensorPose( const CPose3D &newSensorPose ) { sensorLocationOnRobot = newSensorPose; }
116 
117 
118  }; // End of class def.
119 
120 
121  } // End of namespace
122 } // End of namespace
123 
124 #endif



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