From 70c427d1de6b3f930aebb447d3d1ca20644ea576 Mon Sep 17 00:00:00 2001 From: dmarzoug Date: Mon, 25 Mar 2024 10:39:29 +0100 Subject: [PATCH 1/3] bump to v1.0.6 --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9bafa9b..15f44ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "moojoco" -version = "1.0.5" +version = "1.0.6" authors = [ { name = "Dries Marzougui", email = "dries.marzougui@gmail.com" }, ] diff --git a/setup.py b/setup.py index 043dafb..97a135c 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name='moojoco', - version='1.0.5', + version='1.0.6', description='A unified framework for implementing and interfacing with MuJoCo and MuJoCo-XLA simulation ' 'environments.', long_description=readme, From fdc714b0191f5eb04f64cfd26743b067692c37c1 Mon Sep 17 00:00:00 2001 From: dmarzoug Date: Wed, 27 Mar 2024 11:15:36 +0100 Subject: [PATCH 2/3] Fixed #12 and #13 --- moojoco/environment/mjc_env.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/moojoco/environment/mjc_env.py b/moojoco/environment/mjc_env.py index 1f5fb03..e92a421 100644 --- a/moojoco/environment/mjc_env.py +++ b/moojoco/environment/mjc_env.py @@ -98,20 +98,13 @@ def _update_observations(self, state: MJCEnvState) -> MJCEnvState: return state.replace(observations=observations) def _update_simulation(self, state: MJCEnvState, ctrl: ActType) -> MJCEnvState: - mj_data = copy.deepcopy(state.mj_data) - mj_data.ctrl[:] = ctrl + state.mj_data.ctrl[:] = ctrl mujoco.mj_step( m=state.mj_model, - d=mj_data, + d=state.mj_data, nstep=self.environment_configuration.num_physics_steps_per_control_step, ) - # As of MuJoCo 2.0, force-related quantities like cacc are not computed - # unless there's a force sensor in the model. - # See https://github.com/openai/gym/issues/1541 - mujoco.mj_rnePostConstraint(state.mj_model, mj_data) - - # noinspection PyUnresolvedReferences - return state.replace(mj_data=mj_data) + return state def _prepare_reset(self) -> Tuple[mujoco.MjModel, mujoco.MjData]: model = copy.deepcopy(self.frozen_mj_model) From e479f2f09e9768d8cce5d1275632b4db4a0d1453 Mon Sep 17 00:00:00 2001 From: dmarzoug Date: Wed, 27 Mar 2024 11:34:33 +0100 Subject: [PATCH 3/3] Fixed #14 --- moojoco/environment/mjc_env.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/moojoco/environment/mjc_env.py b/moojoco/environment/mjc_env.py index e92a421..e2c8a8c 100644 --- a/moojoco/environment/mjc_env.py +++ b/moojoco/environment/mjc_env.py @@ -107,9 +107,8 @@ def _update_simulation(self, state: MJCEnvState, ctrl: ActType) -> MJCEnvState: return state def _prepare_reset(self) -> Tuple[mujoco.MjModel, mujoco.MjData]: - model = copy.deepcopy(self.frozen_mj_model) - data = copy.deepcopy(self.frozen_mj_data) - return model, data + mujoco.mj_resetData(self.frozen_mj_model, self.frozen_mj_data) + return self.frozen_mj_model, self.frozen_mj_data def _finish_reset( self,