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 
20 {
21 /**\brief Interface for implementing node registration classes.
22  *
23  * CNodeRegistrationDecider provides the basic methods that have to exist in
24  * every node registration decider class. For an example of inheriting from
25  * this class see CFixedIntervalsNRD.
26  *
27  * \note As a naming convention, all the implemented node registration deciders
28  * are suffixed with the NRD acronym.
29  *
30  * \ingroup mrpt_graphslam_grp
31  */
32 template <class GRAPH_T>
34  : public virtual mrpt::graphslam::CRegistrationDeciderOrOptimizer<GRAPH_T>
35 {
36  public:
37  /**\brief Handy typedefs */
38  /**\{*/
39  /**\brief Parent of current class */
41  /**\brief type of graph constraints */
42  using constraint_t = typename GRAPH_T::constraint_t;
43  /**\brief type of underlying poses (2D/3D). */
44  using pose_t = typename GRAPH_T::constraint_t::type_value;
45  using global_pose_t = typename GRAPH_T::global_pose_t;
47  double, constraint_t::state_length, constraint_t::state_length>;
48  /**\}*/
49 
50  /**\brief Default class constructor.*/
52  /**\brief Default class destructor.*/
53  virtual ~CNodeRegistrationDecider();
54  /**\brief Getter method for fetching the currently estimated robot position.
55  *
56  * In single-robot situations this is most likely going to be the last
57  * registered node position + an position/uncertainty increment from that
58  * position
59  */
61  /**\brief Generic method for fetching the incremental action-observations
62  * (or observation-only) depending on the rawlog format readings from the
63  * calling function.
64  *
65  * Implementations of this interface should use (part of) the specified
66  * parameters and call the checkRegistrationCondition to check for
67  * potential node registration
68  *
69  * \return True upon successful node registration in the graph
70  */
71  virtual bool updateState(
73  mrpt::obs::CSensoryFrame::Ptr observations,
74  mrpt::obs::CObservation::Ptr observation) = 0;
75  virtual void getDescriptiveReport(std::string* report_str) const;
76 
77  protected:
78  /**\brief Reset the given PDF method and assign a fixed high-certainty
79  * Covariance/Information matrix
80  */
81  void resetPDF(constraint_t* c);
82  /**\brief Check whether a new node should be registered in the
83  * graph.
84  *
85  * This should be the key-method in any implementation of this
86  * interface. Should call registerNewNodeAtEnd method if the registration
87  * condition is satisfied.
88  *
89  * \return True upon successful node registration in the graph
90  */
91  virtual bool checkRegistrationCondition();
92  /**\brief Utility methods for adding new poses to the graph.
93  */
94  /**\{*/
95  /** Add a new constraint at the end of the graph.
96  * \param[in] constraint Constraint transformation from the latest
97  * registered to the new node.
98  *
99  * \return True upon successful node registration.
100  */
101  bool registerNewNodeAtEnd(const typename GRAPH_T::constraint_t& constraint);
102  /**\brief Same goal as the previous method - uses the m_since_prev_node_PDF
103  * as the constraint at the end.
104  */
105  bool registerNewNodeAtEnd();
106  /**\brief Get a global_pose_t and fill the NODE_ANNOTATIONS-related fields
107  *
108  * \note Users are encouraged to override this method in case they have
109  * defined a new TNodeAnnotations struct and want to use this metadata in
110  * the graph nodes.
111  */
112  virtual void addNodeAnnotsToPose(global_pose_t* pose) const;
113  /**\}*/
114 
115  /**\brief Store the last registered NodeID.
116  *
117  * We don't store its pose since it will most likely change due to calls to
118  * the
119  * graph-optimization procedure / dijkstra_node_estimation
120  */
122  /**\brief Tracking the PDF of the current position of the robot with
123  * regards to the <b previous registered node</b>.
124  */
126  /**\brief Initial information matrix for paths
127  *
128  * Large values for this indicate that I am sure of the corresponding
129  * (initial) pose
130  */
132 };
133 }
135 
136 #endif /* end of include guard: CNODEREGISTRATIONDECIDER_H */
137 
138 
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
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: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 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020