Skip to content

Commit

Permalink
Merge pull request #28 from ami-iit/feature/resolve_uris
Browse files Browse the repository at this point in the history
Resolve URIs with `resolve-robotics-uri-py`
  • Loading branch information
diegoferigo authored Mar 8, 2024
2 parents 79e83d6 + 094a0f9 commit 2f6e37a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ install_requires =
mashumaro
numpy
packaging
resolve-robotics-uri-py
scipy
xmltodict

Expand Down
10 changes: 9 additions & 1 deletion src/rod/utils/resolve_uris.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@
import pathlib
from typing import List

import resolve_robotics_uri_py

from rod import Geometry, logging


def resolve_local_uri(uri: str) -> pathlib.Path:

try:
return resolve_robotics_uri_py.resolve_robotics_uri(uri=uri)
except:
pass

# Remove the prefix of the URI
uri_no_prefix = uri.split(sep="//")[-1]
uri_no_prefix = uri.split(sep="://")[-1]

paths = []
paths += paths_from_environment_variable("GZ_SIM_RESOURCE_PATH")
Expand Down

0 comments on commit 2f6e37a

Please sign in to comment.