00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2011 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 _CTopLCDetectorBase_H 00029 #define _CTopLCDetectorBase_H 00030 00031 #include <mrpt/hmtslam/HMT_SLAM_common.h> 00032 00033 #include <mrpt/poses/CPose3DPDF.h> 00034 #include <mrpt/slam/CSensoryFrame.h> 00035 00036 00037 namespace mrpt 00038 { 00039 namespace hmtslam 00040 { 00041 using namespace mrpt::slam; 00042 00043 /** The virtual base class for Topological Loop-closure Detectors; used in HMT-SLAM 00044 * \sa mrpt::slam::CHMTSLAM 00045 */ 00046 class HMTSLAM_IMPEXP CTopLCDetectorBase 00047 { 00048 protected: 00049 CHMTSLAM *m_hmtslam; 00050 00051 /** Instances can be generated through a class factory only */ 00052 CTopLCDetectorBase( CHMTSLAM *htmslam_obj ) : m_hmtslam(htmslam_obj) { } 00053 00054 public: 00055 /** A class factory, to be implemented in derived classes. */ 00056 //static CTopLCDetectorBase* createNewInstance(); 00057 00058 /** Destructor */ 00059 virtual ~CTopLCDetectorBase() { } 00060 00061 /** Reset the internal state of the TLCD, if any. 00062 * This is needed since the objects are created while loading HMT-SLAM options, but the algorithm may be re-started after that at any time. 00063 */ 00064 virtual void reset() { 00065 // By default, do nothing. 00066 } 00067 00068 /** This method must compute the topological observation model. 00069 * \param out_log_lik The output, a log-likelihood. 00070 * \return NULL (an empty smart pointer), or a PDF of the estimated translation between the two areas (can be a multi-modal PDF). 00071 */ 00072 virtual CPose3DPDFPtr computeTopologicalObservationModel( 00073 const THypothesisID &hypID, 00074 const CHMHMapNodePtr ¤tArea, 00075 const CHMHMapNodePtr &refArea, 00076 double &out_log_lik 00077 ) = 0; 00078 00079 /** If implemented, this method provides the evaluation of an additional term to be added to the SSO between each pair of observations. 00080 * \param out_SSO The output, in the range [0,1]. 00081 * \return true if computed SSO is meaningful. The default virtual method returns false. 00082 */ 00083 virtual bool computeSSOBetweenObservations( 00084 const THypothesisID &hypID, 00085 const TPoseID &poseID1, 00086 const TPoseID &poseID2, 00087 double &out_SSO 00088 ) 00089 { 00090 return false; 00091 } 00092 00093 /** Hook method for being warned about the insertion of a new poses into the maps. 00094 * This should be independent of hypothesis IDs. 00095 */ 00096 virtual void OnNewPose( 00097 const TPoseID &poseID, 00098 const CSensoryFrame *SF ) 00099 { } 00100 00101 }; // end class 00102 00103 typedef stlplus::smart_ptr<CTopLCDetectorBase> CTopLCDetectorBasePtr; 00104 00105 } // end namespace 00106 } // end namespace 00107 #endif
Page generated by Doxygen 1.7.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:30:30 UTC 2011 |