MRPT  2.0.3
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  }
79  using Ptr = std::shared_ptr<CTopLCDetectorBase>;
80 
81 }; // end class
82 
83 } // namespace mrpt::hmtslam
mrpt::hmtslam::CHMHMapNode::Ptr
std::shared_ptr< mrpt::hmtslam ::CHMHMapNode > Ptr
Definition: CHMHMapNode.h:39
mrpt::hmtslam::CHMTSLAM
An implementation of Hybrid Metric Topological SLAM (HMT-SLAM).
Definition: CHMTSLAM.h:67
HMT_SLAM_common.h
mrpt::hmtslam::CTopLCDetectorBase::computeSSOBetweenObservations
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...
Definition: CTopLCDetectorBase.h:61
mrpt::hmtslam::CTopLCDetectorBase::CTopLCDetectorBase
CTopLCDetectorBase(CHMTSLAM *htmslam_obj)
Instances can be generated through a class factory only.
Definition: CTopLCDetectorBase.h:29
mrpt::hmtslam::CTopLCDetectorBase::m_hmtslam
CHMTSLAM * m_hmtslam
Definition: CTopLCDetectorBase.h:26
mrpt::obs::CSensoryFrame
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
Definition: CSensoryFrame.h:51
mrpt::hmtslam
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
Definition: CHierarchicalMapMHPartition.h:27
mrpt::hmtslam::CTopLCDetectorBase::reset
virtual void reset()
Reset the internal state of the TLCD, if any.
Definition: CTopLCDetectorBase.h:41
CSensoryFrame.h
mrpt::hmtslam::CTopLCDetectorBase::~CTopLCDetectorBase
virtual ~CTopLCDetectorBase()=default
A class factory, to be implemented in derived classes.
mrpt::hmtslam::TPoseID
uint64_t TPoseID
An integer number uniquely identifying each robot pose stored in HMT-SLAM.
Definition: HMT_SLAM_common.h:63
mrpt::hmtslam::CTopLCDetectorBase::computeTopologicalObservationModel
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.
mrpt::hmtslam::THypothesisID
int64_t THypothesisID
An integer number uniquely identifying each of the concurrent hypotheses for the robot topological pa...
Definition: HMT_SLAM_common.h:58
mrpt::hmtslam::CTopLCDetectorBase::OnNewPose
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.
Definition: CTopLCDetectorBase.h:74
mrpt::poses::CPose3DPDF::Ptr
std::shared_ptr< CPose3DPDF > Ptr
Definition: CPose3DPDF.h:42
CPose3DPDF.h
mrpt::hmtslam::CTopLCDetectorBase::Ptr
std::shared_ptr< CTopLCDetectorBase > Ptr
Definition: CTopLCDetectorBase.h:79
mrpt::hmtslam::CTopLCDetectorBase
The virtual base class for Topological Loop-closure Detectors; used in HMT-SLAM.
Definition: CTopLCDetectorBase.h:23



Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Thu May 21 21:53:32 UTC 2020