MRPT  2.0.4
CEdgeRegistrationDecider.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 
10 #pragma once
11 
14 #include <mrpt/obs/CObservation.h>
15 #include <mrpt/obs/CSensoryFrame.h>
16 
18 
19 #include <map>
20 #include <string>
21 
23 {
24 /** \brief Interface for implementing edge registration classes.
25  *
26  * CEdgeRegistrationDecider provides the basic methods that have to exist in
27  * every edge registration decider class. For an example of inheriting from
28  * this class see CICPCriteriaERD.
29  *
30  * \note As a naming convention, all the implemented edge registration deciders
31  * are suffixed with the ERD acronym.
32  *
33  * \ingroup mrpt_graphslam_grp
34  */
35 template <class GRAPH_T = typename mrpt::graphs::CNetworkOfPoses2DInf>
37  : public virtual mrpt::graphslam::CRegistrationDeciderOrOptimizer<GRAPH_T>
38 {
39  public:
40  /**\brief Handy typedefs */
41  /**\{*/
42  /**\brief Parent of current class */
44  /**\brief type of graph constraints */
45  using constraint_t = typename GRAPH_T::constraint_t;
46  /**\brief type of underlying poses (2D/3D). */
47  using pose_t = typename GRAPH_T::constraint_t::type_value;
48  /**\}*/
49 
50  CEdgeRegistrationDecider() = default;
51  ~CEdgeRegistrationDecider() override = default;
52  /**\brief Fill the given map with the type of registered edges as well as
53  * the corresponding number of registration of each edge.
54  */
55  virtual void getEdgesStats(
56  std::map<std::string, int>* edge_type_to_num) const {};
57  /**\brief Used by the caller to query for possible loop closures in the
58  * last edge registration procedure.
59  */
60  virtual bool justInsertedLoopClosure() const { return m_just_inserted_lc; }
61  void getDescriptiveReport(std::string* report_str) const override;
62 
63  protected:
64  /**\name Registration criteria checks
65  *\brief Check whether a new edge should be registered in the
66  * graph.
67  *
68  * If condition(s) for edge registration is satisfied, method should
69  * call the registerNewEdge method.
70  */
71  /**\{*/
74  {
75  }
77  const std::set<mrpt::graphs::TNodeID>&)
78  {
79  }
80  /**\}*/
81  /**\brief Register a new constraint/edge in the current graph.
82  *
83  * Implementations of this class should provide a wrapper around
84  * GRAPH_T::insertEdge method.
85  */
86  virtual void registerNewEdge(
87  const mrpt::graphs::TNodeID& from, const mrpt::graphs::TNodeID& to,
88  const constraint_t& rel_edge);
89 
90  bool m_just_inserted_lc = false;
91  /**\brief Indicates whether the ERD implementation expects, at most one
92  * single node to be registered, between successive calls to the
93  * updateState method.
94  */
96 };
97 } // namespace mrpt::graphslam::deciders
virtual void checkRegistrationCondition(mrpt::graphs::TNodeID from, mrpt::graphs::TNodeID to)
Interface for implementing edge registration classes.
void getDescriptiveReport(std::string *report_str) const override
Fill the provided string with a detailed report of the decider/optimizer state.
virtual bool justInsertedLoopClosure() const
Used by the caller to query for possible loop closures in the last edge registration procedure...
virtual void checkRegistrationCondition(const std::set< mrpt::graphs::TNodeID > &)
virtual void getEdgesStats(std::map< std::string, int > *edge_type_to_num) const
Fill the given map with the type of registered edges as well as the corresponding number of registrat...
bool m_override_registered_nodes_check
Indicates whether the ERD implementation expects, at most one single node to be registered, between successive calls to the updateState method.
Interface for implementing node/edge registration deciders or optimizer classes.
typename GRAPH_t ::constraint_t constraint_t
type of graph constraints
typename GRAPH_t ::constraint_t::type_value pose_t
type of underlying poses (2D/3D).
virtual void registerNewEdge(const mrpt::graphs::TNodeID &from, const mrpt::graphs::TNodeID &to, const constraint_t &rel_edge)
Register a new constraint/edge in the current graph.
uint64_t TNodeID
A generic numeric type for unique IDs of nodes or entities.
Definition: TNodeID.h:16



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020