Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adroit hand dense reward fixes #220

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gymnasium_robotics/envs/adroit_hand/adroit_door.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def step(self, a):
palm_pos = self.data.site_xpos[self.grasp_site_id].ravel()

# get to handle
reward = 0.1 * np.linalg.norm(palm_pos - handle_pos)
reward = -0.1 * np.linalg.norm(palm_pos - handle_pos)
# open door
reward += -0.1 * (goal_distance - 1.57) * (goal_distance - 1.57)
# velocity cost
Expand Down
2 changes: 1 addition & 1 deletion gymnasium_robotics/envs/adroit_hand/adroit_hammer.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def step(self, a):
# override reward if not sparse reward
if not self.sparse_reward:
# get the palm to the hammer handle
reward = 0.1 * np.linalg.norm(palm_pos - hamm_pos)
reward = -0.1 * np.linalg.norm(palm_pos - hamm_pos)
# take hammer head to nail
reward -= np.linalg.norm(head_pos - nail_pos)
# make nail go inside
Expand Down
2 changes: 1 addition & 1 deletion gymnasium_robotics/envs/adroit_hand/adroit_relocate.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def step(self, a):

# override reward if not sparse reward
if not self.sparse_reward:
reward = 0.1 * np.linalg.norm(palm_pos - obj_pos) # take hand to object
reward = -0.1 * np.linalg.norm(palm_pos - obj_pos) # take hand to object
if obj_pos[2] > 0.04: # if object off the table
reward += 1.0 # bonus for lifting the object
reward += -0.5 * np.linalg.norm(
Expand Down
Loading