Octomap in rviz



How can I visualize the Octomap being published in rviz?

All the relevant packages are installed on SLAM DUNK. But the /octamap (topic) does not show up when you search “by topic” in “Create visualization” in rviz.




When you have the octomap_rviz_plugin installed, you can add an occupancy grid visualisation on the “by display type” panel and choose the /octomap topic to be used with it.



Thank you for prompt reply. I added it by display type but I did not get any voxels. And I echoed /octomap, the messages are being published.


That’s strange…

All I know is that the octomap gets published only when the image seen by the camera changes significantly.

Sorry to ask but… Did you put the Octomap topic to /octomap in the OccupancyGrid menu? :slight_smile:


“octomap gets published only when the image seen by the camera changes significantly.” Yes that is true.
“Did you put the Octomap topic to /octomap in the OccupancyGrid menu?” Yes, I did that.

I am using some other config file from visualization and has got it working for now!



May I ask how you managed to solve this? I am currently trying to visualize an OcTree using octomap_rviz_plugins. I see something when I use the Octomap display type, but when I use the OccupancyGrid display type it tells me that the Octomap type is wrong. As far as I can tell from the code in octomap_rviz_plugins it should work if the id of my message is “OcTree”, which it is… Anyway would be glad to find some other ways to visualize an occupancy grid


What do you mean by Octomap display type? OccupancyMap?

Have you tried using the ColorOccupancyGrid type?


Sorry for the late reply. With the display type I mean OccupancyMap indeed. The weird thing is that this works, but all the oterh display types don’t. I tried the ColorOccupancyGrid type as well, but that also didn’t work (not to mention that there is no color information anyway).


It might be related to the fact that octomaps can be full or binary in term of data for each voxel: full probability of occupancy or binary, empty or occupied.
In our case it’s binary. The ColorOccupancyGrig might only handle full octomaps.
For me, only the OccupancyGrid and the OccupancyMap work.