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



Page generated by Doxygen 1.9.1 for MRPT 1.9.9 Git: 814d80880 Fri Aug 24 01:51:28 2018 +0200 at mar 26 may 2026 12:30:59 CEST