Gazebo | Ignition | Community
Ask Your Question

Where does gazebo search for the root.sdf file?

asked 2018-05-28 05:56:00 -0500

Adrian gravatar image

Hi together,

I compiled gazebo 9.0.0 from source with reference to sdformat 6.0.0. Now when I try to start the gzserver with the world "worlds/" I get the following error:

Error [] Unable to load file[]
Gazebo multi-robot simulator, version 9.0.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.

[Msg] Waiting for master.
[Msg] Connected to gazebo master @
[Msg] Publicized address:
[Err] [] Can't open display: 
[Wrn] [] Unable to create X window. Rendering will be disabled
[Wrn] [] Cannot initialize render engine since render path type is NONE. Ignore this warning ifrendering has been turned off on purpose.
Error [] Unable to find or open SDF file[root.sdf]
[Err] [] Unable to initialize sdf
[Wrn] [] Falling back on worlds/
Error [] Unable to find or open SDF file[root.sdf]
[Err] [] Unable to initialize sdf

process with pid 3648 terminated by signal SIGSEGV with status: 139 (core dumped!)

The fact that gazebo cannot open the display is ok for me since gazebo is running headlessly on the robot (yes, that might seem strange but in the end it makes sense ^^).

My SDFormat library is not installed in the standard path (e.g. /usr) but in a special directory for foreign packages. To me it seems that I should tell gazebo via any environment variable where to search for root.sdf but I don't know how to do that.

I would be very thankful if anyone could give me a hint.

Thanks and cheers

edit retag flag offensive close merge delete


Are both Gazebo and SDFormat installed in the same non-standard path?

chapulina gravatar imagechapulina ( 2018-05-28 23:14:39 -0500 )edit

More or less. They share the same PREFIX witch is /volume/software/foreign_packages and the gazebo is in ${PREFIX}/gazebo/9.0.0 and sdf in ${PREFIX}/sdformat/6.0.0. Maybe it is worth mentioning, that both packages have been compiled locally and then moved to ${PREFIX}. While moving I tried to take care of adapting all paths, especially in the pkgconfig-files and the cmake-files to fit the new directory. I also adapted the environment paths in sdf_config.h. Still the issue persists.

Adrian gravatar imageAdrian ( 2018-05-29 02:21:41 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-05-29 03:26:30 -0500

Adrian gravatar image

Ok. seems that I found the problem. It did not really have to do with gazebo but rather with SDFormat. My mistake had to do with the way I compiled and then moved SDFormat.

In essence, I had a local install directory, let's call it ${localdir} and then the final destination where SDFormat should be run later ${runtimeDir}. I invoked cmake with cmake .. -DCMAKE_INSTALL_PREFIX=${localdir}, then used make && make install and finally moved the compiled binaries to ${runtimeDir} changing all necessary paths.
However, it seems like I missed some paths or some of them had been compiled into the library, so the solution was to use cmake .. -DCMAKE_INSTALL_PREFIX=${runtimeDir} and then invoke make && make install DESTDIR=${localdir}.

With that approach the libraries were compiled correctly plus I did not have to change any paths at all after moving to ${runtimeDir}.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2018-05-28 05:56:00 -0500

Seen: 5,577 times

Last updated: May 29 '18