diff --git a/bindings/python/pinocchio/visualize/meshcat_visualizer.py b/bindings/python/pinocchio/visualize/meshcat_visualizer.py index 1b8a3282b..395766f09 100644 --- a/bindings/python/pinocchio/visualize/meshcat_visualizer.py +++ b/bindings/python/pinocchio/visualize/meshcat_visualizer.py @@ -69,8 +69,12 @@ def hasMeshFileInfo(geometry_object): return False -def applyScalingOnHomegeneousTransform(homogeneous_transform, scale): - scale = np.asarray(scale).flatten() +def applyScalingOnHomegeneousTransform( + homogeneous_transform: np.ndarray, scale: np.ndarray +) -> np.ndarray: + assert homogeneous_transform.shape == (4, 4) + assert scale.shape == (3,) + scale = np.array(scale).flatten() S = np.diag(np.concatenate((scale, [1.0]))) return homogeneous_transform @ S