Skip to content

Commit

Permalink
BUG: This bug omits the distal joint of the little finger from the ob…
Browse files Browse the repository at this point in the history
…servation. A fix to this will break all the submitted policies. A fix to this will be pushed after the myochallenge23
  • Loading branch information
vikashplus committed Oct 4, 2023
1 parent 98d7e04 commit 457ab68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions myosuite/envs/myo/myochallenge/relocate_v0.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class RelocateEnvV0(BaseV0):

DEFAULT_OBS_KEYS = ['hand_qpos', 'hand_qvel', 'obj_pos', 'goal_pos', 'pos_err', 'obj_rot', 'goal_rot', 'rot_err']
DEFAULT_OBS_KEYS = ['hand_qpos_noMD5', 'hand_qvel', 'obj_pos', 'goal_pos', 'pos_err', 'obj_rot', 'goal_rot', 'rot_err']
DEFAULT_RWD_KEYS_AND_WEIGHTS = {
"pos_dist": 100.0,
"rot_dist": 1.0,
Expand Down Expand Up @@ -68,7 +68,8 @@ def _setup(self,
def get_obs_dict(self, sim):
obs_dict = {}
obs_dict['time'] = np.array([sim.data.time])
obs_dict['hand_qpos'] = sim.data.qpos[:-6].copy()
obs_dict['hand_qpos_noMD5'] = sim.data.qpos[:-7].copy() # ??? This is a bug. This needs to be qpos[:-6]. This bug omits the distal joint of the little finger from the observation. A fix to this will break all the submitted policies. A fix to this will be pushed after the myochallenge23
obs_dict['hand_qpos'] = sim.data.qpos[:-6].copy() # V1 of the env will use this corrected key by default
obs_dict['hand_qvel'] = sim.data.qvel[:-6].copy()*self.dt
obs_dict['obj_pos'] = sim.data.site_xpos[self.object_sid]
obs_dict['goal_pos'] = sim.data.site_xpos[self.goal_sid]
Expand Down
5 changes: 3 additions & 2 deletions myosuite/envs/myo/myochallenge/reorient_v0.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class ReorientEnvV0(BaseV0):

DEFAULT_OBS_KEYS = ['hand_qpos', 'hand_qvel', 'obj_pos', 'goal_pos', 'pos_err', 'obj_rot', 'goal_rot', 'rot_err']
DEFAULT_OBS_KEYS = ['hand_qpos_noMD5', 'hand_qvel', 'obj_pos', 'goal_pos', 'pos_err', 'obj_rot', 'goal_rot', 'rot_err']
DEFAULT_RWD_KEYS_AND_WEIGHTS = {
"pos_dist": 100.0,
"rot_dist": 1.0,
Expand Down Expand Up @@ -77,7 +77,8 @@ def _setup(self,
def get_obs_dict(self, sim):
obs_dict = {}
obs_dict['time'] = np.array([sim.data.time])
obs_dict['hand_qpos'] = sim.data.qpos[:-7].copy()
obs_dict['hand_qpos_noMD5'] = sim.data.qpos[:-7].copy() # ??? This is a bug. This needs to be qpos[:-6]. This bug omits the distal joint of the little finger from the observation. A fix to this will break all the submitted policies. A fix to this will be pushed after the myochallenge23
obs_dict['hand_qpos'] = sim.data.qpos[:-6].copy() # V1 of the env will use this corrected key by default
obs_dict['hand_qvel'] = sim.data.qvel[:-6].copy()*self.dt
obs_dict['obj_pos'] = sim.data.site_xpos[self.object_sid]
obs_dict['goal_pos'] = sim.data.site_xpos[self.goal_sid]
Expand Down

0 comments on commit 457ab68

Please sign in to comment.