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

Add the possibility to set the alpha channel in the meshcat viewer #1033

Merged
merged 3 commits into from
Oct 26, 2022

Conversation

GiulioRomualdi
Copy link
Member

@GiulioRomualdi GiulioRomualdi commented Oct 25, 2022

If you want to use the idyntree-model-view-meshcat script with the alpha channel you can open a terminal and write

idyntree-model-view-meshcat -m <model_path/model.urdf> -a 0.5

This will show the model with an alpha equal to 0.5 as follows

image

In general, you can now load the urdf as

model_path = "model.urdf"
viz.load_model_from_file(model_path)  # in this case the color is retrieved from the urdf.
viz.load_model_from_file(model_path, color=0.5) # in this case the color is retrieved from the urdf but the alpha is set to 0.5 .
viz.load_model_from_file(model_path, color=[1,0,0,0.5]) # in this case the color is set to be [1,0,0] (RGB format) and the  alpha is set to 0.5.
viz.load_model_from_file(model_path, color=[1,0,0]) # in this case the color is set to be [1,0,0] (RGB format) and the  alpha is set to 1 (no transparency).

cc @rob-mau @Giulero

@GiulioRomualdi GiulioRomualdi self-assigned this Oct 25, 2022
@GiulioRomualdi GiulioRomualdi changed the title Add the possibility to set onlythe alpha channel in the meshcat viewer Add the possibility to set the alpha channel in the meshcat viewer Oct 25, 2022
@traversaro
Copy link
Member

Failures seem unrelated, @GiulioRomualdi can you add a note on the changelog?

@GiulioRomualdi
Copy link
Member Author

Hi @traversaro, done in e43366f

@@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [7.0.0] - 2022-08-31

### Added
- Added the possibility to set the alpha channel while loading a model in the meshcat visualizer (https://github.com/robotology/idyntree/pull/1033).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move it under "Unreleased" ? We already released 7.0.0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ops, my fault 😢 . Done in 95d9555

@traversaro traversaro merged commit fb5d987 into master Oct 26, 2022
@traversaro traversaro deleted the meshcat_alpha branch October 26, 2022 13:17
@traversaro
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants