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

v1.0.6 #15

Merged
merged 3 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
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
18 changes: 5 additions & 13 deletions moojoco/environment/mjc_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,17 @@ 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)
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,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]" },
]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading