add ball velocity into observation space

This commit is contained in:
Hongyi Zhou 2022-11-13 15:27:29 +01:00
parent dc524da049
commit b482c1bd89
3 changed files with 6 additions and 2 deletions

View File

@ -578,7 +578,7 @@ for _v in _versions:
kwargs_dict_tt_prodmp['basis_generator_kwargs']['pre_compute_length_factor'] = 5
kwargs_dict_tt_prodmp['phase_generator_kwargs']['alpha_phase'] = 3
# kwargs_dict_tt_prodmp['black_box_kwargs']['duration'] = 4.
kwargs_dict_tt_prodmp['black_box_kwargs']['max_planning_times'] = 4
kwargs_dict_tt_prodmp['black_box_kwargs']['max_planning_times'] = 3
kwargs_dict_tt_prodmp['black_box_kwargs']['replanning_schedule'] = lambda pos, vel, obs, action, t : t % 50 == 0
register(
id=_env_id,

View File

@ -16,6 +16,7 @@ class MPWrapper(RawInterfaceWrapper):
[False] * 7, # joints velocity
[True] * 2, # position ball x, y
[False] * 1, # position ball z
[True] * 3, # velocity ball x, y, z
[True] * 2, # target landing position
# [True] * 1, # time
])

View File

@ -154,7 +154,7 @@ class TableTennisEnv(MujocoEnv, utils.EzPickle):
mujoco.mj_forward(self.model, self.data)
if self._enable_wind:
self._wind_vel[1] = self.np_random.uniform(low=-10, high=10, size=1)
self._wind_vel[1] = self.np_random.uniform(low=-5, high=5, size=1)
self.model.opt.wind[:3] = self._wind_vel
self._hit_ball = False
@ -180,6 +180,9 @@ class TableTennisEnv(MujocoEnv, utils.EzPickle):
self.data.joint("tar_x").qpos.copy(),
self.data.joint("tar_y").qpos.copy(),
self.data.joint("tar_z").qpos.copy(),
self.data.joint("tar_x").qvel.copy(),
self.data.joint("tar_y").qvel.copy(),
self.data.joint("tar_z").qvel.copy(),
# self.data.body("target_ball").xvel.copy(),
self._goal_pos.copy(),
])