Main MRPT website > C++ reference
MRPT logo
CTopLCDetectorBase.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2014, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 #ifndef _CTopLCDetectorBase_H
10 #define _CTopLCDetectorBase_H
11 
13 
14 #include <mrpt/poses/CPose3DPDF.h>
16 
17 
18 namespace mrpt
19 {
20  namespace hmtslam
21  {
22  using namespace mrpt::slam;
23 
24  /** The virtual base class for Topological Loop-closure Detectors; used in HMT-SLAM
25  * \sa mrpt::slam::CHMTSLAM
26  * \ingroup mrpt_hmtslam_grp
27  */
29  {
30  protected:
32 
33  /** Instances can be generated through a class factory only */
34  CTopLCDetectorBase( CHMTSLAM *htmslam_obj ) : m_hmtslam(htmslam_obj) { }
35 
36  public:
37  /** A class factory, to be implemented in derived classes. */
38  //static CTopLCDetectorBase* createNewInstance();
39 
40  /** Destructor */
41  virtual ~CTopLCDetectorBase() { }
42 
43  /** Reset the internal state of the TLCD, if any.
44  * 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.
45  */
46  virtual void reset() {
47  // By default, do nothing.
48  }
49 
50  /** This method must compute the topological observation model.
51  * \param out_log_lik The output, a log-likelihood.
52  * \return NULL (an empty smart pointer), or a PDF of the estimated translation between the two areas (can be a multi-modal PDF).
53  */
54  virtual CPose3DPDFPtr computeTopologicalObservationModel(
55  const THypothesisID &hypID,
56  const CHMHMapNodePtr &currentArea,
57  const CHMHMapNodePtr &refArea,
58  double &out_log_lik
59  ) = 0;
60 
61  /** If implemented, this method provides the evaluation of an additional term to be added to the SSO between each pair of observations.
62  * \param out_SSO The output, in the range [0,1].
63  * \return true if computed SSO is meaningful. The default virtual method returns false.
64  */
66  const THypothesisID &hypID,
67  const TPoseID &poseID1,
68  const TPoseID &poseID2,
69  double &out_SSO
70  )
71  {
72  MRPT_UNUSED_PARAM(hypID); MRPT_UNUSED_PARAM(poseID1);
73  MRPT_UNUSED_PARAM(poseID2); MRPT_UNUSED_PARAM(out_SSO);
74  return false;
75  }
76 
77  /** Hook method for being warned about the insertion of a new poses into the maps.
78  * This should be independent of hypothesis IDs.
79  */
80  virtual void OnNewPose(
81  const TPoseID &poseID,
82  const CSensoryFrame *SF )
83  {
85  }
86 
87  }; // end class
88 
90 
91  } // end namespace
92 } // end namespace
93 #endif
#define HMTSLAM_IMPEXP
stlplus::smart_ptr< CTopLCDetectorBase > CTopLCDetectorBasePtr
virtual bool computeSSOBetweenObservations(const THypothesisID &hypID, const TPoseID &poseID1, const TPoseID &poseID2, double &out_SSO)
If implemented, this method provides the evaluation of an additional term to be added to the SSO betw...
uint64_t TPoseID
An integer number uniquely identifying each robot pose stored in HMT-SLAM.
virtual void OnNewPose(const TPoseID &poseID, const CSensoryFrame *SF)
Hook method for being warned about the insertion of a new poses into the maps.
An implementation of Hybrid Metric Topological SLAM (HMT-SLAM).
Definition: CHMTSLAM.h:66
This namespace contains algorithms for SLAM, localization, map building, representation of robot's ac...
int64_t THypothesisID
An integer number uniquely identifying each of the concurrent hypotheses for the robot topological pa...
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
virtual ~CTopLCDetectorBase()
A class factory, to be implemented in derived classes.
The virtual base class for Topological Loop-closure Detectors; used in HMT-SLAM.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
virtual void reset()
Reset the internal state of the TLCD, if any.
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
Definition: CSensoryFrame.h:53
CTopLCDetectorBase(CHMTSLAM *htmslam_obj)
Instances can be generated through a class factory only.



Page generated by Doxygen 1.8.8 for MRPT 1.2.2 SVN:Unversioned directory at Tue Oct 14 02:14:08 UTC 2014