Robotics StackExchange | Archived questions

gazebo 11.7 -- gz 'SDF parsing the xml failed'

I am trying to insert a model file into gazebo from gnome-terminal using the gz utility. I get the error Error: SDF parsing the xml failed if I use the command, "gz model -f ./model.sdf -m my_robot".

When I insert this or other model files manually, they work. Do you know how I can use the above command to insert an SDF file into gazebo from terminal?

Asked by smdorsey42 on 2021-11-29 06:12:20 UTC

Comments

For future reference, the following manpage explicitly stated what the "gz model" and "gz sdf" commands are for, but I just didn't comprehend it correctly:

http://manpages.ubuntu.com/manpages/bionic/man1/gz.1.html

Asked by smdorsey42 on 2021-11-30 06:13:28 UTC

Answers

Update: I am replying here in case any other users new to gazebo needing to insert a model file from terminal, for whatever reason, can find this thread. I doubt anyone else will suffer the same misconception as I did, but there you go.

I have learned the following things and resolved my core issue, and so will be closing this thread in a minute: 1) I'm a big, dumb, dodo bird

2) gz sdf is not, or can not, be used to spawn an sdf file, but is used to parse, convert, and/or output SDF files from at least the URDF file format, and possibly others??? Maybe it can use the --spawn-file argument to spawn URDF files, but that is not what I needed for the tutorial.

3) The answer to my question was to use the command: "sudo gz model -f /home/gazebo/.gazebo/models/my_robot/model.sdf -m "My Robot" "

And doing so, I explicitly used sudo thinking it would help guarantee that gz was allowed to read from the .gazebo directory, without any permissions issues arising. This may be a non-issue, but I wanted to be sure.

The model file spawned and was automatically shifted to the appropriate x, y, z, R, P, Y values as defined in the model file.

Asked by smdorsey42 on 2021-11-30 06:11:23 UTC

Comments