Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MujocoEnv refactor remove single line function _reset_simulation() #960

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading