update enable winds to __init__

This commit is contained in:
Hongyi Zhou 2022-11-12 10:41:09 +01:00
parent 87633a89fb
commit dc524da049
2 changed files with 6 additions and 2 deletions

View File

@ -258,7 +258,8 @@ for ctxt_dim in [2, 4]:
max_episode_steps=350, max_episode_steps=350,
kwargs={ kwargs={
"ctxt_dim": ctxt_dim, "ctxt_dim": ctxt_dim,
'frame_skip': 4 'frame_skip': 4,
'enable_wind': True
} }
) )

View File

@ -21,6 +21,7 @@ class TableTennisEnv(MujocoEnv, utils.EzPickle):
""" """
def __init__(self, ctxt_dim: int = 2, frame_skip: int = 4, def __init__(self, ctxt_dim: int = 2, frame_skip: int = 4,
enable_switching_goal: bool = False,
enable_wind: bool = False, enable_magnus: bool = False): enable_wind: bool = False, enable_magnus: bool = False):
utils.EzPickle.__init__(**locals()) utils.EzPickle.__init__(**locals())
self._steps = 0 self._steps = 0
@ -55,6 +56,8 @@ class TableTennisEnv(MujocoEnv, utils.EzPickle):
self.action_space = spaces.Box(low=-1, high=1, shape=(7,), dtype=np.float32) self.action_space = spaces.Box(low=-1, high=1, shape=(7,), dtype=np.float32)
self._enable_switching_goal = enable_switching_goal
# complex dynamics settings # complex dynamics settings
self.model.opt.density = 1.225 self.model.opt.density = 1.225
self.model.opt.viscosity = 2.27e-5 self.model.opt.viscosity = 2.27e-5