00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://www.mrpt.org/ | 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 * \ingroup mrpt_hmtslam_grp 00046 */ 00047 class HMTSLAM_IMPEXP CTopLCDetectorBase 00048 { 00049 protected: 00050 CHMTSLAM *m_hmtslam; 00051 00052 /** Instances can be generated through a class factory only */ 00053 CTopLCDetectorBase( CHMTSLAM *htmslam_obj ) : m_hmtslam(htmslam_obj) { } 00054 00055 public: 00056 /** A class factory, to be implemented in derived classes. */ 00057 //static CTopLCDetectorBase* createNewInstance(); 00058 00059 /** Destructor */ 00060 virtual ~CTopLCDetectorBase() { } 00061 00062 /** Reset the internal state of the TLCD, if any. 00063 * 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. 00064 */ 00065 virtual void reset() { 00066 // By default, do nothing. 00067 } 00068 00069 /** This method must compute the topological observation model. 00070 * \param out_log_lik The output, a log-likelihood. 00071 * \return NULL (an empty smart pointer), or a PDF of the estimated translation between the two areas (can be a multi-modal PDF). 00072 */ 00073 virtual CPose3DPDFPtr computeTopologicalObservationModel( 00074 const THypothesisID &hypID, 00075 const CHMHMapNodePtr ¤tArea, 00076 const CHMHMapNodePtr &refArea, 00077 double &out_log_lik 00078 ) = 0; 00079 00080 /** If implemented, this method provides the evaluation of an additional term to be added to the SSO between each pair of observations. 00081 * \param out_SSO The output, in the range [0,1]. 00082 * \return true if computed SSO is meaningful. The default virtual method returns false. 00083 */ 00084 virtual bool computeSSOBetweenObservations( 00085 const THypothesisID &hypID, 00086 const TPoseID &poseID1, 00087 const TPoseID &poseID2, 00088 double &out_SSO 00089 ) 00090 { 00091 return false; 00092 } 00093 00094 /** Hook method for being warned about the insertion of a new poses into the maps. 00095 * This should be independent of hypothesis IDs. 00096 */ 00097 virtual void OnNewPose( 00098 const TPoseID &poseID, 00099 const CSensoryFrame *SF ) 00100 { } 00101 00102 }; // end class 00103 00104 typedef stlplus::smart_ptr<CTopLCDetectorBase> CTopLCDetectorBasePtr; 00105 00106 } // end namespace 00107 } // end namespace 00108 #endif
| Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011 |