Tutorials/1.9/gazebo components


 * 1) Tutorial: Components#

This page describes each of the item involved in running a Gazebo simulation.


 * 1) World Description File ###

The world description file contains all the elements in a simulation, including robots, lights, sensors, and static objects. This file is formatted using SDF (Simulation Description Format), and typically has a `.world` extension.

The Gazebo server (`gzserver`) reads this file to generate and populate a world.

A number of example worlds are shipped with Gazebo. These worlds are located in `/share/gazebo- /worlds`.


 * 1) Model Files ###

A model file uses the same SDF format as world files, but should only contain a single ` ... `. The purpose of these files is to facilitate model reuse, and simplify world files. Once a model file is created, it can be included in a world file using the following SDF syntax:



A number of models are provided in the online model database (in previous versions, some example models were shipped with Gazebo). Assuming that you have an Internet connection when running Gazebo, you can insert any model from the database and the necessary content will be downloaded at runtime.


 * 1) Environment Variables ###

Gazebo uses a number of environment variables to locate files, and setup communications between the server and clients.

Starting with Gazebo 1.9.0, default values that work for most cases are compiled in, so that if you don't need to set any variables. These defaults are also included in a shell script:

source /share/gazebo/setup.sh

If you want to modify Gazebo's behavior, e.g., by extending the path it searches for models, you should first source the shell script listed above, then modify the variables that it sets. The server is the workhorse of Gazebo. It parses a world description file given on the command line, and then simulates the world using a physics and sensor engine. The server can be started using the following command. Note that the server does not include any graphics; it's meant to run headless.
 * 1) Gazebo Server ###

gzserver 

The `` can be: (i) relative to the current directory, (ii) an absolute path, or (iii) relative to a path component in `GAZEBO_RESOURCE_PATH`. Worlds that are shipped with Gazebo are located in `/share/gazebo-/worlds`.

For example, to use the `empty.world` which is shipped with Gazebo, use the following command

gzserver worlds/empty.world


 * 1) Graphical Client ###

The graphical client connects to a running `gzserver` and visualizes the elements. This is also a tool which allows you to modify the running simulation.

The graphical client is run using:

gzclient


 * 1) Server + Graphical Client in one ###

The `gazebo` command combines server and client in one executable. Instead of running `gzserver worlds/empty.world` and then `gzclient`, you can do this:

gazebo worlds/empty.world


 * 1) Plugins ###

Plugins provide a simple and convenient mechanism to interface with Gazebo. Plugins can either be loaded on the command line, or specified in a world/model file (see the SDF format). Plugins specified on the command line are loaded first, then plugins specified in the world/model files are loaded. Most plugins are loaded by the server; however, plugins can also be loaded by the graphical client to facilitate custom GUI generation.

Example of loading a plugin on the command line:

gzserver -p  

The same mechanism is used by the graphical client:

gzclient -p 

For more information refer to the plugins overview page.