From 90b42248b7f7738c741824ed729588ac4243e974 Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas <30759571+Kallinteris-Andreas@users.noreply.github.com> Date: Mon, 8 Jan 2024 09:51:25 +0200 Subject: [PATCH 1/5] Update adroit_door.py --- gymnasium_robotics/envs/adroit_hand/adroit_door.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gymnasium_robotics/envs/adroit_hand/adroit_door.py b/gymnasium_robotics/envs/adroit_hand/adroit_door.py index 3ea6b1b6..323222ab 100644 --- a/gymnasium_robotics/envs/adroit_hand/adroit_door.py +++ b/gymnasium_robotics/envs/adroit_hand/adroit_door.py @@ -282,7 +282,7 @@ def step(self, a): # compute the sparse reward variant first goal_distance = self.data.qpos[self.door_hinge_addrs] - goal_achieved = True if goal_distance >= 1.35 else False + goal_achieved = goal_distance >= 1.35 reward = 10.0 if goal_achieved else -0.1 # override reward if not sparse reward From 30433f54186518dd671e022693e4d0245f2f1906 Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas <30759571+Kallinteris-Andreas@users.noreply.github.com> Date: Mon, 8 Jan 2024 09:54:14 +0200 Subject: [PATCH 2/5] Update adroit_hammer.py --- gymnasium_robotics/envs/adroit_hand/adroit_hammer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gymnasium_robotics/envs/adroit_hand/adroit_hammer.py b/gymnasium_robotics/envs/adroit_hand/adroit_hammer.py index 74abb5fa..8d4c6c0d 100644 --- a/gymnasium_robotics/envs/adroit_hand/adroit_hammer.py +++ b/gymnasium_robotics/envs/adroit_hand/adroit_hammer.py @@ -296,7 +296,7 @@ def step(self, a): # compute the sparse reward variant first goal_distance = np.linalg.norm(nail_pos - goal_pos) - goal_achieved = True if goal_distance < 0.01 else False + goal_achieved = goal_distance < 0.01 reward = 10.0 if goal_achieved else -0.1 # override reward if not sparse reward From 73023c734794ea6f09ff94cbf2fcf3898cbea1ab Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas <30759571+Kallinteris-Andreas@users.noreply.github.com> Date: Mon, 8 Jan 2024 09:54:43 +0200 Subject: [PATCH 3/5] Update adroit_pen.py --- gymnasium_robotics/envs/adroit_hand/adroit_pen.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gymnasium_robotics/envs/adroit_hand/adroit_pen.py b/gymnasium_robotics/envs/adroit_hand/adroit_pen.py index baaebec5..72b27a17 100644 --- a/gymnasium_robotics/envs/adroit_hand/adroit_pen.py +++ b/gymnasium_robotics/envs/adroit_hand/adroit_pen.py @@ -301,9 +301,7 @@ def step(self, a): # compute the sparse reward variant first goal_distance = np.linalg.norm(obj_pos - desired_loc) orien_similarity = np.dot(obj_orien, desired_orien) - goal_achieved = ( - True if (goal_distance < 0.075 and orien_similarity > 0.95) else False - ) + goal_achieved = goal_distance < 0.075 and orien_similarity > 0.95) reward = 10.0 if goal_achieved else -0.1 # goal_failed = obj_pos[2] < 0.075 From e8c88b68e623165ea7a138973fda3701aeecc13c Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas <30759571+Kallinteris-Andreas@users.noreply.github.com> Date: Mon, 8 Jan 2024 09:55:10 +0200 Subject: [PATCH 4/5] Update adroit_relocate.py --- gymnasium_robotics/envs/adroit_hand/adroit_relocate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gymnasium_robotics/envs/adroit_hand/adroit_relocate.py b/gymnasium_robotics/envs/adroit_hand/adroit_relocate.py index 08fecf48..8cb41138 100644 --- a/gymnasium_robotics/envs/adroit_hand/adroit_relocate.py +++ b/gymnasium_robotics/envs/adroit_hand/adroit_relocate.py @@ -286,7 +286,7 @@ def step(self, a): # compute the sparse reward variant first goal_distance = float(np.linalg.norm(obj_pos - target_pos)) - goal_achieved = True if goal_distance < 0.1 else False + goal_achieved = goal_distance < 0.1 reward = 10.0 if goal_achieved else -0.1 # override reward if not sparse reward From 519e90b0bf6a07f7b4ec588f12efa5195bf05e2d Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas <30759571+Kallinteris-Andreas@users.noreply.github.com> Date: Mon, 8 Jan 2024 10:01:17 +0200 Subject: [PATCH 5/5] Update adroit_pen.py --- gymnasium_robotics/envs/adroit_hand/adroit_pen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gymnasium_robotics/envs/adroit_hand/adroit_pen.py b/gymnasium_robotics/envs/adroit_hand/adroit_pen.py index 72b27a17..5e0f6517 100644 --- a/gymnasium_robotics/envs/adroit_hand/adroit_pen.py +++ b/gymnasium_robotics/envs/adroit_hand/adroit_pen.py @@ -301,7 +301,7 @@ def step(self, a): # compute the sparse reward variant first goal_distance = np.linalg.norm(obj_pos - desired_loc) orien_similarity = np.dot(obj_orien, desired_orien) - goal_achieved = goal_distance < 0.075 and orien_similarity > 0.95) + goal_achieved = goal_distance < 0.075 and orien_similarity > 0.95 reward = 10.0 if goal_achieved else -0.1 # goal_failed = obj_pos[2] < 0.075