GZ(1)
π gz(1) β bestie's guide to the gazebo command line β¨
okay so you opened the manual for gz and you came to the right place. this is the Gazebo command line tool for control and analysis, and we're gonna get through the whole thing together. boba in hand, let's go. π
π NAME
gz β Gazebo command line tool for control and analysis.
that's it. that's the whole vibe. π
π SYNPOSIS
gz command [option]... [argument]...
so you say gz, then a command, then however many options you want, then your arguments. structure, we love her. π¦
π§ COMMANDS
πΈ camera
gz camera [options]
this one changes the properties of a camera. if you don't tell it which world you mean with -w, it just grabs the first world it finds on the Gazebo master, no questions asked. but a camera name? required. you gotta give it one, bestie.
Options:
--verboseβ print extra information, if you're nosy like me π-h,--helpβ print this help message-w,--world-name=argβ world name.-c,--camera-name=argβ camera name. psst, rungz camera -lto get a list of camera names first. π-l,--listβ list all cameras-f,--follow=argβ model to follow.
π debug
gz debug [options]
this one is used primarily for bash completion. you give it a command, it returns the completion list for that command. it's giving behind-the-scenes main character. β¨
Options:
--verboseβ print extra information-h,--helpβ print this help message-o,--option=argβ show the command options.
π help
gz help [options]
outputs information about a gz command. when in doubt, ask for help. no shame in it. π«Ά
Options:
--verboseβ print extra information-h,--helpβ print this help message
π¦Ύ joint
gz joint [options]
changes the properties of a joint. if you don't specify a world name with -w, it uses the first world found on the Gazebo master. a model name and a joint name are required.
ok so important: it is recommended to use only one type of command β force, position PID, or velocity PID. don't mix, bestie, it's not that kind of party.
here's the breakdown:
- Force: use
--forceto apply a force. - Position PID: use
--pos-tto specify a target position, along with--pos-p,--pos-i,--pos-dto specify the PID parameters. - Velocity PID: use
--vel-tto specify a target velocity, along with--vel-p,--vel-i,--vel-dto specify the PID parameters.
Options:
--verboseβ print extra information-h,--helpβ print this help message-w,--world-name=argβ world name.-m,--model-name=argβ model name.-j,--joint-name=argβ joint name.-f,--force=argβ force to apply to a joint (N).--pos-t=argβ target angle(rad) for rotation joints or position (m) for linear joints.--pos-p=argβ position proportional gain.--pos-i=argβ position integral gain.--pos-d=argβ position differential gain.--vel-t=argβ target speed (rad/s for rotational joints or m/s for linear joints).--vel-p=argβ velocity proportional gain.--vel-i=argβ velocity integral gain.--vel-d=argβ velocity differential gain.
πΌ log
gz log [options]
introspect and manipulate Gazebo log files. the log command can also start and stop data log recording from an active Gazebo server. multitasking queen. π
Options:
--verboseβ print extra information-h,--helpβ print this help message-i,--infoβ output information about a log file. the log filename should be specified using the--fileoption-e,--echoβ output the contents of a log file to screen.-s,--stepβ step through the contents of a log file.-d,--record=argβ start/stop recording a log file from an active Gazebo server.0=stop record,1=start recording.-w,--world-name=argβ world name, used when starting or stopping recording.-r,--rawβ output the data from echo and step without XML formatting. used in conjuction with--echoor--step.--stamp=argβ add a timestamp to each line of output. valid values aresim,real,wall-z,--hz=argβ filter output to the specified Hz rate. only valid for echo and step commands.-f,--file=argβ path to a log file.-o,--output=argβ output file, valid in conjunction with the filter, raw, hz, and encoding commands. by default, the output file will have the same encoding as the source file. override with the--encodingoption-n,--encoding=argβ specify the encoding (txt,zlib, orbz2) for an output file. valid in conjunction with the output command. see also the--outputargument.--filter=argβ filter output. valid only with the echo, step, and output commands
π marker
gz marker [options]
add, modify, or delete visual markers. little stickers for your sim, basically. πΈ
π Option Details
-a, --add: no argument
this option indicates that a marker should be added or modified. use this in conjunction with -t to specify a marker type, -i to specify a marker id, -p to specify a parent, -f to specify a lifetime for the marker, or -n to specify a namespace.
-n, --namespace: string argument
namespaces allow markers to be grouped. this option can be used the -a and -x command. the default namespace is empty string.
-i, --id: integer argument
each marker has a unique id. use this option with the -a command to assign an id to a marker. if -i is not specified, a value of zero will be used.
-t, --type: string argument
use this command with -a to specify a marker type. the string argument must be one of: sphere, box, cylinder, line_list, line_strip, points, sphere, text, triangle_fan, triangle_list, triangle_strip.
-p, --parent: string argument
a marker can be attached to an existing visual. use this command with -a to specify a parent visual. by default a marker is not attached to a parent visual.
-f, --lifetime: double argument
a marker's lifetime is the number of seconds that it will exist. time starts counting when the marker is created. by default a marker has an infite lifetime.
-d, --delete: integer argument
this option will delete a single marker, if a marker exists with the specified id. the integer argument is the id of the marker to delete.
-x, --delete-all: no argument
delete all markers.
-l, --list: no argument
list all markers.
-y, --layer: integer argument
add or move a marker to the specified layer. use this argument with the -a argument.
-m, --msg: string argument
use this option to send a custom marker message. this option will override all other command line options. details about the marker message can be found using:
$ ign msg -i ign_msgs.Marker
Example:
$ gz marker -m 'action: ADD_MODIFY, type: SPHERE, id: 2, scale: {x:0.2, y:0.4, z:1.2}'
Options:
--verboseβ print extra information-h,--helpβ print this help message-a,--addβ add or modify a visual marker-m,--msg=argβ specify and send a marker message.-n,--namespace=argβ namespace for the visual marker-i,--id=argβ positive integer value of a visual marker-t,--type=argβ type of geometry:box,cylinder,sphere,line_list,line_strip,points,text,triangle_fan,triangle_list,triangle_strip-p,--parent=argβ name of a visual to which this marker should be attached.-f,--lifetime=argβ simulation time the marker should last before deletion.-d,--deleteβ delete an existing visual marker.-x,--delete-allβ delete all markers, or all markers in a namespace.-l,--listβ get a list of the visual markers.-y,--layer=argβ add or move a marker to the specified layer.
π§Έ model
gz model [options]
change properties of a model, delete a model, or spawn a new model. if you don't name a world with -w, it grabs the first world found on the Gazebo master. (the original says "pecified" here, and honestly? relatable. we all have typos. π)
Options:
--verboseβ print extra information-h,--helpβ print this help message-m,--model-name=argβ model name.-w,--world-name=argβ world name.-d,--deleteβ delete a model.-f,--spawn-file=argβ spawn model from SDF file.-s,--spawn-stringβ spawn model from SDF string, pass by a pipe.-i,--infoβ output model state information to the terminal.-p,--poseβ output model pose as a space separated 6-tuple:x y z roll pitch yaw.-x,--pose-x argβ x value-y,--pose-y argβ y value-z,--pose-z argβ z value-R,--pose-R argβ roll in radians.-P,--pose-P argβ pitch in radians.-Y,--pose-Y argβ yaw in radians.
πͺ physics
gz physics [options]
change properties of the physics engine on a specific world. no world name with -w? you know the drill β first world found on the Gazebo master. π
Options:
--verboseβ print extra information-h,--helpβ print this help message-w,--world-name=argβ world name.-g,--gravity=argβ gravity vector. comma separated 3-tuple without whitespace, eg:-g 0,0,-9.8-s,--step-size=argβ maximum step size (seconds).-i,--iters=argβ number of iterations.-u,--update-rate=argβ target real-time update rate.-o,--profile=argβ preset physics profile.
π sdf
gz sdf [options]
introspect, convert, and output SDF files. use the -v option to specify the version of SDF for use with other options. π
Options:
--verboseβ print extra information-h,--helpβ print this help message-d,--describeβ print SDF format for given version(-v).-c,--convert=argβ in place conversion ofargto the latest SDF version.-o,--docβ print HTML SDF. use-vto specify version.-k,--check=argβ validatearg.-v,--version=argβ version of SDF to use with other options.-p,--print=argβ printarg, useful for debugging and as a conversion tool.
π stats
gz stats [options]
prints gzserver statics to standard out. (yes, "statics". we're keeping it. π) if you don't specify a world with -w, it uses the first world found on the Gazebo master.
Options:
--verboseβ print extra information-h,--helpβ print this help message-w,--world-name=argβ world name.-d,--duration=argβ duration (seconds) to run.-p,--plotβ output comma-separated values, useful for processing and plotting.
π‘ topic
gz topic [options]
print topic information to standard out, or publish a message on a topic. if you don't specify a world name with -w, it uses the first world found on the Gazebo master. π₯
Options:
--verboseβ print extra information-h,--helpβ print this help message-w,--world-name=argβ the world name, bestie. that's it, that's the whole thing π«Ά-l,--listβ show me ALL the topics, every single one, the whole roster π-i,--info=argβ get the tea on a specific topic, drop the topic name in arg and it spills β-e,--echo=argβ blast the topic's data straight to your screen so you can watch it go brrr π-v,--view=argβ same idea but make it fashion: peep the topic data through a QT widget β¨-z,--hz=argβ get the publish frequency, aka how often this thing is posting π-b,--bw=argβ get the topic bandwidth, aka how chonky the data stream is πΈ-p,--publish=argβ publish a message onto a topic. you're the main character now, you're the one posting π£-r,--request=argβ send a request, like sliding into the DMs but for topics π-u,--unformattedβ echo output but raw and unfiltered, no formatting, no makeup, no filter πͺ-d,--duration=argβ how long (in seconds) to keep it running. only applies withecho,hz, andbwβ±οΈ-m,--msg=argβ the actual message you're sending on the topic. applies withpublishandrequestπ¬-f,--file=argβ path to a file holding the message you wanna send on the topic. also applies withpublishandrequestπ
π world π
gz world [options]
okay so this one changes the properties of a Gazebo world on a server that's already running. and here's the lil shortcut bestie needs to know: if you don't hand it a name for the world β that's option -w β it's just gonna grab the first world it finds on the Gazebo master. no questions asked, first come first served π
Options:
--verboseβ print the extra deets, give me all the context π£οΈ-h,--helpβ print this help message. classic, iconic, always there for you π-w,--world-name=argβ world name. yeah she's back, she's everywhere π-p,--pause=argβ pause or unpause the simulation.0=unpause,1=pause. freeze frame πΈ-s,--stepβ step the simulation forward one single iteration. baby steps, one at a time π¦-m,--multi-step=argβ step the simulation mulitple iteration. (that's the original spelling bestie, i don't make the rules, i just respect them π)-r,--reset-allβ reset time AND model poses. full factory reset energy, everything back to square one π-t,--reset-timeβ reset just the time β°-o,--reset-modelsβ reset just the models π§Έ
heads up:--pause=argis picky β it only takes0for unpause or1for pause. no vibes-based in-between values, fr fr.
and that's the whole page, bestie!! this one's from the September 2014 era, and it's the GZ(1) manual page. go forth and slay your simulations πβ¨π
π¦ where this page comes from
- ubuntu jammy: gazebo 11.10.2+dfsg-1 Β· Apache-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms