00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2008 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 CMetricMapBuilder_H 00029 #define CMetricMapBuilder_H 00030 00031 #include <mrpt/utils/CSerializable.h> 00032 #include <mrpt/utils/CDebugOutputCapable.h> 00033 #include <mrpt/synch.h> 00034 #include <mrpt/slam/CMultiMetricMap.h> 00035 #include <mrpt/slam/CSensoryFrame.h> 00036 #include <mrpt/slam/CSensFrameProbSequence.h> 00037 #include <mrpt/poses/CPose3DPDF.h> 00038 #include <mrpt/slam/CActionCollection.h> 00039 00040 namespace mrpt 00041 { 00042 namespace slam 00043 { 00048 class MRPTDLLIMPEXP CMetricMapBuilder : public mrpt::utils::CDebugOutputCapable 00049 { 00050 protected: 00053 synch::CCriticalSection critZoneChangingMap; 00054 00057 void loadCurrentMapFromFile(const char *fileName); 00058 00061 void saveCurrentMapToFile(const char *fileName); 00062 00065 void enterCriticalSection() 00066 { 00067 critZoneChangingMap.enter(); 00068 } 00069 00072 void leaveCriticalSection() 00073 { 00074 critZoneChangingMap.leave(); 00075 } 00076 00077 public: 00080 CMetricMapBuilder(); 00081 00084 virtual ~CMetricMapBuilder( ); 00085 00088 virtual void initialize( 00089 CSensFrameProbSequence &initialMap, 00090 CPosePDF *x0 = NULL 00091 ) = 0; 00092 00095 void clear(); 00096 00099 virtual CPose3DPDFPtr getCurrentPoseEstimation() const = 0; 00100 00105 virtual void processActionObservation( CActionCollection &action,CSensoryFrame &observations ) = 0; 00106 00109 virtual void getCurrentlyBuiltMap(CSensFrameProbSequence &out_map) = 0; 00110 00113 virtual unsigned int getCurrentlyBuiltMapSize() = 0; 00114 00117 virtual CMultiMetricMap* getCurrentlyBuiltMetricMap() = 0; 00118 00121 void enableMapUpdating( bool enable ); 00122 00127 virtual void saveCurrentEstimationToImage(const std::string &file, bool formatEMF_BMP = true) = 0; 00128 00129 00132 struct MRPTDLLIMPEXP TOptions 00133 { 00134 TOptions() : verbose(true), 00135 enableMapUpdating(true), 00136 debugForceInsertion(false), 00137 insertImagesAlways(false) 00138 { 00139 } 00140 00143 bool verbose; 00144 00147 bool enableMapUpdating; 00148 00151 bool debugForceInsertion; 00152 00155 bool insertImagesAlways; 00156 00157 } options; 00158 00159 }; // End of class def. 00160 00161 } // End of namespace 00162 } // End of namespace 00163 00164 #endif
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN:exported at Mon Jan 12 13:00:16 UTC 2009 |