Initialize observation spaces and pytest (#2929)

* Remove step initialization for mujoco obs spaces

	* remove step initialization for mujoco obs space

	* pre-commit

pytest obs space mujoco
This commit is contained in:
Rodrigo de Lazcano
2022-06-30 10:59:59 -04:00
committed by GitHub
parent 7f6effbc0d
commit 61a39f41bc
30 changed files with 364 additions and 37 deletions

View File

@@ -2,6 +2,7 @@ import numpy as np
from gym import utils
from gym.envs.mujoco import mujoco_env
from gym.spaces import Box
DEFAULT_CAMERA_CONFIG = {
"trackbodyid": 2,
@@ -180,7 +181,18 @@ class HopperEnv(mujoco_env.MujocoEnv, utils.EzPickle):
exclude_current_positions_from_observation
)
mujoco_env.MujocoEnv.__init__(self, "hopper.xml", 4, **kwargs)
if exclude_current_positions_from_observation:
observation_space = Box(
low=-np.inf, high=np.inf, shape=(11,), dtype=np.float64
)
else:
observation_space = Box(
low=-np.inf, high=np.inf, shape=(12,), dtype=np.float64
)
mujoco_env.MujocoEnv.__init__(
self, "hopper.xml", 4, observation_space=observation_space, **kwargs
)
@property
def healthy_reward(self):