Skip to content

Comments

Resolve URIs to mesh files#20

Merged
diegoferigo merged 3 commits intomainfrom
feature/resolve_uris
Feb 10, 2023
Merged

Resolve URIs to mesh files#20
diegoferigo merged 3 commits intomainfrom
feature/resolve_uris

Conversation

@diegoferigo
Copy link
Contributor

@diegoferigo diegoferigo commented Feb 8, 2023

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.

@diegoferigo diegoferigo self-assigned this Feb 8, 2023
@traversaro
Copy link
Collaborator

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

  • GAZEBO_MODEL_PATH for Gazebo Classic
  • IGN_GAZEBO_RESOURCE_PATH for Ignition Gazebo <= 7
  • GZ_SIM_RESOURCE_PATH for Gazebo Sim >= 7

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
Copy link
Contributor Author

diegoferigo commented Feb 9, 2023

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 😆 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
Copy link
Contributor Author

diegoferigo commented Feb 9, 2023

Done in b3ef67b.

@diegoferigo diegoferigo merged commit a2d549e into main Feb 10, 2023
@diegoferigo diegoferigo deleted the feature/resolve_uris branch February 10, 2023 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement logic to resolve resources URIs

2 participants