IGN_GAZEBO_RESOURCE_PATH doesn't find files if there is more than one path

asked 2020-04-16 09:08:13 -0500

heuristicus gravatar image

I've just started using gazebo with ignition but am having issues setting up resource paths correctly. I have existing world and model files which have been previously used with gazebo_ros.

Models and world files exist in subdirectories worlds and models of the test directory.

The world file (test.world) I am working with looks like:

<?xml version="1.0" ?>
<sdf version="1.4">
  <world name="default">
      <pose>0.5 0 0 0 0 0</pose>

With no change to the IGN_GAZEBO_RESOURCE_PATH, running ign gazebo test.world -v4 does nothing, as of course the file cannot be found.

Now, I add the location of the world file to the resource path:

$ export IGN_GAZEBO_RESOURCE_PATH=/home/user/robots/test/worlds
$ ign gazebo test.world -v4
[Msg] Ignition Gazebo Server v2.16.0
[Msg] Ignition Gazebo GUI    v2.16.0
[Msg] Loading SDF world file[/home/user/robots/test/worlds/test.world].
[Err] [Server.cc:144] Error Code 11 Msg: Unable to find uri[model://ground_plane]
[Err] [Server.cc:144] Error Code 11 Msg: Unable to find uri[model://test/models/block_field]
[Dbg] [ign.cc:279] Shutting down ign-gazebo-server
[Dbg] [Application.cc:87] Initializing application.
[GUI] [Dbg] [Application.cc:407] Create main window
[GUI] [Dbg] [ign.cc:359] GUI requesting list of world names. The server may be busy downloading resources. Please be patient.
[GUI] [Dbg] [SignalHandler.cc:141] Received signal[2].
[GUI] [Dbg] [SignalHandler.cc:141] Received signal[2].
[GUI] [Dbg] [Application.cc:130] Terminating application.

Now it finds the location of the test file but cannot find the models. So, I add the paths to the models::

$ export IGN_GAZEBO_RESOURCE_PATH=${IGN_GAZEBO_RESOURCE_PATH}:/home/user/robots/test/models:/usr/share/gazebo-9/models
$ ign gazebo test.world -v4
Unable to find file test.world

And for some reason it cannot find the world file anymore.

If I go to ~/robots/test/worlds and run ign gazebo test.world -v4, I get the same result as before, where it cannot find the models.

What am I doing wrong?

edit retag flag offensive close merge delete