2 #include <ros/console.h>
18 float COLORS[27][3] = { { 0.6, 0.6, 0.6}, { 0.6, 0.6, 0.4}, { 0.6, 0.6, 0.2},
19 { 0.6, 0.4, 0.6}, { 0.6, 0.4, 0.4}, { 0.6, 0.4, 0.2},
20 { 0.6, 0.2, 0.6}, { 0.6, 0.2, 0.4}, { 0.6, 0.2, 0.2},
21 { 0.4, 0.6, 0.6}, { 0.4, 0.6, 0.4}, { 0.4, 0.6, 0.2},
22 { 0.4, 0.4, 0.6}, { 0.4, 0.4, 0.4}, { 0.4, 0.4, 0.2},
23 { 0.4, 0.2, 0.6}, { 0.4, 0.2, 0.4}, { 0.4, 0.2, 0.2},
24 { 0.2, 0.6, 0.6}, { 0.2, 0.6, 0.4}, { 0.2, 0.6, 0.2},
25 { 0.2, 0.4, 0.6}, { 0.2, 0.4, 0.4}, { 0.2, 0.4, 0.2},
26 { 0.2, 0.2, 0.6}, { 0.2, 0.2, 0.4}, { 0.2, 0.2, 0.2} };
50 float old_depth =
z_buffer_.at<
float>(y, x);
51 if (old_depth == 0. || depth < old_depth)
55 if (
vals_[i_triangle] < 0)
81 for(
unsigned int i = 0; i < str.
size(); ++i)
118 mesh_flat.
addTriangle(triangle_indexes.i1_, triangle_indexes.i2_, triangle_indexes.i3_);
143 constexpr
double al = 0.25;
144 constexpr
double at = 0.01;
150 renderMesh(
cam, cam_pose_inv, x_box, cv::Vec3b(0, 0, 255), res, flatten);
151 renderMesh(
cam, cam_pose_inv, y_box, cv::Vec3b(0, 255, 0), res, flatten);
152 renderMesh(
cam, cam_pose_inv, z_box, cv::Vec3b(255, 0, 0), res, flatten);
159 if (e->visual() && e->has_pose() && !e->hasFlag(
"self") && (
id.size() < 5 ||
id.substr(
id.size() - 5) !=
"floor"))
162 if (show_volumes ==
RoomVolumes && (
id.size() < 4 ||
id.substr(0, 4) !=
"wall"))
continue;
171 color = cv::Vec3b(255 *
b, 255 * g, 255 * r);
176 int i_color =
djb2(
id) % 27;
177 color = cv::Vec3b(255 *
COLORS[i_color][2], 255 *
COLORS[i_color][1], 255 *
COLORS[i_color][0]);
181 renderMesh(
cam, pose, e->visual()->getMesh(), color, res, flatten);
184 if (show_volumes ==
ModelVolumes && !e->volumes().empty())
188 renderMesh(
cam, pose, it->second->getMesh(), cv::Vec3b(0, 0, 255), res, flatten);
192 else if (show_volumes ==
RoomVolumes && e->types().find(
"room") != e->types().end())
197 renderMesh(
cam, pose, it->second->getMesh(), cv::Vec3b(0, 0, 255), res, flatten);