How to use iRobot Create with ROS Indigo and Gazebo

This is an update to my previous post on setting up an iRobot Create/Roomba in Gazebo/ROS for the new ROS distro Indigo.

Steps :

1. Follow the ROS instruction guidelines for Indigo installation [follow ros.org]
2. Setup your catkin workspace (again instructions in ROS wiki)
3. ROS Indigo should automatically install Gazebo 2.x
4. Start here for tutorials on working with ROS and Gazebo. Complete all the tutorials http://gazebosim.org/tutorials
5. Download the iRobot Create SDF from the online repo. It is possible to download the entire library of models from https://bitbucket.org/osrf/gazebo_models
6. Put the “create” folder from the downloaded models into your ~/catkin_ws/src/ directory
7. Insert the differential drive plugin into the model-1_4.sdf file. The plugin can be found here . Problem here is that the plugin has tags which are not required. I am attaching the modified sdf file. (download and change extension to .sdf, replace the original model-1_4.sdf file with the new file).

Assuming you completed all the steps above(use the provided sdf file), here are the instructions to control the icreate with velocity commands from terminal:

1. From the terminal launch roscore. $roscore
2. Launch gazebo with an empty world. $roslaunch gazebo_ros empty_world.launch
3. In another terminal, spawn the create into the gazebo instance. Change directory to your create model. Then: $rosrun gazebo_ros spawn_model -file ~/catkin_ws/src/create/model-1_4.sdf -sdf -model create
4. Then send commands to make the robot move. $rostopic pub -r 10 /cmd_vel geometry_msgs/Twist ‘{linear: {x: 0.1, y: 0.0, z: 0.0}, angular: {x: 0.0,y: 0.0,z: 0.0}}’

8 comments

  1. Hello Saurav,

    First off, great tutorial, especially for a starter like me; thank you.

    I have a question, I am trying to make a launch file that launches multiple of these roombas in gazebo, but I am getting really confused. The online tutorials are confusing, is there a simple way to launch a bunch of roombas at once, and position them in gazeebo?

    Thank you,
    Harsh

    1. Thanks Harsh :), I am glad you found it useful. Can you please share the launch file that you have created. I have never personally tried to use a launch file to spawn models in gazebo. The spawn_model script makes a service request to gazebo. You can modify this script and spawn multiple robots in the same gazebo instance. I think this page might be useful -> Gazebo Tutorial on Spawn Model

      1. I know that this is relatively old, but my brief search has led me to think that when using ROS launch to launch gazebo robot models it still expects to use the urdf format, instead of the sdf model. I am not certain that there is a direct way to launch sdf files. If someone has references for that, I would be grateful if you would point me to it.

          1. Good point. I haven’t. By the way, thanks for putting these notes together. Truly appreciated.

  2. Hello Saurav,

    Thanks for this great tutorial, it’s very easy to follow, but I can’t seem to get the robot to move. It succesfully spawns in Gazebo, but it doesn’t move at all when I send the ros commands. The robot does seem to receive the commands from ros, because when I remove certain pieces of code (such as the … snippets from the left and right wheels), it does move, but in those cases the entire robot starts to spin out of control or even launch itself into the air instead of just moving forward. I followed a different tutorial for a much simpler differential drive robot (http://www.theconstructsim.com/how-to-build-a-differential-drive-simulation/) and this one does drive normally.

    I am using ROS Jade and Gazebo 5.1.0. Do you have any idea why the robot doesn’t move, and is it supposed to work with my versions of ROS and Gazebo? Thanks a lot in advance!

    Best regards,
    Jasper

    1. By the way, those snippets I was talking about were the “inertial” tags in the links of the left and right wheels, it was one of the many things I tried to change or remove to make the robot work. The problem seems to be part of the left and right wheels, but I’m not sure where exactly (the links, the joints etc.).
      Update: I uninstalled ROS and Gazebo and installed your versions (Indigo + Gazebo 2.2) instead and it worked. Thanks again for the great tutorial!

      1. Happy to know you found it useful Jasper! I haven’t yet found the time to update to Jade and Gazebo 5.1 so I have no idea what changes are needed.
        Thanks for sharing your experience, an updated tutorial for Jade is on my to-do list:)

Leave a Reply

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