MRPT  1.9.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-2018, 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 namespace mrpt::hmtslam
18 {
19 /** The virtual base class for Topological Loop-closure Detectors; used in
20  * HMT-SLAM
21  * \sa mrpt::slam::CHMTSLAM
22  * \ingroup mrpt_hmtslam_grp
23  */
25 {
26  protected:
28 
29  /** Instances can be generated through a class factory only */
30  CTopLCDetectorBase(CHMTSLAM* htmslam_obj) : m_hmtslam(htmslam_obj) {}
31  public:
32  /** A class factory, to be implemented in derived classes. */
33  // static CTopLCDetectorBase* createNewInstance();
34 
35  /** Destructor */
36  virtual ~CTopLCDetectorBase() {}
37  /** Reset the internal state of the TLCD, if any.
38  * This is needed since the objects are created while loading HMT-SLAM
39  * options, but the algorithm may be re-started after that at any time.
40  */
41  virtual void reset()
42  {
43  // By default, do nothing.
44  }
45 
46  /** This method must compute the topological observation model.
47  * \param out_log_lik The output, a log-likelihood.
48  * \return nullptr (an empty smart pointer), or a PDF of the estimated
49  * translation between the two areas (can be a multi-modal PDF).
50  */
52  const THypothesisID& hypID, const CHMHMapNode::Ptr& currentArea,
53  const CHMHMapNode::Ptr& refArea, double& out_log_lik) = 0;
54 
55  /** If implemented, this method provides the evaluation of an additional
56  * term to be added to the SSO between each pair of observations.
57  * \param out_SSO The output, in the range [0,1].
58  * \return true if computed SSO is meaningful. The default virtual method
59  * returns false.
60  */
62  const THypothesisID& hypID, const TPoseID& poseID1,
63  const TPoseID& poseID2, double& out_SSO)
64  {
65  MRPT_UNUSED_PARAM(hypID);
66  MRPT_UNUSED_PARAM(poseID1);
67  MRPT_UNUSED_PARAM(poseID2);
68  MRPT_UNUSED_PARAM(out_SSO);
69  return false;
70  }
71 
72  /** Hook method for being warned about the insertion of a new poses into the
73  * maps.
74  * This should be independent of hypothesis IDs.
75  */
76  virtual void OnNewPose(
77  const TPoseID& poseID, const mrpt::obs::CSensoryFrame* SF)
78  {
79  MRPT_UNUSED_PARAM(poseID);
81  }
83 
84 }; // end class
85 
86 }
87 #endif
88 
89 
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...
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
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:68
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
Definition: CSensoryFrame.h:52
virtual ~CTopLCDetectorBase()
A class factory, to be implemented in derived classes.
The virtual base class for Topological Loop-closure Detectors; used in HMT-SLAM.
int64_t THypothesisID
An integer number uniquely identifying each of the concurrent hypotheses for the robot topological pa...
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.
virtual void reset()
Reset the internal state of the TLCD, if any.
virtual mrpt::poses::CPose3DPDF::Ptr computeTopologicalObservationModel(const THypothesisID &hypID, const CHMHMapNode::Ptr &currentArea, const CHMHMapNode::Ptr &refArea, double &out_log_lik)=0
This method must compute the topological observation model.
CTopLCDetectorBase(CHMTSLAM *htmslam_obj)
Instances can be generated through a class factory only.
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
Definition: common.h:186



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020