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

Meshcat-viewer: Scale of .obj meshes gets reset when transformation gets applied #2446

Open
jviereck opened this issue Oct 4, 2024 · 0 comments

Comments

@jviereck
Copy link
Contributor

jviereck commented Oct 4, 2024

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

            # Update viewer configuration.
            self.viewer[visual_name].set_transform(T)

in MeshcatVisualizer::updatePlacements is causing the scaling property to be reset. When I apply the scaling once more like this:

            # Update viewer configuration.
            self.viewer[visual_name].set_transform(T)

            if visual_name in self.scales:
                self.viewer[visual_name].set_property("scale", self.scales[visual_name])

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 in MeshcatVisualizer::loadViewerGeometryObject.

Does this ring a bell for anyone?

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

1 participant