Generate an octomap from your world - gsilano/BebopS GitHub Wiki
Within your <world_name>.world
file you should have the following line in between your <world>..</world>
tags, which loads the octomap plugin.
<plugin name='gazebo_octomap' filename='librotors_gazebo_octomap_plugin.so'>
<octomapPubTopic>world/octomap</octomapPubTopic>
<octomapServiceName>world/get_octomap</octomapServiceName>
</plugin>
Before running the launch file, the octomap_plugins
needs to be compiled through the command
catkin build --cmake-args -DBUILD_OCTOMAP_PLUGIN=TRUE
Then you can make a service call as follows, to create an octomap.
rosservice call /world/get_octomap '{bounding_box_origin: {x: 5, y: 0, z: 1.75}, bounding_box_lengths: {x: 20.8, y: 20.8, z: 4}, leaf_size: 0.1, filename: output_filename.bt}'
IMPORTANT Currently, the plugin only works with Ubuntu 16.04 and Gazebo 7.