MRPT  1.9.9
CRangeScanOps.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #pragma once
11 
14 #include <mrpt/maps/CPointsMap.h>
17 #include <mrpt/poses/CPose2D.h>
18 #include <mrpt/slam/CICP.h>
19 
21 {
22 /**\brief Class for keeping together all the RangeScanner-related functions.
23  *
24  * ## Description
25  *
26  * Deciders that make use of either 2DRangeScans (laser generated
27  * observations) or 3DRangeScans (RGBD-cameras) can inherit from
28  * this class in case they want to use the underlying methods
29  *
30  * ### .ini Configuration Parameters
31  *
32  * \htmlinclude graphslam-engine_config_params_preamble.txt
33  *
34  * - \b conversion_sensor_label
35  * + \a Default value : "KINECT_TO_2D_SCAN"
36  * + \a Required : FALSE
37  * + \a Description : Applicable only when dealing with 3DRangeScans.
38  * Used for converting 3DRangeScan to 2DRangesScan so that they are
39  * visualized on the 2D surface
40  *
41  * - \b conversion_angle_sup
42  * + \a Default value : 10
43  * + \a Required : FALSE
44  * + \a Description : Applicable only when dealing with 3DRangeScans.
45  * Used for converting 3DRangeScan to 2DRangesScan so that they are
46  * visualized on the 2D surface
47  *
48  * - \b conversion_angle_inf
49  * + \a Default value : 10
50  * + \a Required : FALSE
51  * + \a Description : Applicable only when dealing with 3DRangeScans.
52  * Used for converting 3DRangeScan to 2DRangesScan so that they are
53  * visualized on the 2D surface
54  *
55  * - \b conversion_oversampling_ratio
56  * + \a Default value : 1.1
57  * + \a Required : FALSE
58  * + \a Description : Applicable only when dealing with 3DRangeScans.
59  * Used for converting 3DRangeScan to 2DRangesScan so that they are
60  * visualized on the 2D surface
61  *
62  * \note Class contains an instance of the mrpt::slam::CICP class and it parses
63  * the configuration parameters of the latter from the
64  * "ICP" section. Refer to
65  * mrpt::slam::CICP documentation for its list of
66  * configuration parameters
67  *
68  * \ingroup mrpt_graphslam_grp
69  */
70 template <class GRAPH_T = typename mrpt::graphs::CNetworkOfPoses2DInf>
72 {
73  using constraint_t = typename GRAPH_T::constraint_t;
75 
76  protected:
77  /**\brief Align the 2D range scans provided and fill the potential edge that
78  * can transform the one into the other.
79  *
80  * User can optionally ask that additional information be returned in a
81  * TReturnInfo struct
82  */
83  void getICPEdge(
86  const mrpt::poses::CPose2D* initial_pose = nullptr,
87  mrpt::slam::CICP::TReturnInfo* icp_info = nullptr);
88  /**\brief Align the 3D range scans provided and find the potential edge that
89  * can transform the one into the other.
90  *
91  * Fills the 2D part (rel_edge) of the 3D constraint between the scans,
92  * since
93  * we are interested in computing the 2D alignment. User can optionally ask
94  * that additional information be returned in a TReturnInfo struct
95  */
96  void getICPEdge(
99  const mrpt::poses::CPose2D* initial_pose = nullptr,
100  mrpt::slam::CICP::TReturnInfo* icp_info = nullptr);
101  /**\brief Reduce the size of the given CPointsMap by keeping one out of
102  * "keep_point_every" points.
103  *
104  * \note If low_lim is set then the PointsMap will contain at least low_lim
105  * measurements, regardless of keep_point_every value. Set low_lim to 0 if
106  * no
107  * lower limit is to be specified
108  */
109  void decimatePointsMap(
110  mrpt::maps::CPointsMap* m, size_t keep_point_every = 4,
111  size_t low_lim = 0);
112  /**\brief Wrapper around the CObservation3DRangeScan::convertTo2DScan
113  * corresponding method
114  *
115  * \return True if operation was successful, false otherwise
116  */
120 
122  {
123  public:
124  TParams() = default;
125  ~TParams() override = default;
126 
127  void loadFromConfigFile(
128  const mrpt::config::CConfigFileBase& source,
129  const std::string& section) override;
130  void dumpToTextStream(std::ostream& out) const override;
131 
133 
134  /**\brief Struct holding the parameters of 3D to the corresponding 2D
135  * range scan conversion.
136  */
138 
139  bool has_read_config = false;
140  };
142 };
143 } // namespace mrpt::graphslam::deciders
144 #include "CRangeScanOps_impl.h"
void dumpToTextStream(std::ostream &out) const override
This method should clearly display all the contents of the structure in textual form, sending it to a std::ostream.
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
bool convert3DTo2DRangeScan(mrpt::obs::CObservation3DRangeScan::Ptr &scan3D_in, mrpt::obs::CObservation2DRangeScan::Ptr *scan2D_out)
Wrapper around the CObservation3DRangeScan::convertTo2DScan corresponding method. ...
Several implementations of ICP (Iterative closest point) algorithms for aligning two point maps or a ...
Definition: CICP.h:64
void getICPEdge(const mrpt::obs::CObservation2DRangeScan &from, const mrpt::obs::CObservation2DRangeScan &to, constraint_t *rel_edge, const mrpt::poses::CPose2D *initial_pose=nullptr, mrpt::slam::CICP::TReturnInfo *icp_info=nullptr)
Align the 2D range scans provided and fill the potential edge that can transform the one into the oth...
mrpt::obs::T3DPointsTo2DScanParams conversion_params
Struct holding the parameters of 3D to the corresponding 2D range scan conversion.
Declares a class derived from "CObservation" that encapsules a 3D range scan measurement, as from a time-of-flight range camera or any other RGBD sensor.
void decimatePointsMap(mrpt::maps::CPointsMap *m, size_t keep_point_every=4, size_t low_lim=0)
Reduce the size of the given CPointsMap by keeping one out of "keep_point_every" points.
typename GRAPH_T::constraint_t constraint_t
Definition: CRangeScanOps.h:73
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors...
Definition: CPointsMap.h:65
This class allows loading and storing values and vectors of different types from a configuration text...
Used in CObservation3DRangeScan::convertTo2DScan()
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string &section) override
This method load the options from a ".ini"-like file or memory-stored string list.
Class for keeping together all the RangeScanner-related functions.
Definition: CRangeScanOps.h:71
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
Definition: CPose2D.h:39
mrpt::vision::TStereoCalibResults out
The ICP algorithm return information.
Definition: CICP.h:190



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: d8fdc6279 Wed Feb 26 00:43:17 2020 +0100 at miƩ feb 26 00:45:09 CET 2020