Skip to content

Commit

Permalink
Added setter for observation space in Gymnasium wrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
robfiras committed Sep 9, 2024
1 parent 318c150 commit e0c9080
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions loco_mujoco/environments/gymnasium.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ def __init__(self, env_name, render_mode=None, **kwargs):

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

self.observation_space = self._convert_space(self._env.info.observation_space)
self._set_observation_space()
self._set_action_space()


def step(self, action):
"""
Run one timestep of the environment's dynamics.
Expand Down Expand Up @@ -151,6 +150,13 @@ def unwrapped(self):
"""
return self._env

def _set_observation_space(self):
"""
Setter for the observation space.
"""
self.observation_space = self._convert_space(self._env.info.observation_space)
return self.observation_space

def _set_action_space(self):
"""
Setter for the action space.
Expand Down

0 comments on commit e0c9080

Please sign in to comment.