Go to the documentation of this file.
10 #ifndef CRANGESCANOPS_IMPL_H
11 #define CRANGESCANOPS_IMPL_H
19 template <
class GRAPH_T>
40 initial_pose = *initial_pose_in;
44 params.icp.Align(&m1, &m2, initial_pose, &running_time, (
void*)&info);
47 rel_edge->copyFrom(*pdf);
50 if (icp_info) *icp_info = info;
54 template <
class GRAPH_T>
65 mrpt::format(
"Laser scan doesn't contain valid range image"));
68 mrpt::format(
"Laser scan doesn't contain valid range image"));
91 params.icp.Align3D(&m1, &m2, initial_pose, &running_time, (
void*)&info);
97 if (fabs(pdf->getMeanVal().z()) < 0.1)
99 rel_edge->copyFrom(*pdf);
107 if (icp_info) *icp_info = info;
112 template <
class GRAPH_T>
119 size_t map_size = m->
size();
124 size_t conservative_keep_point_every = map_size / low_lim;
126 std::min(keep_point_every, conservative_keep_point_every);
130 std::vector<bool> deletion_mask(map_size,
true);
131 for (
size_t i = 0; i != map_size; ++i)
133 if (i % keep_point_every == 0)
135 deletion_mask[i] =
false;
146 template <
class GRAPH_T>
153 bool success =
false;
158 mrpt::make_aligned_shared<mrpt::obs::CObservation2DRangeScan>();
161 if (scan3D_in->hasRangeImage)
163 scan3D_in->convertTo2DScan(**scan2D_out,
params.conversion_params);
168 std::cout <<
"No valid rangeImage found" << std::endl;
179 template <
class GRAPH_T>
184 template <
class GRAPH_T>
189 template <
class GRAPH_T>
195 "3D=>2D LaserScan Conversion Sensor label = %s\n",
196 conversion_params.sensorLabel.c_str());
198 "3D=>2D LaserScan Conversion angle sup = %.2f deg\n",
201 "3D=>2D LaserScan Conversion angle inf = %.2f deg\n",
204 "3D=>2D LaserScan Conversion oversampling ratio = %.2f\n",
205 conversion_params.oversampling_ratio);
207 "3D=>2D LaserScan Conversion Z minimum = %.2f\n",
208 conversion_params.z_min);
210 icp.options.dumpToTextStream(out);
214 template <
class GRAPH_T>
220 conversion_params.sensorLabel =
source.read_string(
221 section,
"conversion_sensor_label",
"KINECT_TO_2D_SCAN",
false);
223 source.read_double(section,
"conversion_angle_sup", 10,
false));
225 source.read_double(section,
"conversion_angle_inf", 10,
false));
226 conversion_params.oversampling_ratio =
source.read_double(
227 section,
"conversion_oversampling_ratio", 1.1,
false);
228 conversion_params.z_min =
source.read_double(
229 section,
"conversion_z_min", 0,
false);
232 icp.options.loadFromConfigFile(
source,
"ICP");
234 has_read_config =
true;
bool insertObservation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL)
Insert the observation information into this map.
bool convert3DTo2DRangeScan(mrpt::obs::CObservation3DRangeScan::Ptr &scan3D_in, mrpt::obs::CObservation2DRangeScan::Ptr *scan2D_out=nullptr)
Wrapper around the CObservation3DRangeScan::convertTo2DScan corresponding method.
size_t size() const
Returns the number of stored points in the map.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
double RAD2DEG(const double x)
Radians to degrees.
The ICP algorithm return information.
GLsizei GLsizei GLchar * source
void dumpToTextStream(std::ostream &out) const
This method should clearly display all the contents of the structure in textual form,...
Declares a class derived from "CObservation" that encapsules a 3D range scan measurement,...
This class allows loading and storing values and vectors of different types from a configuration text...
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
bool hasRangeImage
true means the field rangeImage contains valid data
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans.
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...
std::shared_ptr< CObservation2DRangeScan > 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 loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string §ion)
This method load the options from a ".ini"-like file or memory-stored string list.
std::shared_ptr< CObservation3DRangeScan > Ptr
#define ASSERTDEBMSG_(f, __ERROR_MSG)
std::shared_ptr< CPose3DPDF > Ptr
typename typename mrpt::graphs::CNetworkOfPoses2DInf ::constraint_t constraint_t
Handy typedefs.
GLsizei const GLchar ** string
void applyDeletionMask(const std::vector< bool > &mask)
Remove from the map the points marked in a bool's array as "true".
std::shared_ptr< CPosePDF > Ptr
GLenum const GLfloat * params
double DEG2RAD(const double x)
Degrees to radians.
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 | |