def get_state(self): """Serializes the qpos and qvel state of the MuJoCo emulator. :return: ([float]) state """ state = MujocoState.from_mjdata(self.sim.data).flatten() return state
def __init__(self, env): if hasattr(env, '_max_episode_steps'): # We step multiple times, then reset to a previous state. # Timestep limit doesn't make much sense at this level. # (Instead, apply it outside of the controller.) raise TypeError("Environment must not have a timestep limit.") self.env = env self.sim = getattr_unwrapped(env, 'sim') state = MujocoState.from_mjdata(self.sim.data).flatten() self._state_size = len(state) self._action_size = reduce(lambda x, y: x * y, env.action_space.shape)
def get_state(self): return MujocoState.from_mjdata(self.sim.data).flatten()
def get_state(self): """Serializes the qpos and qvel state of the MuJoCo emulator.""" return MujocoState.from_mjdata(self.sim.data).flatten()