00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2010 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 CObservation3DRangeScan_H 00029 #define CObservation3DRangeScan_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 #include <mrpt/math/CPolygon.h> 00037 00038 00039 namespace mrpt 00040 { 00041 namespace slam 00042 { 00043 00044 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CObservation3DRangeScan, CObservation,OBS_IMPEXP ) 00045 00046 /** Declares a class derived from "CObservation" that 00047 * encapsules a 3D range scan measurement (e.g. from a time of flight range camera). 00048 * This kind of observations can carry one or more of these data fields: 00049 * - 3D point cloud (as float's instead of double's to save storage space - precision is not a problem in this case). 00050 * - 2D range image (as a matrix). 00051 * - 2D intensity image (as a CImage). 00052 * - 2D confidence image (as a matrix). 00053 * 00054 * The coordinates of the 3D point cloud are in meters with respect to the optical center of the camera, 00055 * with the +X axis pointing forward, +Y pointing left-hand and +Z pointing up. 00056 * 00057 * The 2D images and matrices are stored as common images, with an up->down rows order and left->right, as usual. 00058 * 00059 * A class that grabs observations of this type is mrpt::hwdrivers::CSwissRanger3DCamera 00060 * 00061 * \sa mrpt::hwdrivers::CSwissRanger3DCamera, CObservation 00062 */ 00063 class OBS_IMPEXP CObservation3DRangeScan : public CObservation 00064 { 00065 // This must be added to any CSerializable derived class: 00066 DEFINE_SERIALIZABLE( CObservation3DRangeScan ) 00067 00068 public: 00069 /** Default constructor 00070 */ 00071 CObservation3DRangeScan( ); 00072 00073 /** Destructor 00074 */ 00075 virtual ~CObservation3DRangeScan( ); 00076 00077 bool hasPoints3D; //!< true means the field points3D contains valid data. 00078 vector_float points3D_x; //!< If hasPoints3D=true, the X coordinates of the 3D point cloud detected by the camera. 00079 vector_float points3D_y; //!< If hasPoints3D=true, the Y coordinates of the 3D point cloud detected by the camera. 00080 vector_float points3D_z; //!< If hasPoints3D=true, the Z coordinates of the 3D point cloud detected by the camera. 00081 00082 bool hasRangeImage; //!< true means the field rangeImage contains valid data 00083 mrpt::math::CMatrix rangeImage; //!< If hasRangeImage=true, a matrix of floats with the range data as captured by the camera (in meters). 00084 00085 bool hasIntensityImage; //!< true means the field intensityImage contains valid data 00086 mrpt::utils::CImage intensityImage; //!< If hasIntensityImage=true, a gray-level intensity image of the same size than "rangeImage" 00087 00088 bool hasConfidenceImage; //!< true means the field confidenceImage contains valid data 00089 mrpt::math::CMatrix confidenceImage; //!< If hasConfidenceImage=true, a matrix of floats with the "confidence" value [range 0-1] as estimated by the capture drivers. 00090 00091 00092 float maxRange; //!< The maximum range allowed by the device, in meters (e.g. 8.0m, 5.0m,...) 00093 CPose3D sensorPose; //!< The 6D pose of the sensor on the robot. 00094 float stdError; //!< The "sigma" error of the device in meters, used while inserting the scan in an occupancy grid. 00095 00096 00097 /** A general method to retrieve the sensor pose on the robot. 00098 * Note that most sensors will return a full (6D) CPose3D, but see the derived classes for more details or special cases. 00099 * \sa setSensorPose 00100 */ 00101 void getSensorPose( CPose3D &out_sensorPose ) const { out_sensorPose = sensorPose; } 00102 00103 /** A general method to change the sensor pose on the robot. 00104 * Note that most sensors will use the full (6D) CPose3D, but see the derived classes for more details or special cases. 00105 * \sa getSensorPose 00106 */ 00107 void setSensorPose( const CPose3D &newSensorPose ) { sensorPose = newSensorPose; } 00108 00109 00110 void swap(CObservation3DRangeScan &o); //!< Very efficient method to swap the contents of two observations. 00111 00112 }; // End of class def. 00113 00114 00115 } // End of namespace 00116 00117 namespace utils 00118 { 00119 using namespace ::mrpt::slam; 00120 // Specialization must occur in the same namespace 00121 MRPT_DECLARE_TTYPENAME_PTR(CObservation3DRangeScan) 00122 } 00123 00124 } // End of namespace 00125 00126 #endif
| Page generated by Doxygen 1.6.1 for MRPT 0.9.0 SVN: at Mon Jun 7 06:47:58 UTC 2010 |
