fix tt issues -> context + traj.length

This commit is contained in:
Onur
2022-02-08 09:50:01 +01:00
parent 66be0b1e02
commit 2a27f59e50
6 changed files with 58 additions and 15 deletions
@@ -11,9 +11,9 @@ class MPWrapper(MPEnvWrapper):
def active_obs(self):
# TODO: @Max Filter observations correctly
return np.hstack([
[True] * 7, # Joint Pos
[True] * 3, # Ball pos
[True] * 3 # goal pos
[False] * 7, # Joint Pos
[True] * 2, # Ball pos
[True] * 2 # goal pos
])
@property
+5 -3
View File
@@ -10,7 +10,8 @@ from alr_envs.alr.mujoco.table_tennis.tt_reward import TT_Reward
#TODO: Check for simulation stability. Make sure the code runs even for sim crash
MAX_EPISODE_STEPS = 1750
# MAX_EPISODE_STEPS = 1750
MAX_EPISODE_STEPS = 1375
BALL_NAME_CONTACT = "target_ball_contact"
BALL_NAME = "target_ball"
TABLE_NAME = 'table_tennis_table'
@@ -76,10 +77,11 @@ class TTEnvGym(MujocoEnv, utils.EzPickle):
self._ids_set = True
def _get_obs(self):
ball_pos = self.sim.data.body_xpos[self.ball_id]
ball_pos = self.sim.data.body_xpos[self.ball_id][:2].copy()
goal_pos = self.goal[:2].copy()
obs = np.concatenate([self.sim.data.qpos[:7].copy(), # 7 joint positions
ball_pos,
self.goal.copy()])
goal_pos])
return obs
def sample_context(self):