Skip to content

Commit

Permalink
fix reward reach
Browse files Browse the repository at this point in the history
  • Loading branch information
qgallouedec committed Jun 13, 2024
1 parent 7198d64 commit 857fb6a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gym_lowcostrobot/envs/reach_cube_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,8 @@ def step(self, action):
observation = self.get_observation()

# Get the position of the cube and the distance between the end effector and the cube
cube_pos = self.data.qpos[:3]
ee_id = self.model.body("moving_side").id
ee_pos = self.data.geom_xpos[ee_id]
cube_pos = self.data.xpos[2]
ee_pos = self.data.xpos[8]
ee_to_cube = np.linalg.norm(ee_pos - cube_pos)

# Compute the reward
Expand Down

0 comments on commit 857fb6a

Please sign in to comment.