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 00029 #ifndef CINCREMENTALMAPPARTITIONER_H 00030 #define CINCREMENTALMAPPARTITIONER_H 00031 00032 #include <mrpt/utils/CDebugOutputCapable.h> 00033 #include <mrpt/utils/CLoadableOptions.h> 00034 00035 #include <mrpt/utils/stl_extensions.h> 00036 00037 #include <mrpt/slam/CMultiMetricMap.h> 00038 #include <mrpt/slam/CSimplePointsMap.h> 00039 #include <mrpt/slam/CSensFrameProbSequence.h> 00040 #include <mrpt/slam/CMultiMetricMap.h> 00041 00042 #include <map> 00043 00044 namespace mrpt 00045 { 00046 namespace poses { class CPose3DPDF; } 00047 namespace slam 00048 { 00049 00050 DEFINE_SERIALIZABLE_PRE( CIncrementalMapPartitioner ) 00051 00052 00055 class MRPTDLLIMPEXP CIncrementalMapPartitioner : public utils::CDebugOutputCapable, public CSerializable 00056 { 00057 // This must be added to any CSerializable derived class: 00058 DEFINE_SERIALIZABLE( CIncrementalMapPartitioner ) 00059 00060 public: 00063 CIncrementalMapPartitioner( ); 00064 00067 virtual ~CIncrementalMapPartitioner(); 00068 00071 void clear(); 00072 00075 struct MRPTDLLIMPEXP TOptions : public utils::CLoadableOptions 00076 { 00079 TOptions(); 00080 00083 void loadFromConfigFile( 00084 const mrpt::utils::CConfigFileBase &source, 00085 const std::string §ion); 00086 00089 void dumpToTextStream(CStream &out); 00090 00093 float partitionThreshold; 00094 00097 float gridResolution; 00098 00101 float minDistForCorrespondence; 00102 00105 float minMahaDistForCorrespondence; 00106 00109 bool forceBisectionOnly; 00110 00113 bool useMapMatching; 00114 00117 bool debugSaveAllEigenvectors; 00118 00120 int minimumNumberElementsEachCluster; 00121 00122 } options; 00123 00131 unsigned int addMapFrame( const CSensoryFramePtr &frame, const CPosePDFPtr &robotPose2D ); 00132 00140 unsigned int addMapFrame( const CSensoryFramePtr &frame, const CPose3DPDFPtr &robotPose3D ); 00141 00149 unsigned int addMapFrame( const CSensoryFrame &frame, const CPose3DPDF &robotPose3D ); 00150 00155 void updatePartitions( std::vector<vector_uint> &partitions ); 00156 00159 unsigned int getNodesCount(); 00160 00164 void removeSetOfNodes(vector_uint indexesToRemove, bool changeCoordsRef = true); 00165 00168 void getAdjacencyMatrix( CMatrix &outMatrix ) const; 00169 00172 const CSensFrameProbSequence* getSequenceOfFrames( ) const 00173 { 00174 return &m_individualFrames; 00175 } 00176 00179 CSensFrameProbSequence* getSequenceOfFrames( ) 00180 { 00181 return &m_individualFrames; 00182 } 00183 00186 void markAllNodesForReconsideration(); 00187 00189 void changeCoordinatesOrigin( const CPose3D &newOrigin ); 00190 00192 void changeCoordinatesOriginPoseIndex( const unsigned &newOriginPose ); 00193 00197 void getAs3DScene( 00198 mrpt::opengl::CSetOfObjectsPtr &objs, 00199 const std::map< uint32_t, int64_t > *renameIndexes = NULL 00200 ) const; 00201 00202 private: 00205 CSensFrameProbSequence m_individualFrames; 00206 deque_serializable<mrpt::slam::CMultiMetricMap> m_individualMaps; 00207 00208 00211 CMatrixD m_A; 00212 00215 vector_serializable<vector_uint_serializable> m_last_partition; 00216 00219 bool m_last_last_partition_are_new_ones; 00220 00223 vector_serializable<uint8_t> m_modified_nodes; 00224 00225 }; // End of class def. 00226 00227 00228 } // End of namespace 00229 } // End of namespace 00230 00231 #endif
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN:exported at Mon Jan 12 13:00:16 UTC 2009 |