in robosumo/envs/mujoco_env.py [0:0]
def __init__(self, model_path, frame_skip):
if model_path.startswith("/"):
fullpath = model_path
else:
fullpath = os.path.join(os.path.dirname(__file__), "assets", model_path)
if not os.path.exists(fullpath):
raise IOError("File %s does not exist" % fullpath)
self.frame_skip = frame_skip
self.model = load_model_from_path(fullpath)
self.sim = MjSim(self.model)
self.data = self.sim.data
self.viewer = None
self.buffer_size = (1600, 1280)
self.metadata = {
'render.modes': ['human', 'rgb_array'],
'video.frames_per_second': 60,
}
self.init_qpos = self.data.qpos.ravel().copy()
self.init_qvel = self.data.qvel.ravel().copy()
observation, _reward, done, _info = self._step(np.zeros(self.model.nu))
assert not done
self.obs_dim = np.sum([o.size for o in observation]) if (
type(observation) is tuple) else observation.size
bounds = self.model.actuator_ctrlrange.copy()
low, high = bounds[:, 0], bounds[:, 1]
self.action_space = spaces.Box(low, high)
high = np.inf * np.ones(self.obs_dim)
self.observation_space = spaces.Box(-high, high)
self._seed()