I’ve made a node that will subscribe to OccupancyGrid (map) messages and export a 3D mesh with obstacles corresponding to occupied cells of the map, as if all the occupied pixels were extruded upwards. The package also contains basic config/launch files to open Gazebo and import the mesh. My goal with this package is to make it easy to create simulated environments based on real-world maps.
The GitHub repo is at https://github.com/shilohc/map2gazebo – see the README for more details. I hope this is useful! Let me know if you have any feedback or questions.