Skip to content

Commit

Permalink
MujocoEnv refactor remove single line function _reset_simulation() (
Browse files Browse the repository at this point in the history
  • Loading branch information
Kallinteris-Andreas authored Mar 12, 2024
1 parent 5b0ae19 commit 087a5dc
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions gymnasium/envs/mujoco/mujoco_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ def _initialize_simulation(self) -> Tuple[Any, Any]:
"""
raise NotImplementedError

def _reset_simulation(self) -> None:
"""
Reset MuJoCo simulation data structures, mjModel and mjData.
"""
raise NotImplementedError

def _step_mujoco_simulation(self, ctrl, n_frames) -> None:
"""
Step over the MuJoCo simulation.
Expand All @@ -151,7 +145,7 @@ def reset(
):
super().reset(seed=seed)

self._reset_simulation()
mujoco.mj_resetData(self.model, self.data)

ob = self.reset_model()
info = self._get_reset_info()
Expand Down Expand Up @@ -244,9 +238,6 @@ def _initialize_simulation(
data = mujoco.MjData(model)
return model, data

def _reset_simulation(self):
mujoco.mj_resetData(self.model, self.data)

def set_state(self, qpos, qvel):
super().set_state(qpos, qvel)
self.data.qpos[:] = np.copy(qpos)
Expand Down

0 comments on commit 087a5dc

Please sign in to comment.