robotics Tutorial

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).

Recommended Articles