MRPT  1.9.9
CEdgeRegistrationDecider.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 
10 #ifndef CEDGEREGISTRATIONDECIDER_H
11 #define CEDGEREGISTRATIONDECIDER_H
12 
14 #include <mrpt/obs/CSensoryFrame.h>
15 #include <mrpt/obs/CObservation.h>
17 
19 
20 #include <map>
21 #include <string>
22 
24 {
25 /** \brief Interface for implementing edge registration classes.
26  *
27  * CEdgeRegistrationDecider provides the basic methods that have to exist in
28  * every edge registration decider class. For an example of inheriting from
29  * this class see CICPCriteriaERD.
30  *
31  * \note As a naming convention, all the implemented edge registration deciders
32  * are suffixed with the ERD acronym.
33  *
34  * \ingroup mrpt_graphslam_grp
35  */
36 template <class GRAPH_T = typename mrpt::graphs::CNetworkOfPoses2DInf>
38  : public virtual mrpt::graphslam::CRegistrationDeciderOrOptimizer<GRAPH_T>
39 {
40  public:
41  /**\brief Handy typedefs */
42  /**\{*/
43  /**\brief Parent of current class */
45  /**\brief type of graph constraints */
46  using constraint_t = typename GRAPH_T::constraint_t;
47  /**\brief type of underlying poses (2D/3D). */
48  using pose_t = typename GRAPH_T::constraint_t::type_value;
49  /**\}*/
50 
51  /**\brief Default class constructor.*/
53  /**\brief Default class destructor.*/
54  virtual ~CEdgeRegistrationDecider();
55  /**\brief Generic method for fetching the incremental action/observation
56  * readings from the calling function.
57  *
58  * Implementations of this interface should use (part of) the specified
59  * parameters and call the checkRegistrationCondition to check for
60  * potential Edge registration
61  */
62  virtual bool updateState(
64  mrpt::obs::CSensoryFrame::Ptr observations,
65  mrpt::obs::CObservation::Ptr observation) = 0;
66  /**\brief Fill the given map with the type of registered edges as well as
67  * the corresponding number of registration of each edge.
68  */
69  virtual void getEdgesStats(
70  std::map<std::string, int>* edge_type_to_num) const {};
71  /**\brief Used by the caller to query for possible loop closures in the
72  * last edge registration procedure.
73  */
74  virtual bool justInsertedLoopClosure() const { return m_just_inserted_lc; }
75  virtual void getDescriptiveReport(std::string* report_str) const;
76 
77  protected:
78  /**\name Registration criteria checks
79  *\brief Check whether a new edge should be registered in the
80  * graph.
81  *
82  * If condition(s) for edge registration is satisfied, method should
83  *call
84  * the registerNewEdge method.
85  */
86  /**\{*/
89  {
90  }
92  const std::set<mrpt::graphs::TNodeID>&)
93  {
94  }
95  /**\}*/
96  /**\brief Register a new constraint/edge in the current graph.
97  *
98  * Implementations of this class should provide a wrapper around
99  * GRAPH_T::insertEdge method.
100  */
101  virtual void registerNewEdge(
102  const mrpt::graphs::TNodeID& from, const mrpt::graphs::TNodeID& to,
103  const constraint_t& rel_edge);
104 
106  /**\brief Indicates whether the ERD implementation expects, at most one
107  * single node to be registered, between successive calls to the
108  * updateState method.
109  *
110  * By default set to false.
111  */
113 };
114 }
116 
117 #endif /* end of include guard: CEDGEREGISTRATIONDECIDER_H */
118 
119 
virtual void checkRegistrationCondition(mrpt::graphs::TNodeID from, mrpt::graphs::TNodeID to)
virtual bool updateState(mrpt::obs::CActionCollection::Ptr action, mrpt::obs::CSensoryFrame::Ptr observations, mrpt::obs::CObservation::Ptr observation)=0
Generic method for fetching the incremental action/observation readings from the calling function...
Interface for implementing edge registration classes.
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).
GLsizei const GLchar ** string
Definition: glext.h:4101
virtual void getDescriptiveReport(std::string *report_str) const
Fill the provided string with a detailed report of the decider/optimizer state.
uint64_t TNodeID
A generic numeric type for unique IDs of nodes or entities.
Definition: TNodeID.h:16
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.



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020