Skip to content

Commit

Permalink
Merge pull request #352 from StanfordVL/fix-ag
Browse files Browse the repository at this point in the history
Fix AG bug when no candidates exist
  • Loading branch information
cgokmen authored Dec 22, 2023
2 parents 473960d + a6c119a commit 3f9a24c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions omnigibson/robots/manipulation_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,9 @@ def _calculate_in_hand_object_rigid(self, arm="default"):
dist = np.linalg.norm(np.array(candidate_link.get_position()) - np.array(gripper_center_pos))
candidate_data.append((prim_path, dist))

if not candidate_data:
return None

candidate_data = sorted(candidate_data, key=lambda x: x[-1])
ag_prim_path, _ = candidate_data[0]

Expand Down

0 comments on commit 3f9a24c

Please sign in to comment.