User Tools

Site Tools


Simulating a Turtlebot in a virtual world

These steps will allow you to simulate and play with a virtual Turtlebot powered by gazebo.


first take a look at gazebo simulator, please refer to gazebo wiki if not installed yet, you need turtlebot simulator.

  sudo apt-get install ros-hydro-turtlebot-simulator

Run simulations

First simulations

First you can try to run an empty world:

  roslaunch turtlebot_gazebo turtlebot_empty_world.launch

you should wait a little until you see the turtlebot model in gazebo, Or a bug in the terminal (refer to Connectivity and bugs).

If you see your robot, your simulation should run correctly. You can check all the ROS nodes ans topics by launching


You should see a /gazebo bubble replacing the robot when you are playing with the real robot. That means you can now use the usual demo software for the turtlebot such as keyboard teleop, revitz navigation, SLAM, …

You will create your physical world in gazebo (placing obstacles, creating a world) and then everything should be as if you were using the real robot including sensons feedback.

Advanced simulation

If you are bored of the flat map, you cal load a map with some obstacles:

  roslaunch turtlebot_gazebo turtlebot_playground.launch

Connectivity and bugs

It seems that a lot of issues I had trying to simulate the turtlebot with gazebo came from a bad internet connection. Gazebo needs to acces the server to download files.

I had some other more or less random segmentation fault. All this stuff doesn't seem to be really stable but hey! how much did you pay for it? …

I had more problems with

  roslaunch turtlebot_gazebo turtlebot_playground.launch

It seems to be a bit tricky to get the gmapping working with gazebo.

My success to make it work is random for now.

I'm followig the procedure:

  • launch gazebo (turtlebot emty world)
  • wait until gazebo displays the robot
  • launch the gazebo gmapping demo
  • waint until you see the SLAM running: this step often fails, and SLAM never starts, I don't know why…
  • then you can set up your gazebo environment (willowgarage for instance)
  • finaly you should be able to run rviz view_navigation and build your map with a teleop.

EDIT: Apparently you shoud run the gmapping demo just after lanching gazebo instead of waiting for gazebo being completely launched… weird??? 0_o

EDIT 2: A solution to fix this issue is to merge gmappingdemo.launch and turtlebotemptyworld.launch (or playgroud) and save it under another name, because you don't necessary need to run gmapping with a simulation. You can simply add this line at the end of the turtlebotempty_world.launch file, just before </launch>

<include file="$(find turtlebot_navigation)/launch/includes/gmapping.launch.xml"/>

It works fine for me (Ubuntu 13.10, ROS hydro compiled from source)

Next steps

It's time for you to play with demo codes such as:

  roslaunch turtlebot_gazebo gmapping_demo.launch
  roslaunch turtlebot_rviz_launchers view_navigation.launch

And of course all the kickass obstacle avoidance algorithms you could think of ;-).

Have fun!


Basicaly everything comes from the ROS wiki

/home/share/www/ · Last modified: 2019/12/25 15:40 (external edit)