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-2020, 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  [[maybe_unused]] const THypothesisID& hypID,
63  [[maybe_unused]] const TPoseID& poseID1,
64  [[maybe_unused]] const TPoseID& poseID2,
65  [[maybe_unused]] double& out_SSO)
66  {
67  return false;
68  }
69 
70  /** Hook method for being warned about the insertion of a new poses into the
71  * maps.
72  * This should be independent of hypothesis IDs.
73  */
74  virtual void OnNewPose(
75  [[maybe_unused]] const TPoseID& poseID,
76  [[maybe_unused]] const mrpt::obs::CSensoryFrame* SF)
77  {
78  }
80 
81 }; // end class
82 
83 } // namespace mrpt::hmtslam
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.
virtual void OnNewPose([[maybe_unused]] const TPoseID &poseID, [[maybe_unused]] const mrpt::obs::CSensoryFrame *SF)
Hook method for being warned about the insertion of a new poses into the maps.
virtual bool computeSSOBetweenObservations([[maybe_unused]] const THypothesisID &hypID, [[maybe_unused]] const TPoseID &poseID1, [[maybe_unused]] const TPoseID &poseID2, [[maybe_unused]] double &out_SSO)
If implemented, this method provides the evaluation of an additional term to be added to the SSO betw...
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 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.



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020