34 ret->setName(
"theRobot");
37 obj->setLocalRepresentativePoint({0.0f, 0.0f, 0.15f});
42 t.
r(0) = t.
r(1) = t.
r(2) = 255;
43 t.
g(0) = t.
g(1) = t.
g(2) = 0;
44 t.
b(0) = t.
b(1) = t.
b(2) = 0;
45 t.
a(0) = t.
a(1) = t.
a(2) = 255;
47 t.
vertex(0) = {0.10f, -0.10f, 0.20f};
48 t.
vertex(1) = {-0.20f, 0.10f, 0.25f};
49 t.
vertex(2) = {-0.20f, -0.10f, 0.25f};
51 obj->insertTriangle(t);
52 t.
vertex(0) = {0.10f, -0.10f, 0.20f};
53 t.
vertex(1) = {0.10f, 0.10f, 0.20f};
54 t.
vertex(2) = {-0.20f, 0.10f, 0.25f};
56 obj->insertTriangle(t);
58 t.
vertex(0) = {0.10f, -0.10f, 0.05f};
59 t.
vertex(1) = {0.10f, 0.10f, 0.20f};
60 t.
vertex(2) = {0.10f, -0.10f, 0.20f};
62 obj->insertTriangle(t);
63 t.
vertex(0) = {0.10f, -0.10f, 0.05f};
64 t.
vertex(1) = {0.10f, 0.10f, 0.05f};
65 t.
vertex(2) = {0.10f, 0.10f, 0.20f};
67 obj->insertTriangle(t);
69 t.
vertex(0) = {-0.20f, -0.10f, 0.05f};
70 t.
vertex(1) = {-0.20f, -0.10f, 0.25f};
71 t.
vertex(2) = {-0.20f, 0.10f, 0.25f};
73 obj->insertTriangle(t);
74 t.
vertex(0) = {-0.20f, -0.10f, 0.05f};
75 t.
vertex(1) = {-0.20f, 0.10f, 0.25f};
76 t.
vertex(2) = {-0.20f, 0.10f, 0.05f};
78 obj->insertTriangle(t);
80 t.
vertex(0) = {0.10f, -0.10f, 0.20f};
81 t.
vertex(1) = {-0.20f, -0.10f, 0.25f};
82 t.
vertex(2) = {-0.20f, -0.10f, 0.05f};
84 obj->insertTriangle(t);
86 t.
vertex(0) = {0.10f, -0.10f, 0.20f};
87 t.
vertex(1) = {-0.20f, -0.10f, 0.05f};
88 t.
vertex(2) = {0.10f, -0.10f, 0.05f};
90 obj->insertTriangle(t);
92 t.
vertex(0) = {0.10f, 0.10f, 0.20f};
93 t.
vertex(1) = {-0.20f, 0.10f, 0.05f};
94 t.
vertex(2) = {-0.20f, 0.10f, 0.25f};
96 obj->insertTriangle(t);
98 t.
vertex(0) = {0.10f, 0.10f, 0.20f};
99 t.
vertex(1) = {0.10f, 0.10f, 0.05f};
100 t.
vertex(2) = {-0.20f, 0.10f, 0.05f};
102 obj->insertTriangle(t);
106 t.
vertex(0) = {0.00f, 0.11f, 0.00f};
107 t.
vertex(1) = {0.00f, 0.11f, 0.10f};
108 t.
vertex(2) = {0.05f, 0.11f, 0.05f};
110 obj->insertTriangle(t);
111 t.
vertex(0) = {0.00f, 0.11f, 0.00f};
112 t.
vertex(1) = {0.00f, 0.11f, 0.10f};
113 t.
vertex(2) = {-0.05f, 0.11f, 0.05f};
115 obj->insertTriangle(t);
117 t.
vertex(0) = {0.00f, -0.11f, 0.00f};
118 t.
vertex(1) = {0.00f, -0.11f, 0.10f};
119 t.
vertex(2) = {0.05f, -0.11f, 0.05f};
121 obj->insertTriangle(t);
122 t.
vertex(0) = {0.00f, -0.11f, 0.00f};
123 t.
vertex(1) = {0.00f, -0.11f, 0.10f};
124 t.
vertex(2) = {-0.05f, -0.11f, 0.05f};
126 obj->insertTriangle(t);
141 0, 0, 0, scale, 0, 0, 0.25f * scale, 0.02f * scale, 0.05f * scale);
143 obj->setColor(1, 0, 0);
147 0, 0, 0, 0, scale, 0, 0.25f * scale, 0.02f * scale, 0.05f * scale);
148 obj->setColor(0, 1, 0);
153 0, 0, 0, 0, 0, scale, 0.25f * scale, 0.02f * scale, 0.05f * scale);
154 obj->setColor(0, 0, 1);
169 vector<TPoint2D> level1;
170 level1.emplace_back(0.31, 0);
171 level1.emplace_back(0.22, 0.24);
172 level1.emplace_back(-0.22, 0.24);
173 level1.emplace_back(-0.31, 0);
174 level1.emplace_back(-0.22, -0.24);
175 level1.emplace_back(0.22, -0.24);
179 obj1->setLocation(0, 0, height);
181 obj1->setColor(0.6f, 0.6f, 0.6f);
184 vector<TPoint2D> level2;
185 level2.emplace_back(0.16, 0.21);
186 level2.emplace_back(-0.16, 0.21);
187 level2.emplace_back(-0.16, -0.21);
188 level2.emplace_back(0.16, -0.21);
192 obj2->setLocation(0, 0, height);
194 obj2->setColor(0.2f, 0.2f, 0.2f);
197 vector<TPoint2D> level3;
198 level3.emplace_back(-0.12, 0.12);
199 level3.emplace_back(-0.16, 0.12);
200 level3.emplace_back(-0.16, -0.12);
201 level3.emplace_back(-0.12, -0.12);
204 obj3->setLocation(0, 0, height);
206 obj3->setColor(0.6f, 0.6f, 0.6f);
210 std::make_shared<opengl::CCylinder>(0.05f, 0.05f, 0.4f, 20);
211 obj4->setLocation(0, 0, 0.73);
212 obj4->setColor(0.0f, 0.0f, 0.9f);
216 std::make_shared<opengl::CCylinder>(0.05f, 0.05f, 0.4f, 20);
217 obj5->setPose(
CPose3D(0.32, 0, 0.89, 0, -1, 0));
218 obj5->setColor(0.0f, 0.0f, 0.9f);
233 vector<TPoint2D> level1;
234 level1.emplace_back(0.31, 0);
235 level1.emplace_back(0.22, 0.24);
236 level1.emplace_back(-0.22, 0.24);
237 level1.emplace_back(-0.31, 0);
238 level1.emplace_back(-0.22, -0.24);
239 level1.emplace_back(0.22, -0.24);
243 obj1->setLocation(0, 0, height);
245 obj1->setColor(1.0f, 0.6f, 0.0f);
249 vector<TPoint2D> level2;
250 level2.emplace_back(0.13, 0.1);
251 level2.emplace_back(-0.13, 0.1);
252 level2.emplace_back(-0.13, -0.1);
253 level2.emplace_back(0.13, -0.1);
257 obj2->setLocation(0, 0, height);
259 obj2->setColor(1.0f, 0.6f, 0.2f);
263 vector<TPoint2D> level3;
264 level3.emplace_back(0.03, 0.03);
265 level3.emplace_back(-0.03, 0.03);
266 level3.emplace_back(-0.03, -0.03);
267 level3.emplace_back(0.03, -0.03);
271 obj3->setLocation(0, 0, height);
273 obj3->setColor(0.6f, 0.6f, 0.6f);
277 vector<TPoint2D> level4;
278 level4.emplace_back(0.03, 0.11);
279 level4.emplace_back(-0.03, 0.11);
280 level4.emplace_back(-0.03, -0.11);
281 level4.emplace_back(0.03, -0.11);
284 obj4->setLocation(0, 0, height);
285 obj4->setColor(1.0f, 0.6f, 0.0f);
298 obj->setColor(1, 0, 0);
303 obj->setColor(0, 1, 0);
308 obj->setColor(0, 0, 1);
323 -0.02, 0.14, -0.02, 0.02, 0, -0.04);
324 rect->setColor(1.0f, 0.8f, 0.0f);
326 camera->insert(rect);
329 std::make_shared<opengl::CCylinder>(0.01f, 0.01f, 0.003f, 10);
330 lCam->setColor(1, 0, 0);
333 std::make_shared<opengl::CCylinder>(0.01f, 0.01f, 0.003f, 10);
334 rCam->setPose(
CPose3D(0.12, 0, 0));
335 rCam->setColor(0, 0, 0);
337 camera->insert(lCam);
338 camera->insert(rCam);
349 const float R = scale * 0.01f;
350 const int nSlices = 6;
354 lin->setColor(1, 0, 0);
360 lin->setColor(0, 1, 0);
366 lin->setColor(0, 0, 1);
378 const float R = scale * 0.01f;
379 const int nSlices = 6;
383 lin->setColor(1, 0, 0);
389 lin->setColor(0, 1, 0);
403 base->setColor(0.7f, 0.7f, 0.7f);
407 CCylinder::Ptr cyl1 = std::make_shared<CCylinder>(0.02f, 0.02f, 0.01f);
408 cyl1->setColor(0, 0, 0);
409 cyl1->setLocation(0, 0, -0.014);
414 std::make_shared<CCylinder>(0.02f, 0.0175f, 0.01f);
415 cyl2->setColor(0, 0, 0);
416 cyl2->setLocation(0, 0, -0.004);
421 std::make_shared<CCylinder>(0.0175f, 0.0175f, 0.01f);
422 cyl3->setColor(0, 0, 0);
423 cyl3->setLocation(0, 0, 0.004);
437 base->setColor(0, 0, 0);
442 std::make_shared<CCylinder>(0.028f, 0.024f, 0.028f);
443 cyl1->setColor(0, 0, 0);
444 cyl1->setPose(
CPose3D(0, 0, -0.014));
449 std::make_shared<CCylinder>(0.028f, 0.028f, 0.01f);
450 cyl2->setColor(1.0f, 69.0f / 255.0f, 0);
451 cyl2->setLocation(0, 0, 0.014);
456 std::make_shared<CCylinder>(0.028f, 0.028f, 0.01f);
457 cyl3->setColor(0, 0, 0);
458 cyl3->setLocation(0, 0, 0.024);
470 CBox::Ptr cabin = std::make_shared<CBox>(
472 cabin->setColor(0.7f, 0.7f, 0.7f);
478 back->setColor(1, 1, 1);
482 CBox::Ptr boomAxis = std::make_shared<CBox>(
484 boomAxis->setColor(0, 0, 0);
485 ret->insert(boomAxis);
488 CBox::Ptr boom1 = std::make_shared<CBox>(
490 boom1->setColor(0, 1, 0);
494 CBox::Ptr boom2 = std::make_shared<CBox>(
496 boom2->setColor(0, 1, 0);
501 std::make_shared<CCylinder>(0.716f, 0.716f, 0.387f, 30);
502 cyl1->setColor(0, 0, 0);
503 cyl1->setPose(
CPose3D(-0.710, 0.923, -2.480, 0, 0, 90.0_deg));
508 std::make_shared<CCylinder>(0.716f, 0.716f, 0.387f, 30);
509 cyl2->setColor(0, 0, 0);
510 cyl2->setPose(
CPose3D(-3.937, 0.923, -2.480, 0, 0, 90.0_deg));
515 std::make_shared<CCylinder>(0.716f, 0.716f, 0.387f, 30);
516 cyl1->setColor(0, 0, 0);
517 cyl1->setPose(
CPose3D(-0.710, -0.423, -2.480, 0, 0, 90.0_deg));
522 std::make_shared<CCylinder>(0.716f, 0.716f, 0.387f, 30);
523 cyl2->setColor(0, 0, 0);
524 cyl2->setPose(
CPose3D(-3.937, -0.423, -2.480, 0, 0, 90.0_deg));
CSetOfObjects::Ptr Hokuyo_UTM()
Returns a simple 3D model of a Hokuyo UTM scanner.
mrpt::math::TPoint3Df & vertex(size_t i)
const uint8_t & b(size_t i) const
static Ptr Create(Args &&... args)
static CPose3D FromString(const std::string &s)
CSetOfObjects::Ptr CornerXYSimple(float scale=1.0, float lineWidth=1.0)
Returns two arrows representing a X,Y 2D corner (just thick lines, fast to render).
const uint8_t & r(size_t i) const
CSetOfObjects::Ptr RobotGiraff()
Returns a representation of RobotGiraff.
A triangle (float coordinates) with RGBA colors (u8) and UV (texture coordinates) for each vertex...
CSetOfObjects::Ptr RobotRhodon()
Returns a representation of Rhodon.
const uint8_t & g(size_t i) const
CSetOfObjects::Ptr Househam_Sprayer()
Returns a simple 3D model of a househam sprayer.
static CPolyhedron::Ptr CreateCubicPrism(double x1, double x2, double y1, double y2, double z1, double z2)
Creates a cubic prism, given the coordinates of two opposite vertices.
const uint8_t & a(size_t i) const
This base provides a set of functions for maths stuff.
static Ptr Create(Args &&... args)
TPoint3D_< double > TPoint3D
Lightweight 3D point.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
CSetOfObjects::Ptr RobotPioneer()
Returns a representation of a Pioneer II mobile base.
void setColor(const mrpt::img::TColor &c)
Sets the color of all vertices.
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.
CSetOfObjects::Ptr CornerXYZSimple(float scale=1.0, float lineWidth=1.0)
Returns three arrows representing a X,Y,Z 3D corner (just thick lines instead of complex arrows for f...
An RGBA color - floats in the range [0,1].
The namespace for 3D scene representation and rendering.
CSetOfObjects::Ptr CornerXYZEye()
Returns three arrows representing a X,Y,Z 3D corner.
void computeNormals()
Compute the three normals from the cross-product of "v01 x v02".
CSetOfObjects::Ptr BumblebeeCamera()
Returns a simple 3D model of a PointGrey Bumblebee stereo camera.
static CPolyhedron::Ptr CreateCustomPrism(const std::vector< mrpt::math::TPoint2D > &baseVertices, double height)
Creates a custom prism with vertical edges, given any base which will lie on the XY plane...
CSetOfObjects::Ptr Hokuyo_URG()
Returns a simple 3D model of a Hokuyo URG scanner.