Tutorials/1.5/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, 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.

A bash script is installed with Gazebo that will set these environment variables to defaults that will work in most cases:

source /share/gazebo/setup.sh

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.
 * 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) 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 plugin's overview page.