mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-31 02:06:08 +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
|
||||
|
||||
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):
|
||||
|
Reference in New Issue
Block a user