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

restore render support for mujoco<3 #750

Merged
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
8 changes: 8 additions & 0 deletions gymnasium/envs/mujoco/mujoco_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,14 @@ def _create_overlay(self):
self.add_overlay(topleft, "Toggle geomgroup visibility", "0-4")

self.add_overlay(bottomleft, "FPS", "%d%s" % (1 / self._time_per_render, ""))
if mujoco.__version__ >= "3.0.0":
self.add_overlay(
bottomleft, "Solver iterations", str(self.data.solver_niter[0] + 1)
)
elif mujoco.__version__ < "3.0.0":
self.add_overlay(
bottomleft, "Solver iterations", str(self.data.solver_iter + 1)
)
self.add_overlay(
bottomleft, "Solver iterations", str(self.data.solver_niter[0] + 1)
)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ classic-control = ["pygame >=2.1.3"]
classic_control = ["pygame >=2.1.3"] # kept for backward compatibility
mujoco-py = ["mujoco-py >=2.1,<2.2", "cython<3"]
mujoco_py = ["mujoco-py >=2.1,<2.2", "cython<3"] # kept for backward compatibility
mujoco = ["mujoco >=3.0.0", "imageio >=2.14.1"]
mujoco = ["mujoco >=2.1.5", "imageio >=2.14.1"]
toy-text = ["pygame >=2.1.3"]
toy_text = ["pygame >=2.1.3"] # kept for backward compatibility
jax = ["jax >=0.4.0", "jaxlib >=0.4.0"]
Expand All @@ -67,7 +67,7 @@ all = [
"mujoco-py >=2.1,<2.2",
"cython<3",
# mujoco
"mujoco >=3.0.0",
"mujoco >=2.1.5",
"imageio >=2.14.1",
# toy-text
"pygame >=2.1.3",
Expand Down
Loading