Main MRPT website > C++ reference for MRPT 1.5.9
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-2017, 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>
15 #include <mrpt/obs/CSensoryFrame.h>
16 
17 
18 namespace mrpt
19 {
20  namespace hmtslam
21  {
22  /** The virtual base class for Topological Loop-closure Detectors; used in HMT-SLAM
23  * \sa mrpt::slam::CHMTSLAM
24  * \ingroup mrpt_hmtslam_grp
25  */
27  {
28  protected:
30 
31  /** Instances can be generated through a class factory only */
32  CTopLCDetectorBase( CHMTSLAM *htmslam_obj ) : m_hmtslam(htmslam_obj) { }
33 
34  public:
35  /** A class factory, to be implemented in derived classes. */
36  //static CTopLCDetectorBase* createNewInstance();
37 
38  /** Destructor */
39  virtual ~CTopLCDetectorBase() { }
40 
41  /** Reset the internal state of the TLCD, if any.
42  * 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.
43  */
44  virtual void reset() {
45  // By default, do nothing.
46  }
47 
48  /** This method must compute the topological observation model.
49  * \param out_log_lik The output, a log-likelihood.
50  * \return NULL (an empty smart pointer), or a PDF of the estimated translation between the two areas (can be a multi-modal PDF).
51  */
52  virtual mrpt::poses::CPose3DPDFPtr computeTopologicalObservationModel(
53  const THypothesisID &hypID,
54  const CHMHMapNodePtr &currentArea,
55  const CHMHMapNodePtr &refArea,
56  double &out_log_lik
57  ) = 0;
58 
59  /** If implemented, this method provides the evaluation of an additional term to be added to the SSO between each pair of observations.
60  * \param out_SSO The output, in the range [0,1].
61  * \return true if computed SSO is meaningful. The default virtual method returns false.
62  */
64  const THypothesisID &hypID,
65  const TPoseID &poseID1,
66  const TPoseID &poseID2,
67  double &out_SSO
68  )
69  {
70  MRPT_UNUSED_PARAM(hypID); MRPT_UNUSED_PARAM(poseID1);
71  MRPT_UNUSED_PARAM(poseID2); MRPT_UNUSED_PARAM(out_SSO);
72  return false;
73  }
74 
75  /** Hook method for being warned about the insertion of a new poses into the maps.
76  * This should be independent of hypothesis IDs.
77  */
78  virtual void OnNewPose(
79  const TPoseID &poseID,
80  const mrpt::obs::CSensoryFrame *SF )
81  {
83  }
84 
85  }; // end class
86 
87  typedef std::shared_ptr<CTopLCDetectorBase> CTopLCDetectorBasePtr;
88 
89  } // end namespace
90 } // end namespace
91 #endif
std::shared_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.
An implementation of Hybrid Metric Topological SLAM (HMT-SLAM).
Definition: CHMTSLAM.h:59
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.
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
virtual ~CTopLCDetectorBase()
A class factory, to be implemented in derived classes.
The virtual base class for Topological Loop-closure Detectors; used in HMT-SLAM.
virtual void OnNewPose(const TPoseID &poseID, const mrpt::obs::CSensoryFrame *SF)
Hook method for being warned about the insertion of a new poses into the maps.
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.
CTopLCDetectorBase(CHMTSLAM *htmslam_obj)
Instances can be generated through a class factory only.



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020