-
Notifications
You must be signed in to change notification settings - Fork 12
Description
From https://github.com/rerun-io/rerun-loader-python-example-urdf/blob/main/rerun_loader_urdf.py#L202 it seems that a URDF with package:// URIs will fail. However, the only thing that is needed to actually solve package:// URIs is to know which directories contain the package data (and this directories are typically some variants of <install_prefix>/share or similar. So, it is quite common for library that supports URDFs to be able to load URDFs with package:// with ROS, mainly with two possible strategies (more details and links in robotology/idyntree#291):
- Permit the users to specify via some sort of option passed to the loader the list of paths to consider when solving
package://URIs (see for example https://github.com/robot-descriptions/robot_descriptions.py/blob/380aa5a4d8c81c48ab152f74e9cff523f4d5562a/robot_descriptions/loaders/pinocchio.py#L59). This can be specified as options to the loader command. - Look manually in the environment variables used by ROS and Gazebo, for example
AMENT_PREFIX_PATHandROS_PACKAGE_PATH. We have a pure python library that implements this logic in https://github.com/ami-iit/resolve-robotics-uri-py (available in both PyPI and conda-forge), and could be used as a fallback ifresolve_ros1_packageorresolve_ros2_packagefail (to avoid interfering with existing working use cases).
Would you be open to a PR adding this functionalities of loading package:// URIs without the need of having ROS installed? Thanks in advance!
Just as an example, this would permit to be able to use models installed by non-ROS packages such as https://github.com/robotology/icub-models or https://github.com/robot-descriptions/robot_descriptions.py .