Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I would recommend the command-line tool gzfactory. For some reason, we don't have a tutorial for it yet. To use it, you need a an sdf file. I used one of the model sdf files in the ~/.gazebo/models folder. For example to spawn a hokuyo sensor (make sure it's in your .gazebo/models folder first):

gzfactory spawn -f ~/.gazebo/models/hokuyo/model-1_3.sdf

To spawn another, you'll need to specify a different name, and you'll probably want to put it somewhere else:

gzfactory spawn -f ~/.gazebo/models/hokuyo/model-1_3.sdf -m hokuyo_1 -x 1

Here's the help output that I see when typing gzfactory:

This tool for spawning or deleting models into or from a running Gazebo simulation.

  gzfactory <spawn|delete> [options]
    spawn   : Spawn new model. Must specify a SDF model file.
    delete  : Delete existing model. Must specify model name.

Allowed options:
  -h [ --help ]           produce this help message
  -f [ --sdf ] arg        SDF model file.
  -w [ --world-name ] arg Name of Gazebo world.
  -m [ --model-name ] arg Model name.
  -x [ --pose-x ] arg     set model x position.
  -y [ --pose-y ] arg     set model y position.
  -z [ --pose-z ] arg     set model z positione.
  -R [ --pose-R ] arg     set model roll orientation in radians.
  -P [ --pose-P ] arg     set model pitch orientation in radians.
  -Y [ --pose-Y ] arg     set model yaw orientation in radians.