- This repository describes a method to generate a Ground Truth Octomap
.bt
file from a Gazebo.world
file without the use of any robotic sensors & Mapping algorithms. - The [OpenMACE]((https://github.com/heronsystems/OpenMACE) repository is used to achieve this task & the current repository presents only the relevant parts of OpenMACE in a structured way to make the task at hand easier.
- I tested the method on
Ubuntu 18.04
+Gazebo 9.19.0
+cmake 3.10.2
in WSL2 on Visual Studio Code on a Windows machine. - But I believe my setup should be identical to an Ubuntu 18.04 machine running the same versions of the above software.
- Generating octomap from Gazebo world is acheived using a plugin built as part of this repo.
- Check-out code from the tag pertaining to your Ubuntu version.
- Example
git clone https://github.com/heronsystems/OpenMACE.git --branch=0.0.2
for Ubuntu 18.04. - Tag
0.0.1
corresponds to Ubuntu 16.04 & tagv0.0.3
corresponds to Ubuntu 20.04. - With this clone, a catkin workspace also gets created locally at
<path-to-OpenMACE>/catkin_sim_environment
(this'll be relevant for one of the next steps).
- Example
- Build the repo using the instructions here
- Look at this for a note on the errors you might encounter in this step.
- Install
tf2-sensor-msgs
- For melodic,
sudo apt-get install ros-melodic-tf2-sensor-msgs
works.
- For melodic,
- Install
octomap-ros
- For melodic,
sudo apt-get install ros-melodic-octomap-ros
works.
- For melodic,
- Go to
OpenMACE/catkin_sim_environment
local folder & build the catkin environment.cd <path-to-OpenMACE>/catkin_sim_environment && catkin_make
- The plugin should be located at
<path-to-OpenMACE>/catkin_sim_environment/devel/lib/libBuildOctomapPlugin.so
- Add the plugin into your desired gazebo
.world
file as shown here. - Run Gazebo with this modified
.world
file & call the octomap service as shown here- While executing the
rosrun
command, set theGAZEBO_PLUGIN_PATH
env variable to the directory containing thelibBuildOctomapPlugin.so
plugin so that Gazebo can find it. - While executing the
rosservice
command, source the<path-to-catkin_sim_environment>/devel/setup.bash
file in the terminal in which you want to runrosservice
command.
- While executing the
- From my experimentation, I found that the coordinate frame for the resulting octomap is the same as the Gazebo coordinate frame.
- i.e, The coordinates of a voxel of interest in the resulting ocotmap will be the same as the coordinates of the same voxel in Gazebo.