Main MRPT website > C++ reference for 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-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 CRANGESCANOPS_H
11 #define CRANGESCANOPS_H
12 
17 #include <mrpt/utils/CStream.h>
19 #include <mrpt/maps/CPointsMap.h>
20 #include <mrpt/poses/CPosePDF.h>
21 #include <mrpt/poses/CPose3DPDF.h>
22 #include <mrpt/poses/CPose2D.h>
23 #include <mrpt/poses/CPose3D.h>
24 #include <mrpt/slam/CICP.h>
25 #include <mrpt/system/os.h>
26 
27 #include <iostream>
28 #include <vector>
29 
30 namespace mrpt
31 {
32 namespace graphslam
33 {
34 namespace deciders
35 {
36 /**\brief Class for keeping together all the RangeScanner-related functions.
37  *
38  * ## Description
39  *
40  * Deciders that make use of either 2DRangeScans (laser generated
41  * observations) or 3DRangeScans (RGBD-cameras) can inherit from
42  * this class in case they want to use the underlying methods
43  *
44  * ### .ini Configuration Parameters
45  *
46  * \htmlinclude graphslam-engine_config_params_preamble.txt
47  *
48  * - \b conversion_sensor_label
49  * + \a Default value : "KINECT_TO_2D_SCAN"
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_angle_sup
56  * + \a Default value : 10
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  * - \b conversion_angle_inf
63  * + \a Default value : 10
64  * + \a Required : FALSE
65  * + \a Description : Applicable only when dealing with 3DRangeScans.
66  * Used for converting 3DRangeScan to 2DRangesScan so that they are
67  * visualized on the 2D surface
68  *
69  * - \b conversion_oversampling_ratio
70  * + \a Default value : 1.1
71  * + \a Required : FALSE
72  * + \a Description : Applicable only when dealing with 3DRangeScans.
73  * Used for converting 3DRangeScan to 2DRangesScan so that they are
74  * visualized on the 2D surface
75  *
76  * \note Class contains an instance of the mrpt::slam::CICP class and it parses
77  * the configuration parameters of the latter from the
78  * "ICP" section. Refer to
79  * mrpt::slam::CICP documentation for its list of
80  * configuration parameters
81  *
82  * \ingroup mrpt_graphslam_grp
83  */
84 template <class GRAPH_T = typename mrpt::graphs::CNetworkOfPoses2DInf>
86 {
87  /**\brief Handy typedefs */
88  /**\{*/
89  typedef typename GRAPH_T::constraint_t constraint_t;
91  /**\}*/
92 
93  protected:
94  // Protected methods
95  // ////////////////////////////////////////////////////////////
96 
97  /**\brief Align the 2D range scans provided and fill the potential edge that
98  * can transform the one into the other.
99  *
100  * User can optionally ask that additional information be returned in a
101  * TReturnInfo struct
102  */
103  void getICPEdge(
106  const mrpt::poses::CPose2D* initial_pose = nullptr,
107  mrpt::slam::CICP::TReturnInfo* icp_info = nullptr);
108  /**\brief Align the 3D range scans provided and find the potential edge that
109  * can transform the one into the other.
110  *
111  * Fills the 2D part (rel_edge) of the 3D constraint between the scans,
112  * since
113  * we are interested in computing the 2D alignment. User can optionally ask
114  * that additional information be returned in a TReturnInfo struct
115  */
116  void getICPEdge(
119  const mrpt::poses::CPose2D* initial_pose = nullptr,
120  mrpt::slam::CICP::TReturnInfo* icp_info = nullptr);
121  /**\brief Reduce the size of the given CPointsMap by keeping one out of
122  * "keep_point_every" points.
123  *
124  * \note If low_lim is set then the PointsMap will contain at least low_lim
125  * measurements, regardless of keep_point_every value. Set low_lim to 0 if
126  * no
127  * lower limit is to be specified
128  */
129  void decimatePointsMap(
130  mrpt::maps::CPointsMap* m, size_t keep_point_every = 4,
131  size_t low_lim = 0);
132  /**\brief Wrapper around the CObservation3DRangeScan::convertTo2DScan
133  * corresponding method
134  *
135  * \return True if operation was successful, false otherwise
136  */
138  /*from = */ mrpt::obs::CObservation3DRangeScan::Ptr& scan3D_in,
139  /*to = */ mrpt::obs::CObservation2DRangeScan::Ptr* scan2D_out =
140  nullptr);
141 
143  {
144  public:
145  TParams();
146  ~TParams();
147 
148  void loadFromConfigFile(
150  const std::string& section);
151  void dumpToTextStream(mrpt::utils::CStream& out) const;
152 
154 
155  /**\brief Struct holding the parameters of 3D to the corresponding 2D
156  * range scan conversion.
157  */
159 
161  };
163 };
164 }
165 }
166 } // end of namespaces
167 
168 #include "CRangeScanOps_impl.h"
169 #endif /* end of include guard: CRANGESCANOPS_H */
Several implementations of ICP (Iterative closest point) algorithms for aligning two point maps or a ...
Definition: CICP.h:67
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.
std::shared_ptr< CObservation3DRangeScan > Ptr
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.
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.
std::shared_ptr< CObservation2DRangeScan > Ptr
This class allows loading and storing values and vectors of different types from a configuration text...
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.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:41
GRAPH_T::constraint_t constraint_t
Handy typedefs.
Definition: CRangeScanOps.h:89
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors...
Definition: CPointsMap.h:63
Used in CObservation3DRangeScan::convertTo2DScan()
GLsizei const GLchar ** string
Definition: glext.h:4101
Class for keeping together all the RangeScanner-related functions.
Definition: CRangeScanOps.h:85
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
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:40
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:195
GLsizei GLsizei GLchar * source
Definition: glext.h:4082
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.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019