next up previous contents
Next: 3. The World File Up: 1 User Guide Previous: 1 User Guide   Contents


2. General Usage

2.1 Installing Third-Party Dependencies

Gazebo relies on a number of third-party libraries, most of which will probably be installed on your system by default. You may, however, have to install the following additional packages before installing Gazebo:

2.2 Building and Installing Gazebo

The Gazebo source tarball can be obtained from
After unpacking the tarball, read the generic instructions in README and INSTALL. If you don't feel like reading those files, the following should suffice in most cases:

  $ ./configure
  $ make
  $ make install
Gazebo will be installed in the default location: /usr/local/. The configure script accepts a number of options for customizing the build process, including changing the install location and adding/removing device drivers. For example, to change the install location for Gazebo to ~/local in your home directory, use:
  $ ./configure --prefix /home/<username>/local
Please read the FAQ entry on local installations, available here:

To see a complete list of build options, use:

  $ ./configure --help
If you are going to use Gazebo with Player, note that Gazebo must be installed before Player.

2.3 Starting Gazebo

The Gazebo server can be started as follows:

  $ gazebo <worldfile>
where <worldfile> is the file containing the description of the world and everything in it. Sample world files can be found in the worlds directory of the source distribution, or in the installed version under /usr/local/share/gazebo/worlds/ (default install). For example:
  $ gazebo /usr/local/share/gazebo/worlds/
will create a simple world with a single robot. Gazebo will display a window with a view of the simulated world; the camera viewpoint can be changed by dragging around with the mouse.

2.4 Working with Player

The Player device server treats Gazebo in exactly the same way that it treats real robot hardware: as a device that is a source of data and a sink for commands. Users must therefore run Player seperately, and point it at an running instance of Gazebo. Player has a number of specific drivers, such as gz_position and gz_laser that can be used to interact with Gazebo models.

For example, after starting Gazebo as per the above example, run Player like this:

  $ player -g default /usr/local/share/player/config/gazebo.cfg
Player will output a message indicating that is has connected with the simulation:
   libgazebo msg : opening /tmp/gazebo-<username>-default-sim-default
Users can now interact with the simulated robot exactly as the would a real robot. Try running playerv, for example:
  $ playerv --position:0 --laser:0
This will pop up the standard Player viewer utility. You should see an outline of the robot and the laser scan. Use the mouse to pan and zoom. You can driver the robot around by selecting the "command" option from the menu, and then dragging the little cross hairs to where you want the robot to go. You should see the the robot in the Gazebo window moving at the same time.

See Chapter 4 for examples of typical Player/Gazebo configurations, and consult the Player manual for information on specific Player drivers.

2.5 Command Line Options

Gazebo recognizes the following command line options.

Argument Meaning
-v Print the version string.

next up previous contents
Next: 3. The World File Up: 1 User Guide Previous: 1 User Guide   Contents