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-2017, 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
std::shared_ptr< CHMHMapNode > Ptr
Definition: CHMHMapNode.h:42
An implementation of Hybrid Metric Topological SLAM (HMT-SLAM).
Definition: CHMTSLAM.h:67
The virtual base class for Topological Loop-closure Detectors; used in HMT-SLAM.
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.
virtual void reset()
Reset the internal state of the TLCD, if any.
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 ~CTopLCDetectorBase()
A class factory, to be implemented in derived classes.
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...
std::shared_ptr< CTopLCDetectorBase > Ptr
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
Definition: CSensoryFrame.h:55
std::shared_ptr< CPose3DPDF > Ptr
Definition: CPose3DPDF.h:45
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
Definition: mrpt_macros.h:365
int64_t THypothesisID
An integer number uniquely identifying each of the concurrent hypotheses for the robot topological pa...
uint64_t TPoseID
An integer number uniquely identifying each robot pose stored in HMT-SLAM.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.



Page generated by Doxygen 1.9.1 for MRPT 1.9.9 Git: 63ea9d1f1 Thu Nov 23 00:06:53 2017 +0100 at mar 26 may 2026 12:19:29 CEST