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 CObservationStereoImages_H 00029 #define CObservationStereoImages_H 00030 00031 #include <mrpt/utils/CSerializable.h> 00032 #include <mrpt/utils/CImage.h> 00033 #include <mrpt/slam/CObservation.h> 00034 #include <mrpt/poses/CPose3D.h> 00035 #include <mrpt/poses/CPose3DQuat.h> 00036 #include <mrpt/poses/CPose2D.h> 00037 //#include <mrpt/slam/CLandmark.h> 00038 //#include <mrpt/slam/CLandmarksMap.h> 00039 //#include <mrpt/vision/CCamModel.h> 00040 00041 namespace mrpt 00042 { 00043 namespace slam 00044 { 00045 using namespace mrpt::utils; 00046 //using namespace mrpt::vision; 00047 //class CLandmarksMap; 00048 00049 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CObservationStereoImages , CObservation,OBS_IMPEXP ) 00050 00051 /** Declares a class derived from "CObservation" that encapsule a pair of images taken by a stereo camera. 00052 The next figure illustrate the coordinates reference systems involved in this class:<br> 00053 <center> 00054 <img src="CObservationStereoImages_figRefSystem.png"> 00055 </center> 00056 * 00057 <br> 00058 <b>NOTE:</b> The images stored in this class are supposed to be UNDISTORTED images already.<br> 00059 * \sa CObservation 00060 */ 00061 class OBS_IMPEXP CObservationStereoImages : public CObservation 00062 { 00063 // This must be added to any CSerializable derived class: 00064 DEFINE_SERIALIZABLE( CObservationStereoImages ) 00065 00066 /** If buildAuxiliarMap is called before, this will contain the landmarks-map representation of the observation, for the robot located at the origin. 00067 */ 00068 //class CAuxMapWrapper 00069 //{ 00070 // CLandmarksMap *auxMap; 00071 //public: 00072 // CAuxMapWrapper() : auxMap(NULL) { } 00073 // CAuxMapWrapper(const CAuxMapWrapper &o) : auxMap(NULL) { } 00074 // CAuxMapWrapper & operator =(const CAuxMapWrapper &o) { clear(); return *this; } 00075 00076 // ~CAuxMapWrapper() { clear(); } 00077 00078 // CLandmarksMap * get() { return auxMap; } 00079 // const CLandmarksMap * get() const { return auxMap; } 00080 00081 // void set(CLandmarksMap *m); 00082 00083 // void clear(); 00084 //}; 00085 //mutable CAuxMapWrapper m_auxMap; 00086 00087 00088 public: 00089 /** Default Constructor. 00090 * 00091 */ 00092 CObservationStereoImages( ); 00093 00094 /** Constructor. 00095 * \param iplImageLeft An OpenCV "IplImage*" object with the image to be loaded in the member "imageLeft", or NULL (default) for an empty image. 00096 * \param iplImageRight An OpenCV "IplImage*" object with the image to be loaded in the member "imageRight", or NULL (default) for an empty image. 00097 * 00098 */ 00099 CObservationStereoImages( void *iplImageLeft, void *iplImageRight ); 00100 00101 /** Destructor 00102 */ 00103 ~CObservationStereoImages( ); 00104 00105 /** The pose of the LEFT camera, relative to the robot. 00106 */ 00107 CPose3DQuat cameraPose; 00108 00109 /** Parameters for the left/right cameras: individual intrinsic and distortion parameters of the cameras. 00110 * See the <a href="http://www.mrpt.org/Camera_Parameters">tutorial</a> for a discussion of these parameters. 00111 */ 00112 TCamera leftCamera, rightCamera; 00113 00114 /** The pair of images. 00115 */ 00116 CImage imageLeft, imageRight; 00117 00118 /** The pose of the right camera, relative to the left one: 00119 * Note that using the conventional reference coordinates for the left 00120 * camera (x points to the right, y down), the "right" camera is situated 00121 * at position (BL, 0, 0) with yaw=pitch=roll=0, where BL is the BASELINE. 00122 */ 00123 CPose3DQuat rightCameraPose; 00124 00125 /** This method build the map in "m_auxMap", only the first time this is called. 00126 */ 00127 // const CLandmarksMap * buildAuxiliaryMap( CLandmark::TLandmarkID fID, const CLandmarksMap::TInsertionOptions *insOpts = NULL) const; 00128 00129 /** A general method to retrieve the sensor pose on the robot. 00130 * Note that most sensors will return a full (6D) CPose3D, but see the derived classes for more details or special cases. 00131 * \sa setSensorPose 00132 */ 00133 void getSensorPose( CPose3D &out_sensorPose ) const { out_sensorPose = cameraPose; } 00134 00135 00136 /** A general method to change the sensor pose on the robot. 00137 * Note that most sensors will use the full (6D) CPose3D, but see the derived classes for more details or special cases. 00138 * \sa getSensorPose 00139 */ 00140 void setSensorPose( const CPose3D &newSensorPose ) { cameraPose = newSensorPose; } 00141 00142 //void getRectifiedImages( 00143 00144 00145 }; // End of class def. 00146 00147 00148 } // End of namespace 00149 } // End of namespace 00150 00151 #endif
| Page generated by Doxygen 1.6.1 for MRPT 0.9.0 SVN: at Mon Jun 7 06:47:58 UTC 2010 |
