MRPT  1.9.9
CRangeScanOps.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 CRANGESCANOPS_H
11 #define CRANGESCANOPS_H
12 
17 #include <mrpt/maps/CPointsMap.h>
18 #include <mrpt/poses/CPose2D.h>
19 #include <mrpt/slam/CICP.h>
20 
22 {
23 /**\brief Class for keeping together all the RangeScanner-related functions.
24  *
25  * ## Description
26  *
27  * Deciders that make use of either 2DRangeScans (laser generated
28  * observations) or 3DRangeScans (RGBD-cameras) can inherit from
29  * this class in case they want to use the underlying methods
30  *
31  * ### .ini Configuration Parameters
32  *
33  * \htmlinclude graphslam-engine_config_params_preamble.txt
34  *
35  * - \b conversion_sensor_label
36  * + \a Default value : "KINECT_TO_2D_SCAN"
37  * + \a Required : FALSE
38  * + \a Description : Applicable only when dealing with 3DRangeScans.
39  * Used for converting 3DRangeScan to 2DRangesScan so that they are
40  * visualized on the 2D surface
41  *
42  * - \b conversion_angle_sup
43  * + \a Default value : 10
44  * + \a Required : FALSE
45  * + \a Description : Applicable only when dealing with 3DRangeScans.
46  * Used for converting 3DRangeScan to 2DRangesScan so that they are
47  * visualized on the 2D surface
48  *
49  * - \b conversion_angle_inf
50  * + \a Default value : 10
51  * + \a Required : FALSE
52  * + \a Description : Applicable only when dealing with 3DRangeScans.
53  * Used for converting 3DRangeScan to 2DRangesScan so that they are
54  * visualized on the 2D surface
55  *
56  * - \b conversion_oversampling_ratio
57  * + \a Default value : 1.1
58  * + \a Required : FALSE
59  * + \a Description : Applicable only when dealing with 3DRangeScans.
60  * Used for converting 3DRangeScan to 2DRangesScan so that they are
61  * visualized on the 2D surface
62  *
63  * \note Class contains an instance of the mrpt::slam::CICP class and it parses
64  * the configuration parameters of the latter from the
65  * "ICP" section. Refer to
66  * mrpt::slam::CICP documentation for its list of
67  * configuration parameters
68  *
69  * \ingroup mrpt_graphslam_grp
70  */
71 template <class GRAPH_T = typename mrpt::graphs::CNetworkOfPoses2DInf>
73 {
74  /**\brief Handy typedefs */
75  /**\{*/
76  using constraint_t = typename GRAPH_T::constraint_t;
78  /**\}*/
79 
80  protected:
81  // Protected methods
82  // ////////////////////////////////////////////////////////////
83 
84  /**\brief Align the 2D range scans provided and fill the potential edge that
85  * can transform the one into the other.
86  *
87  * User can optionally ask that additional information be returned in a
88  * TReturnInfo struct
89  */
90  void getICPEdge(
93  const mrpt::poses::CPose2D* initial_pose = nullptr,
94  mrpt::slam::CICP::TReturnInfo* icp_info = nullptr);
95  /**\brief Align the 3D range scans provided and find the potential edge that
96  * can transform the one into the other.
97  *
98  * Fills the 2D part (rel_edge) of the 3D constraint between the scans,
99  * since
100  * we are interested in computing the 2D alignment. User can optionally ask
101  * that additional information be returned in a TReturnInfo struct
102  */
103  void getICPEdge(
106  const mrpt::poses::CPose2D* initial_pose = nullptr,
107  mrpt::slam::CICP::TReturnInfo* icp_info = nullptr);
108  /**\brief Reduce the size of the given CPointsMap by keeping one out of
109  * "keep_point_every" points.
110  *
111  * \note If low_lim is set then the PointsMap will contain at least low_lim
112  * measurements, regardless of keep_point_every value. Set low_lim to 0 if
113  * no
114  * lower limit is to be specified
115  */
116  void decimatePointsMap(
117  mrpt::maps::CPointsMap* m, size_t keep_point_every = 4,
118  size_t low_lim = 0);
119  /**\brief Wrapper around the CObservation3DRangeScan::convertTo2DScan
120  * corresponding method
121  *
122  * \return True if operation was successful, false otherwise
123  */
125  /*from = */ mrpt::obs::CObservation3DRangeScan::Ptr& scan3D_in,
126  /*to = */ mrpt::obs::CObservation2DRangeScan::Ptr* scan2D_out =
127  nullptr);
128 
130  {
131  public:
132  TParams();
133  ~TParams();
134 
135  void loadFromConfigFile(
137  const std::string& section);
138  void dumpToTextStream(std::ostream& out) const;
139 
141 
142  /**\brief Struct holding the parameters of 3D to the corresponding 2D
143  * range scan conversion.
144  */
146 
148  };
150 };
151 }
152 #include "CRangeScanOps_impl.h"
153 #endif /* end of include guard: CRANGESCANOPS_H */
154 
155 
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
void dumpToTextStream(std::ostream &out) const
This method should clearly display all the contents of the structure in textual form, sending it to a std::ostream.
Several implementations of ICP (Iterative closest point) algorithms for aligning two point maps or a ...
Definition: CICP.h:65
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.
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.
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
Handy typedefs.
Definition: CRangeScanOps.h:76
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors...
Definition: CPointsMap.h:64
This class allows loading and storing values and vectors of different types from a configuration text...
Used in CObservation3DRangeScan::convertTo2DScan()
GLsizei const GLchar ** string
Definition: glext.h:4101
Class for keeping together all the RangeScanner-related functions.
Definition: CRangeScanOps.h:72
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:38
bool convert3DTo2DRangeScan(mrpt::obs::CObservation3DRangeScan::Ptr &scan3D_in, mrpt::obs::CObservation2DRangeScan::Ptr *scan2D_out=nullptr)
Wrapper around the CObservation3DRangeScan::convertTo2DScan corresponding method. ...
The ICP algorithm return information.
Definition: CICP.h:190
GLsizei GLsizei GLchar * source
Definition: glext.h:4082



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020