Skip to content

Commit

Permalink
Fixes #45.
Browse files Browse the repository at this point in the history
  • Loading branch information
robfiras committed Sep 9, 2024
1 parent f9654dd commit 39a101c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions loco_mujoco/environments/gymnasium.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,11 @@ class GymnasiumWrapper(Env):
"""

metadata = {
"render_modes": [
"human",
"rgb_array",
]
}

def __init__(self, env_name, render_mode=None, **kwargs):
self.spec = EnvSpec(env_name)

self.metadata = {"render_modes": ["human", "rgb_array"]}

key_render_mode = "render_modes"
assert "headless" not in kwargs.keys(), f"headless parameter is not allowed in Gymnasium environment. " \
f"Please use the render_mode parameter. Supported modes are: " \
Expand All @@ -44,6 +39,8 @@ def __init__(self, env_name, render_mode=None, **kwargs):

self._env = LocoEnv.make(env_name, **kwargs)

self.metadata["render_fps"] = 1.0 / self._env.dt

self.observation_space = self._convert_space(self._env.info.observation_space)
self.action_space = self._convert_space(self._env.info.action_space)

Expand Down

0 comments on commit 39a101c

Please sign in to comment.