Skip to content

Commit

Permalink
resetting bin-picking env
Browse files Browse the repository at this point in the history
  • Loading branch information
reginald-mclean committed Jan 13, 2024
1 parent 57d0ec1 commit e9da213
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_bin_picking_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,9 @@ def compute_reward(self, action, obs):
)
reward = reward_utils.hamacher_product(object_grasped, in_place)

near_object = np.linalg.norm(obj - hand) < 0.05
near_object = np.linalg.norm(obj - hand) < 0.04
pinched_without_obj = obs[3] < 0.43
lifted = obj[2] > self.obj_init_pos[2]
print(near_object, lifted, near_object)
print(np.linalg.norm(obj - hand), obj[2], self.obj_init_pos[2], obs[3])
lifted = obj[2] - 0.02 > self.obj_init_pos[2]
# Increase reward when properly grabbed obj
grasp_success = near_object and lifted and not pinched_without_obj
if grasp_success:
Expand Down

0 comments on commit e9da213

Please sign in to comment.