From acad2a0ee04d03c37f5691bf9cf16c7ef71abc1c Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas <30759571+Kallinteris-Andreas@users.noreply.github.com> Date: Sat, 10 Feb 2024 16:51:33 +0200 Subject: [PATCH 1/4] pin `pyright==1.1.347` (match gymnasium) (#209) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ebaea8c..38f51360 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,7 +39,7 @@ repos: language: node pass_filenames: false types: [python] - additional_dependencies: ["pyright"] + additional_dependencies: ["pyright@1.1.347"] args: - --project=pyproject.toml - repo: https://github.com/pycqa/pydocstyle From 12a336a4bdf3f1607691a582b29aea2e4b70110b Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas <30759571+Kallinteris-Andreas@users.noreply.github.com> Date: Sat, 17 Feb 2024 14:55:01 +0200 Subject: [PATCH 2/4] `gymnasium==1.0` support (#211) * WIP `gymnasium==1.0` support * some fixes * add `unwrapped` to `env` in `tests` * `pre-commit` * update DOCs `import` before `make` * Update pyproject.toml * Update pyproject.toml * added `MazeEnv.model` and `MazeEnv.data` --- 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/__init__.py | 4 +++- .../envs/adroit_hand/adroit_door.py | 3 +++ .../envs/adroit_hand/adroit_hammer.py | 3 +++ .../envs/adroit_hand/adroit_pen.py | 3 +++ .../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 ++++++ .../envs/franka_kitchen/kitchen_env.py | 4 ++++ gymnasium_robotics/envs/maze/ant_maze.py | 8 ++++++++ gymnasium_robotics/envs/maze/ant_maze_v4.py | 17 +++++++++++++++++ gymnasium_robotics/envs/maze/point_maze.py | 17 +++++++++++++++++ .../envs/multiagent_mujoco/mujoco_multi.py | 2 +- .../shadow_dexterous_hand/manipulate_block.py | 7 ++++++- .../shadow_dexterous_hand/manipulate_egg.py | 6 ++++++ .../shadow_dexterous_hand/manipulate_pen.py | 7 ++++++- pyproject.toml | 4 ++-- tests/envs/franka_kitchen/test_kitchen_env.py | 4 ++-- tests/envs/hand/test_manipulate.py | 2 +- .../envs/hand/test_manipulate_touch_sensors.py | 2 +- tests/envs/hand/test_reach.py | 2 +- tests/test_envs.py | 2 +- 27 files changed, 125 insertions(+), 12 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/__init__.py b/gymnasium_robotics/__init__.py index 326547d4..1b1c37d4 100644 --- a/gymnasium_robotics/__init__.py +++ b/gymnasium_robotics/__init__.py @@ -5,6 +5,8 @@ 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.""" @@ -1237,7 +1239,7 @@ def _merge(a, b): ) -__version__ = "1.2.4" +register_robotics_envs() try: 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.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 bf8ec0f2..edcf7f5e 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) ``` @@ -319,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 33b263e7..e655f628 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) ``` @@ -415,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 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/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__( diff --git a/pyproject.toml b/pyproject.toml index 3e482142..4c4961d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,9 +24,9 @@ classifiers = [ 'Topic :: Scientific/Engineering :: Artificial Intelligence', ] dependencies = [ - "mujoco>=2.3.3, <3.0", + "mujoco>=2.2.0", "numpy>=1.21.0", - "gymnasium>=0.26", + "gymnasium>=1.0.0a1", "PettingZoo>=1.23.0", "Jinja2>=3.0.3", "imageio" 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, ) 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 8606192735a9963d1dcc12feade037b77d9349be Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas <30759571+Kallinteris-Andreas@users.noreply.github.com> Date: Mon, 19 Feb 2024 18:36:26 +0200 Subject: [PATCH 3/4] add `MaMuJoCo-v1` environments (#196) * (temp) make mamujoco requirement mandatory * MaMuJoCo Doc update * add ant2x4 image * `MaMuJoCo` DOC Update (adding action space PICs) * more pics * typo fix * typo fixes * fix `shinx` warning * `MaMuJoCo` DOC update * minor formating changes * add `kwargs` * add `mujuco-v5` (init) * `pre-commit` * add hopper_v5 * add walker2d * add Half Cheetah * typo fix * add pusher * add swimmer * pre-commit * typo fix * `xml_file` arg fixes * added `InvertedPendulum-v5` * cleanup * rename * fix camera on new models * add inv_double_pend * fix `humanoid` `info` * `humanoid` add include obs arguments * update reacher DOC * update obs shape (humanoid) * `Ant` cleanup and fix `info` * update `Ant` doc * re-add to humanoid `contact_cost` * fix obs shape * inv_double_pend update doc * Ant doc update * reacher add changelogg * `xml_file` doc fix for hopper and walker * update humanoid doc * Ant obs doc fix * add `__credits__` * `pre-commit` * doc update * doc args cleanup * fix pusher changelogs * `reacher` & `pusher` add xml_file argument * fix typos in `humanoid` * rename obs args * ant add `include_cfrc_ext_in_observation` * register new envs * fix register * typo fix * fix humanoid pickle * fix humanoid pickle (for real this time) * add `reset_noise_scale` to double_pend * add new inv_double_pend args * inv_double_pend re_order ez pickle init to the start * add humanoidstandup * update humanoid standup `info` * `pre-commit` * cleanup * hopper add `info` "z_distance_from_origin" * fix * add `frame_skip` argument * add tendon `info` * fix exclude refactor * update doc * update obs creation * typo fix * cleanup * fixed humanoid arguments docs * add dynamic obs_size calculation * add `metadata["observation_structure"]` * cartpole add args * typo fix * added `reacher`&`pusher` reward weights * cleanup * cleanup * cleanup * `pre-commit` * add `default_camera_config` argunment * fix `ant/humanoid` `info["x/y_position"]` * `ant` add `forward_reward_weight` * ant doc * `ant` cleaned up xy pos aquasition * added `main_body` * fix `healthy_reward` * pre-commit * fix ant velocity * dict * update renderer * add `walker2d` `info[z_distance_from_origon]` * add `reset_info` * refactored observation structures to a member variable * cleanup observation_structure * Final? documention update * cleanup * fix distance_from_origin info * pre-commit * Update maze_v4.py * cleanup * cleanup * clean * cleaup local/global cat generation * remove `osbk._observation_structure` * type hint adition * doc typo fix * more to `gymnasium/mujoco-v5` * disable const 0 observation (`Ant`&`Humanoid`) * port to v5 (missed one) * `dummy_node`, when `factorizatoion=None` now includes action_id * update `map_global_state_to_local_observations` for `v5` * fix `Walker2d` globals from `[root_x, root_x, root_z]` to `[root_x, root_z, root_y]` * add `ignore_body_fn` in `build_obs` * enchance observation mapping * fix map_obs_local2global error msg * remove `ManySegment` classes * rename to `v1` * update docstrings * cleanup * add support for loading custom envs * cleanup * cleanup * fixed temp assets not being removed * fix stupid bug * update manysegswimmer timestep to match swimmer * update swimmer to support `mujoco>=3.0.0` * change manysegmentant timestep * add test for many segment swimmer * expand testing to include different obs types * add a comment * factorization and cleanup * `gymnasium==1.0.0` compatibility * `gymnasium==1.0.0` API * updated documention * update single * make `jinja2` optional and cleanup * add multiswimmer doc * Update pyproject.tom * Update pyproject.toml * Update __init__.py * Update __init__.py * `pre-commit` * Update index.md * Update many_segment_swimmer.py * Update many_segment_ant.py * Update ma_ant.md * Update ma_coupled_half_cheetah.md * Update ma_half_cheetah.md * Update ma_hopper.md * Update ma_humanoid.md * Update ma_humanoid_standup.md * Update ma_multiagentswimmer.md * Update ma_pusher.md * Update ma_reacher.md * Update ma_single.md * Update ma_swimmer.md * Update ma_walker2d.md * Update README.md --- README.md | 2 + docs/envs/MaMuJoCo/index.md | 31 +- docs/envs/MaMuJoCo/ma_ant.md | 20 +- docs/envs/MaMuJoCo/ma_coupled_half_cheetah.md | 10 +- docs/envs/MaMuJoCo/ma_half_cheetah.md | 12 +- docs/envs/MaMuJoCo/ma_hopper.md | 10 +- docs/envs/MaMuJoCo/ma_humanoid.md | 11 +- docs/envs/MaMuJoCo/ma_humanoid_standup.md | 11 +- docs/envs/MaMuJoCo/ma_multiagentswimmer.md | 81 ++++ docs/envs/MaMuJoCo/ma_pusher.md | 10 +- docs/envs/MaMuJoCo/ma_reacher.md | 10 +- docs/envs/MaMuJoCo/ma_single.md | 6 +- docs/envs/MaMuJoCo/ma_swimmer.md | 10 +- docs/envs/MaMuJoCo/ma_walker2d.md | 11 +- gymnasium_robotics/__init__.py | 4 +- .../envs/multiagent_mujoco/__init__.py | 6 - .../assets/many_segment_ant.xml.template | 8 +- .../assets/many_segment_swimmer.xml.template | 13 +- .../multiagent_mujoco/coupled_half_cheetah.py | 4 +- .../{mamujoco_v0.py => mamujoco_v1.py} | 0 .../multiagent_mujoco/many_segment_ant.py | 233 +++-------- .../multiagent_mujoco/many_segment_swimmer.py | 197 +++------ .../envs/multiagent_mujoco/mujoco_multi.py | 376 +++++++++++------- .../envs/multiagent_mujoco/obsk.py | 128 ++---- tests/envs/MaMuJoCo/test_MaMuJoCo.py | 178 ++++++--- 25 files changed, 674 insertions(+), 708 deletions(-) create mode 100644 docs/envs/MaMuJoCo/ma_multiagentswimmer.md rename gymnasium_robotics/envs/multiagent_mujoco/{mamujoco_v0.py => mamujoco_v1.py} (100%) diff --git a/README.md b/README.md index 403ec1dc..c8d0031d 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ The [D4RL](https://github.com/Farama-Foundation/D4RL) environments are now avail The different tasks involve hammering a nail, opening a door, twirling a pen, or picking up and moving a ball. * [Franka Kitchen](https://robotics.farama.org/envs/franka_kitchen/) - Multitask environment in which a 9-DoF Franka robot is placed in a kitchen containing several common household items. The goal of each task is to interact with the items in order to reach a desired goal configuration. +* [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) - A collection of multi agent factorizations of the [Gymnasium/MuJoCo](https://gymnasium.farama.org/environments/mujoco/) environments and a framework for factorizing robotic environments, uses the [pettingzoo.ParallelEnv](https://pettingzoo.farama.org/api/parallel/) API. + **WIP**: generate new `D4RL` environment datasets with [Minari](https://github.com/Farama-Foundation/Minari). ## Multi-goal API diff --git a/docs/envs/MaMuJoCo/index.md b/docs/envs/MaMuJoCo/index.md index b70a16a5..94d2b9b0 100644 --- a/docs/envs/MaMuJoCo/index.md +++ b/docs/envs/MaMuJoCo/index.md @@ -19,20 +19,19 @@ Gymansium-Robotics/MaMuJoCo Represents the first, easy to use Framework for rese MaMuJoCo mainly uses the [PettingZoo.ParallelAPI](https://pettingzoo.farama.org/api/parallel/), but also supports a few extra functions: ```{eval-rst} -.. autofunction:: gymnasium_robotics.mamujoco_v0.parallel_env.map_local_actions_to_global_action +.. autofunction:: gymnasium_robotics.mamujoco_v1.parallel_env.map_local_actions_to_global_action ``` - ```{eval-rst} -.. autofunction:: gymnasium_robotics.mamujoco_v0.parallel_env.map_global_action_to_local_actions +.. autofunction:: gymnasium_robotics.mamujoco_v1.parallel_env.map_global_action_to_local_actions ``` ```{eval-rst} -.. autofunction:: gymnasium_robotics.mamujoco_v0.parallel_env.map_global_state_to_local_observations +.. autofunction:: gymnasium_robotics.mamujoco_v1.parallel_env.map_global_state_to_local_observations ``` ```{eval-rst} -.. autofunction:: gymnasium_robotics.mamujoco_v0.parallel_env.map_local_observation_to_global_state +.. autofunction:: gymnasium_robotics.mamujoco_v1.parallel_env.map_local_observations_to_global_state ``` ```{eval-rst} -.. autofunction:: gymnasium_robotics.mamujoco_v0.get_parts_and_edges +.. autofunction:: gymnasium_robotics.mamujoco_v1.get_parts_and_edges ``` MaMuJoCo also supports the [PettingZoo.AECAPI](https://pettingzoo.farama.org/api/aec/) but does not expose extra functions. @@ -41,19 +40,19 @@ MaMuJoCo also supports the [PettingZoo.AECAPI](https://pettingzoo.farama.org/api ### Arguments ```{eval-rst} -.. autofunction:: gymnasium_robotics.mamujoco_v0.parallel_env.__init__ +.. autofunction:: gymnasium_robotics.mamujoco_v1.parallel_env.__init__ ``` ## How to create new agent factorizations -### example 'Ant-v4', '8x1' +### example 'Ant-v5', '8x1' In this example, we will create an agent factorization not present in Gymnasium-Robotics/MaMuJoCo the "Ant"/'8x1', where each agent controls a single joint/action (first implemented by [safe-MaMuJoCo](https://github.com/chauncygu/Safe-Multi-Agent-Mujoco)). first we will load the graph of MaMuJoCo: ```python ->>> from gymnasium_robotics.mamujoco_v0 import get_parts_and_edges ->>> unpartioned_nodes, edges, global_nodes = get_parts_and_edges('Ant-v4', None) +>>> from gymnasium_robotics.mamujoco_v1 import get_parts_and_edges +>>> unpartioned_nodes, edges, global_nodes = get_parts_and_edges('Ant-v5', None) ``` The `unpartioned_nodes` contain the nodes of the MaMuJoCo graph. The `edges` well, contain the edges of the graph. @@ -63,18 +62,23 @@ To create our '8x1' partition we will need to partition the `unpartioned_nodes`: ```python >>> unpartioned_nodes [(hip1, ankle1, hip2, ankle2, hip3, ankle3, hip4, ankle4)] ->>> partioned_nodes = [(unpartioned_nodes[0][0],), (unpartioned_nodes[0][1],), (unpartioned_nodes[0][2],), (unpartioned_nodes[0][3],), (unpartioned_nodes[0][4],), (unpartioned_nodes[0][5],), (unpartioned_nodes[0][6],), (unpartioned_nodes[0][7],)]>>> partioned_nodes +>>> partioned_nodes = [(unpartioned_nodes[0][0],), (unpartioned_nodes[0][1],), (unpartioned_nodes[0][2],), (unpartioned_nodes[0][3],), (unpartioned_nodes[0][4],), (unpartioned_nodes[0][5],), (unpartioned_nodes[0][6],), (unpartioned_nodes[0][7],)] >>> partioned_nodes [(hip1,), (ankle1,), (hip2,), (ankle2,), (hip3,), (ankle3,), (hip4,), (ankle4,)] ``` Finally package the partitions and create our environment: ```python >>> my_agent_factorization = {"partition": partioned_nodes, "edges": edges, "globals": global_nodes} ->>> gym_env = mamujoco_v0('Ant', '8x1', agent_factorization=my_agent_factorization) +>>> gym_env = mamujoco_v1('Ant', '8x1', agent_factorization=my_agent_factorization) ``` ## Version History -v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of [the original multiagent_mujuco](https://github.com/schroederdewitt/multiagent_mujoco) +* v1: + - Now based on `Gymnasium/MuJoCo-v5` instead of `Gymnasium/MuJoCo-v4` (https://github.com/Farama-Foundation/Gymnasium/pull/572). + - When `factorizatoion=None`, the `env.gent_action_partitions.dummy_node` now contains `action_id` (it used to be `None`). + - Added `map_local_observations_to_global_state` & optimized runtime performance of `map_global_state_to_local_observations`. + - Added `gym_env` argument which can be used to load third-party `Gymansium.MujocoEnv` environments. +* v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of [the original multiagent_mujuco](https://github.com/schroederdewitt/multiagent_mujoco) ```{toctree} :hidden: @@ -84,6 +88,7 @@ ma_half_cheetah.md ma_hopper.md ma_humanoid_standup.md ma_humanoid.md +ma_multiagentswimmer.md ma_reacher.md ma_swimmer.md ma_pusher.md diff --git a/docs/envs/MaMuJoCo/ma_ant.md b/docs/envs/MaMuJoCo/ma_ant.md index d1bb06f4..150de59a 100644 --- a/docs/envs/MaMuJoCo/ma_ant.md +++ b/docs/envs/MaMuJoCo/ma_ant.md @@ -15,7 +15,7 @@ This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo The task is [Gymansium's MuJoCo/Ant](https://gymnasium.farama.org/environments/mujoco/ant/). -| Defaults | `env = mamujoco_v0.parallel_env("Ant", None)` | +| Defaults | `env = mamujoco_v1.parallel_env("Ant", None)` | |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0']` | | Number of Agents | 1 | @@ -23,14 +23,14 @@ The task is [Gymansium's MuJoCo/Ant](https://gymnasium.farama.org/environments/m | Part partition | `[(hip4, ankle4, hip1, ankle1, hip2, ankle2, hip3, ankle3)]` | ## Action Space -The action spaces is depended on the partitioning +The shape of the action space depends on the partitioning. The partitioning has the following form: ### if partitioning is None: ```{figure} figures/ant.png :name: ant ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Ant", None)` | +| Instantiate | `env = mamujoco_v1.parallel_env("Ant", None)` | |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0']` | | Number of Agents | 1 | @@ -56,7 +56,7 @@ If partitioning, is None then the environment contains a single agent with the s :name: ant_2x4 ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Ant", "2x4")` | +| Instantiate | `env = mamujoco_v1.parallel_env("Ant", "2x4")` | |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0', 'agent_1']` | | Number of Agents | 2 | @@ -86,7 +86,7 @@ The environment is partitioned in 2 parts, the front part (containing the front :name: ant_2x4d ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Ant", "2x4d")` | +| Instantiate | `env = mamujoco_v1.parallel_env("Ant", "2x4d")` | |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0', 'agent_1']` | | Number of Agents | 2 | @@ -114,7 +114,7 @@ The environment is partitioned in 2 parts, split diagonally. :name: ant_4x2 ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Ant", "4x2")` | +| Instantiate | `env = mamujoco_v1.parallel_env("Ant", "4x2")` | |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0', 'agent_1', 'agent_2', 'agent_3']` | | Number of Agents | 4 | @@ -168,7 +168,7 @@ All agents receive the same [Gymnasium's Ant](https://gymnasium.farama.org/envir ## Starting state -The starting state of the environment is the as [Gymnasium's Ant](https://gymnasium.farama.org/environments/mujoco/ant/#starting-state). +The starting state of the environment is the same as [Gymnasium's Ant](https://gymnasium.farama.org/environments/mujoco/ant/#starting-state). @@ -178,7 +178,11 @@ All agent terminate and truncate at the same time given the same conditions as [ ## Version History -- v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of the original MaMuJoCo [schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco). +* v1: + - Now based on `Gymnasium/MuJoCo-v5` instead of `Gymnasium/MuJoCo-v4` (https://github.com/Farama-Foundation/Gymnasium/pull/572). + - Now observes `local_categories` of `cfrc_ext` by default (same as `Gymnasium/MuJoCo-v5/Ant`). + - Renamed global node `torso` → `root`. +* v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of the original MaMuJoCo [schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco). Changes from the original `MaMuJoCo` ([schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco)): - Fixed diagonal factorization ("2x4d") not being diagonal. - Fixed Global observations (The Ant's Torso: `rootx`, `rooty`, `rootz`) not being observed. diff --git a/docs/envs/MaMuJoCo/ma_coupled_half_cheetah.md b/docs/envs/MaMuJoCo/ma_coupled_half_cheetah.md index 3acaae3e..da6d89ef 100644 --- a/docs/envs/MaMuJoCo/ma_coupled_half_cheetah.md +++ b/docs/envs/MaMuJoCo/ma_coupled_half_cheetah.md @@ -11,14 +11,14 @@ The environment consists of 2 half cheetahs coupled by an elastic tendon. ## Action Space -The action spaces is depended on the partitioning. +The shape of the action space depends on the partitioning. The partitioning has the following form: ### if partitioning is None: ```{figure} figures/coupled_half_cheetah.png :name: coupled_half_cheetah ``` -| Instantiate | `env = mamujoco_v0.parallel_env("CoupledHalfCheetah", None)` | +| Instantiate | `env = mamujoco_v1.parallel_env("CoupledHalfCheetah", None)` | |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0']` | | Number of Agents | 1 | @@ -49,7 +49,7 @@ If partitioning, is `None`, then the environment contains a single agent with th :name: coupled_half_cheetah_1p1 ``` -| Instantiate | `env = mamujoco_v0.parallel_env("CoupledHalfCheetah", "1p1")`| +| Instantiate | `env = mamujoco_v1.parallel_env("CoupledHalfCheetah", "1p1")`| |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0', 'agent_1']` | | Number of Agents | 2 | @@ -98,7 +98,7 @@ All agents receive the same average reward of each cheetah. ## Starting state -The starting state of the environment is the as [Gymnasium's Half Cheetah](https://gymnasium.farama.org/environments/mujoco/half_cheetah/#starting-state) (but with 2 cheetahs). +The starting state of the environment is the same as [Gymnasium's Half Cheetah](https://gymnasium.farama.org/environments/mujoco/half_cheetah/#starting-state) (but with 2 cheetahs). @@ -108,6 +108,8 @@ All agent terminate and truncate at the same time, given the same conditions as ## Version History +* v1: + - Now based on `Gymnasium/MuJoCo-v5` instead of `Gymnasium/MuJoCo-v4` (https://github.com/Farama-Foundation/Gymnasium/pull/572). - v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of the original MaMuJoCo [schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco). Changes from the original `MaMuJoCo` ([schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco)): - Fixed action mapping of the second cheetah (It would previously not work) diff --git a/docs/envs/MaMuJoCo/ma_half_cheetah.md b/docs/envs/MaMuJoCo/ma_half_cheetah.md index 4f463b8e..88b4a364 100644 --- a/docs/envs/MaMuJoCo/ma_half_cheetah.md +++ b/docs/envs/MaMuJoCo/ma_half_cheetah.md @@ -17,14 +17,14 @@ The task is [Gymansium's MuJoCo/Half Cheetah](https://gymnasium.farama.org/envir ## Action Space -The action spaces is depended on the partitioning +The shape of the action space depends on the partitioning. The partitioning has the following form: ### if partitioning is None: ```{figure} figures/half_cheetah.png :name: half_cheetah ``` -| Instantiate | `env = mamujoco_v0.parallel_env("HalfCheetah", None)` | +| Instantiate | `env = mamujoco_v1.parallel_env("HalfCheetah", None)` | |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0']` | | Number of Agents | 1 | @@ -47,7 +47,7 @@ If partitioning, is `None`, then the environment contains a single agent with th :name: half_cheetah_2x3 ``` -| Instantiate | `env = mamujoco_v0.parallel_env("HalfCheetah", "2x3")`| +| Instantiate | `env = mamujoco_v1.parallel_env("HalfCheetah", "2x3")`| |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0', 'agent_1']` | | Number of Agents | 2 | @@ -75,7 +75,7 @@ The environment is partitioned in 2 parts, the front part (containing the front :name: half_cheetah_6x1 ``` -| Instantiate | `env = mamujoco_v0.parallel_env("HalfCheetah", "6x1")`| +| Instantiate | `env = mamujoco_v1.parallel_env("HalfCheetah", "6x1")`| |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0', 'agent_1', 'agent_2', 'agent_3', 'agent_4', 'agent_5']` | | Number of Agents | 6 | @@ -129,7 +129,7 @@ All agents receive the same [Gymnasium's Half Cheetah](https://gymnasium.farama. ## Starting state -The starting state of the environment is the as [Gymnasium's Half Cheetah](https://gymnasium.farama.org/environments/mujoco/half_cheetah/#starting-state). +The starting state of the environment is the same as [Gymnasium's Half Cheetah](https://gymnasium.farama.org/environments/mujoco/half_cheetah/#starting-state). @@ -138,6 +138,8 @@ All agent terminate and truncate at the same time, given the same conditions as ## Version History +* v1: + - Now based on `Gymnasium/MuJoCo-v5` instead of `Gymnasium/MuJoCo-v4` (https://github.com/Farama-Foundation/Gymnasium/pull/572). - v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of the original MaMuJoCo [schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco). Changes from the original `MaMuJoCo` ([schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco)): - Added/Fixed Global observations (The Cheetah's front tip: `rootx`, `rooty`, `rootz`) not being observed. diff --git a/docs/envs/MaMuJoCo/ma_hopper.md b/docs/envs/MaMuJoCo/ma_hopper.md index bc27fb69..40bbf6f0 100644 --- a/docs/envs/MaMuJoCo/ma_hopper.md +++ b/docs/envs/MaMuJoCo/ma_hopper.md @@ -17,14 +17,14 @@ The task is [Gymansium's MuJoCo/Hopper](https://gymnasium.farama.org/environment ## Action Space -The action spaces is depended on the partitioning +The shape of the action space depends on the partitioning. The partitioning has the following form: ### if partitioning is None: ```{figure} figures/hopper.png :name: hopper ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Hopper", None)` | +| Instantiate | `env = mamujoco_v1.parallel_env("Hopper", None)` | |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0']` | | Number of Agents | 1 | @@ -47,7 +47,7 @@ If partitioning, is `None`, then the environment contains a single agent with th :name: hopper_3x1 ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Hopper", "3x1")`| +| Instantiate | `env = mamujoco_v1.parallel_env("Hopper", "3x1")`| |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0', 'agent_1', 'agent_2']` | | Number of Agents | 3 | @@ -89,7 +89,7 @@ All agents receive the same [Gymnasium's Hopper](https://gymnasium.farama.org/en ## Starting state -The starting state of the environment is the as [Gymnasium's Hopper](https://gymnasium.farama.org/environments/mujoco/hopper/#starting-state). +The starting state of the environment is the same as [Gymnasium's Hopper](https://gymnasium.farama.org/environments/mujoco/hopper/#starting-state). @@ -98,6 +98,8 @@ All agent terminate and truncate at same time given the same conditions as [Gymn ## Version History +* v1: + - Now based on `Gymnasium/MuJoCo-v5` instead of `Gymnasium/MuJoCo-v4` (https://github.com/Farama-Foundation/Gymnasium/pull/572). - v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of the original MaMuJoCo [schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco). Changes from the original `MaMuJoCo` ([schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco)): - Fixed Global observations (The Hopper's top: `rootx`, `rooty`, `rootz`) not being observed. diff --git a/docs/envs/MaMuJoCo/ma_humanoid.md b/docs/envs/MaMuJoCo/ma_humanoid.md index 52291ad9..47d8afa2 100644 --- a/docs/envs/MaMuJoCo/ma_humanoid.md +++ b/docs/envs/MaMuJoCo/ma_humanoid.md @@ -17,14 +17,14 @@ The task is [Gymansium's MuJoCo/Humanoid](https://gymnasium.farama.org/environme ## Action Space -The action spaces is depended on the partitioning +The shape of the action space depends on the partitioning. The partitioning has the following form: ### if partitioning is None: ```{figure} figures/humanoid.png :name: humanoid ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Humanoid", None)` | +| Instantiate | `env = mamujoco_v1.parallel_env("Humanoid", None)` | |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0']` | | Number of Agents | 1 | @@ -60,7 +60,7 @@ If partitioning, is `None` then the environment contains a single agent with the :name: humanoid_9|8 ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Humanoid", "3x1")`| +| Instantiate | `env = mamujoco_v1.parallel_env("Humanoid", "3x1")`| |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0', 'agent_1']` | | Number of Agents | 2 | @@ -114,7 +114,7 @@ All agents receive the same [Gymnasium's Humanoid](https://gymnasium.farama.org/ ## Starting state -The starting state of the environment is the as [Gymnasium's Humanoid](https://gymnasium.farama.org/environments/mujoco/humanoid/#starting-state). +The starting state of the environment is the same as [Gymnasium's Humanoid](https://gymnasium.farama.org/environments/mujoco/humanoid/#starting-state). @@ -123,6 +123,9 @@ All agent terminate and truncate at the same time, given the same conditions as ## Version History +* v1: + - Now based on `Gymnasium/MuJoCo-v5` instead of `Gymnasium/MuJoCo-v4` (https://github.com/Farama-Foundation/Gymnasium/pull/572). + - No longer observes `qfrc_actuator` of `root` & `cinert`, `cvel`, `qfrc_actuator`, `cfrc_ext` of `worldbody` (same as `Gymnasium/MuJoCo-v5/Humanoid`). - v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of the original MaMuJoCo [schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco). Changes from the original `MaMuJoCo` ([schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco)): - Added/Fixed Global observations (The Humanoids's torso: `rootx`, `rooty`, `rootz`) not being observed. diff --git a/docs/envs/MaMuJoCo/ma_humanoid_standup.md b/docs/envs/MaMuJoCo/ma_humanoid_standup.md index 55369e1c..d330a7f4 100644 --- a/docs/envs/MaMuJoCo/ma_humanoid_standup.md +++ b/docs/envs/MaMuJoCo/ma_humanoid_standup.md @@ -17,14 +17,14 @@ The task is [Gymansium's MuJoCo/Humanoid Standup](https://gymnasium.farama.org/e ## Action Space -The action spaces is depended on the partitioning +The shape of the action space depends on the partitioning. The partitioning has the following form: ### if partitioning is None: ```{figure} figures/humanoid.png :name: humanoid ``` -| Instantiate | `env = mamujoco_v0.parallel_env("HumanoidStandup", None)` | +| Instantiate | `env = mamujoco_v1.parallel_env("HumanoidStandup", None)` | |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0']` | | Number of Agents | 1 | @@ -60,7 +60,7 @@ If partitioning, is `None` then the environment contains a single agent with the :name: humanoid_9|8 ``` -| Instantiate | `env = mamujoco_v0.parallel_env("HumanoidStandup", "3x1")`| +| Instantiate | `env = mamujoco_v1.parallel_env("HumanoidStandup", "3x1")`| |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0', 'agent_1']` | | Number of Agents | 2 | @@ -114,7 +114,7 @@ All agents receive the same [Gymnasium's Humanoid Standup](https://gymnasium.far ## Starting state -The starting state of the environment is the as [Gymnasium's Humanoid Standup](https://gymnasium.farama.org/environments/mujoco/humanoid_standup/#starting-state). +The starting state of the environment is the same as [Gymnasium's Humanoid Standup](https://gymnasium.farama.org/environments/mujoco/humanoid_standup/#starting-state). @@ -123,6 +123,9 @@ All agent terminate and truncate at the same time, given the same conditions as ## Version History +* v1: + - Now based on `Gymnasium/MuJoCo-v5` instead of `Gymnasium/MuJoCo-v4` (https://github.com/Farama-Foundation/Gymnasium/pull/572). + - No longer observes `qfrc_actuator` of `root` & `cinert`, `cvel`, `qfrc_actuator`, `cfrc_ext` of `worldbody` (same as `Gymnasium/MuJoCo-v5/HumanoidStandup`). - v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of the original MaMuJoCo [schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco). Changes from the original `MaMuJoCo` ([schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco)): - Added/Fixed Global observations (The Humanoids's torso: `rootx`, `rooty`, `rootz`) not being observed. diff --git a/docs/envs/MaMuJoCo/ma_multiagentswimmer.md b/docs/envs/MaMuJoCo/ma_multiagentswimmer.md new file mode 100644 index 00000000..ce3657ca --- /dev/null +++ b/docs/envs/MaMuJoCo/ma_multiagentswimmer.md @@ -0,0 +1,81 @@ +--- +firstpage: +lastpage: +--- +ManySegmentSwimmer + +# Swimmer +```{figure} figures/many_segment_swimmer.png + :name: many_segment_swimmer +``` + + +This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) environments. Please read that page first for general information. +The task is variation of [Gymansium's MuJoCo/Swimmer](https://gymnasium.farama.org/environments/mujoco/swimmer/), which instead of having 2 segments, it has configurable amount of segments. + +The task was first introduced by Christian A. Schroeder de Witt in ["FACMAC: Factored Multi-Agent Centralised Policy Gradients"](https://arxiv.org/abs/2003.06709) + + +## Action Space +The shape of the action space depends on the partitioning. The partitioning has the following form: `${Number Of Agents}x${Number Of Segments per Agent}` + +| Instantiate | `env = mamujoco_v1.parallel_env("ManySegmentSwimmer", ${Number Of Agents}x${Number Of Segments per Agent})` | +|-----------------------|------------------------------------------------------| +| Agents | `agents= ['agent_0', ..., 'agent_${Number Of Agents}']` | +| Number of Agents | `${Number Of Agents}` | +| Action Spaces | `{${agents} : Box(-1, 1, (${Number Of Segments per Agent},), float32)}` | +| Part partition | `(joint0, joint1,)` | + +The environment is partitioned in `${Number Of Agents}` parts, with each part corresponding to `${Number Of Segments per Agent}` joints. + +#### Agent 0 action space +| Num | Action | Control Min | Control Max | Name (in corresponding XML file) | Joint | Unit | +|-----|------------------------------------|-------------|-------------|----------------------------------|-------|--------------| +| 0 | Torque applied on the first rotor | -1 | 1 | motor1_rot | hinge | torque (N m) | +| 1 | Torque applied on the second rotor | -1 | 1 | motor2_rot | hinge | torque (N m) | +| ... | ... | -1 | 1 | ... | hinge | torque (N m) | +| `${Number Of Segments per Agent}` | Torque applied on the agent's last rotor | -1 | 1 | motor`${Number Of Segments per Agent}`_rot | hinge | torque (N m) | +#### Agent 1 action space +| Num | Action | Control Min | Control Max | Name (in corresponding XML file) | Joint | Unit | +|-----|------------------------------------|-------------|-------------|----------------------------------|-------|--------------| +| 0 | Torque applied on the `${Number Of Segments per Agent}` rotor | -1 | 1 | ??? | hinge | torque (N m) | +| ... | ... | -1 | 1 | ... | hinge | torque (N m) | +| `${Number Of Segments per Agent}` | Torque applied on the agent's last rotor | -1 | 1 | motor`2x${Number Of Segments per Agent}`_rot | hinge | torque (N m) | +#### Agent ... action space +... + + + +## Observation Space +| Observation Categories || +|-----------------------|------------------------------------------------------| +| Default `local_categories` | `[["qpos", "qvel"], ["qpos"]]` | +| Default `global_categories` | `("qpos", "qvel")` | +| Supported observation categories | `"qpos", "qvel"` | + +Besides the local observation of each agent (which depend on their parts of the agent, the observation categories and the observation depth), each agent also observes the position and velocity items of the swimmer's tip. +See more at the [Gymnasium's Swimmer](https://gymnasium.farama.org/environments/mujoco/swimmer/#observation-space). + + + +## Rewards +All agents receive the same [Gymnasium's Swimmer](https://gymnasium.farama.org/environments/mujoco/swimmer/#observation-space) reward. + + + +## Starting state +The starting state of the environment is the same as [Gymnasium's Swimmer](https://gymnasium.farama.org/environments/mujoco/swimmer/#starting-state). + + + +## Episode End +All agent terminate and truncate at the same time, given the same conditions as [Gymnasium's Swimmer](https://gymnasium.farama.org/environments/mujoco/swimmer/#episode-end). + + +## Version History +* v1: + - Now based on `Gymnasium/MuJoCo-v5` instead of `Gymnasium/MuJoCo-v4` (https://github.com/Farama-Foundation/Gymnasium/pull/572). + - Now uses the same `option.timestep` as `Gymansum/Swimmer` (0.01). + - Updated model to work with `mujoco>=3.0.0`. +* v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of the original MaMuJoCo [schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco). + diff --git a/docs/envs/MaMuJoCo/ma_pusher.md b/docs/envs/MaMuJoCo/ma_pusher.md index d4f92f30..1c45a1f2 100644 --- a/docs/envs/MaMuJoCo/ma_pusher.md +++ b/docs/envs/MaMuJoCo/ma_pusher.md @@ -17,14 +17,14 @@ The task is [Gymansium's MuJoCo/Pusher](https://gymnasium.farama.org/environment ## Action Space -The action spaces is depended on the partitioning +The shape of the action space depends on the partitioning. The partitioning has the following form: ### if partitioning is None: ```{figure} figures/pusher.png :name: pusher ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Pusher", None)` | +| Instantiate | `env = mamujoco_v1.parallel_env("Pusher", None)` | |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0']` | | Number of Agents | 1 | @@ -50,7 +50,7 @@ If partitioning, is None then the environment contains a single agent with the s :name: pusher_3p ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Pusher", "3p")`| +| Instantiate | `env = mamujoco_v1.parallel_env("Pusher", "3p")`| |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0', 'agent_1']` | | Number of Agents | 3 | @@ -98,7 +98,7 @@ All agents receive the same [Gymnasium's Pusher](https://gymnasium.farama.org/en ## Starting state -The starting state of the environment is the as [Gymnasium's Pusher](https://gymnasium.farama.org/environments/mujoco/pusher/#starting-state). +The starting state of the environment is the same as [Gymnasium's Pusher](https://gymnasium.farama.org/environments/mujoco/pusher/#starting-state). @@ -107,4 +107,6 @@ All agent terminate and truncate at same time given the same conditions as [Gymn ## Version History +* v1: + - Now based on `Gymnasium/MuJoCo-v5` instead of `Gymnasium/MuJoCo-v4` (https://github.com/Farama-Foundation/Gymnasium/pull/572). - v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), first implemented here. diff --git a/docs/envs/MaMuJoCo/ma_reacher.md b/docs/envs/MaMuJoCo/ma_reacher.md index 0bd613d9..a587e1c8 100644 --- a/docs/envs/MaMuJoCo/ma_reacher.md +++ b/docs/envs/MaMuJoCo/ma_reacher.md @@ -17,14 +17,14 @@ The task is [Gymansium's MuJoCo/Reacher](https://gymnasium.farama.org/environmen ## Action Space -The action spaces is depended on the partitioning +The shape of the action space depends on the partitioning. The partitioning has the following form: ### if partitioning is None: ```{figure} figures/reacher.png :name: reacher ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Reacher", None)` | +| Instantiate | `env = mamujoco_v1.parallel_env("Reacher", None)` | |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0']` | | Number of Agents | 1 | @@ -45,7 +45,7 @@ If partitioning, is `None`, then the environment contains a single agent with th :name: reacher_2x1 ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Reacher", "2x1")`| +| Instantiate | `env = mamujoco_v1.parallel_env("Reacher", "2x1")`| |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0', 'agent_1']` | | Number of Agents | 2 | @@ -84,7 +84,7 @@ All agents receive the same [Gymnasium's Reacher](https://gymnasium.farama.org/e ## Starting state -The starting state of the environment is the as [Gymnasium's Reacher](https://gymnasium.farama.org/environments/mujoco/reacher/#starting-state). +The starting state of the environment is the same as [Gymnasium's Reacher](https://gymnasium.farama.org/environments/mujoco/reacher/#starting-state). @@ -93,6 +93,8 @@ All agent terminate and truncate at the same time, given the same conditions as ## Version History +* v1: + - Now based on `Gymnasium/MuJoCo-v5` instead of `Gymnasium/MuJoCo-v4` (https://github.com/Farama-Foundation/Gymnasium/pull/572). - v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of the original MaMuJoCo [schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco). Changes from the original `MaMuJoCo` ([schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco)): - Added/Fixed Global observations (The Targets's coordinates: `targetx`, `targety`) not being observed. diff --git a/docs/envs/MaMuJoCo/ma_single.md b/docs/envs/MaMuJoCo/ma_single.md index dab60914..599ce7d8 100644 --- a/docs/envs/MaMuJoCo/ma_single.md +++ b/docs/envs/MaMuJoCo/ma_single.md @@ -20,7 +20,7 @@ The Purpose of these is to allow researchers to debug multi-agent learning algor ## Action Space -The action spaces is depended on the partitioning. +The shape of the action space depends on the partitioning. The partitioning has the following form: ## Observation Space The agent receives the same observations as the single agent Gymnasium environment. @@ -43,6 +43,8 @@ The agent terminates and truncates at the same time, given the same conditions a ## Version History -v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of [the original multiagent_mujuco](https://github.com/schroederdewitt/multiagent_mujoco). +* v1: + - Now based on `Gymnasium/MuJoCo-v5` instead of `Gymnasium/MuJoCo-v4` (https://github.com/Farama-Foundation/Gymnasium/pull/572). +* v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of [the original multiagent_mujuco](https://github.com/schroederdewitt/multiagent_mujoco). No Changes from the original `MaMuJoCo` ([schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco)). diff --git a/docs/envs/MaMuJoCo/ma_swimmer.md b/docs/envs/MaMuJoCo/ma_swimmer.md index 97400b5c..0d066615 100644 --- a/docs/envs/MaMuJoCo/ma_swimmer.md +++ b/docs/envs/MaMuJoCo/ma_swimmer.md @@ -17,14 +17,14 @@ The task is [Gymansium's MuJoCo/Swimmer](https://gymnasium.farama.org/environmen ## Action Space -The action spaces is depended on the partitioning +The shape of the action space depends on the partitioning. The partitioning has the following form: ### if partitioning is None: ```{figure} figures/swimmer.png :name: swimmer ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Swimmer", None)` | +| Instantiate | `env = mamujoco_v1.parallel_env("Swimmer", None)` | |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0']` | | Number of Agents | 1 | @@ -45,7 +45,7 @@ If partitioning, is `None` then the environment contains a single agent with the :name: swimmer_2x1 ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Swimmer", "2x1")`| +| Instantiate | `env = mamujoco_v1.parallel_env("Swimmer", "2x1")`| |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0', 'agent_1']` | | Number of Agents | 2 | @@ -83,7 +83,7 @@ All agents receive the same [Gymnasium's Swimmer](https://gymnasium.farama.org/e ## Starting state -The starting state of the environment is the as [Gymnasium's Swimmer](https://gymnasium.farama.org/environments/mujoco/swimmer/#starting-state). +The starting state of the environment is the same as [Gymnasium's Swimmer](https://gymnasium.farama.org/environments/mujoco/swimmer/#starting-state). @@ -92,6 +92,8 @@ All agent terminate and truncate at the same time, given the same conditions as ## Version History +* v1: + - Now based on `Gymnasium/MuJoCo-v5` instead of `Gymnasium/MuJoCo-v4` (https://github.com/Farama-Foundation/Gymnasium/pull/572). - v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of the original MaMuJoCo [schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco). Changes from the original `MaMuJoCo` ([schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco)): - Added/Fixed Global observations (The Swimmer's front tip: `free_body_rot`) not being observed. diff --git a/docs/envs/MaMuJoCo/ma_walker2d.md b/docs/envs/MaMuJoCo/ma_walker2d.md index e273e5c3..cfa7ef03 100644 --- a/docs/envs/MaMuJoCo/ma_walker2d.md +++ b/docs/envs/MaMuJoCo/ma_walker2d.md @@ -17,14 +17,14 @@ The task is [Gymansium's MuJoCo/Walker2D](https://gymnasium.farama.org/environme ## Action Space -The action spaces is depended on the partitioning +The shape of the action space depends on the partitioning. The partitioning has the following form: ### if partitioning is None: ```{figure} figures/walker2d.png :name: walker2d ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Walker2D", None)` | +| Instantiate | `env = mamujoco_v1.parallel_env("Walker2D", None)` | |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0']` | | Number of Agents | 1 | @@ -49,7 +49,7 @@ If partitioning, is `None` then the environment contains a single agent with the :name: walker2d_2x3 ``` -| Instantiate | `env = mamujoco_v0.parallel_env("Walker2d", "2x3")`| +| Instantiate | `env = mamujoco_v1.parallel_env("Walker2d", "2x3")`| |-----------------------|------------------------------------------------------| | Agents | `agents= ['agent_0', 'agent_1']` | | Number of Agents | 2 | @@ -92,7 +92,7 @@ All agents receive the same [Gymnasium's Walker2D](https://gymnasium.farama.org/ ## Starting state -The starting state of the environment is the as [Gymnasium's Walker2D](https://gymnasium.farama.org/environments/mujoco/walker2d/#starting-state). +The starting state of the environment is the same as [Gymnasium's Walker2D](https://gymnasium.farama.org/environments/mujoco/walker2d/#starting-state). @@ -102,6 +102,9 @@ All agent terminate and truncate at the same time given the same conditions as [ ## Version History +* v1: + - Now based on `Gymnasium/MuJoCo-v5` instead of `Gymnasium/MuJoCo-v4` (https://github.com/Farama-Foundation/Gymnasium/pull/572). + - Fixed bug: global nodes are now `[root_x, root_z, root_y]` (used to be `[root_x, root_x, root_z]`). - v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of the original MaMuJoCo [schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco). Changes from the original `MaMuJoCo` ([schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco)): - Added/Fixed Global observations (The Walker's top: `rootx`, `rooty`, `rootz`) not being observed. diff --git a/gymnasium_robotics/__init__.py b/gymnasium_robotics/__init__.py index 1b1c37d4..49c86374 100644 --- a/gymnasium_robotics/__init__.py +++ b/gymnasium_robotics/__init__.py @@ -3,9 +3,9 @@ from gymnasium_robotics.core import GoalEnv from gymnasium_robotics.envs.maze import maps -from gymnasium_robotics.envs.multiagent_mujoco import mamujoco_v0 +from gymnasium_robotics.envs.multiagent_mujoco import mamujoco_v1 -__version__ = "1.2.4" +__version__ = "1.3.0a1" def register_robotics_envs(): diff --git a/gymnasium_robotics/envs/multiagent_mujoco/__init__.py b/gymnasium_robotics/envs/multiagent_mujoco/__init__.py index cf745d64..07eb2b5d 100644 --- a/gymnasium_robotics/envs/multiagent_mujoco/__init__.py +++ b/gymnasium_robotics/envs/multiagent_mujoco/__init__.py @@ -3,12 +3,6 @@ from gymnasium_robotics.envs.multiagent_mujoco.coupled_half_cheetah import ( # noqa: F401 CoupledHalfCheetahEnv, ) -from gymnasium_robotics.envs.multiagent_mujoco.many_segment_ant import ( # noqa: F401 - ManySegmentAntEnv, -) -from gymnasium_robotics.envs.multiagent_mujoco.many_segment_swimmer import ( # noqa: F401 - ManySegmentSwimmerEnv, -) from gymnasium_robotics.envs.multiagent_mujoco.mujoco_multi import ( # noqa: F401 MultiAgentMujocoEnv, ) diff --git a/gymnasium_robotics/envs/multiagent_mujoco/assets/many_segment_ant.xml.template b/gymnasium_robotics/envs/multiagent_mujoco/assets/many_segment_ant.xml.template index 3b6b4eb8..8bfc3308 100644 --- a/gymnasium_robotics/envs/multiagent_mujoco/assets/many_segment_ant.xml.template +++ b/gymnasium_robotics/envs/multiagent_mujoco/assets/many_segment_ant.xml.template @@ -1,7 +1,13 @@ + -