Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesh fails to load when filename attribute doesn't start with package:// #1741

Closed
stephane-caron opened this issue Sep 6, 2022 · 4 comments

Comments

@stephane-caron
Copy link
Collaborator

The description cf2p.urdf for the Crazyflie 2.0 drone does not load properly with pinocchio 2.6.3:

ValueError: Could not load resource ./cf2.dae
Unable to open file "./cf2.dae".
Hint: the mesh directory may be wrong.

I believe I have configured the mesh path properly. Here is why:

  • The URDF loads the mesh file using a relative path: <mesh filename="./cf2.dae" scale=" 1 1 1"/>
  • If we add the package:// prefix: <mesh filename="package://./cf2.dae" scale=" 1 1 1"/>, then the mesh loads properly and can e.g. be visualized in MeshCat:

image

Is there indeed an inconsistency in the way pinocchio treats the optional package:// prefix?

(Relevant part of the URDF spec.)

@jcarpent
Copy link
Contributor

jcarpent commented Sep 6, 2022

I think relative paths are not supported by the convention.
Package relates to some known placement for the ROS ecosystem.

At first glance, we should be able to robustify to also handle relative path wrt the current file. @fabinsch Could you handle this issue?

@fabinsch
Copy link
Contributor

fabinsch commented Sep 7, 2022

Hi @stephane-caron, I agree with @jcarpent : it is written in the ROS urdf specs that the <mesh> entry should use package if a relative path should be specified (from the docs: "Prefix the filename with package://<packagename>/<path> to make the path to the mesh file relative to the package <packagename>"). So it was good from your side to replace it accordingly in the Urdf.

However, I added the ability in Pinocchio to handle this kind of relative path in #1742.

@stephane-caron
Copy link
Collaborator Author

Thanks for checking 🙂 Unfortunately there are several URDFs out there that use relative paths, I just took that one as an example.

From the sentence you quote, what the spec says is: "if you want to make the path relative to a package, then use package://". Unfortunately this is incomplete as it does not specify whether relative paths without package:// are allowed, and if so to what directory they are relative to.

However, I added the ability in Pinocchio to handle this kind of relative path in #1742.

Looks perfect 👍

@jcarpent
Copy link
Contributor

jcarpent commented Sep 7, 2022

Solved by #1742.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants