Gazebo | Ignition | Community
Ask Your Question
0

Some questions about <uri> in sdf files

asked 2023-06-14 08:40:12 -0500

biagio gravatar image

updated 2023-06-14 10:53:54 -0500

Hi to all.

I was reading the Gazebo documentation and I have some questions to which I was not able to find an answer neither in the documentation nor on the forums.

As far I as I have understood, Gazebo has a bunch of environmental variable that expand to a list of path in the system to look for files. Copy pasting from my notes we have:

  • GAZEBO_MODEL_PATH: colon-separated set of directories where Gazebo will search for models

  • GAZEBO_RESOURCE_PATH: colon separated set of directories where Gazebo will search for other resources such as world and media files

  • GAZEBO_MASTER_URI: uri of the gazebo master. This specifies the IP and port where the server will be started and tells the clients where to connect to.

  • GAZEBO_PLUGIN_PATH: colon-separated set of directories where Gazebo will search for the plugin shared libraries at runtime

  • GAZEBO_MODEL_DATABASE_PATH: URI of the online model database where Gazebo will download model from

Now, when we build a model using an sdf file, we can use the tag <uri>path_to_resource</uri> to look for specific resources, such as meshes, models and so on. In the documentation and online tutorial, I have often found things like

<uri>model://path</uri>

or

<uri>file://path</uri>

Now, I guess that model:// is just a place holder for GAZEBO_MODEL_PATH.

My questions are:

  1. what does file:// correspond to?
  2. Are there any other place holder I have not yet seen?
  3. Can you point me to a place in the documentation where this place holders are defined?

Thanks for your time and patience.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2023-06-15 06:44:57 -0500

jrtg gravatar image

updated 2023-06-21 07:52:15 -0500

I had a further look:

Wrt. model://:

Based on this documentation, I conclude that model:// is replaced by:

  • GZ_SIM_RESOURCE_PATH for Gazebo Sim, and
  • GAZEBO_MODEL_PATH and/or GAZEBO_RESOURCE_PATH for Gazebo Classic

I cannot find the latter two in the Gazebo Sim source code, so these seem for Gazebo Classic only.


Wrt. file://:

Based on this comment in the code (for Gazebo Sim, not sure about Classic), I conclude that file:// can be followed by either a relative path or an absolute path.

Lines 43-47 of the comment contradict with line 53 but I can confirm that -for my use case- file://rel/path seems to work just fine for a relative path.


Wrt. other environment variables:

A grep through the source code of Gazebo Sim yields following list. The IGN ones are deprecated in Garden

GZ_FILE_PATH
GZ_GUI_PLUGIN_PATH
GZ_GUI_RESOURCE_PATH
GZ_LAUNCH_CONFIG_PATH
GZ_LAUNCH_PLUGIN_PATH
GZ_PLUGIN_PATH
GZ_RENDERING_PLUGIN_PATH
GZ_SIM_PHYSICS_ENGINE_PATH
GZ_SIM_RENDER_ENGINE_PATH
GZ_SIM_RESOURCE_PATH
GZ_SIM_SERVER_CONFIG_PATH
GZ_SIM_SYSTEM_PLUGIN_PATH
IGN_FILE_PATH
IGN_GAZEBO_RESOURCE_PATH
IGN_GAZEBO_SYSTEM_PLUGIN_PATH
IGN_GUI_PLUGIN_PATH
IGN_LAUNCH_CONFIG_PATH
IGN_LAUNCH_PLUGIN_PATH
IGN_PLUGIN_PATH
IGN_RENDERING_PLUGIN_PATH
SDF_PATH
edit flag offensive delete link more

Comments

Thank you very much for the help! I also had a look in these days at the other discussion you linked https://osrf-migration.github.io/sdfo...

As far as I understood, in Gazebo Classic it worked like this:

  • models:// was replaced byGAZEBO_MODEL_PATH
  • file:// was replaced by GAZEBO_RESOURCE_PATH

    The behavior of Gazebo Sim for file:// was changed to respect some standard about URI files: https://en.wikipedia.org/wiki/File_UR...

biagio gravatar imagebiagio ( 2023-06-22 11:09:20 -0500 )edit
0

answered 2023-06-19 03:11:09 -0500

SébastienL gravatar image

Hi, I'm new to Gazebo, but for most sdf files i used, file corresponds at least to GZ_SIM_RESOURCE_PATH (garden).

hope it can help.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-06-14 08:38:27 -0500

Seen: 524 times

Last updated: Jun 21 '23