robotics-toolbox-python icon indicating copy to clipboard operation
robotics-toolbox-python copied to clipboard

Incomplete handling of mesh filenames in URDF parsing

Open TJMolnar opened this issue 9 months ago • 0 comments

Paths for mesh filenames in URDF are commonly prefixed with either "package://" or "file://" however urdf.py only handles the former:

https://github.com/petercorke/robotics-toolbox-python/blob/7f1bcae7e17360ea9b30a49731c2c93a219c6a19/roboticstoolbox/tools/urdf/urdf.py#L299-L311

This results in filenames with the second prefix, e.g:

<mesh filename="file:///opt/ros/humble/share/kortex_description/arms/gen3/7dof/meshes/base_link.STL"/>

To be passed directly to rtb_path_to_datafile without sanitising, which results in the file not being found. This should be simple to fix by adding a check for the file:// prefix alongside the existing package:// one

TJMolnar avatar May 21 '24 01:05 TJMolnar