diff --git a/omnigibson/prims/entity_prim.py b/omnigibson/prims/entity_prim.py index 4028e1982..6909f4460 100644 --- a/omnigibson/prims/entity_prim.py +++ b/omnigibson/prims/entity_prim.py @@ -779,9 +779,9 @@ def get_angular_velocity(self): def set_position_orientation(self, position=None, orientation=None): if position is not None: - position = position[None, :] + position = np.asarray(position)[None, :] if orientation is not None: - orientation = orientation[None, :] + orientation = np.asarray(orientation)[None, :] self._articulation_view.set_world_poses(position, orientation) BoundingBoxAPI.clear() @@ -791,9 +791,9 @@ def get_position_orientation(self): def set_local_pose(self, position=None, orientation=None): if position is not None: - position = position[None, :] + position = np.asarray(position)[None, :] if orientation is not None: - orientation = orientation[None, :] + orientation = np.asarray(orientation)[None, :] self._articulation_view.set_local_poses(position, orientation) BoundingBoxAPI.clear() diff --git a/omnigibson/prims/rigid_prim.py b/omnigibson/prims/rigid_prim.py index e31f79154..082e97123 100644 --- a/omnigibson/prims/rigid_prim.py +++ b/omnigibson/prims/rigid_prim.py @@ -258,11 +258,11 @@ def get_angular_velocity(self): def set_position_orientation(self, position=None, orientation=None): if position is not None: - position = position[None, :] + position = np.asarray(position)[None, :] if orientation is not None: assert np.isclose(np.linalg.norm(orientation), 1, atol=1e-3), \ f"{self.prim_path} desired orientation {orientation} is not a unit quaternion." - orientation = orientation[None, :] + orientation = np.asarray(orientation)[None, :] self._rigid_prim_view.set_world_poses(positions=position, orientations=orientation) def get_position_orientation(self): @@ -274,9 +274,9 @@ def get_position_orientation(self): def set_local_pose(self, position=None, orientation=None): if position is not None: - position = position[None, :] + position = np.asarray(position)[None, :] if orientation is not None: - orientation = orientation[None, :] + orientation = np.asarray(orientation)[None, :] self._articulation_view.set_local_poses(position, orientation) def get_local_pose(self):