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 CMetricMapBuilderRBPF_H 00029 #define CMetricMapBuilderRBPF_H 00030 00031 #include <mrpt/slam/CMetricMapBuilder.h> 00032 #include <mrpt/slam/CMultiMetricMapPDF.h> 00033 #include <mrpt/slam/CMultiMetricMap.h> 00034 00035 #include <mrpt/bayes/CParticleFilter.h> 00036 #include <mrpt/bayes/CParticleFilterCapable.h> 00037 #include <mrpt/utils/CLoadableOptions.h> 00038 #include <mrpt/utils/safe_pointers.h> 00039 00040 namespace mrpt 00041 { 00042 namespace slam 00043 { 00061 class MRPTDLLIMPEXP CMetricMapBuilderRBPF : public CMetricMapBuilder 00062 { 00063 public: 00066 CMultiMetricMapPDF mapPDF; 00067 00068 protected: 00071 bayes::CParticleFilter::TParticleFilterOptions m_PF_options; 00072 00075 float insertionLinDistance,insertionAngDistance; 00076 00080 float linDistSinceLast,angDistSinceLast; 00081 00084 non_copiable_ptr<CMultiMetricMap> currentMetricMapEstimation; 00085 00086 public: 00087 00090 struct MRPTDLLIMPEXP TConstructionOptions : public utils::CLoadableOptions 00091 { 00092 public: 00095 TConstructionOptions(); 00096 00099 void loadFromConfigFile( 00100 const mrpt::utils::CConfigFileBase &source, 00101 const std::string §ion); 00102 00105 void dumpToTextStream( 00106 CStream &out); 00107 00108 float insertionLinDistance; 00109 float insertionAngDistance; 00110 00111 bayes::CParticleFilter::TParticleFilterOptions PF_options; 00112 00113 TSetOfMetricMapInitializers mapsInitializers; 00114 CMultiMetricMapPDF::TPredictionParams predictionOptions; 00115 }; 00116 00119 CMetricMapBuilderRBPF( const TConstructionOptions &initializationOptions ); 00120 00123 virtual ~CMetricMapBuilderRBPF( ); 00124 00127 void initialize( 00128 CSensFrameProbSequence &initialMap, 00129 CPosePDF *x0 = NULL 00130 ); 00131 00134 void clear(); 00135 00138 CPose3DPDFPtr getCurrentPoseEstimation() const; 00139 00143 void getCurrentMostLikelyPath( std::deque<CPose2D> &outPath ) const; 00144 00147 void getCurrentMostLikelyPath( std::deque<CPose3D> &outPath ) const; 00148 00154 void processActionObservation( 00155 CActionCollection &action, 00156 CSensoryFrame &observations ); 00157 00160 void getCurrentlyBuiltMap(CSensFrameProbSequence &out_map); 00161 00164 CMultiMetricMap* getCurrentlyBuiltMetricMap(); 00165 00168 unsigned int getCurrentlyBuiltMapSize(); 00169 00174 void saveCurrentEstimationToImage(const std::string &file, bool formatEMF_BMP = true); 00175 00178 void drawCurrentEstimationToImage( utils::CMRPTCanvas *img ); 00179 00182 void saveCurrentPathEstimationToTextFile( std::string fil ); 00183 00184 double getCurrentJointEntropy(); 00185 00188 struct MRPTDLLIMPEXP TStats 00189 { 00190 TStats() : 00191 observationsInserted(false) 00192 { } 00193 00195 bool observationsInserted; 00196 00197 }; 00198 00199 00202 TStats m_statsLastIteration; 00203 00204 }; // End of class def. 00205 00206 } // End of namespace 00207 } // End of namespace 00208 00209 #endif
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN:exported at Mon Jan 12 13:00:16 UTC 2009 |