MRPT  2.0.4
CNodeRegistrationDecider.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 
13 #include <mrpt/obs/CObservation.h>
14 #include <mrpt/obs/CSensoryFrame.h>
15 
17 
19 {
20 /**\brief Interface for implementing node registration classes.
21  *
22  * CNodeRegistrationDecider provides the basic methods that have to exist in
23  * every node registration decider class. For an example of inheriting from
24  * this class see CFixedIntervalsNRD.
25  *
26  * \note As a naming convention, all the implemented node registration deciders
27  * are suffixed with the NRD acronym.
28  *
29  * \ingroup mrpt_graphslam_grp
30  */
31 template <class GRAPH_T>
33  : public virtual mrpt::graphslam::CRegistrationDeciderOrOptimizer<GRAPH_T>
34 {
35  public:
36  /**\brief Handy typedefs */
37  /**\{*/
38  /**\brief Parent of current class */
40  /**\brief type of graph constraints */
41  using constraint_t = typename GRAPH_T::constraint_t;
42  /**\brief type of underlying poses (2D/3D). */
43  using pose_t = typename GRAPH_T::constraint_t::type_value;
44  using global_pose_t = typename GRAPH_T::global_pose_t;
46  double, constraint_t::state_length, constraint_t::state_length>;
47  /**\}*/
48 
49  /**\brief Default class constructor.*/
51  /**\brief Default class destructor.*/
52  ~CNodeRegistrationDecider() override = default;
53  /**\brief Getter method for fetching the currently estimated robot position.
54  *
55  * In single-robot situations this is most likely going to be the last
56  * registered node position + an position/uncertainty increment from that
57  * position
58  */
60  void getDescriptiveReport(std::string* report_str) const override;
61 
62  protected:
63  /**\brief Reset the given PDF method and assign a fixed high-certainty
64  * Covariance/Information matrix
65  */
66  void resetPDF(constraint_t* c);
67  /**\brief Check whether a new node should be registered in the
68  * graph.
69  *
70  * This should be the key-method in any implementation of this
71  * interface. Should call registerNewNodeAtEnd method if the registration
72  * condition is satisfied.
73  *
74  * \return True upon successful node registration in the graph
75  */
76  virtual bool checkRegistrationCondition();
77  /**\brief Utility methods for adding new poses to the graph.
78  */
79  /**\{*/
80  /** Add a new constraint at the end of the graph.
81  * \param[in] constraint Constraint transformation from the latest
82  * registered to the new node.
83  *
84  * \return True upon successful node registration.
85  */
86  bool registerNewNodeAtEnd(const typename GRAPH_T::constraint_t& constraint);
87  /**\brief Same goal as the previous method - uses the m_since_prev_node_PDF
88  * as the constraint at the end.
89  */
90  bool registerNewNodeAtEnd();
91  /**\brief Get a global_pose_t and fill the NODE_ANNOTATIONS-related fields
92  *
93  * \note Users are encouraged to override this method in case they have
94  * defined a new TNodeAnnotations struct and want to use this metadata in
95  * the graph nodes.
96  */
97  virtual void addNodeAnnotsToPose(global_pose_t* pose) const;
98  /**\}*/
99 
100  /**\brief Store the last registered NodeID.
101  *
102  * We don't store its pose since it will most likely change due to calls to
103  * the
104  * graph-optimization procedure / dijkstra_node_estimation
105  */
107  /**\brief Tracking the PDF of the current position of the robot with
108  * regards to the <b previous registered node</b>.
109  */
111  /**\brief Initial information matrix for paths
112  *
113  * Large values for this indicate that I am sure of the corresponding
114  * (initial) pose
115  */
117 };
118 } // namespace mrpt::graphslam::deciders
virtual global_pose_t getCurrentRobotPosEstimation() const
Getter method for fetching the currently estimated robot position.
Interface for implementing node registration classes.
mrpt::graphs::TNodeID m_prev_registered_nodeID
Store the last registered NodeID.
bool registerNewNodeAtEnd()
Same goal as the previous method - uses the m_since_prev_node_PDF as the constraint at the end...
Interface for implementing node/edge registration deciders or optimizer classes.
virtual bool checkRegistrationCondition()
Check whether a new node should be registered in the graph.
void resetPDF(constraint_t *c)
Reset the given PDF method and assign a fixed high-certainty Covariance/Information matrix...
~CNodeRegistrationDecider() override=default
Default class destructor.
typename GRAPH_t ::constraint_t::type_value pose_t
type of underlying poses (2D/3D).
inf_mat_t m_init_inf_mat
Initial information matrix for paths.
virtual void addNodeAnnotsToPose(global_pose_t *pose) const
Get a global_pose_t and fill the NODE_ANNOTATIONS-related fields.
void getDescriptiveReport(std::string *report_str) const override
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
typename GRAPH_t ::constraint_t constraint_t
type of graph constraints
constraint_t m_since_prev_node_PDF
Tracking the PDF of the current position of the robot with regards to the <b previous registered node...



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