-
Notifications
You must be signed in to change notification settings - Fork 406
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
Meshcat-viewer: Scale of .obj meshes gets reset when transformation gets applied #2446
Comments
Hi there! I've found the same problem. In my case I'm using negative scale to do symmetric meshes. The negative scale was applied in the case of other visualizer, such as GepettoVisualizer. However, in MeshcatVisualizer it was not considered. I have not found the code snippet you are mentioning, @jviereck (probably for different versions). However, I believe that something should be changed in updatePlacements. I've done some progress but not solved the problem yet. BTW, I'm using Pinocchio 3.2.0. |
By adding these lines, it seems that it works: scale = visual.meshScale
Tscale = np.identity(4)
Tscale[range(3), range(3)] = np.array(scale)
Ttransform = T @ Tscale
# Update viewer configuration.
self.viewer[visual_name].set_transform(Ttransform) |
Should have been solved in #2511. |
Thank you for fixing this @jcarpent ! |
I've compiled the latest version of pinocchio from source and the latest meshcat-python package version. The parts of my robot are made of .obj meshes that are scaled to size. When I create a
MeshcatVisualizer
and load the URDF file, the .obj meshes are displayed, however, the scale seems to be ignored.Spending some time debugging this, it looks like setting the transform
in
MeshcatVisualizer::updatePlacements
is causing the scaling property to be reset. When I apply the scaling once more like this:then the scale shows up properly in Meshcat. Here,
self.scales
is a new dict that stores the scaling values when the objects are created inMeshcatVisualizer::loadViewerGeometryObject
.Does this ring a bell for anyone?
The text was updated successfully, but these errors were encountered: