Gazebo | Ignition | Community
Ask Your Question

Gazebo Unable to Intialize SDF

asked 2020-04-28 14:45:30 -0500

jaelrod gravatar image

Hi folks,

I am brand new to ROS & Gazebo and apologize for any shortcomings of this question due to my own naivety.

I have gotten ROS1 melodic & Gazebo9 installed on Windows and such that I am able to run roslaunch gazebo_ros empty_world.launch. What I am trying to do now is normalize & automate that installation process (in a non-default directory) so that developer experience is consistent from machine to machine. I have almost everything in order, but something is off with SDF. Seems like maybe I need to set some additional path variables or something, but I haven't figured out how to get any more diagnostics information than --verbose. Next step, I guess, is to compile from source and debug it, but thought I'd ask here before going to that length.

sdformat.dll & .lib are in both PATH & LD_LIBRARY_PATH, and from looking in DependencyWalker.exe, it looks like they have all of the dependencies they need, yet I still get SDF errors when running Gazebo. Can I further instruct Gazebo how to run it? Can I get some more detailed diagnostics output?

Errors look like:

gzserver --verbose worlds\
[Err] [..\gazebo\] Unable to initialize sdf
[Wrn] [..\gazebo\] Falling back on worlds/
[Err] [..\gazebo\] Unable to initialize sdf
gz sdf -p ros\melodic\x64\share\urdf_tutorial\urdf\01-myfirst.urdf
ERROR: SDF parsing the xml failed

Gazebo env looks like:

set | findstr /i "gazebo"

Any help would be greatly appreciated.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-04-28 17:16:17 -0500

jaelrod gravatar image

Figured it out, posting the answer here in case anyone else runs into this:

SDF was failing to find file root.sdf. Reading source of sdformat, it looks like the error messages to stream sdferr are disabled on Win32 because of failing tests or something, which would explain why I wasn't provided with any error message.

The reason SDF failed to find.sdf files is because my installation is not in the default directory c:\opt. There is an environment variable, SDF_PATH (I didn't find any documentation of it), that is consulted inside of sdf::findFile. Setting this variable to point installDir\rosdeps\x64\share\sdformat\1.6 resolved the issue, and now Gazebo works fine.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-04-28 13:44:55 -0500

Seen: 317 times

Last updated: Apr 28 '20