ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

The costmap_2d package only accepts a nav_msgs::OccupancyGrid type of map into the static_map layer of the costmap. Im assuming the static_map layer is what you are interested in since you want to 'create' a global costmap and then be able to calculate a single global path for the robot to traverse along. However, you must note that the nav_msgs::OccupancyGrid is a 2D representation of a grid map (3 colors as you mentioned; known, empty, unknown).

One thing you could do, is set the voxel grid parameter in your costmap configurations to true, so that your data (pointclouds, LIDAR, etc) is represented in 3D; just setup your observation sources to whatever types of sensors you use like in line 38. But i actually am not sure myself if the path planner will plan paths around elevated obstacles (for example like a hanging chandelier) since you only specify 2D footprint of your robot (width and length) but no height. But now that i think about it, i think all the 3D obstacle data gets squashed into a 2D layer anyway (can someone verify this please?).

Another option would be using a octomap which is a 3D occupancy grid. Please note, you wont be able to simply input the 3D occupancy grid into the costmap static_layer through the /map topic, since the topic sends nav_msgs::OccupancyGrid messages as i said above. However i have found a question here which basically states that the octomap_server can already just publish a 2D projection of your 3D occupancy grid, so you can use it with the map_server or costmap static layer.

Hope this helps