Note: This tutorial assumes that you have completed the previous tutorials: ROS tutorials. |
Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
Visualizing a Voxel Grid in RViz
Description: How to see the voxels represented with with accurate size in RVizKeywords: Costmap, Voxel
Tutorial Level: INTERMEDIATE
Contents
This tutorial explains how to use the Marber-based visualization of a Voxel Grid (There is also a pointcloud-based visualization, but it doesnt represent the voxel volumes accurately).
Step 1: Start the Marker publisher node
In order to visualize the markers, you must start the node that will publish the markers as a topic. In order for this to work, you must ensure that the correct voxel grid topic is being fed to this node, so if your voxel layer is publishing the voxel grid as anything else than voxel_grid, you must remap the topics as shown below.
1 rosrun costmap_2d costmap_2d_markers voxel_grid:=<your_voxel_grid_topic> visualization_marker:=<your_visualization_marker_topic>
Naturally, this can be incorporated into a launch file just like any other node.
Step 2: In RViz, add a Marker element listening to the visualization_marker topic
In RViz, click "Add", then, in the "By display type" tab, select Marker and click OK. If the markers are being published in a topic other than visualization_marker, set the Marker Topic to the correct one.