This should be valid, but if we go to the root/ directory and run yourdfpy robots/humanoid/robot.urdf the STL mesh won't load properly.
Why?
The filename_handler_magic is called with arguments ("package://art/meshes/beautiful.stl", "robots/humanoid").
What if should do: return "art/meshes/beautiful.stl"
What it currently does: return "package://art/meshes/beautiful.stl"
If we unroll its execution, it currently checks for the following paths, does not find the STL file there, issues a warning and returns its first input unchanged.
URDF files can load meshes from different packages. Let's take the following situation:
Here
robot.urdf
can contain a mesh tag like:This should be valid, but if we go to the
root/
directory and runyourdfpy robots/humanoid/robot.urdf
the STL mesh won't load properly.Why?
The
filename_handler_magic
is called with arguments("package://art/meshes/beautiful.stl", "robots/humanoid")
."art/meshes/beautiful.stl"
"package://art/meshes/beautiful.stl"
If we unroll its execution, it currently checks for the following paths, does not find the STL file there, issues a warning and returns its first input unchanged.
robots/humanoid/meshes/beautiful.stl
robots/meshes/beautiful.stl
meshes/beautiful.stl