Gazebo | Ignition | Community
Ask Your Question
0

Gazebo Unable to Intialize SDF

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

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\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"
GAZEBO_MASTER_URI=http://localhost:11345
GAZEBO_MODEL_DATABASE_URI=http://models.gazebosim.org
GAZEBO_MODEL_PATH=installDir\rosdeps\x64\share\gazebo-9\models;
GAZEBO_PLUGIN_PATH=installDir\rosdeps\x64\lib\gazebo-9\plugins;
GAZEBO_RESOURCE_PATH=installDir\rosdeps\x64\share\gazebo-9;

Any help would be greatly appreciated.

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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

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

Stats

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

Seen: 78 times

Last updated: Apr 28