Add a model to SDF by name and coordinates

Hi all, first time here.
I wanted to have the ability to run a script which given a model name (e.g table, cup, etc) and x y z pitch roll yaw. will add the model to the world.
I tried to find something similar but I couldn’t, does anybody knows of such?
If not, any suggestion on how to start? is there a nice gazebo api to work with?
Thanks a lot!

Welcome!

I think the simplest solution would be using the gz model command line tool, for example:

gz model --spawn-file=path/to/my_robot.sdf --model-name=myrobot -x 10 -y 20 -z 30 -R 1.57

See gz model -h for more options.

1 Like