10 #include <gtest/gtest.h> 23 #include <Eigen/Dense> 71 ICP.
Align(&m1, &m2, initialPose, &runningTime, (
void*)&info);
86 EXPECT_NEAR(good_pose.
distanceTo(pdf->getMeanVal()), 0, 0.02);
92 sph->setLocation(0, 0, 0);
93 sph->setColor(1, 0, 0);
96 CDisk::Ptr pln = std::make_shared<opengl::CDisk>();
97 pln->setDiskRadius(2);
99 pln->setColor(0.8, 0, 0);
103 CDisk::Ptr pln2 = std::make_shared<opengl::CDisk>();
104 pln2->setDiskRadius(2);
107 pln2->setColor(0.9, 0, 0);
139 std::make_shared<CGridPlaneXY>(-20, 20, -20, 20, 0, 1);
140 plane1->setColor(0.3, 0.3, 0.3);
141 scene1->insert(plane1);
142 scene2->insert(plane1);
143 scene3->insert(plane1);
147 scene1->insert(world);
151 std::make_shared<CAngularObservationMesh>();
153 std::make_shared<CAngularObservationMesh>();
155 CAngularObservationMesh::trace2DSetOfRays(
157 CAngularObservationMesh::TDoubleRange::CreateFromAperture(
159 CAngularObservationMesh::TDoubleRange::CreateFromAperture(
161 CAngularObservationMesh::trace2DSetOfRays(
163 CAngularObservationMesh::TDoubleRange::CreateFromAperture(
165 CAngularObservationMesh::TDoubleRange::CreateFromAperture(
172 origin1->setScale(0.6f);
173 scene1->insert(origin1);
174 scene2->insert(origin1);
179 origin2->setScale(0.6f);
180 scene1->insert(origin2);
181 scene2->insert(origin2);
187 aom1->generatePointCloud(&M1);
188 aom2->generatePointCloud(&M2);
204 scene2->insert(PTNS1);
205 scene2->insert(PTNS2);
221 &run_time, &icp_info);
233 <<
"ICP output: mean= " <<
mean << endl
void changeCoordinatesReference(const mrpt::poses::CPose2D &b)
Replace each point by (pose compounding operator).
TICPAlgorithm ICP_algorithm
The algorithm to use (default: icpClassic).
mrpt::poses::CPosePDF::Ptr Align(const mrpt::maps::CMetricMap *m1, const mrpt::maps::CMetricMap *m2, const mrpt::poses::CPose2D &grossEst, float *runningTime=nullptr, void *info=nullptr)
The method for aligning a pair of metric maps, aligning only 2D + orientation.
mrpt::img::TColorf color
Color of points.
mrpt::poses::CPose3DPDF::Ptr Align3D(const mrpt::maps::CMetricMap *m1, const mrpt::maps::CMetricMap *m2, const mrpt::poses::CPose3D &grossEst, float *runningTime=nullptr, void *info=nullptr)
The method for aligning a pair of metric maps, aligning the full 6D pose.
Several implementations of ICP (Iterative closest point) algorithms for aligning two point maps or a ...
double DEG2RAD(const double x)
Degrees to radians.
void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &outObj) const override
Returns a 3D object representing the map.
void example2DRangeScan(mrpt::obs::CObservation2DRangeScan &s, int i=0)
Example 2D lidar scans (form a venerable SICK LMS200).
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans. ...
void generateObjects(CSetOfObjects::Ptr &world)
TEST_F(ICPTests, AlignScans_icpClassic)
void align2scans(const TICPAlgorithm icp_method)
double smallestThresholdDist
The size for threshold such that iterations will stop, since it is considered precise enough...
TConfigParams options
The options employed by the ICP align.
double distanceTo(const CPoseOrPoint< OTHERCLASS, DIM2 > &b) const
Returns the Euclidean distance to another pose/point:
This base provides a set of functions for maths stuff.
CPose3D viewpoint2(0.5, -0.2, 2.6, DEG2RAD(-5), DEG2RAD(100), DEG2RAD(-7))
unsigned int maxIterations
Maximum number of iterations to run.
This namespace contains representation of robot actions and observations.
bool doRANSAC
Perform a RANSAC step, mrpt::tfest::se2_l2_robust(), after the ICP convergence, to obtain a better es...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
TICPAlgorithm
The ICP algorithm selection, used in mrpt::slam::CICP::options mrpt_slam_grp.
const size_t HOW_MANY_YAWS
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...
static void generateObjects(CSetOfObjects::Ptr &world)
TRenderOptions renderOptions
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).
double ALFA
The scale factor for thresholds everytime convergence is achieved.
CSetOfObjects::Ptr CornerXYZ(float scale=1.0)
Returns three arrows representing a X,Y,Z 3D corner.
CPose3D SCAN2_POSE_ERROR(0.15, -0.07, 0.10, -0.03, 0.1, 0.1)
A RGB color - floats in the range [0,1].
The ICP algorithm return information.
The namespace for 3D scene representation and rendering.
double mean(const CONTAINER &v)
Computes the mean value of a vector.
double thresholdDist
Initial threshold distance for two points to become a correspondence.
const size_t HOW_MANY_PITCHS
vector_t asVectorVal() const
Return the pose or point as a 1xN vector with all the components (see derived classes for each implem...
bool insertObservation(const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D *robotPose=nullptr)
Insert the observation information into this map.
CPose3D viewpoint1(-0.3, 0.7, 3, DEG2RAD(5), DEG2RAD(80), DEG2RAD(3))