Robotics StackExchange | Archived questions

Gazebo Unable to Intialize SDF

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 & LDLIBRARYPATH, 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\empty.world
[Err] [..\gazebo\Server.cc:391] Unable to initialize sdf
[Wrn] [..\gazebo\Server.cc:341] Falling back on worlds/empty.world
[Err] [..\gazebo\Server.cc:391] 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"
GAZEBOMASTERURI=http://localhost:11345
GAZEBOMODELDATABASEURI=http://models.gazebosim.org
GAZEBOMODELPATH=installDir\rosdeps\x64\share\gazebo-9\models;
GAZEBOPLUGINPATH=installDir\rosdeps\x64\lib\gazebo-9\plugins;
GAZEBORESOURCE_PATH=installDir\rosdeps\x64\share\gazebo-9;

Any help would be greatly appreciated.

Thanks!

Asked by jaelrod on 2020-04-28 13:44:55 UTC

Comments

Answers

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.

Asked by jaelrod on 2020-04-28 17:16:17 UTC

Comments