mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-31 18:12:53 +00:00
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:
committed by
GitHub
parent
7f6effbc0d
commit
61a39f41bc
@@ -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):
|
||||
|
Reference in New Issue
Block a user