Main MRPT website > C++ reference
MRPT logo
CObservationBearingRange.h
Go to the documentation of this file.
00001 /* +---------------------------------------------------------------------------+
00002    |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |
00003    |                                                                           |
00004    |                       http://www.mrpt.org/                                |
00005    |                                                                           |
00006    |   Copyright (C) 2005-2011  University of Malaga                           |
00007    |                                                                           |
00008    |    This software was written by the Machine Perception and Intelligent    |
00009    |      Robotics Lab, University of Malaga (Spain).                          |
00010    |    Contact: Jose-Luis Blanco  <jlblanco@ctima.uma.es>                     |
00011    |                                                                           |
00012    |  This file is part of the MRPT project.                                   |
00013    |                                                                           |
00014    |     MRPT is free software: you can redistribute it and/or modify          |
00015    |     it under the terms of the GNU General Public License as published by  |
00016    |     the Free Software Foundation, either version 3 of the License, or     |
00017    |     (at your option) any later version.                                   |
00018    |                                                                           |
00019    |   MRPT is distributed in the hope that it will be useful,                 |
00020    |     but WITHOUT ANY WARRANTY; without even the implied warranty of        |
00021    |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         |
00022    |     GNU General Public License for more details.                          |
00023    |                                                                           |
00024    |     You should have received a copy of the GNU General Public License     |
00025    |     along with MRPT.  If not, see <http://www.gnu.org/licenses/>.         |
00026    |                                                                           |
00027    +---------------------------------------------------------------------------+ */
00028 #ifndef CObservationBearingRange_H
00029 #define CObservationBearingRange_H
00030 
00031 #include <mrpt/utils/CSerializable.h>
00032 #include <mrpt/slam/CObservation.h>
00033 #include <mrpt/poses/CPose3D.h>
00034 
00035 namespace mrpt
00036 {
00037 namespace slam
00038 {
00039         DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CObservationBearingRange , CObservation, OBS_IMPEXP)
00040 
00041         /** This observation represents a number of range-bearing value pairs, each one for a detected landmark, which optionally can have identification IDs.
00042          *  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
00043          *  two direction angles: yaw (azimuth) and pitch (negative elevation). For 2D sensors, the pitch must be always set to 0.
00044          * See CObservationBearingRange::validCovariances for the instructions to fill the uncertainty covariances.
00045          * \sa CObservation
00046          * \ingroup mrpt_obs_grp
00047          */
00048         class OBS_IMPEXP CObservationBearingRange : public CObservation
00049         {
00050                 // This must be added to any CSerializable derived class:
00051                 DEFINE_SERIALIZABLE( CObservationBearingRange )
00052 
00053          public:
00054                 /** Default constructor.
00055                  */
00056                 CObservationBearingRange( );
00057 
00058                 float minSensorDistance, maxSensorDistance;  //! Information about the sensor: Ranges, in meters (0: there is no limits)
00059                 float fieldOfView_yaw;          //!< Information about the sensor: The "field-of-view" of the sensor, in radians (for yaw ).
00060                 float fieldOfView_pitch;        //!< Information about the sensor: The "field-of-view" of the sensor, in radians (for pitch ).
00061 
00062                 /** The position of the sensor on the robot.
00063                   */
00064                 CPose3D         sensorLocationOnRobot;
00065 
00066                 /** Each one of the measurements:
00067                         */
00068                 struct OBS_IMPEXP TMeasurement
00069                 {
00070                         /** The sensed landmark distance, in meters. */
00071                         float   range;
00072 
00073                         /** The sensed landmark direction, in radians, measured as the yaw (azimuth) and pitch (negative elevation).
00074                           *  Set pitch to zero for 2D sensors.
00075                           * See mrpt::poses::CPose3D for a definition of the 3D angles.
00076                           */
00077                         float   yaw,pitch;
00078 
00079                         /** The ID of the sensed beacon, or INVALID_LANDMARK_ID (-1) if the sensor does not identify the landmark. */
00080                         int32_t landmarkID;
00081 
00082                         /** The covariance matrix of the landmark, with variable indices [0,1,2] being [range,yaw,pitch]. */
00083                         CMatrixDouble33 covariance;
00084                 };
00085 
00086                 typedef std::vector<TMeasurement> TMeasurementList;
00087 
00088                 /** The list of observed ranges:  */
00089                 TMeasurementList sensedData;
00090 
00091                 /** 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.
00092                   */
00093                 bool validCovariances;
00094 
00095                 /** Taken into account only if validCovariances=false: the standard deviation of the sensor noise model for range,yaw and pitch (in meters and radians).
00096                   *  If validCovariances=true, these 3 values are ignored and the individual 3x3 covariance matrices contain the actual uncertainties for each of the detected landmarks.
00097                   */
00098                 float sensor_std_range,sensor_std_yaw,sensor_std_pitch;
00099 
00100                  /** Prints out the contents of the object.
00101                    */
00102                  void  debugPrintOut();
00103 
00104                 /** A general method to retrieve the sensor pose on the robot.
00105                   *  Note that most sensors will return a full (6D) CPose3D, but see the derived classes for more details or special cases.
00106                   * \sa setSensorPose
00107                   */
00108                 void getSensorPose( CPose3D &out_sensorPose ) const { out_sensorPose = sensorLocationOnRobot; }
00109 
00110 
00111                 /** A general method to change the sensor pose on the robot.
00112                   *  Note that most sensors will use the full (6D) CPose3D, but see the derived classes for more details or special cases.
00113                   * \sa getSensorPose
00114                   */
00115                 void setSensorPose( const CPose3D &newSensorPose ) { sensorLocationOnRobot = newSensorPose; }
00116 
00117 
00118         }; // End of class def.
00119 
00120 
00121         } // End of namespace
00122 } // End of namespace
00123 
00124 #endif



Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011