Tutorials/1.9/Overview of new ROS integration

As of Gazebo 1.9 and ROS Hydro, Gazebo no longer has any direct ROS dependencies and is now installed as an Ubuntu stand-alone package. Historically using Gazebo with ROS required a specific version of Gazebo be built with the legacy 'simulator_gazebo' stack.

To achieve ROS integration with stand-alone Gazebo, a new set of ROS packages named [`gazebo_ros_pkgs`](http://ros.org/wiki/gazebo_ros_pkgs) has been created to provide wrappers around the stand-alone Gazebo. They provide the necessary interfaces to simulate a robot in Gazebo using ROS messages, services and dynamic reconfigure. Among the primary differences from 'simulator_gazebo', 'gazebo_ros_pkgs' now:

- Supports the latest stand alone system dependency of Gazebo, that has no ROS bindings on its own - Builds with catkin - Treats URDF and SDF as equally as possible - Reduces code duplication with Gazebo - Improves out of the box support for controllers using ros_control - Integrates real time controller efficiency improvements from the DARPA Robotics Challenge - Cleans up old code from previous versions of ROS and Gazebo

An overview of the new interface is in the following diagram:




 * 1) Upgrading from simulator_gazebo

The following guidelines will help you upgrade your Gazebo-dependent packages from simulator_gazebo for use in your ROS packages:


 * 1) Catkin

Your previous packages for interfacing with Gazebo with the old simulator_gazebo stack are likely still using the rosbuild build system. With gazebo_ros_pkgs in ROS Hydro, you will first need to "catkinize" your packages to begin migration. See the Catkin Tutorials.


 * 1) Launch Files

Some changes are required in previously created roslaunch files for starting Gazebo. The best way to update these packages is to review the Using roslaunch files to spawn models in Gazebo tutorial. In a nutshell:

- Within roslaunch files, pkg="gazebo" needs to be now renamed to pkg="gazebo_ros" - gazebo_worlds package has been removed. Most of the world files were rarely used and were not maintained with changes in SDF XML formats. Thus, all worlds have been centralized within the Gazebo project itself, including empty.world. - The best way to use Gazebo launch files is to simply inherent/include the master "empty world" launch file located in the gazebo_ros package.


 * 1) CMakeLists.txt

- Because Gazebo is no longer a ROS package but instead a system dependency, your CMake file might need to be reconfigured. The following is an example CMakeLists.txt:

cmake_minimum_required(VERSION 2.8.3) project(YOURROBOT_gazebo_plugins)

find_package(catkin REQUIRED COMPONENTS  gazebo_ros )

find_package(gazebo REQUIRED)
 * 1) Depend on system install of Gazebo

include_directories(include ${catkin_INCLUDE_DIRS} ${GAZEBO_INCLUDE_DIRS} ${SDFormat_INCLUDE_DIRS})

add_library(...) # TODO
 * 1) Build whatever you need here

catkin_package(   DEPENDS       gazebo_ros    CATKIN_DEPENDS    INCLUDE_DIRS     LIBRARIES )


 * 1) package.xml

This is the replacement for the rosbuild "manifest.xml":

- Add dependency on the new gazebo_ros</tt> package: <build_depend>gazebo_ros</build_depend> <run_depend>gazebo_ros</run_depend>

The names of the ROS nodes to launch Gazebo have changes slightly to coincide with the Gazebo executable names:
 * 1) Running Gazebo

- rosrun gazebo_ros gazebo</tt> now launch both the Gazebo server and GUI. - rosrun gazebo_ros gui</tt> has been renamed to rosrun gazebo_ros gzclient</tt> - rosrun gazebo_ros gzserver</tt> has been added

Available nodes to run:

rosrun gazebo_ros gazebo rosrun gazebo_ros gzserver rosrun gazebo_ros gzclient rosrun gazebo_ros spawn_model rosrun gazebo_ros perf rosrun gazebo_ros debug

These nodes are better documented in the tutorial Using roslaunch files to spawn models in Gazebo.


 * 1) More

Add your upgrade issues here, please


 * 1) Tutorials

Tutorials from ros.org have been almost entirely removed and re-written from scratch on this website to reflect the many changes that have occured over the course of Gazebo's history. We've done our best to thoroughly document how to get your URDF-based robot running smoothly in Gazebo. If you have any question please see answers.ros.org.

Continue to Installing gazebo_ros Packages