ami-iit / rod

The ultimate Python tool for RObot Descriptions processing.
https://pypi.org/project/rod/
BSD 3-Clause "New" or "Revised" License
13 stars 3 forks source link

Resolve URIs to mesh files #20

Closed diegoferigo closed 1 year ago

diegoferigo commented 1 year ago

This is an initial implementation of resolving local URIs of the form e.g. <something>://dir/file.stl where <something> is part of IGN_GAZEBO_RESOURCE_PATH.

After parsing a URDF/SDF model, calling Model.resolve_uris() will replace all the URIs with the real path to the local file.

Partially resolves #8.

traversaro commented 1 year ago

From what I understand, the env variable used to expand the model:// or similar URIs are:

While we may not want to support the legacy GAZEBO_MODEL_PATH, perhaps we can already start using also the new GZ_SIM_RESOURCE_PATH ?

diegoferigo commented 1 year ago

While we may not want to support the legacy GAZEBO_MODEL_PATH, perhaps we can already start using also the new GZ_SIM_RESOURCE_PATH?

This is why this PR just partially resolves #8 :laughing: Yep for the moment I can extend the search also to all three variables (I don't see why we should not support Gazebo Classic since it's effortless).

However, there's more than that, like SDF_PATH (see here), fuel URIs, etc. Thanks for opening an issue upstream, having a more extensive documentation of all the supported URIs might be useful. Most of the information is there, but I remember in the past it happened that I had to dig into the code to check specific details of environment details.

Then, there are Fuel links. Furthermore, I've seen in the past both model:// and file://. Again, I'm not 100% confident I have right now all the information for a complete implementation of URI support. I commented in #8 as a reminder and for the time being I only add what you suggested.

diegoferigo commented 1 year ago

Done in b3ef67b.