Skip to content

Creating 3D octomaps using Turtlebot

Ridhwan Luthra edited this page Jun 1, 2017 · 1 revision

Note: We will be using Turtlebot spawned in Gazebo for this tutorial but you can use anything as long as there is a point cloud published on the topics. If you want to use Octomap with your own point clouds skip to finishing up the installation

Installation

First, make sure setup that you have setup Turtlebot in Gazebo. Refer to Turtlebot setup Gazebo ROS

Install octomap_server
sudo apt install ros-indigo-octomap-server

Editing the launch file

open the launch file (feel free to use your favourite text editor)

roscd octomap_server
cd launch
sudo subl octomap_mapping.launch

Change the remap tag to
<remap from="cloud_in" to="/camera/depth/points" />
This is for when using Turtlebot, make sure you use the topic on which your point cloud is being published.

Change the frame_id param to map. This is necessary to allow visualisation in Rviz.
<param name="frame_id" type="string" value="map" />

Visualising the octomap in Rviz

Start rviz
rviz
make sure ROS master is running.
In Rviz,

  1. Change Fixed Frame to /map.
  2. Add MarkerArray Visualisation
  3. Change Marker Topic to /occupied_cells_vis_array

You should be able to see the map being generated.