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

Apply visual colors #7

Closed
stephane-caron opened this issue Apr 6, 2022 · 3 comments
Closed

Apply visual colors #7

stephane-caron opened this issue Apr 6, 2022 · 3 comments

Comments

@stephane-caron
Copy link
Contributor

If I understand correctly, visual materials are currently read and written but not rendered. Loading e.g. the Upkie URDF we get the dark "ninja" version:

upkie-ninja

Trimesh can render materials so getting them to yourdfpy is a matter of plugging the right info. Here is for instance a draft PR to do so (opening the issue here to keep track):

upkie-colored-chassis

Is there an interest to render colors (eventually materials) in yourdfpy?

@clemense
Copy link
Owner

clemense commented Apr 7, 2022

Oh, that's great, thanks! What do you think is missing to make this a non-draft PR?

@stephane-caron
Copy link
Contributor Author

Well I hacked the call to apply_visual_color(geom, v) at the first spot I found where it worked, so first I wanted your feedback on whether it makes sense within the overall code 😃

There are three aspects to materials from the URDF reference that a visualizer would eventually need to handle: color, texture and named material.

If it makes sense, we could go for it this way:

  • Color: this PR
  • Named materials: subsequent PR (probably more involved, with updates to Robot and _parse_robot)
  • Texture: later (not part of my current use cases but likely useful to others)

@stephane-caron
Copy link
Contributor Author

And #15 adds support for named materials, so now the Upkie model renders as:

image

Moving the remaining point on textures to #16 so that we can let the PR close this issue.

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

2 participants