Main MRPT website > C++ reference for MRPT 1.9.9
CICPCriteriaNRD.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 CICPCRITERIANRD_H
11 #define CICPCRITERIANRD_H
12 
14 #include <mrpt/obs/CSensoryFrame.h>
19 
23 
24 #include <string>
25 
26 namespace mrpt
27 {
28 namespace graphslam
29 {
30 namespace deciders
31 {
32 /**\brief ICP-based Fixed Intervals Node Registration
33  *
34  * ## Description
35  *
36  * Current Decider is meant for adding nodes in 2D datasets recorded using
37  * a laser range finder or RGB-D camera (e.g. Kinect). No odometry data from
38  * encoders is needed. Using ICP to match consecutive RangeScan measurements,
39  * the decider keeps track of the pose transformation since the last registered
40  * node. If the norm or the angle of the latter surpasses certain thresholds
41  * (which are read from an external .ini file) then a new node is added to the
42  * graph)
43  * \sa loadParams, TParams::loadFromConfigFile
44  *
45  * Decider *does not guarantee* thread safety when accessing the GRAPH_T
46  * resource. This is handled by the CGraphSlamEngine class.
47  *
48  * ### Specifications
49  *
50  * - Map type: 2D
51  * - MRPT rawlog format: #1, #2
52  * - Graph Type: CPosePDFGaussianInf
53  * - Observations Used: CObservation2DRangeScan, CObservation3DRangeScan
54  * - Node Registration Strategy: Fixed Intervals
55  *
56  * ### .ini Configuration Parameters
57  *
58  * \htmlinclude config_params_preamble.txt
59  *
60  * - \b class_verbosity
61  * + \a Section : NodeRegistrationDeciderParameters
62  * + \a default value : 1 (mrpt::system::LVL_INFO)
63  * + \a Required : FALSE
64  *
65  * - \b registration_max_distance
66  * + \a Section : NodeRegistrationDeciderParameters
67  * + \a Default value : 0.5 // meters
68  * + \a Required : FALSE
69  *
70  * - \b registration_max_angle
71  * + \a Section : NodeRegistrationDeciderParameters
72  * + \a Default value : 10 // degrees
73  * + \a Required : FALSE
74  *
75  * \note Since the decider inherits from the CRangeScanOps
76  * class, it parses the configuration parameters of the latter as well from the
77  * "ICP" section. Refer to the CRangeScanOps documentation for
78  * its list of configuration
79  * parameters
80  *
81  * \note Class contains an instance of the TSlidingWindow class and it parses
82  * the configuration parameters of the latter from the
83  * "NodeRegistrationDeciderParameters" section. Refer to TSlidingWindow
84  * documentation for its list of configuration parameters
85  *
86  * \ingroup mrpt_graphslam_grp
87  */
88 template <class GRAPH_T>
91  GRAPH_T>,
93 {
94  public:
95  // Public functions
96  //////////////////////////////////////////////////////////////
97  /**\brief Handy typedefs */
98  /**\{*/
99  /**\brief type of graph constraints */
100  using constraint_t = typename GRAPH_T::constraint_t;
101  /**\brief type of underlying poses (2D/3D). */
102  using pose_t = typename GRAPH_T::constraint_t::type_value;
103  using global_pose_t = typename GRAPH_T::global_pose_t;
104 
106  double, constraint_t::state_length, constraint_t::state_length>;
107  /**\brief Typedef for accessing methods of the RangeScanRegistrationDecider
108  * parent class.
109  */
111  using decider_t = CICPCriteriaNRD<GRAPH_T>; /**< self type */
112  /**\brief Node Registration Decider */
113  using parent_t =
115  /**\}*/
116 
117  /**\brief Class constructor */
118  CICPCriteriaNRD();
119  /**\brief Class destructor */
121 
122  void loadParams(const std::string& source_fname);
123  void printParams() const;
124  void getDescriptiveReport(std::string* report_str) const;
125 
126  /**\brief Update the decider state using the latest dataset measurements.
127  *
128  * \note Depending on the observations at hand, update of the state is
129  * handled either by updateState2D, or by updateState3D methods. This
130  * helps in separating the 2D, 3D RangeScans handling altogether, which in
131  * turn simplifies the overall procedure
132  *
133  * Order of calls:
134  * updateState (calls) ==> updateState2D/3D ==>
135  * checkRegistrationCondition2D/3D ==> CheckRegistrationCondition
136  *
137  * \sa updateState2D, updateState3D
138  */
139  bool updateState(
141  mrpt::obs::CSensoryFrame::Ptr observations,
142  mrpt::obs::CObservation::Ptr observation);
143  /**\brief Specialized updateState method used solely when dealing with
144  * 2DRangeScan information.
145  * \sa updateState3D
146  */
148  /**\brief Specialized updateState method used solely when dealing with
149  * 3DRangeScan information.
150  * \sa updateState2D
151  */
153 
155  {
156  public:
157  TParams(decider_t& d);
158  ~TParams();
159 
160  decider_t& decider; /**< Reference to outer decider class */
161 
162  void loadFromConfigFile(
164  const std::string& section);
165  void dumpToTextStream(std::ostream& out) const;
166 
167  double registration_max_distance; /**< Maximum distance for new node
168  registration */
169  double registration_max_angle; /**< Maximum angle difference for new
170  node registration */
171  };
172 
173  // Public members
174  // ////////////////////////////
176 
177  protected:
178  // protected functions
179  //////////////////////////////////////////////////////////////
181  /**\brief Specialized checkRegistrationCondtion method used solely when
182  * dealing with 2DRangeScan information
183  * \sa checkRegistrationCondition3D
184  */
186  /**\brief Specialized checkRegistrationCondition method used solely when
187  * dealing with 3DRangeScan information
188  * \sa checkRegistrationCondition2D
189  */
191 
192  // protected members
193  //////////////////////////////////////////////////////////////
195 
196  /**\brief handy laser scans to use in the class methods
197  */
198  /**\{ */
199  /**\brief 2D LaserScan corresponding to the latest registered node in the
200  * graph */
202  /**\brief Current LaserScan. Set during the new measurements acquisition in
203  * updateState method
204  */
206 
209  /**\} */
210 
211  /**\brief Odometry rigid-body transformation since the last accepted
212  * LaserScan.
213  *
214  * Decider can use it to smoothen the trajectory in the case of high noise
215  * in the laser measurements
216  */
218  /**\brief pose_t estimation using only odometry information.
219  * \note Utilized only in observation-only rawlogs.
220  *
221  */
223  /**\brief pose_t estimation using only odometry information.
224  * \note Utilized only in observation-only rawlogs.
225  *
226  * Resets next time an ICP edge/Odometry measurement is utilized for
227  * updating the estimated robot position.
228  */
230  /**\brief Keeps track of the last N measurements between the ICP edge and
231  * the corresponding odometry measurements.
232  *
233  * Use the last odometry rigid body transformation instead of the
234  * ICP edge if the mahalanobis distance between them is greater than this
235  * limit.
236  */
238 
239  // criteria for adding new a new node
242 
243  /**How many times we used the ICP Edge instead of Odometry edge*/
245  /**How many times we used the Odometry Edge instead of the ICP edge */
247 };
248 } // namespace deciders
249 } // namespace graphslam
250 } // namespace mrpt
251 
252 #include "CICPCriteriaNRD_impl.h"
253 #endif /* end of include guard: CICPCRITERIANRD_H */
mrpt::obs::CObservation::Ptr
std::shared_ptr< CObservation > Ptr
Definition: CObservation.h:45
mrpt::graphslam::deciders::CNodeRegistrationDecider
Interface for implementing node registration classes.
Definition: CNodeRegistrationDecider.h:37
mrpt::graphslam::deciders::CICPCriteriaNRD::getDescriptiveReport
void getDescriptiveReport(std::string *report_str) const
Fill the provided string with a detailed report of the decider/optimizer state.
Definition: CICPCriteriaNRD_impl.h:318
mrpt::graphslam::deciders::CICPCriteriaNRD::TParams::registration_max_distance
double registration_max_distance
Maximum distance for new node registration.
Definition: CICPCriteriaNRD.h:167
mrpt::graphslam::deciders::CICPCriteriaNRD::checkRegistrationCondition
bool checkRegistrationCondition()
Check whether a new node should be registered in the graph.
Definition: CICPCriteriaNRD_impl.h:249
mrpt::obs::CSensoryFrame::Ptr
std::shared_ptr< CSensoryFrame > Ptr
Definition: CSensoryFrame.h:56
mrpt::graphslam::deciders::CICPCriteriaNRD::TParams
Definition: CICPCriteriaNRD.h:154
mrpt::graphslam::deciders::CICPCriteriaNRD::printParams
void printParams() const
Print the problem parameters - relevant to the decider/optimizer to the screen in a unified/compact w...
Definition: CICPCriteriaNRD_impl.h:306
mrpt::graphslam::deciders::CICPCriteriaNRD::checkRegistrationCondition2D
bool checkRegistrationCondition2D()
Specialized checkRegistrationCondtion method used solely when dealing with 2DRangeScan information.
Definition: CICPCriteriaNRD_impl.h:153
mrpt::graphslam::deciders::CICPCriteriaNRD::m_mahal_distance_ICP_odom
TSlidingWindow m_mahal_distance_ICP_odom
Keeps track of the last N measurements between the ICP edge and the corresponding odometry measuremen...
Definition: CICPCriteriaNRD.h:237
mrpt::graphslam::deciders::CICPCriteriaNRD::m_curr_odometry_only_pose
pose_t m_curr_odometry_only_pose
pose_t estimation using only odometry information.
Definition: CICPCriteriaNRD.h:222
mrpt::graphslam::deciders::CICPCriteriaNRD::m_last_laser_scan3D
mrpt::obs::CObservation3DRangeScan::Ptr m_last_laser_scan3D
Definition: CICPCriteriaNRD.h:207
mrpt::graphslam::deciders::CICPCriteriaNRD::m_is_using_3DScan
bool m_is_using_3DScan
Definition: CICPCriteriaNRD.h:194
mrpt::graphslam::deciders::CICPCriteriaNRD::m_use_angle_difference_node_reg
bool m_use_angle_difference_node_reg
Definition: CICPCriteriaNRD.h:240
mrpt::graphslam::CRegistrationDeciderOrOptimizer
Interface for implementing node/edge registration deciders or optimizer classes.
Definition: CRegistrationDeciderOrOptimizer.h:44
mrpt::graphslam::deciders::CNodeRegistrationDecider::constraint_t
typename GRAPH_T::constraint_t constraint_t
type of graph constraints
Definition: CNodeRegistrationDecider.h:46
CObservation3DRangeScan.h
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::graphslam::deciders::CICPCriteriaNRD::~CICPCriteriaNRD
~CICPCriteriaNRD()
Class destructor.
Definition: CICPCriteriaNRD_impl.h:45
CActionCollection.h
mrpt::graphslam::deciders::CICPCriteriaNRD::m_curr_laser_scan3D
mrpt::obs::CObservation3DRangeScan::Ptr m_curr_laser_scan3D
Definition: CICPCriteriaNRD.h:208
CRangeScanOps.h
mrpt::graphslam::deciders::CICPCriteriaNRD::updateState
bool updateState(mrpt::obs::CActionCollection::Ptr action, mrpt::obs::CSensoryFrame::Ptr observations, mrpt::obs::CObservation::Ptr observation)
Update the decider state using the latest dataset measurements.
Definition: CICPCriteriaNRD_impl.h:50
CICPCriteriaNRD_impl.h
source
GLsizei GLsizei GLchar * source
Definition: glext.h:4082
mrpt::graphslam::deciders::CICPCriteriaNRD::m_times_used_odom
int m_times_used_odom
How many times we used the Odometry Edge instead of the ICP edge.
Definition: CICPCriteriaNRD.h:246
CConfigFileBase.h
mrpt::graphslam::deciders::CICPCriteriaNRD::TParams::dumpToTextStream
void dumpToTextStream(std::ostream &out) const
This method should clearly display all the contents of the structure in textual form,...
Definition: CICPCriteriaNRD_impl.h:365
mrpt::graphslam::deciders::CICPCriteriaNRD::TParams::decider
decider_t & decider
Reference to outer decider class.
Definition: CICPCriteriaNRD.h:160
TSlidingWindow.h
mrpt::config::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: config/CConfigFileBase.h:44
mrpt::graphslam::deciders::CICPCriteriaNRD::m_last_laser_scan2D
mrpt::obs::CObservation2DRangeScan::Ptr m_last_laser_scan2D
handy laser scans to use in the class methods
Definition: CICPCriteriaNRD.h:201
mrpt::graphslam::deciders::CICPCriteriaNRD::checkRegistrationCondition3D
bool checkRegistrationCondition3D()
Specialized checkRegistrationCondition method used solely when dealing with 3DRangeScan information.
Definition: CICPCriteriaNRD_impl.h:242
mrpt::config::CLoadableOptions
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
Definition: config/CLoadableOptions.h:28
CNodeRegistrationDecider.h
mrpt::math::CMatrixFixedNumeric< double, constraint_t::state_length, constraint_t::state_length >
mrpt::graphslam::deciders::CICPCriteriaNRD::updateState3D
bool updateState3D(mrpt::obs::CObservation3DRangeScan::Ptr observation)
Specialized updateState method used solely when dealing with 3DRangeScan information.
Definition: CICPCriteriaNRD_impl.h:234
mrpt::graphslam::deciders::CICPCriteriaNRD::loadParams
void loadParams(const std::string &source_fname)
Load the necessary for the decider/optimizer configuration parameters.
Definition: CICPCriteriaNRD_impl.h:285
mrpt::obs::CObservation2DRangeScan::Ptr
std::shared_ptr< CObservation2DRangeScan > Ptr
Definition: CObservation2DRangeScan.h:58
mrpt::graphslam::deciders::CICPCriteriaNRD::CICPCriteriaNRD
CICPCriteriaNRD()
Class constructor.
Definition: CICPCriteriaNRD_impl.h:23
CSensoryFrame.h
mrpt::graphslam::deciders::CICPCriteriaNRD::updateState2D
bool updateState2D(mrpt::obs::CObservation2DRangeScan::Ptr observation)
Specialized updateState method used solely when dealing with 2DRangeScan information.
Definition: CICPCriteriaNRD_impl.h:130
CLoadableOptions.h
mrpt::graphslam::deciders::CNodeRegistrationDecider::pose_t
typename GRAPH_T::constraint_t::type_value pose_t
type of underlying poses (2D/3D).
Definition: CNodeRegistrationDecider.h:48
mrpt::graphslam::deciders::CICPCriteriaNRD::TParams::TParams
TParams(decider_t &d)
Definition: CICPCriteriaNRD_impl.h:357
mrpt::graphslam::deciders::CICPCriteriaNRD::TParams::~TParams
~TParams()
Definition: CICPCriteriaNRD_impl.h:361
mrpt::graphslam::deciders::CICPCriteriaNRD::m_latest_odometry_PDF
constraint_t m_latest_odometry_PDF
Odometry rigid-body transformation since the last accepted LaserScan.
Definition: CICPCriteriaNRD.h:217
mrpt::graphslam::TSlidingWindow
Class to monitor the evolution of a statistical quantity.
Definition: TSlidingWindow.h:45
mrpt::graphslam::deciders::CNodeRegistrationDecider::global_pose_t
typename GRAPH_T::global_pose_t global_pose_t
Definition: CNodeRegistrationDecider.h:49
mrpt::obs::CObservation3DRangeScan::Ptr
std::shared_ptr< CObservation3DRangeScan > Ptr
Definition: CObservation3DRangeScan.h:226
mrpt::graphslam::deciders::CICPCriteriaNRD::m_curr_laser_scan2D
mrpt::obs::CObservation2DRangeScan::Ptr m_curr_laser_scan2D
Current LaserScan.
Definition: CICPCriteriaNRD.h:205
mrpt::graphslam::deciders::CICPCriteriaNRD::TParams::registration_max_angle
double registration_max_angle
Maximum angle difference for new node registration.
Definition: CICPCriteriaNRD.h:169
mrpt::graphslam::deciders::CICPCriteriaNRD::TParams::loadFromConfigFile
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string &section)
This method load the options from a ".ini"-like file or memory-stored string list.
Definition: CICPCriteriaNRD_impl.h:386
mrpt::graphslam::deciders::CICPCriteriaNRD::m_use_distance_node_reg
bool m_use_distance_node_reg
Definition: CICPCriteriaNRD.h:241
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::graphslam::deciders::CICPCriteriaNRD::params
TParams params
Definition: CICPCriteriaNRD.h:175
mrpt::graphslam::deciders::CICPCriteriaNRD
ICP-based Fixed Intervals Node Registration.
Definition: CICPCriteriaNRD.h:89
mrpt::graphslam::deciders::CICPCriteriaNRD::m_last_odometry_only_pose
pose_t m_last_odometry_only_pose
pose_t estimation using only odometry information.
Definition: CICPCriteriaNRD.h:229
mrpt::obs::CActionCollection::Ptr
std::shared_ptr< CActionCollection > Ptr
Definition: CActionCollection.h:30
mrpt::graphslam::deciders::CICPCriteriaNRD::m_times_used_ICP
int m_times_used_ICP
How many times we used the ICP Edge instead of Odometry edge.
Definition: CICPCriteriaNRD.h:244
mrpt::graphslam::deciders::CRangeScanOps
Class for keeping together all the RangeScanner-related functions.
Definition: CRangeScanOps.h:76
CObservation2DRangeScan.h



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST