From 0999a6a587c038dd868f01644cb959dff99707e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20F=C3=B6rster?= Date: Wed, 31 Aug 2022 17:31:21 +0200 Subject: [PATCH] Correctly pass scale to pybullet API --- igibson/objects/shapenet_object.py | 2 +- igibson/objects/ycb_object.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/igibson/objects/shapenet_object.py b/igibson/objects/shapenet_object.py index 3c64b7dbd..1410cf36b 100644 --- a/igibson/objects/shapenet_object.py +++ b/igibson/objects/shapenet_object.py @@ -37,7 +37,7 @@ def _load(self, simulator): """ Load the object into pybullet """ - collision_id = p.createCollisionShape(p.GEOM_MESH, fileName=self.filename, meshScale=self.scale) + collision_id = p.createCollisionShape(p.GEOM_MESH, fileName=self.filename, meshScale=(self.scale,) * 3) body_id = p.createMultiBody( basePosition=self.pose["position"], baseOrientation=self.pose["orientation_quat"], diff --git a/igibson/objects/ycb_object.py b/igibson/objects/ycb_object.py index 9c41f8445..dff7ed476 100644 --- a/igibson/objects/ycb_object.py +++ b/igibson/objects/ycb_object.py @@ -19,8 +19,8 @@ def __init__(self, name, scale=1, **kwargs): self.scale = scale def _load(self, simulator): - collision_id = p.createCollisionShape(p.GEOM_MESH, fileName=self.collision_filename, meshScale=self.scale) - visual_id = p.createVisualShape(p.GEOM_MESH, fileName=self.visual_filename, meshScale=self.scale) + collision_id = p.createCollisionShape(p.GEOM_MESH, fileName=self.collision_filename, meshScale=(self.scale,) * 3) + visual_id = p.createVisualShape(p.GEOM_MESH, fileName=self.visual_filename, meshScale=(self.scale,) * 3) body_id = p.createMultiBody( baseCollisionShapeIndex=collision_id,