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

Revision history [back]

click to hide/show revision 1
initial version

ROS costmaps are typically visualized using nav_msgs/GridCells. If you were to fill one of these data structures with your probabilistic map, you would be able to visualize it in Rviz.

ROS costmaps are typically visualized using nav_msgs/GridCells. If you were to fill one of these data structures with your probabilistic map, you would be able to visualize it in Rviz. Rviz in three colors (INFLATED, OCCUPIED, UNKNOWN).

What I did to visualize probabilistic maps, however, was simply to save my data structure as an image file (with OpenCV) and then view it as a sensor_msgs/Image. This is a pretty hacky solution, but I needed to save them as images anyway, so it worked for me.

ROS costmaps are typically visualized using nav_msgs/GridCells. If you were to fill one of these data structures with your probabilistic map, you would be able to visualize it in Rviz in three colors (INFLATED, OCCUPIED, UNKNOWN).

What I did to visualize probabilistic maps, however, was simply to save my data structure as an image file (with OpenCV) and then view it as a sensor_msgs/Image. This is a pretty hacky solution, but I needed to save them as images anyway, so it worked for me.

EDIT:

To convert my costmap-like data structure to an OpenCV image, I simply just set each costmap cell as a pixel in an OpenCv IplImage data structure. Then, you can just cv_bridge to convert that image to a sensor_msgs/Image. This is simple to do if you know OpenCv, but you might have to do some research on the OpenCv image data structure. It's not too complex.

ROS costmaps are typically visualized using nav_msgs/GridCells. If you were to fill one of these data structures with your probabilistic map, you would be able to visualize it in Rviz in three colors (INFLATED, OCCUPIED, UNKNOWN).

What I did to visualize probabilistic maps, however, was simply to save my data structure as an image file (with OpenCV) and then view it as a sensor_msgs/Image. This is a pretty hacky solution, but I needed to save them as images anyway, so it worked for me.

EDIT:

To convert my costmap-like data structure to an OpenCV image, I simply just set each costmap cell as a pixel in an OpenCv IplImage data structure. Then, you can just cv_bridge to convert that image to a sensor_msgs/Image. This is simple to do if you know OpenCv, but you might have to do some research on the OpenCv image data structure. It's not too complex.

It should be noted that the Image in Rviz is in a separate window from the robot body. You won't be able to overlay one on the other using this method.