49 class_colormap colormap_positive(
"jet",colorrange, 1,
false);
50 class_colormap colormap_negative(
"pink",colorrange, 1,
false);
53 visualization_msgs::Marker marker_cell;
55 marker_cell.header.frame_id = grid_frame;
56 marker_cell.header.stamp = ros::Time::now();;
57 marker_cell.ns =
"elvation_cell";
58 marker_cell.action = visualization_msgs::Marker::ADD;
59 marker_cell.type = visualization_msgs::Marker::CUBE;
60 marker_cell.pose.orientation.x = 0; marker_cell.pose.orientation.y = 0.0; marker_cell.pose.orientation.z = 0; marker_cell.pose.orientation.w = 1;
62 marker_cell.scale.x = nav_map.
Sx;
63 marker_cell.scale.y = nav_map.
Sy;
65 geometry_msgs::Point p;
68 visualization_msgs::Marker marker_text;
70 marker_text.header.frame_id = grid_frame;
71 marker_text.header.stamp = ros::Time::now();;
72 marker_text.ns =
"confidence_cell";
73 marker_text.action = visualization_msgs::Marker::ADD;
74 marker_text.type = visualization_msgs::Marker::TEXT_VIEW_FACING;
75 marker_text.scale.x = 0.07;
76 marker_text.scale.y = 0.07;
77 marker_text.scale.z = 0.07;
78 marker_text.color.a = 1.0;
79 marker_text.color.r = 0.0;
80 marker_text.color.g = 0.0;
81 marker_text.color.b = 0.0;
85 for(uint row=0;row<nav_map.
grid.rows();row++)
88 p.x = row*nav_map.
Sx+nav_map.
Sx/2;
90 for(uint col=0;col<nav_map.
grid.cols();col++)
93 node_data = nav_map.
grid(row,col);
95 if (node_data->num_points>0 || node_data->interpolate_z_data)
98 marker_cell.id = counter;
105 p.z= node_data->Zmed/2;
106 marker_cell.scale.z = node_data->Zmed;
109 if (node_data->Zmed>=0 )
110 marker_cell.color = colormap_positive.color((colorrange*node_data->Zmed)/Zmax);
112 marker_cell.color =colormap_positive.color((colorrange*abs(node_data->Zmed))/abs(Zmin));
115 marker_cell.pose.position=p;
118 marker_list.
update(marker_cell);
123 marker_text.id = counter;
126 marker_text.pose.position.x = p.x;
127 marker_text.pose.position.y = p.y;
129 marker_text.pose.position.z = node_data->Zmed+0.05;
131 marker_text.pose.position.z = 0.05;
134 boost::format fm(
"%d");
135 fm % node_data->Z_confidence;
138 marker_text.text = fm.str();
166 visualization_msgs::Marker mk;
168 geometry_msgs::Point p;
169 std_msgs::ColorRGBA color;
171 mk.header.frame_id = grid_frame; mk.header.stamp = ros::Time::now(); mk.ns =
"normals";
172 mk.action = visualization_msgs::Marker::ADD; mk.type = visualization_msgs::Marker::LINE_LIST; mk.id = 0;
173 mk.pose.position.x = 0; mk.pose.position.y = 0; mk.pose.position.z = 0;
174 mk.pose.orientation.x = 0; mk.pose.orientation.y = 0; mk.pose.orientation.z = 0; mk.pose.orientation.w = 1;
175 mk.scale.x = 0.01; mk.scale.y = 0.01; mk.scale.z = 0;
176 mk.color.r = 0.7; mk.color.g = 0; mk.color.b = 0; mk.color.a = 1;
178 for(uint row=0;row<nav_map.
grid.rows();row++)
180 for(uint col=0;col<nav_map.
grid.cols();col++)
182 node_data = nav_map.
grid(row,col);
184 if (node_data->has_normal)
187 p.x = row*nav_map.
Sx+nav_map.
Sx/2;
195 p.z= node_data->Zmed;
204 mk.points.push_back(p);
208 p.x = px_aux + (cos(node_data->med_angle_X))*rat;
209 p.y = py_aux + (cos(node_data->med_angle_Y))*rat;
210 p.z = pz_aux + (cos(node_data->med_angle_Z))*rat;
212 mk.points.push_back(p);
232 class_colormap colormap_positive(
"jet",colorrange, 1,
false);
235 visualization_msgs::Marker marker_cell;
237 marker_cell.header.frame_id = grid_frame;
238 marker_cell.header.stamp = ros::Time::now();;
239 marker_cell.ns =
"accessibility_cell";
240 marker_cell.action = visualization_msgs::Marker::ADD;
241 marker_cell.type = visualization_msgs::Marker::CUBE;
242 marker_cell.pose.orientation.x = 0; marker_cell.pose.orientation.y = 0.0; marker_cell.pose.orientation.z = 0; marker_cell.pose.orientation.w = 1;
244 marker_cell.scale.x = nav_map.
Sx;
245 marker_cell.scale.y = nav_map.
Sy;
247 geometry_msgs::Point p;
251 visualization_msgs::Marker marker_text;
253 marker_text.header.frame_id = grid_frame;
254 marker_text.header.stamp = ros::Time::now();;
255 marker_text.ns =
"debug_cell";
256 marker_text.action = visualization_msgs::Marker::ADD;
257 marker_text.type = visualization_msgs::Marker::TEXT_VIEW_FACING;
258 marker_text.scale.x = 0.07;
259 marker_text.scale.y = 0.07;
260 marker_text.scale.z = 0.07;
261 marker_text.color.a = 1.0;
262 marker_text.color.r = 0.0;
263 marker_text.color.g = 0.0;
264 marker_text.color.b = 0.0;
268 for(uint row=0;row<nav_map.
grid.rows();row++)
271 p.x = row*nav_map.
Sx+nav_map.
Sx/2;
273 for(uint col=0;col<nav_map.
grid.cols();col++)
276 node_data = nav_map.
grid(row,col);
278 if (node_data->num_points>0 || node_data->interpolate_z_data)
281 marker_cell.id = counter;
288 p.z=(1-node_data->z_accessibility)/2;
290 p.z=(1-node_data->angleX_accessibility)/2;
292 p.z=(1-node_data->angleY_accessibility)/2;
294 p.z=(1-node_data->angleZ_accessibility)/2;
296 p.z=(1-node_data->total_accessibility)/2;
299 marker_cell.scale.z =1-node_data->z_accessibility;
301 marker_cell.scale.z =1-node_data->angleX_accessibility;
303 marker_cell.scale.z =1-node_data->angleY_accessibility;
305 marker_cell.scale.z =1-node_data->angleZ_accessibility;
307 marker_cell.scale.z =1-node_data->total_accessibility;
311 marker_cell.color = colormap_positive.color(colorrange*(1-node_data->z_accessibility)-1);
313 marker_cell.color = colormap_positive.color(colorrange*(1-node_data->angleX_accessibility)-1);
315 marker_cell.color = colormap_positive.color(colorrange*(1-node_data->angleY_accessibility)-1);
317 marker_cell.color = colormap_positive.color(colorrange*(1-node_data->angleZ_accessibility)-1);
319 marker_cell.color = colormap_positive.color(colorrange*(1-node_data->total_accessibility)-1);
323 marker_cell.pose.position=p;
326 marker_list.
update(marker_cell);
331 marker_text.id = counter;
334 marker_text.pose.position.x = p.x;
335 marker_text.pose.position.y = p.y;
338 marker_text.pose.position.z = (1-node_data->z_accessibility)+0.1;
340 marker_text.pose.position.z = (1-node_data->angleX_accessibility)+0.1;
342 marker_text.pose.position.z = (1-node_data->angleY_accessibility)+0.1;
344 marker_text.pose.position.z = (1-node_data->angleZ_accessibility)+0.1;
346 marker_text.pose.position.z = (1-node_data->total_accessibility)+0.1;
349 boost::format fm(
"%d");
351 fm % node_data->z_accessibility;
353 fm % node_data->angleX_accessibility;
355 fm % node_data->angleY_accessibility;
357 fm % node_data->angleZ_accessibility;
359 fm % node_data->total_accessibility;
361 marker_text.text = fm.str();
382 visualization_msgs::Marker mk;
384 std_msgs::ColorRGBA color;
386 mk.header.frame_id = grid_frame; mk.header.stamp = ros::Time::now(); mk.ns =
"polygon";
387 mk.action = visualization_msgs::Marker::ADD; mk.type = visualization_msgs::Marker::LINE_STRIP; mk.id = 0;
388 mk.pose.position.x = 0; mk.pose.position.y = 0; mk.pose.position.z = 0;
389 mk.pose.orientation.x = 0; mk.pose.orientation.y = 0; mk.pose.orientation.z = 0; mk.pose.orientation.w = 1;
390 mk.scale.x = 0.08; mk.scale.y = 0.01; mk.scale.z = 0;
391 mk.color.r = 0; mk.color.g = 1; mk.color.b = 0; mk.color.a = 1;
404 visualization_msgs::Marker mk;
406 std_msgs::ColorRGBA color;
408 mk.header.frame_id = grid_frame; mk.header.stamp = ros::Time::now(); mk.ns =
"polygon_obstacle";
409 mk.action = visualization_msgs::Marker::ADD; mk.type = visualization_msgs::Marker::LINE_STRIP; mk.id = 0;
410 mk.pose.position.x = 0; mk.pose.position.y = 0; mk.pose.position.z = 0;
411 mk.pose.orientation.x = 0; mk.pose.orientation.y = 0; mk.pose.orientation.z = 0; mk.pose.orientation.w = 1;
412 mk.scale.x = 0.08; mk.scale.y = 0.01; mk.scale.z = 0;
413 mk.color.r = 1; mk.color.g = 0; mk.color.b = 0; mk.color.a = 1;
int debug_accessibility
Which accessibility map should be draw.
std::vector< geometry_msgs::Point > obstacle_points
visualization_msgs::Marker create_Markers_Normals(Navigability_Map &nav_map, std::string grid_frame)
Function to generate marker for the visualization of the Normals on the Class Navigability_Map.
double Sx
The X dimension of the cell.
visualization_msgs::Marker create_Markers_Polygon(Navigability_Map &nav_map, std::string grid_frame)
void update(visualization_msgs::Marker &marker)
double Sy
The Y dimension of the cell.
std::vector< geometry_msgs::Point > polygon_points
visualization_msgs::Marker create_Markers_Obstacle(Navigability_Map &nav_map, std::string grid_frame)
vector< visualization_msgs::Marker > create_Markers_AccessibilityMap(Navigability_Map &nav_map, std::string grid_frame)
Function to generate marker for the visualization of the Accessibility Map on the Class Navigability_...
double Zmin_filter
Max distance to be consider in the Z direction of the PointCloud.
Grid grid
The two-dimensional grid with the cells.
double Zmax_filter
Min distance to be consider in the Z direction of the PointCloud.
vector< visualization_msgs::Marker > getOutgoingMarkers(void)
boost::shared_ptr< grid_node > grid_nodePtr
vector< visualization_msgs::Marker > create_Markers_ElavationMap(Navigability_Map &nav_map, std::string grid_frame)
Function to generate marker for the visualization of the Elevation Map on the Class Navigability_Map...
int CARaxis_col
Center col of the grid.
Declarion functions and class to handle the visualization markers of the Class Navigability_Map.
int colorrange
Color to represent the maps.