2D occupancy grid of a Gazebo world
I am trying to visualize a 2D occupancy grid in rviz for a gazebo world, with extracting and publishing each feature seperatley. For example for an empty gazebo world with just a box and a cylinder , i want to publish both the box and cylinder as OccupancyGrid messages using separate publishers.
The issue i'm running into is getting the data for each model , is the only way to do this by parsing the world file and manually getting the dimensions ? Does anyone know if there is a way to convert a gazebo world into a 2D occupancy grid ?