Tutorials/1.2/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 included in a world file using the following SDF syntax:

">

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


 * 1) Environment Variables ###

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

> `GAZEBO_MASTER_URI`: The hostname and port of the master, typically `http://localhost:11345`

> `GAZEBO_RESOURCE_PATH`: Path to the resource files, typically `/shared/gazebo- `

> `GAZEBO_PLUGIN_PATH`: Path to Gazebo plugins, typically `/lib/gazebo- /plugins`

> `OGRE_RESOURCE_PATH`: Path to Ogre plugins, typically `/lib/OGRE`

todo document gazebo_model_path

A bash script is installed with Gazebo that will set these environment variables:

source /share/gazebo- /setup.bash 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. gzserver  The `` must be relative to the current directory, an absolute path, or a world file shipped with Gazebo. Worlds that are shipped with Gazebo are located in `/share/gazebo-/worlds`.
 * 1) Gazebo Server ###

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 plugins page.