Installing gazebo_ros_pkgs (ROS 1)


The set of ROS packages for interfacing with Gazebo are contained within a new meta package (catkin's version of stacks) named gazebo_ros_pkgs. See Overview of new ROS integration for background information before continuing here.

These instructions are for using the Gazebo versions that are fully integrated with ROS Lunar, ROS Kinetic and ROS Indigo. It is recommended to first read Which combination of ROS/Gazebo version to use before going on with this tutorial. Depending on your needs, you could need an alternative installation.


You should understand the basic concepts of ROS and have gone through the ROS Tutorials.

Install ROS

We recommend for these ROS integration tutorials you install (ros-lunar-desktop-full, ros-kinetic-desktop-full or ros-indigo-desktop-full) so that you have all the necessary packages.

See the ROS installation page for more details. Be sure to source your ROS setup.bash script by following the instructions on the ROS installation page.

Install Gazebo

You can install Gazebo either from source or from pre-build Ubuntu debians.

See Install Gazebo. If installing from source, be sure to build the gazebo_X.Y (X.Y being your desired version) branch.

Test that stand-alone Gazebo works

Before attempting to install the gazebo_ros_pkgs, make sure the stand-alone Gazebo works by running in terminal:


You should see the GUI open with an empty world. Also, test adding a model by clicking on the "Insert" tab on the left and selecting a model to add (then clicking on the simulation to select where to place the model).

Test that you have the right version of Gazebo

To see where you install Gazebo, and if it is in the correct location, run:

which gzserver
which gzclient

If you installed from source to the default location it should say:


If you installed from debian it should say:


Install gazebo_ros_pkgs

Choose the method you would prefer. The easier and faster is installing it from packages but installing from source means you can more easily debug and submit bug patches ;-)

A. Install Pre-Built Debians

The gazebo_ros_pkgs packages are available in:

======= * ROS Noetic:

sudo apt-get install ros-noetic-gazebo-ros-pkgs ros-noetic-gazebo-ros-control
sudo apt-get install ros-melodic-gazebo-ros-pkgs ros-melodic-gazebo-ros-control
sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control

If this installation method ends successfully for you, jump to the Testing Gazebo with ROS Integration section below.

B. Install from Source (on Ubuntu)

If you are running an earlier version of ROS (Groovy or earlier) you will need to install gazebo_ros_pkgs from source. Installing from source is also useful if you want to develop new plugins or submit patches.

Setup A Catkin Workspace

These instructions require the use of the catkin build system.

If you do not have a catkin workspace setup, try the following commands:

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
cd ~/catkin_ws

Then add to your .bashrc file a source to the setup scripts:

echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc

For more details see the Create A Catkin Workspace tutorial.

Clone the Github Repositories

Make sure git is installed on your Ubuntu machine:

sudo apt-get install git
ROS Kinetic

Kinetic is using the gazebo 7.x series, start by installing it:

sudo apt-get install -y libgazebo7-dev

Download the source code from the gazebo_ros_pkgs github repository:

cd ~/catkin_ws/src
git clone -b kinetic-devel

Check for any missing dependencies using rosdep:

rosdep update
rosdep check --from-paths . --ignore-src --rosdistro kinetic

You can automatically install the missing dependencies using rosdep via debian install:

rosdep install --from-paths . --ignore-src --rosdistro kinetic -y

Now jump to the build the gazebo_ros_pkgs section.

Build the gazebo_ros_pkgs

To build the Gazebo ROS integration packages, run the following commands:

cd ~/catkin_ws/

See for issues or questions with building these packages.

Testing Gazebo with ROS Integration

Be sure to always source the appropriate ROS setup file, which for Kinetic is done like so:

source /opt/ros/kinetic/setup.bash

You might want to add that line to your ~/.bashrc.

Assuming your ROS and Gazebo environment have been properly setup and built, you should now be able to run Gazebo through a simple rosrun command, after launching roscore if needed:

Source the catkin setup.bash if it's not already in your .bashrc

source ~/catkin_ws/devel/setup.bash
roscore &
rosrun gazebo_ros gazebo

The Gazebo GUI should appear with nothing inside the viewing window.

To verify that the proper ROS connections are setup, view the available ROS topics:

rostopic list

You should see within the lists topics such as:


You can also verify the Gazebo services exist:

rosservice list

You should see within the list services such as:


Other ROS Ways To Start Gazebo

There are several rosrun commands for starting Gazebo:

  • Launch both the server and client together

    rosrun gazebo_ros gazebo
  • Launch the Gazebo server only

    rosrun gazebo_ros gzserver
  • Launch the Gazebo client only

    rosrun gazebo_ros gzclient
  • Launches the Gazebo server only, in debug mode using GDB

    rosrun gazebo_ros debug
  • Additionally, you can start Gazebo using roslaunch

    roslaunch gazebo_ros empty_world.launch