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



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST