Main MRPT website > C++ reference for 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 
23 namespace mrpt
24 {
25 namespace graphslam
26 {
27 namespace deciders
28 {
29 /** \brief Interface for implementing edge registration classes.
30  *
31  * CEdgeRegistrationDecider provides the basic methods that have to exist in
32  * every edge registration decider class. For an example of inheriting from
33  * this class see CICPCriteriaERD.
34  *
35  * \note As a naming convention, all the implemented edge registration deciders
36  * are suffixed with the ERD acronym.
37  *
38  * \ingroup mrpt_graphslam_grp
39  */
40 template <class GRAPH_T = typename mrpt::graphs::CNetworkOfPoses2DInf>
42  : public virtual mrpt::graphslam::CRegistrationDeciderOrOptimizer<GRAPH_T>
43 {
44  public:
45  /**\brief Handy typedefs */
46  /**\{*/
47  /**\brief Parent of current class */
49  /**\brief type of graph constraints */
50  using constraint_t = typename GRAPH_T::constraint_t;
51  /**\brief type of underlying poses (2D/3D). */
52  using pose_t = typename GRAPH_T::constraint_t::type_value;
53  /**\}*/
54 
55  /**\brief Default class constructor.*/
57  /**\brief Default class destructor.*/
58  virtual ~CEdgeRegistrationDecider();
59  /**\brief Generic method for fetching the incremental action/observation
60  * readings from the calling function.
61  *
62  * Implementations of this interface should use (part of) the specified
63  * parameters and call the checkRegistrationCondition to check for
64  * potential Edge registration
65  */
66  virtual bool updateState(
68  mrpt::obs::CSensoryFrame::Ptr observations,
69  mrpt::obs::CObservation::Ptr observation) = 0;
70  /**\brief Fill the given map with the type of registered edges as well as
71  * the corresponding number of registration of each edge.
72  */
73  virtual void getEdgesStats(
74  std::map<std::string, int>* edge_type_to_num) const {};
75  /**\brief Used by the caller to query for possible loop closures in the
76  * last edge registration procedure.
77  */
78  virtual bool justInsertedLoopClosure() const { return m_just_inserted_lc; }
79  virtual void getDescriptiveReport(std::string* report_str) const;
80 
81  protected:
82  /**\name Registration criteria checks
83  *\brief Check whether a new edge should be registered in the
84  * graph.
85  *
86  * If condition(s) for edge registration is satisfied, method should
87  *call
88  * the registerNewEdge method.
89  */
90  /**\{*/
93  {
94  }
96  const std::set<mrpt::graphs::TNodeID>&)
97  {
98  }
99  /**\}*/
100  /**\brief Register a new constraint/edge in the current graph.
101  *
102  * Implementations of this class should provide a wrapper around
103  * GRAPH_T::insertEdge method.
104  */
105  virtual void registerNewEdge(
106  const mrpt::graphs::TNodeID& from, const mrpt::graphs::TNodeID& to,
107  const constraint_t& rel_edge);
108 
110  /**\brief Indicates whether the ERD implementation expects, at most one
111  * single node to be registered, between successive calls to the
112  * updateState method.
113  *
114  * By default set to false.
115  */
117 };
118 }
119 }
120 } // end of namespaces
121 
123 
124 #endif /* end of include guard: CEDGEREGISTRATIONDECIDER_H */
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
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
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:17
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: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019