Console-mode server (gazebo)
The basic gazebo server is a console-mode application: it creates no windows and accepts no user input. The console-mode server is useful for running automated tests and batch experiments.For an interactive GUI interface, see the documentation Interactive server (wxgazebo).
The server is run as follows:
$ gazebo [options] <worldfile>
where [options] is one or more of the following:
- -h : Print usage message.
- -s <id> : Use server id <id> (an integer); default is 0
- -f : Force usage of the server id (use with caution)
- -d <level> : Verbose mode: -1 = none, 0 = critical messages (default), 9 = all messages
- -t <sec> : Timeout and quit after <sec> seconds
- -l <logfile> : Log messages to <logfile>
- -n : Do not do any time control
The server prints some diagnostic information to the console before starting the main simulation loop. Check carefully for any warnings that are printed at this stage; common warnings include:
- Invalid tags or attributes in the world file, which yield "unused attribute" warnings: To remove these warnings, fix the world file.
warning : in worlds/pioneer2at.world:14 unused attribute [xuz]
- Left-over files from an earlier instance of the server (that crashed). To remove this warning, delete the indicated directory.
gz_server.c:111 directory [/tmp/gazebo-ahoward-0] already exists
While the simulation loop is running, basic status information is printed on the console:
Time 1.542 1.560 0.000 [1.000] 0.220 [ 14%]
These five fields specify, in order:
- The elapsed real time (sec).
- The elapsed simulation time (sec).
- The accumulated pause time (sec).
- The ratio of elapsed simulation to elaped real time; i.e., the effective speed of the simulator. This should hover around target speed as specified in the world file, but may fall below this value if your processor is too slow.
- The total CPU time used by the server; useful for performance monitoring.
- The CPU utilization, measured as ratio of total CPU time to elapsed real time. Note that this measures the utilization by the server process only; it does not measure the processor utilization of the X server, which may be significant.
The server can be terminated with control-C
. Errors, warnings and messages are appended by default to a file called .gazebo located in your home directory, or to the log file specified with the -l command line option.