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