55 CSphere::Ptr sph = mrpt::make_aligned_shared<CSphere>(0.5);
56 sph->setLocation(0, 0, 0);
57 sph->setColor(1, 0, 0);
60 CDisk::Ptr pln = mrpt::make_aligned_shared<opengl::CDisk>();
61 pln->setDiskRadius(2);
63 pln->setColor(0.8, 0, 0);
67 CDisk::Ptr pln = mrpt::make_aligned_shared<opengl::CDisk>();
68 pln->setDiskRadius(2);
70 pln->setColor(0.9, 0, 0);
83 mrpt::make_aligned_shared<CGridPlaneXY>(-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);
95 mrpt::make_aligned_shared<CAngularObservationMesh>();
97 mrpt::make_aligned_shared<CAngularObservationMesh>();
99 cout <<
"Performing ray-tracing..." << endl;
100 CAngularObservationMesh::trace2DSetOfRays(
102 CAngularObservationMesh::TDoubleRange::CreateFromAperture(
104 CAngularObservationMesh::TDoubleRange::CreateFromAperture(
106 CAngularObservationMesh::trace2DSetOfRays(
108 CAngularObservationMesh::TDoubleRange::CreateFromAperture(
110 CAngularObservationMesh::TDoubleRange::CreateFromAperture(
112 cout <<
"Ray-tracing done" << endl;
118 origin1->setScale(0.6);
119 scene1->insert(origin1);
120 scene2->insert(origin1);
125 origin2->setScale(0.6);
126 scene1->insert(origin2);
127 scene2->insert(origin2);
133 aom1->generatePointCloud(&M1);
134 aom2->generatePointCloud(&M2);
150 scene2->insert(PTNS1);
151 scene2->insert(PTNS2);
163 std::vector<double> xs, ys, zs;
165 cout <<
"Size of xs in M1: " << xs.size() << endl;
167 cout <<
"Size of xs in M2: " << xs.size() << endl;
173 &run_time, &icp_info);
177 cout <<
"ICP run took " << run_time <<
" secs." << endl;
178 cout <<
"Goodness: " << 100 * icp_info.
goodness
180 <<
" Quality: " << icp_info.
quality << endl;
181 cout <<
"ICP output: mean= " <<
mean << endl;
190 scene3->insert(PTNS1);
191 scene3->insert(PTNS2_ALIGN);
198 window.setPos(10, 10);
199 window2.setPos(530, 10);
200 window3.setPos(10, 520);
202 window.get3DSceneAndLock() = scene1;
203 window.unlockAccess3DScene();
205 window2.get3DSceneAndLock() = scene2;
206 window2.unlockAccess3DScene();
208 window3.get3DSceneAndLock() = scene3;
209 window3.unlockAccess3DScene();
211 std::this_thread::sleep_for(20ms);
212 window.forceRepaint();
213 window2.forceRepaint();
215 window.setCameraElevationDeg(15);
216 window.setCameraAzimuthDeg(90);
217 window.setCameraZoom(15);
219 window2.setCameraElevationDeg(15);
220 window2.setCameraAzimuthDeg(90);
221 window2.setCameraZoom(15);
223 window3.setCameraElevationDeg(15);
224 window3.setCameraAzimuthDeg(90);
225 window3.setCameraZoom(15);
227 cout <<
"Press any key to exit..." << endl;
240 cout <<
"Error: " << e.what() <<
'.' << endl;
245 cout <<
"Unknown Error.\n";