Main MRPT website > C++ reference for MRPT 1.9.9
CFixedIntervalsNRD.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 CFIXEDINTERVALSNRD_H
11 #define CFIXEDINTERVALSNRD_H
12 
14 #include <mrpt/obs/CSensoryFrame.h>
16 #include <mrpt/obs/CRawlog.h>
18 #include <mrpt/utils/CConfigFile.h>
20 #include <mrpt/utils/CStream.h>
22 
24 
25 #include <iostream>
26 
27 namespace mrpt
28 {
29 namespace graphslam
30 {
31 namespace deciders
32 {
33 /**\brief Fixed Intervals Odometry-based Node Registration
34  *
35  * ## Description
36  *
37  * Determine whether to insert a new pose in the graph given the distance and
38  * angle thresholds. When the odometry readings indicate that any of the
39  * thresholds has been surpassed, with regards to the previous registered
40  * pose, a new node is added in the graph.
41  *
42  * Current decider is a minimal, simple implementation of the
43  * CNodeRegistrationDecider interface which can be used for 2D datasets.
44  * Decider *does not guarantee* thread safety when accessing the GRAPH_T
45  * resource. This is handled by the CGraphSlamEngine instance.
46  *
47  * ### Specifications
48  *
49  * - Map type: 2D
50  * - MRPT rawlog format: #1, #2
51  * - Graph Type: CPosePDFGaussianInf
52  * - Observations Used: CObservationOdometry, CActionRobotMovement2D
53  * - Node Registration Strategy: Fixed Odometry Intervals
54  *
55  * ### .ini Configuration Parameters
56  *
57  * \htmlinclude graphslam-engine_config_params_preamble.txt
58  *
59  * - \b class_verbosity
60  * + \a Section : NodeRegistrationDeciderParameters
61  * + \a Default value : 1 (LVL_INFO)
62  * + \a Required : FALSE
63  *
64  * - \b registration_max_distance
65  * + \a Section : NodeRegistrationDeciderParameters
66  * + \a Default value : 0.5 // meters
67  * + \a Required : FALSE
68  *
69  * - \b registration_max_angle
70  * + \a Section : NodeRegistrationDeciderParameters
71  * + \a Default value : 60 // degrees
72  * + \a Required : FALSE
73  *
74  * \ingroup mrpt_graphslam_grp
75  */
76 template <class GRAPH_T = typename mrpt::graphs::CNetworkOfPoses2DInf>
79  GRAPH_T>
80 {
81  public:
82  // Public functions
83  //////////////////////////////////////////////////////////////
84 
85  /**\brief Handy typedefs */
86  /**\{*/
87  /**\brief Node Registration Decider */
90 
91  /**\brief type of graph constraints */
92  typedef typename GRAPH_T::constraint_t constraint_t;
93  /**\brief type of underlying poses (2D/3D). */
94  typedef typename GRAPH_T::constraint_t::type_value pose_t;
95  typedef typename GRAPH_T::global_pose_t global_pose_t;
96 
97  typedef mrpt::math::CMatrixFixedNumeric<double, constraint_t::state_length,
98  constraint_t::state_length>
100  /**\brief Node Registration Decider */
103  /**\}*/
104 
105  /**\brief Class constructor */
107  /**\brief Class destructor */
109 
110  void loadParams(const std::string& source_fname);
111  void printParams() const;
112  void getDescriptiveReport(std::string* report_str) const;
113 
114  /**\brief Method makes use of the CActionCollection/CObservation to update
115  * the
116  * odometry estimation from the last inserted pose
117  *
118  * \return True upon successful node registration in the graph
119  */
120  bool updateState(
122  mrpt::obs::CSensoryFrame::Ptr observations,
123  mrpt::obs::CObservation::Ptr observation);
124 
125  /**\brief Parameters structure for managing the relevant to the decider
126  * variables in a compact manner
127  */
129  {
130  public:
131  TParams();
132  ~TParams();
133 
134  void loadFromConfigFile(
136  const std::string& section);
137  void dumpToTextStream(mrpt::utils::CStream& out) const;
138  /**\brief Return a string with the configuration parameters
139  */
140  void getAsString(std::string* params_out) const;
141  std::string getAsString() const;
142 
143  // max values for new node registration
146  };
147 
148  // Public members
149  // ////////////////////////////
151 
152  protected:
153  // protected functions
154  //////////////////////////////////////////////////////////////
155  /**\name Registration Conditions Specifiers
156  */
157  /**\{ */
158  /**\brief If estimated position surpasses the registration max values since
159  * the previous registered node, register a new node in the graph.
160  *
161  * \return True on successful registration.
162  */
165  const mrpt::poses::CPose2D& p1, const mrpt::poses::CPose2D& p2) const;
167  const mrpt::poses::CPose3D& p1, const mrpt::poses::CPose3D& p2) const;
168  /**\} */
169 
170  // protected members
171  //////////////////////////////////////////////////////////////
172 
173  /**\brief pose_t estimation using only odometry information. Handy for
174  * observation-only rawlogs.
175  */
177  /**\brief pose_t estimation using only odometry information. Handy for
178  * observation-only rawlogs.
179  */
181  /**\brief Keep track of whether we are reading from an observation-only
182  * rawlog file or from an action-observation rawlog
183  */
185 };
186 }
187 }
188 } // end of namespaces
189 
190 #include "CFixedIntervalsNRD_impl.h"
191 #endif /* end of include guard: CFIXEDINTERVALSNRD_H */
mrpt::graphslam::deciders::CNodeRegistrationDecider< GRAPH_T > node_reg
Handy typedefs.
GRAPH_T::constraint_t::type_value pose_t
type of underlying poses (2D/3D).
Interface for implementing node registration classes.
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string &section)
This method load the options from a ".ini"-like file or memory-stored string list.
bool m_observation_only_rawlog
Keep track of whether we are reading from an observation-only rawlog file or from an action-observati...
This class allows loading and storing values and vectors of different types from a configuration text...
void printParams() const
Print the problem parameters - relevant to the decider/optimizer to the screen in a unified/compact w...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:41
A numeric matrix of compile-time fixed size.
GRAPH_T::constraint_t constraint_t
type of graph constraints
bool checkRegistrationCondition()
If estimated position surpasses the registration max values since the previous registered node...
std::shared_ptr< CSensoryFrame > Ptr
Definition: CSensoryFrame.h:56
mrpt::math::CMatrixFixedNumeric< double, constraint_t::state_length, constraint_t::state_length > inf_mat_t
std::shared_ptr< CObservation > Ptr
Definition: CObservation.h:43
void dumpToTextStream(mrpt::utils::CStream &out) const
This method should clearly display all the contents of the structure in textual form, sending it to a CStream.
mrpt::graphslam::deciders::CNodeRegistrationDecider< GRAPH_T > parent_t
Node Registration Decider.
GLsizei const GLchar ** string
Definition: glext.h:4101
bool updateState(mrpt::obs::CActionCollection::Ptr action, mrpt::obs::CSensoryFrame::Ptr observations, mrpt::obs::CObservation::Ptr observation)
Method makes use of the CActionCollection/CObservation to update the odometry estimation from the las...
void loadParams(const std::string &source_fname)
Load the necessary for the decider/optimizer configuration parameters.
GRAPH_T::constraint_t::type_value pose_t
type of underlying poses (2D/3D).
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
pose_t m_last_odometry_only_pose
pose_t estimation using only odometry information.
std::shared_ptr< CActionCollection > Ptr
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
Definition: CPose2D.h:40
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
pose_t m_curr_odometry_only_pose
pose_t estimation using only odometry information.
Fixed Intervals Odometry-based Node Registration.
GLsizei GLsizei GLchar * source
Definition: glext.h:4082
Parameters structure for managing the relevant to the decider variables in a compact manner...
void getDescriptiveReport(std::string *report_str) const
Fill the provided string with a detailed report of the decider/optimizer state.
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...



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