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-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 CNODEREGISTRATIONDECIDER_H
11 #define CNODEREGISTRATIONDECIDER_H
12 
14 #include <mrpt/obs/CSensoryFrame.h>
15 #include <mrpt/obs/CObservation.h>
17 #include <mrpt/utils/TParameters.h>
18 #include <mrpt/utils/CTimeLogger.h>
20 
23 
24 namespace mrpt
25 {
26 namespace graphslam
27 {
28 namespace deciders
29 {
30 /**\brief Interface for implementing node registration classes.
31  *
32  * CNodeRegistrationDecider provides the basic methods that have to exist in
33  * every node registration decider class. For an example of inheriting from
34  * this class see CFixedIntervalsNRD.
35  *
36  * \note As a naming convention, all the implemented node registration deciders
37  * are suffixed with the NRD acronym.
38  *
39  * \ingroup mrpt_graphslam_grp
40  */
41 template <class GRAPH_T>
43  : public virtual mrpt::graphslam::CRegistrationDeciderOrOptimizer<GRAPH_T>
44 {
45  public:
46  /**\brief Handy typedefs */
47  /**\{*/
48  /**\brief Parent of current class */
50  /**\brief type of graph constraints */
51  typedef typename GRAPH_T::constraint_t constraint_t;
52  /**\brief type of underlying poses (2D/3D). */
53  typedef typename GRAPH_T::constraint_t::type_value pose_t;
54  typedef typename GRAPH_T::global_pose_t global_pose_t;
55  typedef mrpt::math::CMatrixFixedNumeric<double, constraint_t::state_length,
56  constraint_t::state_length>
58  /**\}*/
59 
60  /**\brief Default class constructor.*/
62  /**\brief Default class destructor.*/
63  virtual ~CNodeRegistrationDecider();
64  /**\brief Getter method for fetching the currently estimated robot position.
65  *
66  * In single-robot situations this is most likely going to be the last
67  * registered node position + an position/uncertainty increment from that
68  * position
69  */
71  /**\brief Generic method for fetching the incremental action-observations
72  * (or observation-only) depending on the rawlog format readings from the
73  * calling function.
74  *
75  * Implementations of this interface should use (part of) the specified
76  * parameters and call the checkRegistrationCondition to check for
77  * potential node registration
78  *
79  * \return True upon successful node registration in the graph
80  */
81  virtual bool updateState(
83  mrpt::obs::CSensoryFrame::Ptr observations,
84  mrpt::obs::CObservation::Ptr observation) = 0;
85  virtual void getDescriptiveReport(std::string* report_str) const;
86 
87  protected:
88  /**\brief Reset the given PDF method and assign a fixed high-certainty
89  * Covariance/Information matrix
90  */
91  void resetPDF(constraint_t* c);
92  /**\brief Check whether a new node should be registered in the
93  * graph.
94  *
95  * This should be the key-method in any implementation of this
96  * interface. Should call registerNewNodeAtEnd method if the registration
97  * condition is satisfied.
98  *
99  * \return True upon successful node registration in the graph
100  */
101  virtual bool checkRegistrationCondition();
102  /**\brief Utility methods for adding new poses to the graph.
103  */
104  /**\{*/
105  /** Add a new constraint at the end of the graph.
106  * \param[in] constraint Constraint transformation from the latest
107  * registered to the new node.
108  *
109  * \return True upon successful node registration.
110  */
111  bool registerNewNodeAtEnd(const typename GRAPH_T::constraint_t& constraint);
112  /**\brief Same goal as the previous method - uses the m_since_prev_node_PDF
113  * as the constraint at the end.
114  */
115  bool registerNewNodeAtEnd();
116  /**\brief Get a global_pose_t and fill the NODE_ANNOTATIONS-related fields
117  *
118  * \note Users are encouraged to override this method in case they have
119  * defined a new TNodeAnnotations struct and want to use this metadata in
120  * the graph nodes.
121  */
122  virtual void addNodeAnnotsToPose(global_pose_t* pose) const;
123  /**\}*/
124 
125  /**\brief Store the last registered NodeID.
126  *
127  * We don't store its pose since it will most likely change due to calls to
128  * the
129  * graph-optimization procedure / dijkstra_node_estimation
130  */
132  /**\brief Tracking the PDF of the current position of the robot with
133  * regards to the <b previous registered node</b>.
134  */
136  /**\brief Initial information matrix for paths
137  *
138  * Large values for this indicate that I am sure of the corresponding
139  * (initial) pose
140  */
142 };
143 }
144 }
145 } // end of namespaces
146 
148 
149 #endif /* end of include guard: CNODEREGISTRATIONDECIDER_H */
virtual global_pose_t getCurrentRobotPosEstimation() const
Getter method for fetching the currently estimated robot position.
GRAPH_T::constraint_t::type_value pose_t
type of underlying poses (2D/3D).
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...
mrpt::math::CMatrixFixedNumeric< double, constraint_t::state_length, constraint_t::state_length > inf_mat_t
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::graphslam::CRegistrationDeciderOrOptimizer< GRAPH_T > parent_t
Handy typedefs.
bool registerNewNodeAtEnd()
Same goal as the previous method - uses the m_since_prev_node_PDF as the constraint at the end...
GRAPH_T::constraint_t constraint_t
type of graph constraints
A numeric matrix of compile-time fixed size.
uint64_t TNodeID
The type for node IDs in graphs of different types.
const GLubyte * c
Definition: glext.h:6313
Interface for implementing node/edge registration deciders or optimizer classes.
std::shared_ptr< CSensoryFrame > Ptr
Definition: CSensoryFrame.h:56
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...
std::shared_ptr< CObservation > Ptr
Definition: CObservation.h:43
GLsizei const GLchar ** string
Definition: glext.h:4101
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::shared_ptr< CActionCollection > Ptr
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.
mrpt::utils::TNodeID m_prev_registered_nodeID
Store the last registered NodeID.
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: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019