If you are in a folder that contains a file named model.sdf and attempt to spawn it with the command gzfactory spawn -f model.sdf, it will fail with the following error:
$ gzfactory spawn -f model.sdf
Error [parser_urdf.cc:2597] Unable to call parseURDF on robot model
Error [parser.cc:273] parse as old deprecated model file failed.
Error: SDF parsing the xml failed
This occurs because sdf::findFile finds share/sdformat/1.4/model.sdf before it finds the model.sdf in the local folder.
Using an absolute path works:
$ gzfactory spawn -f $PWD/model.sdf
Msg Waiting for master
Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 192.168.1.183
Spawning Model into default world.
Other filenames also work.
$ gzfactory spawn -f model-1_3.sdf
Msg Waiting for master
Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 192.168.1.183
Spawning Model into default world.
Presumably, other file names will have this same issue: joint.sdf, light.sdf, etc.
Original report (archived issue) by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).
If you are in a folder that contains a file named model.sdf and attempt to spawn it with the command
gzfactory spawn -f model.sdf
, it will fail with the following error:This occurs because
sdf::findFile
findsshare/sdformat/1.4/model.sdf
before it finds the model.sdf in the local folder.Using an absolute path works:
Other filenames also work.
Presumably, other file names will have this same issue:
joint.sdf
,light.sdf
, etc.