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
class InvertedPendulumEnv(mujoco_env.MujocoEnv, utils.EzPickle):
@@ -18,8 +19,14 @@ class InvertedPendulumEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self, **kwargs):
utils.EzPickle.__init__(self)
observation_space = Box(low=-np.inf, high=np.inf, shape=(4,), dtype=np.float64)
mujoco_env.MujocoEnv.__init__(
self, "inverted_pendulum.xml", 2, mujoco_bindings="mujoco_py", **kwargs
self,
"inverted_pendulum.xml",
2,
mujoco_bindings="mujoco_py",
observation_space=observation_space,
**kwargs
)
def step(self, a):