Main MRPT website > C++ reference for MRPT 1.5.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 #include <mrpt/system/threads.h>
23 
25 
26 #include <iostream>
27 
28 namespace mrpt { namespace graphslam { namespace deciders {
29 
30 /**\brief Fixed Intervals Odometry-based Node Registration
31  *
32  * ## Description
33  *
34  * Determine whether to insert a new pose in the graph given the distance and
35  * angle thresholds. When the odometry readings indicate that any of the
36  * thresholds has been surpassed, with regards to the previous registered
37  * pose, a new node is added in the graph.
38  *
39  * Current decider is a minimal, simple implementation of the
40  * CNodeRegistrationDecider interface which can be used for 2D datasets.
41  * Decider *does not guarantee* thread safety when accessing the GRAPH_T
42  * resource. This is handled by the CGraphSlamEngine instance.
43  *
44  * ### Specifications
45  *
46  * - Map type: 2D
47  * - MRPT rawlog format: #1, #2
48  * - Graph Type: CPosePDFGaussianInf
49  * - Observations Used: CObservationOdometry, CActionRobotMovement2D
50  * - Node Registration Strategy: Fixed Odometry Intervals
51  *
52  * ### .ini Configuration Parameters
53  *
54  * \htmlinclude graphslam-engine_config_params_preamble.txt
55  *
56  * - \b class_verbosity
57  * + \a Section : NodeRegistrationDeciderParameters
58  * + \a Default value : 1 (LVL_INFO)
59  * + \a Required : FALSE
60  *
61  * - \b registration_max_distance
62  * + \a Section : NodeRegistrationDeciderParameters
63  * + \a Default value : 0.5 // meters
64  * + \a Required : FALSE
65  *
66  * - \b registration_max_angle
67  * + \a Section : NodeRegistrationDeciderParameters
68  * + \a Default value : 60 // degrees
69  * + \a Required : FALSE
70  *
71  * \ingroup mrpt_graphslam_grp
72  */
73 template<class GRAPH_T=typename mrpt::graphs::CNetworkOfPoses2DInf>
76 {
77  public:
78  // Public functions
79  //////////////////////////////////////////////////////////////
80 
81  /**\brief Handy typedefs */
82  /**\{*/
83  /**\brief Node Registration Decider */
85 
86  /**\brief type of graph constraints */
87  typedef typename GRAPH_T::constraint_t constraint_t;
88  /**\brief type of underlying poses (2D/3D). */
89  typedef typename GRAPH_T::constraint_t::type_value pose_t;
90  typedef typename GRAPH_T::global_pose_t global_pose_t;
91 
92  typedef mrpt::math::CMatrixFixedNumeric<double,
93  constraint_t::state_length,
94  constraint_t::state_length> inf_mat_t;
95  /**\brief Node Registration Decider */
97  /**\}*/
98 
99  /**\brief Class constructor */
101  /**\brief Class destructor */
103 
104 
105  void loadParams(const std::string& source_fname);
106  void printParams() const;
107  void getDescriptiveReport(std::string* report_str) const;
108 
109  /**\brief Method makes use of the CActionCollection/CObservation to update the
110  * odometry estimation from the last inserted pose
111  *
112  * \return True upon successful node registration in the graph
113  */
114  bool updateState( mrpt::obs::CActionCollectionPtr action,
115  mrpt::obs::CSensoryFramePtr observations,
116  mrpt::obs::CObservationPtr observation );
117 
118  /**\brief Parameters structure for managing the relevant to the decider
119  * variables in a compact manner
120  */
122  public:
123  TParams();
124  ~TParams();
125 
126  void loadFromConfigFile(
128  const std::string &section);
129  void dumpToTextStream(mrpt::utils::CStream &out) const;
130  /**\brief Return a string with the configuration parameters
131  */
132  void getAsString(std::string* params_out) const;
133  std::string getAsString() const;
134 
135  // max values for new node registration
138  };
139 
140  // Public members
141  // ////////////////////////////
143 
144  protected:
145  // protected functions
146  //////////////////////////////////////////////////////////////
147  /**\name Registration Conditions Specifiers
148  */
149  /**\{ */
150  /**\brief If estimated position surpasses the registration max values since
151  * the previous registered node, register a new node in the graph.
152  *
153  * \return True on successful registration.
154  */
157  const mrpt::poses::CPose2D& p1,
158  const mrpt::poses::CPose2D& p2) const;
160  const mrpt::poses::CPose3D& p1,
161  const mrpt::poses::CPose3D& p2) const;
162  /**\} */
163 
164  // protected members
165  //////////////////////////////////////////////////////////////
166 
167  /**\brief pose_t estimation using only odometry information. Handy for
168  * observation-only rawlogs.
169  */
171  /**\brief pose_t estimation using only odometry information. Handy for
172  * observation-only rawlogs.
173  */
175  /**\brief Keep track of whether we are reading from an observation-only
176  * rawlog file or from an action-observation rawlog
177  */
179 
180 };
181 
182 } } } // end of namespaces
183 
184 #include "CFixedIntervalsNRD_impl.h"
185 #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:38
A numeric matrix of compile-time fixed size.
GRAPH_T::constraint_t constraint_t
type of graph constraints
bool updateState(mrpt::obs::CActionCollectionPtr action, mrpt::obs::CSensoryFramePtr observations, mrpt::obs::CObservationPtr observation)
Method makes use of the CActionCollection/CObservation to update the odometry estimation from the las...
bool checkRegistrationCondition()
If estimated position surpasses the registration max values since the previous registered node...
mrpt::math::CMatrixFixedNumeric< double, constraint_t::state_length, constraint_t::state_length > inf_mat_t
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:3919
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.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
Definition: CPose2D.h:36
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:72
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:3908
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.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020