Verified Commit 50f49cc7 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

python/meshcat: enforce scaling only for meshes

parent 24dbede8
...@@ -259,9 +259,12 @@ class MeshcatVisualizer(BaseVisualizer): ...@@ -259,9 +259,12 @@ class MeshcatVisualizer(BaseVisualizer):
# Get mesh pose. # Get mesh pose.
M = self.visual_data.oMg[self.visual_model.getGeometryId(visual.name)] M = self.visual_data.oMg[self.visual_model.getGeometryId(visual.name)]
# Manage scaling # Manage scaling
scale = np.asarray(visual.meshScale).flatten() if self.isMesh(visual):
S = np.diag(np.concatenate((scale,[1.0]))) scale = np.asarray(visual.meshScale).flatten()
T = np.array(M.homogeneous).dot(S) S = np.diag(np.concatenate((scale,[1.0])))
T = np.array(M.homogeneous).dot(S)
else:
T = M.homogeneous
# Update viewer configuration. # Update viewer configuration.
self.viewer[self.getViewerNodeName(visual,pin.GeometryType.VISUAL)].set_transform(T) self.viewer[self.getViewerNodeName(visual,pin.GeometryType.VISUAL)].set_transform(T)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment