00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 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 */ 00047 class OBS_IMPEXP CObservationBearingRange : public CObservation 00048 { 00049 // This must be added to any CSerializable derived class: 00050 DEFINE_SERIALIZABLE( CObservationBearingRange ) 00051 00052 public: 00053 /** Default constructor. 00054 */ 00055 CObservationBearingRange( ); 00056 00057 float minSensorDistance, maxSensorDistance; //! Information about the sensor: Ranges, in meters (0: there is no limits) 00058 float fieldOfView_yaw; //!< Information about the sensor: The "field-of-view" of the sensor, in radians (for yaw ). 00059 float fieldOfView_pitch; //!< Information about the sensor: The "field-of-view" of the sensor, in radians (for pitch ). 00060 00061 /** The position of the sensor on the robot. 00062 */ 00063 CPose3D sensorLocationOnRobot; 00064 00065 /** Each one of the measurements: 00066 */ 00067 struct OBS_IMPEXP TMeasurement 00068 { 00069 /** The sensed landmark distance, in meters. 00070 */ 00071 float range; 00072 00073 /** The sensed landmark direction, in radians, measured as the yaw (azimuth) and pitch (negative elevation). 00074 * See mrpt::poses::CPose3D for a definition of the 3D angles. 00075 */ 00076 float yaw,pitch; 00077 00078 /** The ID of the sensed beacon, or INVALID_LANDMARK_ID (-1) if the sensor does not identify the landmark. 00079 */ 00080 int32_t landmarkID; 00081 00082 /** The covariance matrix of the landmark. 00083 */ 00084 CMatrixDouble33 covariance; 00085 }; 00086 00087 typedef std::vector<TMeasurement> TMeasurementList; 00088 00089 /** The list of observed ranges: */ 00090 TMeasurementList sensedData; 00091 00092 /** 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. 00093 */ 00094 bool validCovariances; 00095 00096 /** Taken into account only if validCovariances=false: the standard deviation of the sensor noise model for range,yaw and pitch (in meters and radians). 00097 * If validCovariances=true, these 3 values are ignored and the individual 3x3 covariance matrices contain the actual uncertainties for each of the detected landmarks. 00098 */ 00099 float sensor_std_range,sensor_std_yaw,sensor_std_pitch; 00100 00101 /** Prints out the contents of the object. 00102 */ 00103 void debugPrintOut(); 00104 00105 /** A general method to retrieve the sensor pose on the robot. 00106 * Note that most sensors will return a full (6D) CPose3D, but see the derived classes for more details or special cases. 00107 * \sa setSensorPose 00108 */ 00109 void getSensorPose( CPose3D &out_sensorPose ) const { out_sensorPose = sensorLocationOnRobot; } 00110 00111 00112 /** A general method to change the sensor pose on the robot. 00113 * Note that most sensors will use the full (6D) CPose3D, but see the derived classes for more details or special cases. 00114 * \sa getSensorPose 00115 */ 00116 void setSensorPose( const CPose3D &newSensorPose ) { sensorLocationOnRobot = newSensorPose; } 00117 00118 00119 }; // End of class def. 00120 00121 00122 } // End of namespace 00123 } // End of namespace 00124 00125 #endif
Page generated by Doxygen 1.7.1 for MRPT 0.9.4 SVN: at Mon Jan 10 23:33:19 UTC 2011 |