56 sph->setLocation(0, 0, 0);
57 sph->setColor(1, 0, 0);
61 pln->setDiskRadius(2);
63 pln->setColor(0.8, 0, 0);
68 pln->setDiskRadius(2);
70 pln->setColor(0.9, 0, 0);
83 CGridPlaneXY::Create(-20, 20, -20, 20, 0, 1);
84 plane1->setColor(0.3, 0.3, 0.3);
85 scene1->insert(plane1);
86 scene2->insert(plane1);
87 scene3->insert(plane1);
91 scene1->insert(world);
97 cout <<
"Performing ray-tracing..." << endl;
98 CAngularObservationMesh::trace2DSetOfRays(
100 CAngularObservationMesh::TDoubleRange::CreateFromAperture(
102 CAngularObservationMesh::TDoubleRange::CreateFromAperture(
104 CAngularObservationMesh::trace2DSetOfRays(
106 CAngularObservationMesh::TDoubleRange::CreateFromAperture(
108 CAngularObservationMesh::TDoubleRange::CreateFromAperture(
110 cout <<
"Ray-tracing done" << endl;
116 origin1->setScale(0.6);
117 scene1->insert(origin1);
118 scene2->insert(origin1);
123 origin2->setScale(0.6);
124 scene1->insert(origin2);
125 scene2->insert(origin2);
131 aom1->generatePointCloud(&M1);
132 aom2->generatePointCloud(&M2);
148 scene2->insert(PTNS1);
149 scene2->insert(PTNS2);
161 std::vector<double> xs, ys, zs;
163 cout <<
"Size of xs in M1: " << xs.size() << endl;
165 cout <<
"Size of xs in M2: " << xs.size() << endl;
171 &run_time, &icp_info);
175 cout <<
"ICP run took " << run_time <<
" secs." << endl;
176 cout <<
"Goodness: " << 100 * icp_info.
goodness 178 <<
" Quality: " << icp_info.
quality << endl;
179 cout <<
"ICP output: mean= " <<
mean << endl;
188 scene3->insert(PTNS1);
189 scene3->insert(PTNS2_ALIGN);
196 window.setPos(10, 10);
197 window2.setPos(530, 10);
198 window3.setPos(10, 520);
200 window.get3DSceneAndLock() = scene1;
201 window.unlockAccess3DScene();
203 window2.get3DSceneAndLock() = scene2;
204 window2.unlockAccess3DScene();
206 window3.get3DSceneAndLock() = scene3;
207 window3.unlockAccess3DScene();
209 std::this_thread::sleep_for(20ms);
210 window.forceRepaint();
211 window2.forceRepaint();
213 window.setCameraElevationDeg(15);
214 window.setCameraAzimuthDeg(90);
215 window.setCameraZoom(15);
217 window2.setCameraElevationDeg(15);
218 window2.setCameraAzimuthDeg(90);
219 window2.setCameraZoom(15);
221 window3.setCameraElevationDeg(15);
222 window3.setCameraAzimuthDeg(90);
223 window3.setCameraZoom(15);
225 cout <<
"Press any key to exit..." << endl;
238 cout <<
"Error: " << e.what() <<
'.' << endl;
243 cout <<
"Unknown Error.\n";
float quality
A measure of the 'quality' of the local minimum of the sqr.
void changeCoordinatesReference(const mrpt::poses::CPose2D &b)
Replace each point by (pose compounding operator).
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 ...
void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &outObj) const override
Returns a 3D object representing the map.
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans. ...
void generateObjects(CSetOfObjects::Ptr &world)
TConfigParams options
The options employed by the ICP align.
float goodness
A goodness measure for the alignment, it is a [0,1] range indicator of percentage of correspondences...
CPose3D viewpoint2(0.5, -0.2, 2.6, DEG2RAD(-5), DEG2RAD(100), DEG2RAD(-7))
void getAllPoints(VECTOR &xs, VECTOR &ys, VECTOR &zs, size_t decimation=1) const
Returns a copy of the 2D/3D points as a std::vector of float coordinates.
This namespace contains representation of robot actions and observations.
unsigned short nIterations
The number of executed iterations until convergence.
vector< CObservation2DRangeScan > sequence_scans2
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
const size_t HOW_MANY_YAWS
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
TRenderOptions renderOptions
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
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.
Classes for creating GUI windows for 2D and 3D visualization.
double thresholdDist
Initial threshold distance for two points to become a correspondence.
const size_t HOW_MANY_PITCHS
A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.
vector< CObservation2DRangeScan > sequence_scans1
CPose3D viewpoint1(-0.3, 0.7, 3, DEG2RAD(5), DEG2RAD(80), DEG2RAD(3))