From 8641ef4d397a3c07278fe704b75383633c6af14a Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas <30759571+Kallinteris-Andreas@users.noreply.github.com> Date: Wed, 14 Feb 2024 05:53:55 +0200 Subject: [PATCH 1/8] WIP `gymnasium==1.0` support --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3e482142..6050835b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ dependencies = [ "mujoco>=2.3.3, <3.0", "numpy>=1.21.0", - "gymnasium>=0.26", + "gymnasium>=1.0.0a", "PettingZoo>=1.23.0", "Jinja2>=3.0.3", "imageio" From b6bbe94efd00475070eaeac378bb5c24f3c71a9c Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas Date: Wed, 14 Feb 2024 13:45:20 +0200 Subject: [PATCH 2/8] some fixes --- gymnasium_robotics/__init__.py | 5 +++-- gymnasium_robotics/envs/multiagent_mujoco/mujoco_multi.py | 2 +- tests/test_envs.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gymnasium_robotics/__init__.py b/gymnasium_robotics/__init__.py index 326547d4..c323ba11 100644 --- a/gymnasium_robotics/__init__.py +++ b/gymnasium_robotics/__init__.py @@ -5,6 +5,7 @@ from gymnasium_robotics.envs.maze import maps from gymnasium_robotics.envs.multiagent_mujoco import mamujoco_v0 +__version__ = "1.2.4" def register_robotics_envs(): """Register all environment ID's to Gymnasium.""" @@ -1236,8 +1237,8 @@ def _merge(a, b): max_episode_steps=280, ) +register_robotics_envs() -__version__ = "1.2.4" try: @@ -1251,4 +1252,4 @@ def _merge(a, b): ): print(notifications["gymnasium_robotics"][__version__], file=sys.stderr) except Exception: # nosec - pass + pass \ No newline at end of file diff --git a/gymnasium_robotics/envs/multiagent_mujoco/mujoco_multi.py b/gymnasium_robotics/envs/multiagent_mujoco/mujoco_multi.py index 76d99a4e..0d671d16 100755 --- a/gymnasium_robotics/envs/multiagent_mujoco/mujoco_multi.py +++ b/gymnasium_robotics/envs/multiagent_mujoco/mujoco_multi.py @@ -20,7 +20,7 @@ import gymnasium import numpy as np import pettingzoo -from gymnasium.wrappers.time_limit import TimeLimit +from gymnasium.wrappers import TimeLimit from gymnasium_robotics.envs.multiagent_mujoco.coupled_half_cheetah import ( CoupledHalfCheetahEnv, diff --git a/tests/test_envs.py b/tests/test_envs.py index 6fc05928..472652c3 100644 --- a/tests/test_envs.py +++ b/tests/test_envs.py @@ -14,7 +14,7 @@ for message in [ "This version of the mujoco environments depends on the mujoco-py bindings, which are no longer maintained and may stop working. Please upgrade to the v4 versions of the environments (which depend on the mujoco python bindings instead), unless you are trying to precisely replicate previous works).", "A Box observation space minimum value is -infinity. This is probably too low.", - "A Box observation space maximum value is -infinity. This is probably too high.", + "A Box observation space maximum value is infinity. This is probably too high.", "For Box action spaces, we recommend using a symmetric and normalized space (range=[-1, 1] or [0, 1]). See https://stable-baselines3.readthedocs.io/en/master/guide/rl_tips.html for more information.", ] ] From 0db84160327ecaac86d85192f6f6bacd9cd2ac8b Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas Date: Wed, 14 Feb 2024 13:58:02 +0200 Subject: [PATCH 3/8] add `unwrapped` to `env` in `tests` --- tests/envs/franka_kitchen/test_kitchen_env.py | 4 ++-- tests/envs/hand/test_manipulate.py | 2 +- tests/envs/hand/test_manipulate_touch_sensors.py | 2 +- tests/envs/hand/test_reach.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/envs/franka_kitchen/test_kitchen_env.py b/tests/envs/franka_kitchen/test_kitchen_env.py index e6616cf6..4c3f92b4 100644 --- a/tests/envs/franka_kitchen/test_kitchen_env.py +++ b/tests/envs/franka_kitchen/test_kitchen_env.py @@ -47,7 +47,7 @@ def test_task_completion(remove_task_when_completed, terminate_on_tasks_complete # Complete a task sequentially for each environment step for task in TASKS: # Force task to be achieved - env.data.qpos[OBS_ELEMENT_INDICES[task]] = OBS_ELEMENT_GOALS[task] + env.unwrapped.data.qpos[OBS_ELEMENT_INDICES[task]] = OBS_ELEMENT_GOALS[task] _, _, terminated, _, info = env.step(env.action_space.sample()) completed_tasks.add(task) @@ -91,7 +91,7 @@ def test_task_completion(remove_task_when_completed, terminate_on_tasks_complete # Complete a task sequentially for each environment step for task in TASKS: # Force task to be achieved - env.data.qpos[OBS_ELEMENT_INDICES[task]] = OBS_ELEMENT_GOALS[task] + env.unwrapped.data.qpos[OBS_ELEMENT_INDICES[task]] = OBS_ELEMENT_GOALS[task] completed_tasks.add(task) _, _, terminated, _, info = env.step(env.action_space.sample()) diff --git a/tests/envs/hand/test_manipulate.py b/tests/envs/hand/test_manipulate.py index e1afe251..c27b3d5a 100644 --- a/tests/envs/hand/test_manipulate.py +++ b/tests/envs/hand/test_manipulate.py @@ -16,7 +16,7 @@ def test_serialize_deserialize(environment_id): env1.reset() env2 = pickle.loads(pickle.dumps(env1)) - assert env1.target_position == env2.target_position, ( + assert env1.unwrapped.target_position == env2.unwrapped.target_position, ( env1.target_position, env2.target_position, ) diff --git a/tests/envs/hand/test_manipulate_touch_sensors.py b/tests/envs/hand/test_manipulate_touch_sensors.py index 4cda849d..f741e3f4 100644 --- a/tests/envs/hand/test_manipulate_touch_sensors.py +++ b/tests/envs/hand/test_manipulate_touch_sensors.py @@ -16,7 +16,7 @@ def test_serialize_deserialize(environment_id): env1.reset() env2 = pickle.loads(pickle.dumps(env1)) - assert env1.target_position == env2.target_position, ( + assert env1.unwrapped.target_position == env2.unwrapped.target_position, ( env1.target_position, env2.target_position, ) diff --git a/tests/envs/hand/test_reach.py b/tests/envs/hand/test_reach.py index 6596aa12..7cf93665 100644 --- a/tests/envs/hand/test_reach.py +++ b/tests/envs/hand/test_reach.py @@ -8,7 +8,7 @@ def test_serialize_deserialize(): env1.reset() env2 = pickle.loads(pickle.dumps(env1)) - assert env1.distance_threshold == env2.distance_threshold, ( + assert env1.unwrapped.distance_threshold == env2.unwrapped.distance_threshold, ( env1.distance_threshold, env2.distance_threshold, ) From 651fc9400697e58da4760727a3e8604762bd5dbe Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas Date: Wed, 14 Feb 2024 14:05:22 +0200 Subject: [PATCH 4/8] `pre-commit` --- gymnasium_robotics/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gymnasium_robotics/__init__.py b/gymnasium_robotics/__init__.py index c323ba11..1b1c37d4 100644 --- a/gymnasium_robotics/__init__.py +++ b/gymnasium_robotics/__init__.py @@ -7,6 +7,7 @@ __version__ = "1.2.4" + def register_robotics_envs(): """Register all environment ID's to Gymnasium.""" @@ -1237,8 +1238,8 @@ def _merge(a, b): max_episode_steps=280, ) -register_robotics_envs() +register_robotics_envs() try: @@ -1252,4 +1253,4 @@ def _merge(a, b): ): print(notifications["gymnasium_robotics"][__version__], file=sys.stderr) except Exception: # nosec - pass \ No newline at end of file + pass From cfcb61e25fa92e6fc4cbcd7f11551f679149b137 Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas Date: Wed, 14 Feb 2024 14:23:53 +0200 Subject: [PATCH 5/8] update DOCs `import` before `make` --- docs/content/multi-goal_api.md | 3 +++ docs/envs/franka_kitchen/index.md | 3 +++ docs/envs/shadow_dexterous_hand/index.md | 3 +++ docs/index.md | 4 ++++ gymnasium_robotics/envs/adroit_hand/adroit_door.py | 3 +++ gymnasium_robotics/envs/adroit_hand/adroit_hammer.py | 3 +++ gymnasium_robotics/envs/adroit_hand/adroit_pen.py | 3 +++ gymnasium_robotics/envs/adroit_hand/adroit_relocate.py | 3 +++ gymnasium_robotics/envs/fetch/pick_and_place.py | 6 ++++++ gymnasium_robotics/envs/fetch/push.py | 6 ++++++ gymnasium_robotics/envs/fetch/reach.py | 6 ++++++ gymnasium_robotics/envs/fetch/slide.py | 6 ++++++ gymnasium_robotics/envs/franka_kitchen/kitchen_env.py | 4 ++++ gymnasium_robotics/envs/maze/ant_maze_v4.py | 9 +++++++++ gymnasium_robotics/envs/maze/point_maze.py | 9 +++++++++ .../envs/shadow_dexterous_hand/manipulate_block.py | 7 ++++++- .../envs/shadow_dexterous_hand/manipulate_egg.py | 6 ++++++ .../envs/shadow_dexterous_hand/manipulate_pen.py | 7 ++++++- 18 files changed, 89 insertions(+), 2 deletions(-) diff --git a/docs/content/multi-goal_api.md b/docs/content/multi-goal_api.md index 1c396ac8..d4458dfa 100644 --- a/docs/content/multi-goal_api.md +++ b/docs/content/multi-goal_api.md @@ -21,6 +21,9 @@ goal, e.g. state derived from the simulation. ```python import gymnasium as gym +import gymnasium_robotics + +gym.register_envs(gymnasium_robotics) env = gym.make("FetchReach-v2") env.reset() diff --git a/docs/envs/franka_kitchen/index.md b/docs/envs/franka_kitchen/index.md index 7a20ab2c..7b54c5f5 100644 --- a/docs/envs/franka_kitchen/index.md +++ b/docs/envs/franka_kitchen/index.md @@ -16,6 +16,9 @@ The tasks can be selected when the environment is initialized passing a list of ```python import gymnasium as gym +import gymnasium_robotics + +gym.register_envs(gymnasium_robotics) env = gym.make('FrankaKitchen-v1', tasks_to_complete=['microwave', 'kettle']) ``` diff --git a/docs/envs/shadow_dexterous_hand/index.md b/docs/envs/shadow_dexterous_hand/index.md index c874e348..ae93485e 100644 --- a/docs/envs/shadow_dexterous_hand/index.md +++ b/docs/envs/shadow_dexterous_hand/index.md @@ -22,6 +22,9 @@ These environments are instanceated by adding the following strings to the Hand ```python import gymnasium as gym +import gymnasium_robotics + +gym.register_envs(gymnasium_robotics) env = gym.make('HandManipulateEgg_BooleanTouchSensors-v1') ``` diff --git a/docs/index.md b/docs/index.md index 6294ee8d..f40b7a63 100644 --- a/docs/index.md +++ b/docs/index.md @@ -52,6 +52,10 @@ The creation and interaction with the robotic environments follow the Gymnasium ```{code-block} python import gymnasium as gym +import gymnasium_robotics + +gym.register_envs(gymnasium_robotics) + env = gym.make("FetchPickAndPlace-v2", render_mode="human") observation, info = env.reset(seed=42) for _ in range(1000): diff --git a/gymnasium_robotics/envs/adroit_hand/adroit_door.py b/gymnasium_robotics/envs/adroit_hand/adroit_door.py index 323222ab..e2d02caa 100644 --- a/gymnasium_robotics/envs/adroit_hand/adroit_door.py +++ b/gymnasium_robotics/envs/adroit_hand/adroit_door.py @@ -163,6 +163,9 @@ class AdroitHandDoorEnv(MujocoEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('AdroitHandDoor-v1', max_episode_steps=400) ``` diff --git a/gymnasium_robotics/envs/adroit_hand/adroit_hammer.py b/gymnasium_robotics/envs/adroit_hand/adroit_hammer.py index 8d4c6c0d..af68a408 100644 --- a/gymnasium_robotics/envs/adroit_hand/adroit_hammer.py +++ b/gymnasium_robotics/envs/adroit_hand/adroit_hammer.py @@ -172,6 +172,9 @@ class AdroitHandHammerEnv(MujocoEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('AdroitHandHammer-v1', max_episode_steps=400) ``` diff --git a/gymnasium_robotics/envs/adroit_hand/adroit_pen.py b/gymnasium_robotics/envs/adroit_hand/adroit_pen.py index 5e0f6517..37e4e2e6 100644 --- a/gymnasium_robotics/envs/adroit_hand/adroit_pen.py +++ b/gymnasium_robotics/envs/adroit_hand/adroit_pen.py @@ -165,6 +165,9 @@ class AdroitHandPenEnv(MujocoEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('AdroitHandPen-v1', max_episode_steps=400) ``` diff --git a/gymnasium_robotics/envs/adroit_hand/adroit_relocate.py b/gymnasium_robotics/envs/adroit_hand/adroit_relocate.py index 8cb41138..db9031cf 100644 --- a/gymnasium_robotics/envs/adroit_hand/adroit_relocate.py +++ b/gymnasium_robotics/envs/adroit_hand/adroit_relocate.py @@ -165,6 +165,9 @@ class AdroitHandRelocateEnv(MujocoEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('AdroitHandRelocate-v1', max_episode_steps=400) ``` diff --git a/gymnasium_robotics/envs/fetch/pick_and_place.py b/gymnasium_robotics/envs/fetch/pick_and_place.py index b6d0673c..74b5ed21 100644 --- a/gymnasium_robotics/envs/fetch/pick_and_place.py +++ b/gymnasium_robotics/envs/fetch/pick_and_place.py @@ -92,6 +92,9 @@ class MujocoFetchPickAndPlaceEnv(MujocoFetchEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('FetchPickAndPlaceDense-v2') ``` @@ -118,6 +121,9 @@ class MujocoFetchPickAndPlaceEnv(MujocoFetchEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('FetchPickAndPlace-v2', max_episode_steps=100) ``` diff --git a/gymnasium_robotics/envs/fetch/push.py b/gymnasium_robotics/envs/fetch/push.py index 57545ac9..10a87282 100644 --- a/gymnasium_robotics/envs/fetch/push.py +++ b/gymnasium_robotics/envs/fetch/push.py @@ -120,6 +120,9 @@ class MujocoFetchPushEnv(MujocoFetchEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('FetchPushDense-v2') ``` @@ -146,6 +149,9 @@ class MujocoFetchPushEnv(MujocoFetchEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('FetchPush-v2', max_episode_steps=100) ``` diff --git a/gymnasium_robotics/envs/fetch/reach.py b/gymnasium_robotics/envs/fetch/reach.py index 19e2b6cf..962fd74d 100644 --- a/gymnasium_robotics/envs/fetch/reach.py +++ b/gymnasium_robotics/envs/fetch/reach.py @@ -82,6 +82,9 @@ class MujocoFetchReachEnv(MujocoFetchEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('FetchReachDense-v2') ``` @@ -104,6 +107,9 @@ class MujocoFetchReachEnv(MujocoFetchEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('FetchReach-v2', max_episode_steps=100) ``` diff --git a/gymnasium_robotics/envs/fetch/slide.py b/gymnasium_robotics/envs/fetch/slide.py index bc0dbf4e..1381b4a5 100644 --- a/gymnasium_robotics/envs/fetch/slide.py +++ b/gymnasium_robotics/envs/fetch/slide.py @@ -120,6 +120,9 @@ class MujocoFetchSlideEnv(MujocoFetchEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('FetchSlideDense-v2') ``` @@ -145,6 +148,9 @@ class MujocoFetchSlideEnv(MujocoFetchEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('FetchSlide-v2', max_episode_steps=100) ``` diff --git a/gymnasium_robotics/envs/franka_kitchen/kitchen_env.py b/gymnasium_robotics/envs/franka_kitchen/kitchen_env.py index beba0af9..a8c0c3cc 100644 --- a/gymnasium_robotics/envs/franka_kitchen/kitchen_env.py +++ b/gymnasium_robotics/envs/franka_kitchen/kitchen_env.py @@ -64,6 +64,10 @@ class KitchenEnv(GoalEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) + env = gym.make('FrankaKitchen-v1', tasks_to_complete=['microwave', 'kettle']) ``` diff --git a/gymnasium_robotics/envs/maze/ant_maze_v4.py b/gymnasium_robotics/envs/maze/ant_maze_v4.py index bf8ec0f2..da448e96 100644 --- a/gymnasium_robotics/envs/maze/ant_maze_v4.py +++ b/gymnasium_robotics/envs/maze/ant_maze_v4.py @@ -65,6 +65,9 @@ class AntMazeEnv(MazeEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) example_map = [[1, 1, 1, 1, 1], [1, C, 0, C, 1], @@ -158,6 +161,9 @@ class AntMazeEnv(MazeEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('AntMaze_UMaze-v4') ``` @@ -192,6 +198,9 @@ class AntMazeEnv(MazeEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('AntMaze_UMaze-v4', max_episode_steps=100) ``` diff --git a/gymnasium_robotics/envs/maze/point_maze.py b/gymnasium_robotics/envs/maze/point_maze.py index 33b263e7..f1e5710f 100644 --- a/gymnasium_robotics/envs/maze/point_maze.py +++ b/gymnasium_robotics/envs/maze/point_maze.py @@ -196,6 +196,9 @@ class PointMazeEnv(MazeEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) example_map = [[1, 1, 1, 1, 1], [1, C, 0, C, 1], @@ -253,6 +256,9 @@ class PointMazeEnv(MazeEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('PointMaze_UMazeDense-v3') ``` @@ -286,6 +292,9 @@ class PointMazeEnv(MazeEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('PointMaze_UMaze-v3', max_episode_steps=100) ``` diff --git a/gymnasium_robotics/envs/shadow_dexterous_hand/manipulate_block.py b/gymnasium_robotics/envs/shadow_dexterous_hand/manipulate_block.py index f0ffe70c..bd82c3d4 100644 --- a/gymnasium_robotics/envs/shadow_dexterous_hand/manipulate_block.py +++ b/gymnasium_robotics/envs/shadow_dexterous_hand/manipulate_block.py @@ -166,6 +166,9 @@ class MujocoHandBlockEnv(MujocoManipulateEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('HandManipulateBlock-v1') ``` @@ -193,6 +196,9 @@ class MujocoHandBlockEnv(MujocoManipulateEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('HandManipulateBlock-v1', max_episode_steps=100) ``` @@ -203,7 +209,6 @@ class MujocoHandBlockEnv(MujocoManipulateEnv, EzPickle): * v1: the environment depends on the newest [mujoco python bindings](https://mujoco.readthedocs.io/en/latest/python.html) maintained by the MuJoCo team in Deepmind. * v0: the environment depends on `mujoco_py` which is no longer maintained. - """ def __init__( diff --git a/gymnasium_robotics/envs/shadow_dexterous_hand/manipulate_egg.py b/gymnasium_robotics/envs/shadow_dexterous_hand/manipulate_egg.py index fab89d99..d0f6f0d8 100644 --- a/gymnasium_robotics/envs/shadow_dexterous_hand/manipulate_egg.py +++ b/gymnasium_robotics/envs/shadow_dexterous_hand/manipulate_egg.py @@ -169,6 +169,9 @@ class MujocoHandEggEnv(MujocoManipulateEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('HandManipulateEgg-v1') ``` @@ -196,6 +199,9 @@ class MujocoHandEggEnv(MujocoManipulateEnv, EzPickle): ``` import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('HandManipulateEgg-v1', max_episode_steps=100) ``` diff --git a/gymnasium_robotics/envs/shadow_dexterous_hand/manipulate_pen.py b/gymnasium_robotics/envs/shadow_dexterous_hand/manipulate_pen.py index 03682268..b9f9fb35 100644 --- a/gymnasium_robotics/envs/shadow_dexterous_hand/manipulate_pen.py +++ b/gymnasium_robotics/envs/shadow_dexterous_hand/manipulate_pen.py @@ -168,6 +168,9 @@ class MujocoHandPenEnv(MujocoManipulateEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('HandManipulatePen-v1') ``` @@ -195,6 +198,9 @@ class MujocoHandPenEnv(MujocoManipulateEnv, EzPickle): ```python import gymnasium as gym + import gymnasium_robotics + + gym.register_envs(gymnasium_robotics) env = gym.make('HandManipulatePen-v1', max_episode_steps=100) ``` @@ -205,7 +211,6 @@ class MujocoHandPenEnv(MujocoManipulateEnv, EzPickle): * v1: the environment depends on the newest [mujoco python bindings](https://mujoco.readthedocs.io/en/latest/python.html) maintained by the MuJoCo team in Deepmind. * v0: the environment depends on `mujoco_py` which is no longer maintained. - """ def __init__( From eb80d63c6688ad858af0ce6134d0e6aaba950c92 Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas <30759571+Kallinteris-Andreas@users.noreply.github.com> Date: Wed, 14 Feb 2024 14:55:31 +0200 Subject: [PATCH 6/8] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6050835b..2472ede3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ 'Topic :: Scientific/Engineering :: Artificial Intelligence', ] dependencies = [ - "mujoco>=2.3.3, <3.0", + "mujoco>=2.2.0", "numpy>=1.21.0", "gymnasium>=1.0.0a", "PettingZoo>=1.23.0", From c6b53dd79ab38151823a33813a9e01aa8e5fd0d0 Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas <30759571+Kallinteris-Andreas@users.noreply.github.com> Date: Thu, 15 Feb 2024 05:43:12 +0200 Subject: [PATCH 7/8] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2472ede3..4c4961d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ dependencies = [ "mujoco>=2.2.0", "numpy>=1.21.0", - "gymnasium>=1.0.0a", + "gymnasium>=1.0.0a1", "PettingZoo>=1.23.0", "Jinja2>=3.0.3", "imageio" From 4355697e216ede5263081ee4cc1732935dd9f3cc Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas <30759571+Kallinteris-Andreas@users.noreply.github.com> Date: Sat, 17 Feb 2024 04:52:30 +0000 Subject: [PATCH 8/8] added `MazeEnv.model` and `MazeEnv.data` --- gymnasium_robotics/envs/maze/ant_maze.py | 8 ++++++++ gymnasium_robotics/envs/maze/ant_maze_v4.py | 8 ++++++++ gymnasium_robotics/envs/maze/point_maze.py | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/gymnasium_robotics/envs/maze/ant_maze.py b/gymnasium_robotics/envs/maze/ant_maze.py index b586e9e8..d1395e78 100644 --- a/gymnasium_robotics/envs/maze/ant_maze.py +++ b/gymnasium_robotics/envs/maze/ant_maze.py @@ -122,3 +122,11 @@ def render(self): def close(self): super().close() self.ant_env.close() + + @property + def model(self): + return self.ant_env.model + + @property + def data(self): + return self.ant_env.data diff --git a/gymnasium_robotics/envs/maze/ant_maze_v4.py b/gymnasium_robotics/envs/maze/ant_maze_v4.py index da448e96..edcf7f5e 100644 --- a/gymnasium_robotics/envs/maze/ant_maze_v4.py +++ b/gymnasium_robotics/envs/maze/ant_maze_v4.py @@ -328,3 +328,11 @@ def render(self): def close(self): super().close() self.ant_env.close() + + @property + def model(self): + return self.ant_env.model + + @property + def data(self): + return self.ant_env.data diff --git a/gymnasium_robotics/envs/maze/point_maze.py b/gymnasium_robotics/envs/maze/point_maze.py index f1e5710f..e655f628 100644 --- a/gymnasium_robotics/envs/maze/point_maze.py +++ b/gymnasium_robotics/envs/maze/point_maze.py @@ -424,3 +424,11 @@ def render(self): def close(self): super().close() self.point_env.close() + + @property + def model(self): + return self.point_env.model + + @property + def data(self): + return self.point_env.data