Skip to content →

How To: Setup Turtlebot Simulator in ROS with Gazebo

Important note: Do not buy parts or equipment from Dabit Industries, they are extremely incompetent and will take ages to ship parts that will be incomplete and you’ll be left scratching your head. Our lab has had an extremely bad experience and I wholly recommend Clearpath robotics. 

We have 2 first generation iRobot Create platforms in our lab and my goal is to convert these into turtlebots. As a first step, lets start with setting up a turtlebot Gazebo simulation so that we can play around with autonomous navigation etc. Full detailed instructions are here, in this tutorial all the instructions are compressed into the most useful steps to get you up and running fast.

Configuration: Ubuntu 14.04 LTS, ROS Indigo

This tutorial assumes you have full ROS desktop installation.

Installation Steps:

  1. $sudo apt-get update
  2. $sudo apt-get install ros-indigo-turtlebot ros-indigo-turtlebot-apps ros-indigo-turtlebot-interactions ros-indigo-turtlebot-simulator ros-indigo-kobuki-ftdi ros-indigo-rocon-remocon ros-indigo-rocon-qt-library ros-indigo-ar-track-alvar-msgs
  3. $source /opt/ros/indigo/setup.bash

First Simulation: Driving robot around and seeing kinect depth image.

  1. Open 4 terminal tabs.
  2. In terminal 1:$roscore
  3. In terminal 2:$roslaunch turtlebot_gazebo turtlebot_world.launch
  4. In terminal 3:$roslaunch turtlebot_rviz_launchers view_robot.launch
  5. Instructions on how to change rviz settings for turtlebot sim are here. Once you read through the instructions, you will be able to see the kinect depth.
  6. In terminal 4:$roslaunch turtlebot_teleop keyboard_teleop.launch
  7. Drive around by using your keyboard. Detailed instructions here.

Second Simulation: Mapping an environment by driving around it.

  1. Open 5 terminal tabs.
  2. In terminal 1:$roscore
  3. In terminal 2:$roslaunch turtlebot_gazebo turtlebot_world.launch
  4. In terminal 3:$roslaunch turtlebot_gazebo gmapping_demo.launch
  5. In terminal 4:$roslaunch turtlebot_rviz_launchers view_navigation.launch
  6. Follow instructions here to change cost map.
  7. In terminal 5:$roslaunch turtlebot_teleop keyboard_teleop.launch

Drive around the robot to build your map. Now to save the map.

  1. Create a directory $mkdir ~/turtlebot_custom_maps
  2. $rosrun map_server map_saver -f ~/turtlebot_custom_maps/tutorial

Now you may interrupt all processes except roscore.

Third Simulation: Autonomous driving

  1. In one terminal run:$roslaunch turtlebot_gazebo turtlebot_world.launch
  2. In another terminal run:$roslaunch turtlebot_gazebo amcl_demo.launch map_file:=/home/USERNAME/turtlebot_custom_maps/tutorial.yaml
  3. In another terminal run:$roslaunch turtlebot_rviz_launchers view_navigation.launch
  4. Send a navigation goal to the robot by clicking on 2D Nav Goal button in rviz (in the top bar).

Published in robotics Tutorial


  1. V2 V2

    sudo apt-get install gazebo2 libsdformat1 ros-indigo-gazebo-plugins ros-indigo-turtlebot ros-indigo-turtlebot-apps ros-indigo-turtlebot-interactions ros-indigo-gazebo-ros ros-indigo-kobuki-gazebo-plugins ros-indigo-turtlebot-gazebo ros-indigo-turtlebot-simulator ros-indigo-kobuki-ftdi ros-indigo-rocon-remocon ros-indigo-rocon-qt-library ros-indigo-ar-track-alvar-msgs

  2. az az

    i have a few questions related to ros.i am using turtlebot3 simulation with ros kinetic.Since i have just started i am a bit confused.Originally i have to create a global path planner using any algorithm(Astar,dstar etc).For that i think i need to have the information(x,y) of all the cells or grids in map so that i can apply an algorithm on them.
    Now everytime someone gives me a new world,do i have to first create a map of that using gmapping and teleop first?or load a built map in terminal so that data starts publishing in map topic?
    In my code would i just be subscribed to nav_msgs:occupancy grid(which comes form map topic i believe).When does the data starts getting published in map topic?
    Also in A star ‘H’ is distance from goal but ‘G’ is weight.Do i have assign one myself or is it something related to costmap_2d package.
    I need a guidance to know what sort of topics i need to have to start implementing the algorithm.Thanks.

  3. kenhero kenhero

    i’d like to know how to set turtlebot3 autonomous navigation in gazebo simulation.

    • sauravagarwal sauravagarwal

      Sorry but I have not worked with the turtlebot 3. If you figure it out please do share on this blog for other readers to benefit from it. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *