Main MRPT website > C++ reference for MRPT 1.5.6
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 
13 
15 #include <mrpt/obs/CSensoryFrame.h>
16 #include <mrpt/obs/CObservation.h>
19 #include <mrpt/utils/TParameters.h>
20 #include <mrpt/utils/CTimeLogger.h>
22 
25 
26 
27 namespace mrpt { namespace graphslam { namespace deciders {
28 
29 /**\brief Interface for implementing node registration classes.
30  *
31  * CNodeRegistrationDecider provides the basic methods that have to exist in
32  * every node registration decider class. For an example of inheriting from
33  * this class see CFixedIntervalsNRD.
34  *
35  * \note As a naming convention, all the implemented node registration deciders
36  * are suffixed with the NRD acronym.
37  *
38  * \ingroup mrpt_graphslam_grp
39  */
40 template<class GRAPH_T>
43 {
44  public:
45  /**\brief Handy typedefs */
46  /**\{*/
47  /**\brief Parent of current class */
49  /**\brief type of graph constraints */
50  typedef typename GRAPH_T::constraint_t constraint_t;
51  /**\brief type of underlying poses (2D/3D). */
52  typedef typename GRAPH_T::constraint_t::type_value pose_t;
53  typedef typename GRAPH_T::global_pose_t global_pose_t;
54  typedef mrpt::math::CMatrixFixedNumeric<double,
55  constraint_t::state_length,
56  constraint_t::state_length> inf_mat_t;
57  /**\}*/
58 
59  /**\brief Default class constructor.*/
61  /**\brief Default class destructor.*/
62  virtual ~CNodeRegistrationDecider();
63  /**\brief Getter method for fetching the currently estimated robot position.
64  *
65  * In single-robot situations this is most likely going to be the last
66  * registered node position + an position/uncertainty increment from that
67  * position
68  */
70  /**\brief Generic method for fetching the incremental action-observations
71  * (or observation-only) depending on the rawlog format readings from the
72  * calling function.
73  *
74  * Implementations of this interface should use (part of) the specified
75  * parameters and call the checkRegistrationCondition to check for
76  * potential node registration
77  *
78  * \return True upon successful node registration in the graph
79  */
80  virtual bool updateState(
81  mrpt::obs::CActionCollectionPtr action,
82  mrpt::obs::CSensoryFramePtr observations,
83  mrpt::obs::CObservationPtr observation ) = 0;
84  virtual void getDescriptiveReport(std::string* report_str) const;
85 
86  protected:
87  /**\brief Reset the given PDF method and assign a fixed high-certainty
88  * Covariance/Information matrix
89  */
90  void resetPDF(constraint_t* c);
91  /**\brief Check whether a new node should be registered in the
92  * graph.
93  *
94  * This should be the key-method in any implementation of this
95  * interface. Should call registerNewNodeAtEnd method if the registration
96  * condition is satisfied.
97  *
98  * \return True upon successful node registration in the graph
99  */
100  virtual bool checkRegistrationCondition();
101  /**\brief Utility methods for adding new poses to the graph.
102  */
103  /**\{*/
104  /** Add a new constraint at the end of the graph.
105  * \param[in] constraint Constraint transformation from the latest
106  * registered to the new node.
107  *
108  * \return True upon successful node registration.
109  */
111  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 the
128  * graph-optimization procedure / dijkstra_node_estimation
129  */
131  /**\brief Tracking the PDF of the current position of the robot with
132  * regards to the <b previous registered node</b>.
133  */
135  /**\brief Initial information matrix for paths
136  *
137  * Large values for this indicate that I am sure of the corresponding
138  * (initial) pose
139  */
141 };
142 
143 } } } // end of namespaces
144 
146 
147 #endif /* end of include guard: CNODEREGISTRATIONDECIDER_H */
GRAPH_T::constraint_t::type_value pose_t
type of underlying poses (2D/3D).
mrpt::math::CMatrixFixedNumeric< double, constraint_t::state_length, constraint_t::state_length > inf_mat_t
Interface for implementing node registration classes.
const GLfloat * c
Definition: glew.h:10088
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...
virtual global_pose_t getCurrentRobotPosEstimation() const
Getter method for fetching the currently estimated robot position.
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.
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...
virtual void getDescriptiveReport(std::string *report_str) const
Fill the provided string with a detailed report of the decider/optimizer state.
inf_mat_t m_init_inf_mat
Initial information matrix for paths.
GLsizei const GLcharARB ** string
Definition: glew.h:3293
virtual bool updateState(mrpt::obs::CActionCollectionPtr action, mrpt::obs::CSensoryFramePtr observations, mrpt::obs::CObservationPtr observation)=0
Generic method for fetching the incremental action-observations (or observation-only) depending on th...
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.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018