Skip to content

Commit

Permalink
Fix some naiveties
Browse files Browse the repository at this point in the history
  • Loading branch information
cgokmen committed Dec 13, 2023
1 parent b922a5f commit fe44403
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions omnigibson/prims/entity_prim.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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()

Expand Down
8 changes: 4 additions & 4 deletions omnigibson/prims/rigid_prim.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down

0 comments on commit fe44403

Please sign in to comment.