Main MRPT website > C++ reference for MRPT 1.9.9
CNodeRegistrationDecider.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 CNODEREGISTRATIONDECIDER_H
11 #define CNODEREGISTRATIONDECIDER_H
12 
14 #include <mrpt/obs/CSensoryFrame.h>
15 #include <mrpt/obs/CObservation.h>
16 
18 
19 namespace mrpt
20 {
21 namespace graphslam
22 {
23 namespace deciders
24 {
25 /**\brief Interface for implementing node registration classes.
26  *
27  * CNodeRegistrationDecider provides the basic methods that have to exist in
28  * every node registration decider class. For an example of inheriting from
29  * this class see CFixedIntervalsNRD.
30  *
31  * \note As a naming convention, all the implemented node registration deciders
32  * are suffixed with the NRD acronym.
33  *
34  * \ingroup mrpt_graphslam_grp
35  */
36 template <class GRAPH_T>
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  using global_pose_t = typename GRAPH_T::global_pose_t;
51  double, constraint_t::state_length, constraint_t::state_length>;
52  /**\}*/
53 
54  /**\brief Default class constructor.*/
56  /**\brief Default class destructor.*/
57  virtual ~CNodeRegistrationDecider();
58  /**\brief Getter method for fetching the currently estimated robot position.
59  *
60  * In single-robot situations this is most likely going to be the last
61  * registered node position + an position/uncertainty increment from that
62  * position
63  */
65  /**\brief Generic method for fetching the incremental action-observations
66  * (or observation-only) depending on the rawlog format readings from the
67  * calling function.
68  *
69  * Implementations of this interface should use (part of) the specified
70  * parameters and call the checkRegistrationCondition to check for
71  * potential node registration
72  *
73  * \return True upon successful node registration in the graph
74  */
75  virtual bool updateState(
77  mrpt::obs::CSensoryFrame::Ptr observations,
78  mrpt::obs::CObservation::Ptr observation) = 0;
79  virtual void getDescriptiveReport(std::string* report_str) const;
80 
81  protected:
82  /**\brief Reset the given PDF method and assign a fixed high-certainty
83  * Covariance/Information matrix
84  */
85  void resetPDF(constraint_t* c);
86  /**\brief Check whether a new node should be registered in the
87  * graph.
88  *
89  * This should be the key-method in any implementation of this
90  * interface. Should call registerNewNodeAtEnd method if the registration
91  * condition is satisfied.
92  *
93  * \return True upon successful node registration in the graph
94  */
95  virtual bool checkRegistrationCondition();
96  /**\brief Utility methods for adding new poses to the graph.
97  */
98  /**\{*/
99  /** Add a new constraint at the end of the graph.
100  * \param[in] constraint Constraint transformation from the latest
101  * registered to the new node.
102  *
103  * \return True upon successful node registration.
104  */
105  bool registerNewNodeAtEnd(const typename GRAPH_T::constraint_t& constraint);
106  /**\brief Same goal as the previous method - uses the m_since_prev_node_PDF
107  * as the constraint at the end.
108  */
109  bool registerNewNodeAtEnd();
110  /**\brief Get a global_pose_t and fill the NODE_ANNOTATIONS-related fields
111  *
112  * \note Users are encouraged to override this method in case they have
113  * defined a new TNodeAnnotations struct and want to use this metadata in
114  * the graph nodes.
115  */
116  virtual void addNodeAnnotsToPose(global_pose_t* pose) const;
117  /**\}*/
118 
119  /**\brief Store the last registered NodeID.
120  *
121  * We don't store its pose since it will most likely change due to calls to
122  * the
123  * graph-optimization procedure / dijkstra_node_estimation
124  */
126  /**\brief Tracking the PDF of the current position of the robot with
127  * regards to the <b previous registered node</b>.
128  */
130  /**\brief Initial information matrix for paths
131  *
132  * Large values for this indicate that I am sure of the corresponding
133  * (initial) pose
134  */
136 };
137 } // namespace deciders
138 } // namespace graphslam
139 } // namespace mrpt
140 
142 
143 #endif /* end of include guard: CNODEREGISTRATIONDECIDER_H */
virtual global_pose_t getCurrentRobotPosEstimation() const
Getter method for fetching the currently estimated robot position.
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-observations (or observation-only) depending on th...
Interface for implementing node registration classes.
virtual void getDescriptiveReport(std::string *report_str) const
Fill the provided string with a detailed report of the decider/optimizer state.
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...
const GLubyte * c
Definition: glext.h:6313
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...
GLsizei const GLchar ** string
Definition: glext.h:4101
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
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.
uint64_t TNodeID
A generic numeric type for unique IDs of nodes or entities.
Definition: TNodeID.h:17
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 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019