MRPT  1.9.9
CTopLCDetectorBase.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
12 
13 #include <mrpt/obs/CSensoryFrame.h>
14 #include <mrpt/poses/CPose3DPDF.h>
15 
16 namespace mrpt::hmtslam
17 {
18 /** The virtual base class for Topological Loop-closure Detectors; used in
19  * HMT-SLAM
20  * \sa mrpt::slam::CHMTSLAM
21  * \ingroup mrpt_hmtslam_grp
22  */
24 {
25  protected:
27 
28  /** Instances can be generated through a class factory only */
29  CTopLCDetectorBase(CHMTSLAM* htmslam_obj) : m_hmtslam(htmslam_obj) {}
30 
31  public:
32  /** A class factory, to be implemented in derived classes. */
33  // static CTopLCDetectorBase* createNewInstance();
34 
35  /** Destructor */
36  virtual ~CTopLCDetectorBase() = default;
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 } // namespace mrpt::hmtslam
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:67
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
Definition: CSensoryFrame.h:51
virtual ~CTopLCDetectorBase()=default
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: 31e853f50 Thu Nov 21 23:57:32 2019 +0100 at vie nov 22 00:00:11 CET 2019