Skip to content

Commit

Permalink
fix typo & remove duplicate variable assignments, remove typecasting …
Browse files Browse the repository at this point in the history
…in tiago class
  • Loading branch information
misoshiruseijin committed Sep 26, 2023
1 parent 95f731e commit 28f793f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
10 changes: 4 additions & 6 deletions omnigibson/robots/manipulation_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1263,15 +1263,13 @@ def _load_state(self, state):
return

# Include AG_state
# TODO: currently doese not take care of cloth objects
self._ag_obj_constraint_params = state["ag_obj_constraint_params"]
for arm in self._ag_obj_constraint_params.keys():
if len(self._ag_obj_constraint_params[arm]) > 0:
data = self._ag_obj_constraint_params[arm]
# TODO: currently does not take care of cloth objects
for arm in state["ag_obj_constraint_params"].keys():
if len(state["ag_obj_constraint_params"][arm]) > 0:
data = state["ag_obj_constraint_params"][arm]
obj = og.sim.scene.object_registry("prim_path", data["ag_obj_prim_path"])
link = obj.links[data["ag_link_prim_path"].split("/")[-1]]
self._ag_data[arm] = (obj, link)
self._ag_obj_in_hand[arm] = obj
self._establish_grasp(arm=arm, ag_data=self._ag_data[arm], contact_pos=data["contact_pos"])

def _serialize(self, state):
Expand Down
10 changes: 0 additions & 10 deletions omnigibson/robots/tiago.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,16 +572,6 @@ def get_position_orientation(self):

def set_position_orientation(self, position=None, orientation=None):
current_position, current_orientation = self.get_position_orientation()
if position is None:
position = current_position
if orientation is None:
orientation = current_orientation

# Position and orientation are lists when restoring scene from json. Cast to np.array
if isinstance(position, list):
position = np.array(position)
if isinstance(orientation, list):
orientation = np.array(orientation)

# If the simulator is playing, set the 6 base joints to achieve the desired pose of base_footprint link frame
if self._dc is not None and self._dc.is_simulating():
Expand Down

0 comments on commit 28f793f

Please sign in to comment.