Skip to main content

Pure python package to solve ROS-style package:// and Gazebo-style model:// URIs in absolute paths.

Project description

resolve-robotics-uri-py

Pure Python package (that only depends on Python stdlib) to resolve a package:// (ROS-style) or model:// (Gazebo-style) URI to an absolute filename.

Installation

Install using onle one of the following commands to install in an existing environment:

Installation from conda-forge

conda install -c conda-forge resolve-robotics-uri-py

Installation from PyPI

python -m pip install resolve-robotics-uri-py

Usage in Python

Add import resolve_robotics_uri_py to your Python file, then take inspiration from the following examples.

If you want to get the location of the iCubGazeboV2_7 iCub model installed from icub-models:

absolute_path = resolve_robotics_uri_py.resolve_robotics_uri("package://iCub/robots/iCubGazeboV2_7/model.urdf")

If you want to get the location of the ergoCubSN00 model installed from ergocub-software:

absolute_path = resolve_robotics_uri_py.resolve_robotics_uri("package://ergoCub/robots/ergoCubSN000/model.urdf")

If you want to get the location of the panda model installed by moveit_resources_panda_description:

absolute_path = resolve_robotics_uri_py.resolve_robotics_uri("package://moveit_resources_panda_description/urdf/panda.urdf")

Command Line usage

resolve_robotics_uri_py also install a command line tool called resolve-robotics-uri-py for use in scripts, that can be used as:

resolve-robotics-uri-py package://iCub/robots/iCubGazeboV2_7/model.urdf

For example, on bash this can be used to easily convert the a urdf specified via package:// to an sdf (assuming you have Gazebo installed), using the backtick operator:

gz sdf -p `resolve-robotics-uri-py package://iCub/robots/iCubGazeboV2_7/model.urdf`

Adding Custom Search Paths

Some packages may not be installed in standard locations, or you may want to use a custom directory structure. In such cases, you have a few options:

Option 1: Modify the Native Search Paths

You can add the search path to one of the natively supported paths of Gazebo or ROS, such as:

  • GZ_SIM_RESOURCE_PATH
  • AMENT_PREFIX_PATH

Option 2: Specify Additional Search Paths

If you prefer not to modify the default ROS or Gazebo search paths, you can use either the --package_dirs command line option or set the RRU_ADDITIONAL_PATHS environment variable:

Using the --package_dirs Command Line Option:
resolve-robotics-uri-py --package_dirs /path/to/packages:/another/path package://my_package/model.urdf
Setting the RRU_ADDITIONAL_PATHS Environment Variable:
export RRU_ADDITIONAL_PATHS=/path/to/packages:/another/path
resolve-robotics-uri-py package://my_package/model.urdf

Both methods accept a colon-separated list of directories (or semicolon-separated on Windows).

In Python code, you can specify additional paths using the additional_package_dirs parameter:

absolute_path = resolve_robotics_uri_py.resolve_robotics_uri(
     "package://my_package/model.urdf",
     package_dirs=["/path/to/packages", "/another/path"]
)

Details on how files are searched

You can find the details on how resolve-robotics-uri-py find files in the rru_spec.md file.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

BSD-3-Clause

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

resolve_robotics_uri_py-0.5.1.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

resolve_robotics_uri_py-0.5.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file resolve_robotics_uri_py-0.5.1.tar.gz.

File metadata

  • Download URL: resolve_robotics_uri_py-0.5.1.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for resolve_robotics_uri_py-0.5.1.tar.gz
Algorithm Hash digest
SHA256 bcbe8aab5dfd228c3e120d35d8b9a6afc14483422701c11330ff8c415d3b5cbf
MD5 74e6e00743f9b4013e3308a6473e1be5
BLAKE2b-256 7062dca8d993c9e2e17d0c6a3184ac1e3d088b10430271ff8f947d810010d0f2

See more details on using hashes here.

File details

Details for the file resolve_robotics_uri_py-0.5.1-py3-none-any.whl.

File metadata

File hashes

Hashes for resolve_robotics_uri_py-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b4fb4278dd6823f778a617047e07a2d69a0b470678fe7061a5985baec8a0298
MD5 8e30f46e20047223ca4fc778bfe79b5a
BLAKE2b-256 a382115f29fdb7d3d25d4281ec22fe9f1184612f8e5c9bdb66244c3a4213f61b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page