00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2009 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 CObservationGasSensors_H 00029 #define CObservationGasSensors_H 00030 00031 #include <mrpt/utils/CSerializable.h> 00032 #include <mrpt/slam/CObservation.h> 00033 #include <mrpt/poses/CPose3D.h> 00034 #include <mrpt/poses/CPose2D.h> 00035 00036 namespace mrpt 00037 { 00038 namespace slam 00039 { 00040 00041 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE( CObservationGasSensors , CObservation ) 00042 00043 /** Declares a class derived from "CObservation" that represents a set of readings from gas sensors. 00044 * 00045 * \sa CObservation 00046 */ 00047 class MRPTDLLIMPEXP CObservationGasSensors : public CObservation 00048 { 00049 // This must be added to any CSerializable derived class: 00050 DEFINE_SERIALIZABLE( CObservationGasSensors ) 00051 00052 public: 00053 /** Constructor. 00054 */ 00055 CObservationGasSensors( ); 00056 00057 /** The structure for each e-nose 00058 */ 00059 struct MRPTDLLIMPEXP TObservationENose 00060 { 00061 TObservationENose() : 00062 eNosePoseOnTheRobot(), 00063 readingsVoltage(), 00064 sensorTypes(), 00065 hasTemperature(false), 00066 temperature() 00067 {} 00068 00069 /** The pose of the sensors on the robot 00070 */ 00071 math::TPose3D eNosePoseOnTheRobot; 00072 00073 /** The set of readings (in volts) from the array of sensors (size of "sensorTypes" is the same that the size of "readingsVoltage") 00074 */ 00075 vector_float readingsVoltage; 00076 00077 /** The kind of sensors in the array (size of "sensorTypes" is the same that the size of "readingsVoltage") 00078 * The meaning of values for types of sensors is as follows: 00079 * 0x0000 : No sensor installed in this slot 00080 * 0x2600 : Figaro TGS 2600 00081 * 0x2602 : Figaro TGS 2602 00082 * 0x2620 : Figaro TGS 2620 00083 * 0x4161 : Figaro TGS 4161 00084 */ 00085 vector_int sensorTypes; 00086 00087 /** Must be true for "temperature" to contain a valid measurement 00088 */ 00089 bool hasTemperature; 00090 00091 /** Sensed temperature in Celcius (valid if hasTemperature=true only) 00092 */ 00093 float temperature; 00094 }; 00095 00096 /** One entry per e-nose on the robot. 00097 */ 00098 std::vector<TObservationENose> m_readings; 00099 00100 /** Implements the virtual method in charge of finding the likelihood between this 00101 * and another observation, probably only of the same derived class. The operator 00102 * may be asymmetric. 00103 * 00104 * \param anotherObs The other observation to compute likelihood with. 00105 * \param anotherObsPose If known, the belief about the robot pose when the other observation was taken can be supplied here, or NULL if it is unknown. 00106 * 00107 * \return Returns a likelihood measurement, in the range [0,1]. 00108 * \exception std::exception On any error, as another observation being of an invalid class. 00109 */ 00110 float likelihoodWith( const CObservation *anotherObs, const CPosePDF *anotherObsPose = NULL ) const; 00111 00112 /** A general method to retrieve the sensor pose on the robot. 00113 * Note that most sensors will return a full (6D) CPose3D, but see the derived classes for more details or special cases. 00114 * \sa setSensorPose 00115 */ 00116 void getSensorPose( CPose3D &out_sensorPose ) const; 00117 00118 00119 /** A general method to change the sensor pose on the robot. 00120 * Note that most sensors will use the full (6D) CPose3D, but see the derived classes for more details or special cases. 00121 * \sa getSensorPose 00122 */ 00123 void setSensorPose( const CPose3D &newSensorPose ); 00124 00125 00126 }; // End of class def. 00127 00128 00129 } // End of namespace 00130 } // End of namespace 00131 00132 #endif
Page generated by Doxygen 1.5.9 for MRPT 0.7.1 SVN: at Mon Aug 17 22:20:53 EDT 2009 |