From 3733e966816f39ca6cac645816f7bda6e4020fcb Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas Date: Sun, 13 Oct 2024 08:40:02 +0300 Subject: [PATCH 1/6] enable --- tests/test_envs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_envs.py b/tests/test_envs.py index f880b297..3bcb9569 100644 --- a/tests/test_envs.py +++ b/tests/test_envs.py @@ -30,7 +30,7 @@ @pytest.mark.parametrize( - "spec", non_mujoco_py_env_specs, ids=[spec.id for spec in non_mujoco_py_env_specs] + "spec", all_testing_env_specs, ids=[spec.id for spec in all_testing_env_specs] ) def test_env(spec): # Capture warnings @@ -53,7 +53,7 @@ def test_env(spec): @pytest.mark.parametrize( - "env_spec", non_mujoco_py_env_specs, ids=[env.id for env in non_mujoco_py_env_specs] + "env_spec", all_testing_env_specs, ids=[env.id for env in all_testing_env_specs] ) def test_env_determinism_rollout(env_spec: EnvSpec): """Run a rollout with two environments and assert equality. @@ -132,7 +132,7 @@ def test_mujoco_reset_state_seeding(env_spec: EnvSpec): @pytest.mark.parametrize( - "spec", non_mujoco_py_env_specs, ids=[spec.id for spec in non_mujoco_py_env_specs] + "spec", all_testing_env_specs, ids=[spec.id for spec in all_testing_env_specs] ) def test_render_modes(spec): env = spec.make() @@ -150,8 +150,8 @@ def test_render_modes(spec): @pytest.mark.parametrize( "env_spec", - non_mujoco_py_env_specs, - ids=[spec.id for spec in non_mujoco_py_env_specs], + all_testing_env_specs, + ids=[spec.id for spec in all_testing_env_specs], ) def test_pickle_env(env_spec): env: gym.Env = env_spec.make() From 9a7218051f50da7faaf9c586947ef60d28433fe8 Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas Date: Sun, 13 Oct 2024 08:46:01 +0300 Subject: [PATCH 2/6] . --- tests/test_envs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_envs.py b/tests/test_envs.py index 3bcb9569..d94984a8 100644 --- a/tests/test_envs.py +++ b/tests/test_envs.py @@ -53,7 +53,7 @@ def test_env(spec): @pytest.mark.parametrize( - "env_spec", all_testing_env_specs, ids=[env.id for env in all_testing_env_specs] + "env_spec", non_mujoco_py_env_specs, ids=[env.id for env in non_mujoco_py_env_specs] ) def test_env_determinism_rollout(env_spec: EnvSpec): """Run a rollout with two environments and assert equality. From 4f53bf33d421d70d39a37180f929d01768904f19 Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas Date: Sun, 13 Oct 2024 08:49:47 +0300 Subject: [PATCH 3/6] . --- tests/test_envs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_envs.py b/tests/test_envs.py index d94984a8..fa49f90a 100644 --- a/tests/test_envs.py +++ b/tests/test_envs.py @@ -132,7 +132,7 @@ def test_mujoco_reset_state_seeding(env_spec: EnvSpec): @pytest.mark.parametrize( - "spec", all_testing_env_specs, ids=[spec.id for spec in all_testing_env_specs] + "spec", non_mujoco_py_env_specs, ids=[spec.id for spec in non_mujoco_py_env_specs] ) def test_render_modes(spec): env = spec.make() @@ -150,8 +150,8 @@ def test_render_modes(spec): @pytest.mark.parametrize( "env_spec", - all_testing_env_specs, - ids=[spec.id for spec in all_testing_env_specs], + non_mujoco_py_env_specs, + ids=[spec.id for spec in non_mujoco_py_env_specs], ) def test_pickle_env(env_spec): env: gym.Env = env_spec.make() From 43b2e6817b7c197f44bf8af62dbdbfe84a4d8372 Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas Date: Sun, 13 Oct 2024 09:33:48 +0300 Subject: [PATCH 4/6] . --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 81c1f74b..dd0542b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,7 @@ testing = [ "cython<3", "PettingZoo>=1.23.0", "Jinja2>=3.0.3", + "disutils" ] mujoco_py = ["mujoco_py<2.2,>=2.1", "cython<3"] From 5fa492028d8770cf5a1f78a137aabc1075ec316a Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas Date: Sun, 13 Oct 2024 09:47:03 +0300 Subject: [PATCH 5/6] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 005b3c37..39ea1e86 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v2 - run: | From 224a88617b36a53d88af677f5a32b3424e1efc54 Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas Date: Sun, 13 Oct 2024 22:21:16 +0300 Subject: [PATCH 6/6] pre-commit --- .github/ISSUE_TEMPLATE/proposal.md | 2 +- .github/stale.yml | 2 +- .github/workflows/build-docs-dev.yml | 2 +- .github/workflows/build-docs-version.yml | 2 +- .github/workflows/build-publish.yml | 1 - .github/workflows/build.yml | 2 +- .../workflows/manual-build-docs-version.yml | 2 +- .gitignore | 2 +- .pre-commit-config.yaml | 57 +++++++++++++------ CODE_OF_CONDUCT.rst | 2 - README.md | 6 +- docs/_static/css/env_pages.css | 2 +- docs/content/installation.md | 2 +- docs/content/multi-goal_api.md | 2 +- docs/envs/MaMuJoCo/index.md | 4 +- docs/envs/MaMuJoCo/ma_ant.md | 4 +- docs/envs/MaMuJoCo/ma_coupled_half_cheetah.md | 3 +- docs/envs/MaMuJoCo/ma_half_cheetah.md | 8 +-- docs/envs/MaMuJoCo/ma_hopper.md | 4 +- docs/envs/MaMuJoCo/ma_humanoid.md | 5 +- docs/envs/MaMuJoCo/ma_humanoid_standup.md | 4 +- docs/envs/MaMuJoCo/ma_multiagentswimmer.md | 3 +- docs/envs/MaMuJoCo/ma_pusher.md | 4 +- docs/envs/MaMuJoCo/ma_reacher.md | 5 +- docs/envs/MaMuJoCo/ma_single.md | 1 - docs/envs/MaMuJoCo/ma_swimmer.md | 5 +- docs/envs/MaMuJoCo/ma_walker2d.md | 4 +- docs/envs/franka_kitchen/index.md | 2 +- docs/envs/maze/index.md | 2 +- docs/release_notes.md | 2 +- .../envs/assets/adroit_hand/adroit_assets.xml | 10 ++-- .../envs/assets/adroit_hand/adroit_door.xml | 16 +++--- .../envs/assets/adroit_hand/adroit_hammer.xml | 14 ++--- .../envs/assets/adroit_hand/adroit_model.xml | 2 +- .../envs/assets/adroit_hand/adroit_pen.xml | 14 ++--- .../assets/adroit_hand/adroit_relocate.xml | 16 +++--- .../envs/assets/fetch/pick_and_place.xml | 6 +- gymnasium_robotics/envs/assets/fetch/push.xml | 8 +-- .../envs/assets/fetch/reach.xml | 4 +- .../envs/assets/fetch/shared.xml | 8 +-- .../envs/assets/fetch/slide.xml | 4 +- .../envs/assets/hand/manipulate_block.xml | 2 +- .../envs/assets/hand/manipulate_egg.xml | 2 +- .../envs/assets/hand/manipulate_pen.xml | 2 +- gymnasium_robotics/envs/assets/hand/reach.xml | 2 +- .../kitchen_franka/franka_assets/LICENSE.md | 2 - .../kitchen_franka/franka_assets/actuator.xml | 2 +- .../franka_assets/basic_scene.xml | 2 +- .../kitchen_assets/basic_scene.xml | 2 +- .../kitchen_assets/kitchen_env_model.xml | 4 +- gymnasium_robotics/envs/fetch/fetch_env.py | 14 ++--- .../envs/franka_kitchen/franka_env.py | 2 +- .../envs/franka_kitchen/kitchen_env.py | 2 +- .../envs/franka_kitchen/utils.py | 1 + gymnasium_robotics/envs/maze/maze_v4.py | 1 + gymnasium_robotics/envs/maze/point.py | 2 +- .../assets/coupled_half_cheetah.xml | 2 +- .../assets/many_segment_ant.xml.template | 2 +- .../assets/many_segment_swimmer.xml.template | 2 +- .../multiagent_mujoco/coupled_half_cheetah.py | 1 + .../multiagent_mujoco/many_segment_swimmer.py | 1 - .../envs/multiagent_mujoco/mujoco_multi.py | 22 +++---- .../envs/shadow_dexterous_hand/reach.py | 2 +- gymnasium_robotics/utils/rotations.py | 4 +- pyproject.toml | 1 - tests/envs/MaMuJoCo/test_MaMuJoCo.py | 2 +- tests/test_envs.py | 2 +- tests/utils.py | 1 + 68 files changed, 169 insertions(+), 163 deletions(-) mode change 100755 => 100644 gymnasium_robotics/envs/multiagent_mujoco/mujoco_multi.py diff --git a/.github/ISSUE_TEMPLATE/proposal.md b/.github/ISSUE_TEMPLATE/proposal.md index 26cea16e..1e9e2609 100644 --- a/.github/ISSUE_TEMPLATE/proposal.md +++ b/.github/ISSUE_TEMPLATE/proposal.md @@ -6,7 +6,7 @@ title: "[Proposal] Proposal title" -### Proposal +### Proposal A clear and concise description of the proposal. diff --git a/.github/stale.yml b/.github/stale.yml index 52d6499f..9df56402 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -59,4 +59,4 @@ only: issues # issues: # exemptLabels: -# - confirmed \ No newline at end of file +# - confirmed diff --git a/.github/workflows/build-docs-dev.yml b/.github/workflows/build-docs-dev.yml index 98a3f9ab..07b715bb 100644 --- a/.github/workflows/build-docs-dev.yml +++ b/.github/workflows/build-docs-dev.yml @@ -46,4 +46,4 @@ jobs: with: folder: _build target-folder: main - clean: false \ No newline at end of file + clean: false diff --git a/.github/workflows/build-docs-version.yml b/.github/workflows/build-docs-version.yml index 2c2d8ae3..515cd0f4 100644 --- a/.github/workflows/build-docs-version.yml +++ b/.github/workflows/build-docs-version.yml @@ -59,4 +59,4 @@ jobs: folder: _build clean-exclude: | *.*.*/ - main \ No newline at end of file + main diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index e7b9daaa..1c073a87 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -54,4 +54,3 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} - diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 39ea1e86..70bda381 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', "3.12"] steps: - uses: actions/checkout@v2 - run: | diff --git a/.github/workflows/manual-build-docs-version.yml b/.github/workflows/manual-build-docs-version.yml index c8fa99f3..8cf0d2c4 100644 --- a/.github/workflows/manual-build-docs-version.yml +++ b/.github/workflows/manual-build-docs-version.yml @@ -71,4 +71,4 @@ jobs: folder: _build clean-exclude: | *.*.*/ - main \ No newline at end of file + main diff --git a/.gitignore b/.gitignore index 7b0b9053..eb9b1a7c 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,4 @@ vizdoom.ini # docs docs/envs/**/*.* !docs/envs/**/index.md -_build/ \ No newline at end of file +_build/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bee4a8f0..aa600fdf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,30 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks repos: - - repo: https://github.com/python/black - rev: 22.3.0 + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 hooks: - - id: black + - id: check-symlinks + - id: destroyed-symlinks + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-toml + - id: check-ast + - id: check-added-large-files + - id: check-merge-conflict + - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable + - id: detect-private-key + - id: debug-statements - repo: https://github.com/codespell-project/codespell - rev: v2.1.0 + rev: v2.3.0 hooks: - id: codespell exclude: .svg args: - --ignore-words-list=nd,reacher,thist,ths, arry - - repo: https://github.com/pycqa/flake8 + - repo: https://github.com/PyCQA/flake8 rev: 7.1.1 hooks: - id: flake8 @@ -21,16 +35,31 @@ repos: - --max-line-length=456 - --show-source - --statistics + - repo: https://github.com/asottile/pyupgrade + rev: v3.18.0 + hooks: + - id: pyupgrade + args: ["--py38-plus"] - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort args: ["--profile", "black"] - - repo: https://github.com/asottile/pyupgrade - rev: v2.32.0 + - repo: https://github.com/python/black + rev: 24.10.0 hooks: - - id: pyupgrade - args: ["--py38-plus"] + - id: black + - repo: https://github.com/pycqa/pydocstyle + rev: 6.3.0 + hooks: + - id: pydocstyle + exclude: ^(tests/envs/hand)|(tests/test_envs.py)|(tests/__init__.py)|(tests/utils.py)|(tests/envs/__init__.py)|(docs)|(gymnasium_robotics/utils)|(gymnasium_robotics/envs/fetch)|(gymnasium_robotics/envs/shadow_dexterous_hand)|(gymnasium_robotics/envs/maze)|(gymnasium_robotics/envs/adroit_hand)|(gymnasium_robotics/envs/franka_kitchen) + args: + - --convention=google + - --add-ignore=D100 + - --source + - --explain + additional_dependencies: ["tomli"] - repo: local hooks: - id: pyright @@ -42,11 +71,3 @@ repos: additional_dependencies: ["pyright@1.1.347"] args: - --project=pyproject.toml - - repo: https://github.com/pycqa/pydocstyle - rev: 6.1.1 - hooks: - - id: pydocstyle - exclude: ^(tests/envs/hand)|(tests/test_envs.py)|(tests/__init__.py)|(tests/utils.py)|(tests/envs/__init__.py)|(docs)|(gymnasium_robotics/utils)|(gymnasium_robotics/envs/fetch)|(gymnasium_robotics/envs/shadow_dexterous_hand)|(gymnasium_robotics/envs/maze)|(gymnasium_robotics/envs/adroit_hand)|(gymnasium_robotics/envs/franka_kitchen) - args: - - --convention=google - - --add-ignore=D100 diff --git a/CODE_OF_CONDUCT.rst b/CODE_OF_CONDUCT.rst index e78793c7..06942265 100644 --- a/CODE_OF_CONDUCT.rst +++ b/CODE_OF_CONDUCT.rst @@ -65,5 +65,3 @@ Attribution ----------- This Code of Conduct is adapted from `Python's Code of Conduct `_, which is under a `Creative Commons License `_. - - diff --git a/README.md b/README.md index 3f4d8937..4a980dce 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The documentation website is at [robotics.farama.org](https://robotics.farama.or To install the Gymnasium-Robotics environments use `pip install gymnasium-robotics` -These environments also require the MuJoCo engine from Deepmind to be installed. Instructions to install the physics engine can be found at the [MuJoCo website](https://mujoco.org/) and the [MuJoCo Github repository](https://github.com/deepmind/mujoco). +These environments also require the MuJoCo engine from Deepmind to be installed. Instructions to install the physics engine can be found at the [MuJoCo website](https://mujoco.org/) and the [MuJoCo Github repository](https://github.com/deepmind/mujoco). Note that the latest environment versions use the latest mujoco python bindings maintained by the MuJoCo team. If you wish to use the old versions of the environments that depend on [mujoco-py](https://github.com/openai/mujoco-py), please install this library with `pip install gymnasium-robotics[mujoco-py]` @@ -28,7 +28,7 @@ We support and test for Linux and macOS. We will accept PRs related to Windows, * [Fetch](https://robotics.farama.org/envs/fetch/) - A collection of environments with a 7-DoF robot arm that has to perform manipulation tasks such as Reach, Push, Slide or Pick and Place. * [Shadow Dexterous Hand](https://robotics.farama.org/envs/shadow_dexterous_hand/) - A collection of environments with a 24-DoF anthropomorphic robotic hand that has to perform object manipulation tasks with a cube, egg-object, or pen. There are variations of these environments that also include data from 92 touch sensors in the observation space. -* [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. +* [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. The [D4RL](https://github.com/Farama-Foundation/D4RL) environments are now available. These environments have been refactored and may not have the same action/observation spaces as the original, please read their documentation: @@ -76,7 +76,7 @@ substitute_truncated = env.compute_truncated(obs["achieved_goal"], substitute_go The `GoalEnv` class can also be used for custom environments. ## Project Maintainers -Main Contributors: [Rodrigo Perez-Vicente](https://github.com/rodrigodelazcano), [Kallinteris Andreas](https://github.com/Kallinteris-Andreas), [Jet Tai](https://github.com/jjshoots) +Main Contributors: [Rodrigo Perez-Vicente](https://github.com/rodrigodelazcano), [Kallinteris Andreas](https://github.com/Kallinteris-Andreas), [Jet Tai](https://github.com/jjshoots) Maintenance for this project is also contributed by the broader Farama team: [farama.org/team](https://farama.org/team). diff --git a/docs/_static/css/env_pages.css b/docs/_static/css/env_pages.css index 6d3f1efb..e9439ab2 100644 --- a/docs/_static/css/env_pages.css +++ b/docs/_static/css/env_pages.css @@ -32,4 +32,4 @@ width: 240px; margin: 12px auto; display: block; -} \ No newline at end of file +} diff --git a/docs/content/installation.md b/docs/content/installation.md index d2079bfd..e0dc0364 100644 --- a/docs/content/installation.md +++ b/docs/content/installation.md @@ -7,7 +7,7 @@ lastpage: To install the Gymnasium-Robotics environments use `pip install gymnasium-robotics` -These environments also require the MuJoCo engine from Deepmind to be installed. Instructions to install the physics engine can be found at the [MuJoCo website](https://mujoco.org/) and the [MuJoCo Github repository](https://github.com/deepmind/mujoco). +These environments also require the MuJoCo engine from Deepmind to be installed. Instructions to install the physics engine can be found at the [MuJoCo website](https://mujoco.org/) and the [MuJoCo Github repository](https://github.com/deepmind/mujoco). Note that the latest environment versions use the latest mujoco python bindings maintained by the MuJoCo team. If you wish to use the old versions of the environments that depend on [mujoco-py](https://github.com/openai/mujoco-py), please install this library with `pip install gymnasium-robotics[mujoco-py]` diff --git a/docs/content/multi-goal_api.md b/docs/content/multi-goal_api.md index c9b65ad2..cceeff24 100644 --- a/docs/content/multi-goal_api.md +++ b/docs/content/multi-goal_api.md @@ -54,4 +54,4 @@ The `GoalEnv` class can also be used for custom environments. .. autofunction:: gymnasium_robotics.core.GoalEnv.compute_reward .. autofunction:: gymnasium_robotics.core.GoalEnv.compute_terminated .. autofunction:: gymnasium_robotics.core.GoalEnv.compute_truncated -``` \ No newline at end of file +``` diff --git a/docs/envs/MaMuJoCo/index.md b/docs/envs/MaMuJoCo/index.md index 890397e9..d4eaf0d0 100644 --- a/docs/envs/MaMuJoCo/index.md +++ b/docs/envs/MaMuJoCo/index.md @@ -83,7 +83,7 @@ Here we are Factorizing the "[Boston Dynamics Spot with arm](https://bostondynam We are using the robot model from [MuJoCo Menagerie](https://github.com/google-deepmind/mujoco_menagerie/tree/main/boston_dynamics_spot). ```{figure} figures/boston_dymanics_spot_arm.png - :name: Boston Dymanics Spot Arm factorization + :name: Boston Dynamics Spot Arm factorization ``` ```python @@ -179,7 +179,7 @@ env = mamujoco_v1.parallel_env( xml_file="./mujoco_menagerie/boston_dynamics_spot/scene_arm.xml", ) ``` -Of course, you also need to add new elements to the environment and define your task, to do something useful. +Of course, you also need to add new elements to the environment and define your task, to do something useful. diff --git a/docs/envs/MaMuJoCo/ma_ant.md b/docs/envs/MaMuJoCo/ma_ant.md index 150de59a..bf8b8970 100644 --- a/docs/envs/MaMuJoCo/ma_ant.md +++ b/docs/envs/MaMuJoCo/ma_ant.md @@ -9,7 +9,7 @@ lastpage:

ant

- + This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) environments. Please read that page first for general information. The task is [Gymansium's MuJoCo/Ant](https://gymnasium.farama.org/environments/mujoco/ant/). @@ -151,7 +151,7 @@ The environment is partitioned in 4 parts, with each part corresponding to a leg ## Observation Space | Observation Categories || -|-----------------------|------------------------------------------------------| +|-----------------------|------------------------------------------------------| | Default `local_categories` | `[["qpos", "qvel"], ["qpos"]]` | | Default `global_categories` | `("qpos", "qvel")` | | Supported observation categories | `"qpos", "qvel", "cfrc_ext"` | diff --git a/docs/envs/MaMuJoCo/ma_coupled_half_cheetah.md b/docs/envs/MaMuJoCo/ma_coupled_half_cheetah.md index da6d89ef..76410e43 100644 --- a/docs/envs/MaMuJoCo/ma_coupled_half_cheetah.md +++ b/docs/envs/MaMuJoCo/ma_coupled_half_cheetah.md @@ -83,7 +83,7 @@ The environment is partitioned in 2 parts, one part corresponding to the first c ## Observation Space | Observation Categories || -|-----------------------|------------------------------------------------------| +|-----------------------|------------------------------------------------------| | Default `local_categories` | `[["qpos", "qvel", "ten_J", "ten_length,ten_velocity"], ["qpos"]]` | | Default `global_categories` | `("qpos", "qvel")` | | Supported observation categories | `"qpos", "qvel", "ten_J", "ten_length,ten_velocity"` | @@ -117,4 +117,3 @@ Changes from the original `MaMuJoCo` ([schroederdewitt/multiagent_mujoco](https: - Added/Fixed Global observations (The Cheetahes's front tips: `rootx`s, `rooty`s, `rootz`s) not being observed. - Improved node naming - Changed action ordering to be same as [Gymnasium/MuJoCo/HalfCheetah](https://gymnasium.farama.org/environments/mujoco/half_cheetah/#action-space) - diff --git a/docs/envs/MaMuJoCo/ma_half_cheetah.md b/docs/envs/MaMuJoCo/ma_half_cheetah.md index 88b4a364..2fcc708b 100644 --- a/docs/envs/MaMuJoCo/ma_half_cheetah.md +++ b/docs/envs/MaMuJoCo/ma_half_cheetah.md @@ -9,7 +9,7 @@ lastpage:

Half Cheetah

- + This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) environments. Please read that page first for general information. The task is [Gymansium's MuJoCo/Half Cheetah](https://gymnasium.farama.org/environments/mujoco/half_cheetah/). @@ -42,7 +42,7 @@ If partitioning, is `None`, then the environment contains a single agent with th | 4 | Torque applied on the front shin rotor | -1 | 1 | fshin | hinge | torque (N m) | | 5 | Torque applied on the front foot rotor | -1 | 1 | ffoot | hinge | torque (N m) | -### if partitioning == "2x3": # front and back +### if partitioning == "2x3": # front and back ```{figure} figures/half_cheetah_2x3.png :name: half_cheetah_2x3 ``` @@ -113,7 +113,7 @@ The environment is partitioned in 6 parts, each part corresponding to a single j ## Observation Space | Observation Categories || -|-----------------------|------------------------------------------------------| +|-----------------------|------------------------------------------------------| | Default `local_categories` | `[["qpos", "qvel"], ["qpos"]]` | | Default `global_categories` | `("qpos", "qvel")` | | Supported observation categories | `"qpos", "qvel"` | @@ -144,5 +144,3 @@ All agent terminate and truncate at the same time, given the same conditions as 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. - Changed action ordering to be same as [Gymnasium/MuJoCo/HalfCheetah](https://gymnasium.farama.org/environments/mujoco/half_cheetah/#action-space) - - diff --git a/docs/envs/MaMuJoCo/ma_hopper.md b/docs/envs/MaMuJoCo/ma_hopper.md index 40bbf6f0..f9d8e368 100644 --- a/docs/envs/MaMuJoCo/ma_hopper.md +++ b/docs/envs/MaMuJoCo/ma_hopper.md @@ -9,7 +9,7 @@ lastpage:

Hopper

- + This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) environments. Please read that page first for general information. The task is [Gymansium's MuJoCo/Hopper](https://gymnasium.farama.org/environments/mujoco/hopper/). @@ -73,7 +73,7 @@ The environment is partitioned in 3 parts, each part corresponding to a single j ## Observation Space | Observation Categories || -|-----------------------|------------------------------------------------------| +|-----------------------|------------------------------------------------------| | Default `local_categories` | `[["qpos", "qvel"], ["qpos"]]` | | Default `global_categories` | `("qpos", "qvel")` | | Supported observation categories | `"qpos", "qvel"` | diff --git a/docs/envs/MaMuJoCo/ma_humanoid.md b/docs/envs/MaMuJoCo/ma_humanoid.md index 47d8afa2..0bb5ec26 100644 --- a/docs/envs/MaMuJoCo/ma_humanoid.md +++ b/docs/envs/MaMuJoCo/ma_humanoid.md @@ -9,7 +9,7 @@ lastpage:

Humanoid

- + This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) environments. Please read that page first for general information. The task is [Gymansium's MuJoCo/Humanoid](https://gymnasium.farama.org/environments/mujoco/humanoid/). @@ -98,7 +98,7 @@ The environment is partitioned in 2 parts, one part corresponding to the upper b ## Observation Space | Observation Categories || -|-----------------------|------------------------------------------------------| +|-----------------------|------------------------------------------------------| | Default `local_categories` | `[["qpos", "qvel", "cinert", "cvel", "qfrc_actuator", "cfrc_ext"], ["qpos"]]` | | Default `global_categories` | `("qpos", "qvel", "cinert", "cvel", "qfrc_actuator", "cfrc_ext")` | | Supported observation categories | `"qpos", "qvel", "cinert", "cvel", "qfrc_actuator", "cfrc_ext"` | @@ -132,4 +132,3 @@ Changes from the original `MaMuJoCo` ([schroederdewitt/multiagent_mujoco](https: - Fixed abdomen observations ordering. - Added support for body observations (`cvel`, `cinert`, `cfrc_ext`) - Changed action ordering to be same as [Gymnasium/MuJoCo/Humanoid](https://gymnasium.farama.org/environments/mujoco/humanoid/#action-space) - diff --git a/docs/envs/MaMuJoCo/ma_humanoid_standup.md b/docs/envs/MaMuJoCo/ma_humanoid_standup.md index d330a7f4..cb8962eb 100644 --- a/docs/envs/MaMuJoCo/ma_humanoid_standup.md +++ b/docs/envs/MaMuJoCo/ma_humanoid_standup.md @@ -9,7 +9,7 @@ lastpage:

Humanoid Standup

- + This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) environments. Please read that page first for general information. The task is [Gymansium's MuJoCo/Humanoid Standup](https://gymnasium.farama.org/environments/mujoco/humanoid_standup/). @@ -98,7 +98,7 @@ The environment is partitioned in 2 parts, one part corresponding to the upper b ## Observation Space | Observation Categories || -|-----------------------|------------------------------------------------------| +|-----------------------|------------------------------------------------------| | Default `local_categories` | `[["qpos", "qvel", "cinert", "cvel", "qfrc_actuator", "cfrc_ext"], ["qpos"]]` | | Default `global_categories` | `("qpos", "qvel", "cinert", "cvel", "qfrc_actuator", "cfrc_ext")` | | Supported observation categories | `"qpos", "qvel", "cinert", "cvel", "qfrc_actuator", "cfrc_ext"` | diff --git a/docs/envs/MaMuJoCo/ma_multiagentswimmer.md b/docs/envs/MaMuJoCo/ma_multiagentswimmer.md index 90371ca2..a1ef01cf 100644 --- a/docs/envs/MaMuJoCo/ma_multiagentswimmer.md +++ b/docs/envs/MaMuJoCo/ma_multiagentswimmer.md @@ -48,7 +48,7 @@ The environment is partitioned in `${Number Of Agents}` parts, with each part co ## Observation Space | Observation Categories || -|-----------------------|------------------------------------------------------| +|-----------------------|------------------------------------------------------| | Default `local_categories` | `[["qpos", "qvel"], ["qpos"]]` | | Default `global_categories` | `("qpos", "qvel")` | | Supported observation categories | `"qpos", "qvel"` | @@ -78,4 +78,3 @@ All agent terminate and truncate at the same time, given the same conditions as - 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 1c45a1f2..addee041 100644 --- a/docs/envs/MaMuJoCo/ma_pusher.md +++ b/docs/envs/MaMuJoCo/ma_pusher.md @@ -9,7 +9,7 @@ lastpage:

Pusher

- + This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) environments. Please read that page first for general information. The task is [Gymansium's MuJoCo/Pusher](https://gymnasium.farama.org/environments/mujoco/pusher/). @@ -82,7 +82,7 @@ The environment is partitioned in 3 parts, one part corresponding to the shoulde ## Observation Space | Observation Categories || -|-----------------------|------------------------------------------------------| +|-----------------------|------------------------------------------------------| | Default `local_categories` | `[["qpos", "qvel"], ["qpos"]]` | | Default `global_categories` | `("qpos", "qvel")` | | Supported observation categories | `"qpos", "qvel"` | diff --git a/docs/envs/MaMuJoCo/ma_reacher.md b/docs/envs/MaMuJoCo/ma_reacher.md index a587e1c8..fbcafd6a 100644 --- a/docs/envs/MaMuJoCo/ma_reacher.md +++ b/docs/envs/MaMuJoCo/ma_reacher.md @@ -9,7 +9,7 @@ lastpage:

Reacher

- + This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) environments. Please read that page first for general information. The task is [Gymansium's MuJoCo/Reacher](https://gymnasium.farama.org/environments/mujoco/reacher/). @@ -68,7 +68,7 @@ The environment is partitioned in 2 parts, one part corresponding to the first j ## Observation Space | Observation Categories || -|-----------------------|------------------------------------------------------| +|-----------------------|------------------------------------------------------| | Default `local_categories` | `[["qpos", "qvel", "fingertip_dist"], ["qpos"]]` | | Default `global_categories` | `("qpos", "qvel")` | | Supported observation categories | `"qpos", "qvel", "fingertip_dist"` | @@ -98,4 +98,3 @@ All agent terminate and truncate at the same time, given the same conditions as - 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 599ce7d8..be5e3a17 100644 --- a/docs/envs/MaMuJoCo/ma_single.md +++ b/docs/envs/MaMuJoCo/ma_single.md @@ -47,4 +47,3 @@ The agent terminates and truncates at the same time, given the same conditions a - 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 0d066615..eff56830 100644 --- a/docs/envs/MaMuJoCo/ma_swimmer.md +++ b/docs/envs/MaMuJoCo/ma_swimmer.md @@ -9,7 +9,7 @@ lastpage:

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 [Gymansium's MuJoCo/Swimmer](https://gymnasium.farama.org/environments/mujoco/swimmer/). @@ -67,7 +67,7 @@ The environment is partitioned in 2 parts, one part corresponding to the first j ## Observation Space | Observation Categories || -|-----------------------|------------------------------------------------------| +|-----------------------|------------------------------------------------------| | Default `local_categories` | `[["qpos", "qvel"], ["qpos"]]` | | Default `global_categories` | `("qpos", "qvel")` | | Supported observation categories | `"qpos", "qvel"` | @@ -97,4 +97,3 @@ All agent terminate and truncate at the same time, given the same conditions as - 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 cfa7ef03..7779cb7b 100644 --- a/docs/envs/MaMuJoCo/ma_walker2d.md +++ b/docs/envs/MaMuJoCo/ma_walker2d.md @@ -9,7 +9,7 @@ lastpage:

Walker2D

- + This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) environments. Please read that page first for general information. The task is [Gymansium's MuJoCo/Walker2D](https://gymnasium.farama.org/environments/mujoco/walker2d/). @@ -76,7 +76,7 @@ The environment is partitioned in 2 parts, one part corresponding to the right l ## Observation Space | Observation Categories || -|-----------------------|------------------------------------------------------| +|-----------------------|------------------------------------------------------| | Default `local_categories` | `[["qpos", "qvel"], ["qpos"]]` | | Default `global_categories` | `("qpos", "qvel")` | | Supported observation categories | `"qpos", "qvel"` | diff --git a/docs/envs/franka_kitchen/index.md b/docs/envs/franka_kitchen/index.md index 7b54c5f5..9407f256 100644 --- a/docs/envs/franka_kitchen/index.md +++ b/docs/envs/franka_kitchen/index.md @@ -62,4 +62,4 @@ These environments were first introduced in [“Relay Policy Learning: Solving L ```{toctree} :glob: :hidden: -./* \ No newline at end of file +./* diff --git a/docs/envs/maze/index.md b/docs/envs/maze/index.md index cf799a23..40d43571 100644 --- a/docs/envs/maze/index.md +++ b/docs/envs/maze/index.md @@ -29,4 +29,4 @@ These environments were first introduced in [“D4RL: Datasets for Deep Data-Dri ```{toctree} :glob: :hidden: -./* \ No newline at end of file +./* diff --git a/docs/release_notes.md b/docs/release_notes.md index a35dc7a6..16e25769 100644 --- a/docs/release_notes.md +++ b/docs/release_notes.md @@ -9,4 +9,4 @@ title: Release Notes :github: https://github.com/Farama-Foundation/Gymnasium-Robotics/releases :pypi: https://pypi.org/project/gymnasium-robotics/ :changelog-url: -``` \ No newline at end of file +``` diff --git a/gymnasium_robotics/envs/assets/adroit_hand/adroit_assets.xml b/gymnasium_robotics/envs/assets/adroit_hand/adroit_assets.xml index 4d02b35c..fdbc7635 100644 --- a/gymnasium_robotics/envs/assets/adroit_hand/adroit_assets.xml +++ b/gymnasium_robotics/envs/assets/adroit_hand/adroit_assets.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file + diff --git a/gymnasium_robotics/envs/assets/adroit_hand/adroit_pen.xml b/gymnasium_robotics/envs/assets/adroit_hand/adroit_pen.xml index 21fc9ca4..bf71522a 100644 --- a/gymnasium_robotics/envs/assets/adroit_hand/adroit_pen.xml +++ b/gymnasium_robotics/envs/assets/adroit_hand/adroit_pen.xml @@ -1,11 +1,11 @@ - + @@ -30,7 +30,7 @@ - + @@ -40,7 +40,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -85,6 +85,6 @@ - + diff --git a/gymnasium_robotics/envs/assets/adroit_hand/adroit_relocate.xml b/gymnasium_robotics/envs/assets/adroit_hand/adroit_relocate.xml index d4b458ac..0462d1f9 100644 --- a/gymnasium_robotics/envs/assets/adroit_hand/adroit_relocate.xml +++ b/gymnasium_robotics/envs/assets/adroit_hand/adroit_relocate.xml @@ -1,11 +1,11 @@ - + @@ -35,7 +35,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -81,8 +81,8 @@ - + - - + + diff --git a/gymnasium_robotics/envs/assets/fetch/pick_and_place.xml b/gymnasium_robotics/envs/assets/fetch/pick_and_place.xml index 337032a8..2af830ea 100644 --- a/gymnasium_robotics/envs/assets/fetch/pick_and_place.xml +++ b/gymnasium_robotics/envs/assets/fetch/pick_and_place.xml @@ -6,7 +6,7 @@ - + @@ -14,11 +14,11 @@ - + - + diff --git a/gymnasium_robotics/envs/assets/fetch/push.xml b/gymnasium_robotics/envs/assets/fetch/push.xml index 8e12db24..35d47960 100644 --- a/gymnasium_robotics/envs/assets/fetch/push.xml +++ b/gymnasium_robotics/envs/assets/fetch/push.xml @@ -6,7 +6,7 @@ - + @@ -18,7 +18,7 @@ - + @@ -27,6 +27,6 @@ - + - \ No newline at end of file + diff --git a/gymnasium_robotics/envs/assets/fetch/reach.xml b/gymnasium_robotics/envs/assets/fetch/reach.xml index 2ca621e4..fcdc36ab 100644 --- a/gymnasium_robotics/envs/assets/fetch/reach.xml +++ b/gymnasium_robotics/envs/assets/fetch/reach.xml @@ -6,7 +6,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/gymnasium_robotics/envs/assets/fetch/shared.xml b/gymnasium_robotics/envs/assets/fetch/shared.xml index 5d61fef7..feb42db6 100644 --- a/gymnasium_robotics/envs/assets/fetch/shared.xml +++ b/gymnasium_robotics/envs/assets/fetch/shared.xml @@ -14,7 +14,7 @@ - + @@ -38,18 +38,18 @@ - + - + - + diff --git a/gymnasium_robotics/envs/assets/fetch/slide.xml b/gymnasium_robotics/envs/assets/fetch/slide.xml index efbfb51b..ed89398f 100644 --- a/gymnasium_robotics/envs/assets/fetch/slide.xml +++ b/gymnasium_robotics/envs/assets/fetch/slide.xml @@ -6,7 +6,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/gymnasium_robotics/envs/assets/hand/manipulate_block.xml b/gymnasium_robotics/envs/assets/hand/manipulate_block.xml index 83a6517e..39a24a43 100644 --- a/gymnasium_robotics/envs/assets/hand/manipulate_block.xml +++ b/gymnasium_robotics/envs/assets/hand/manipulate_block.xml @@ -35,7 +35,7 @@ - + diff --git a/gymnasium_robotics/envs/assets/hand/manipulate_egg.xml b/gymnasium_robotics/envs/assets/hand/manipulate_egg.xml index d60217f7..5c3906a7 100644 --- a/gymnasium_robotics/envs/assets/hand/manipulate_egg.xml +++ b/gymnasium_robotics/envs/assets/hand/manipulate_egg.xml @@ -35,7 +35,7 @@ - + diff --git a/gymnasium_robotics/envs/assets/hand/manipulate_pen.xml b/gymnasium_robotics/envs/assets/hand/manipulate_pen.xml index 20a6fb5e..144a7ea4 100644 --- a/gymnasium_robotics/envs/assets/hand/manipulate_pen.xml +++ b/gymnasium_robotics/envs/assets/hand/manipulate_pen.xml @@ -34,7 +34,7 @@ - + diff --git a/gymnasium_robotics/envs/assets/hand/reach.xml b/gymnasium_robotics/envs/assets/hand/reach.xml index ddc87817..305c0784 100644 --- a/gymnasium_robotics/envs/assets/hand/reach.xml +++ b/gymnasium_robotics/envs/assets/hand/reach.xml @@ -28,7 +28,7 @@ - + diff --git a/gymnasium_robotics/envs/assets/kitchen_franka/franka_assets/LICENSE.md b/gymnasium_robotics/envs/assets/kitchen_franka/franka_assets/LICENSE.md index 4a67574d..261eeb9e 100644 --- a/gymnasium_robotics/envs/assets/kitchen_franka/franka_assets/LICENSE.md +++ b/gymnasium_robotics/envs/assets/kitchen_franka/franka_assets/LICENSE.md @@ -199,5 +199,3 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - diff --git a/gymnasium_robotics/envs/assets/kitchen_franka/franka_assets/actuator.xml b/gymnasium_robotics/envs/assets/kitchen_franka/franka_assets/actuator.xml index f816900a..b31f20cd 100644 --- a/gymnasium_robotics/envs/assets/kitchen_franka/franka_assets/actuator.xml +++ b/gymnasium_robotics/envs/assets/kitchen_franka/franka_assets/actuator.xml @@ -14,4 +14,4 @@ - \ No newline at end of file + diff --git a/gymnasium_robotics/envs/assets/kitchen_franka/franka_assets/basic_scene.xml b/gymnasium_robotics/envs/assets/kitchen_franka/franka_assets/basic_scene.xml index 4bb7e70a..493f1fef 100644 --- a/gymnasium_robotics/envs/assets/kitchen_franka/franka_assets/basic_scene.xml +++ b/gymnasium_robotics/envs/assets/kitchen_franka/franka_assets/basic_scene.xml @@ -11,4 +11,4 @@ - \ No newline at end of file + diff --git a/gymnasium_robotics/envs/assets/kitchen_franka/kitchen_assets/basic_scene.xml b/gymnasium_robotics/envs/assets/kitchen_franka/kitchen_assets/basic_scene.xml index 60eb4fa5..ed176dda 100644 --- a/gymnasium_robotics/envs/assets/kitchen_franka/kitchen_assets/basic_scene.xml +++ b/gymnasium_robotics/envs/assets/kitchen_franka/kitchen_assets/basic_scene.xml @@ -32,4 +32,4 @@ - \ No newline at end of file + diff --git a/gymnasium_robotics/envs/assets/kitchen_franka/kitchen_assets/kitchen_env_model.xml b/gymnasium_robotics/envs/assets/kitchen_franka/kitchen_assets/kitchen_env_model.xml index 5672fdef..df2e9307 100644 --- a/gymnasium_robotics/envs/assets/kitchen_franka/kitchen_assets/kitchen_env_model.xml +++ b/gymnasium_robotics/envs/assets/kitchen_franka/kitchen_assets/kitchen_env_model.xml @@ -43,7 +43,7 @@ - + @@ -71,7 +71,7 @@ - + diff --git a/gymnasium_robotics/envs/fetch/fetch_env.py b/gymnasium_robotics/envs/fetch/fetch_env.py index 25b5b98b..1e90984c 100644 --- a/gymnasium_robotics/envs/fetch/fetch_env.py +++ b/gymnasium_robotics/envs/fetch/fetch_env.py @@ -37,7 +37,7 @@ def __init__( target_range, distance_threshold, reward_type, - **kwargs + **kwargs, ): """Initializes a new Fetch environment. @@ -205,9 +205,9 @@ def generate_mujoco_observations(self): object_rel_pos = object_pos - grip_pos object_velp -= grip_velp else: - object_pos = ( - object_rot - ) = object_velp = object_velr = object_rel_pos = np.zeros(0) + object_pos = object_rot = object_velp = object_velr = object_rel_pos = ( + np.zeros(0) + ) gripper_state = robot_qpos[-2:] gripper_vel = ( @@ -338,9 +338,9 @@ def generate_mujoco_observations(self): object_rel_pos = object_pos - grip_pos object_velp -= grip_velp else: - object_pos = ( - object_rot - ) = object_velp = object_velr = object_rel_pos = np.zeros(0) + object_pos = object_rot = object_velp = object_velr = object_rel_pos = ( + np.zeros(0) + ) gripper_state = robot_qpos[-2:] gripper_vel = ( diff --git a/gymnasium_robotics/envs/franka_kitchen/franka_env.py b/gymnasium_robotics/envs/franka_kitchen/franka_env.py index 40d62746..949c0698 100644 --- a/gymnasium_robotics/envs/franka_kitchen/franka_env.py +++ b/gymnasium_robotics/envs/franka_kitchen/franka_env.py @@ -9,7 +9,7 @@ Original Author of the code: Abhishek Gupta & Justin Fu -The modifications made involve separatin the Kitchen environment from the Franka environment and addint support for compatibility with +The modifications made involve separating the Kitchen environment from the Franka environment and addint support for compatibility with the Gymnasium and Multi-goal API's This project is covered by the Apache 2.0 License. diff --git a/gymnasium_robotics/envs/franka_kitchen/kitchen_env.py b/gymnasium_robotics/envs/franka_kitchen/kitchen_env.py index a8c0c3cc..a133382f 100644 --- a/gymnasium_robotics/envs/franka_kitchen/kitchen_env.py +++ b/gymnasium_robotics/envs/franka_kitchen/kitchen_env.py @@ -9,7 +9,7 @@ Original Author of the code: Abhishek Gupta & Justin Fu -The modifications made involve separatin the Kitchen environment from the Franka environment and addint support for compatibility with +The modifications made involve separating the Kitchen environment from the Franka environment and addint support for compatibility with the Gymnasium and Multi-goal API's. This project is covered by the Apache 2.0 License. diff --git a/gymnasium_robotics/envs/franka_kitchen/utils.py b/gymnasium_robotics/envs/franka_kitchen/utils.py index cb050eb2..3f0cecba 100644 --- a/gymnasium_robotics/envs/franka_kitchen/utils.py +++ b/gymnasium_robotics/envs/franka_kitchen/utils.py @@ -1,5 +1,6 @@ """Utility functions to read the file with the joints configuration of the Franka robot located at '../assets/kitchen_franka/franka_assets/franka_config.xml'. """ + import xml.etree.ElementTree as ET import numpy as np diff --git a/gymnasium_robotics/envs/maze/maze_v4.py b/gymnasium_robotics/envs/maze/maze_v4.py index e601a805..0c2d394e 100644 --- a/gymnasium_robotics/envs/maze/maze_v4.py +++ b/gymnasium_robotics/envs/maze/maze_v4.py @@ -10,6 +10,7 @@ This project is covered by the Apache 2.0 License. """ + import math import tempfile import time diff --git a/gymnasium_robotics/envs/maze/point.py b/gymnasium_robotics/envs/maze/point.py index adba8baf..5fcf1680 100644 --- a/gymnasium_robotics/envs/maze/point.py +++ b/gymnasium_robotics/envs/maze/point.py @@ -43,7 +43,7 @@ def __init__(self, xml_file: Optional[str] = None, **kwargs): model_path=xml_file, frame_skip=1, observation_space=observation_space, - **kwargs + **kwargs, ) def reset_model(self) -> np.ndarray: diff --git a/gymnasium_robotics/envs/multiagent_mujoco/assets/coupled_half_cheetah.xml b/gymnasium_robotics/envs/multiagent_mujoco/assets/coupled_half_cheetah.xml index ff9e1617..f7c8ad0d 100644 --- a/gymnasium_robotics/envs/multiagent_mujoco/assets/coupled_half_cheetah.xml +++ b/gymnasium_robotics/envs/multiagent_mujoco/assets/coupled_half_cheetah.xml @@ -159,4 +159,4 @@ - \ No newline at end of file + 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 8bfc3308..79e075a8 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 @@ -57,4 +57,4 @@ modified by @kallinteris-andreas {{ actuators }} - \ No newline at end of file + diff --git a/gymnasium_robotics/envs/multiagent_mujoco/assets/many_segment_swimmer.xml.template b/gymnasium_robotics/envs/multiagent_mujoco/assets/many_segment_swimmer.xml.template index cff01a49..4688f715 100644 --- a/gymnasium_robotics/envs/multiagent_mujoco/assets/many_segment_swimmer.xml.template +++ b/gymnasium_robotics/envs/multiagent_mujoco/assets/many_segment_swimmer.xml.template @@ -38,4 +38,4 @@ modified by @kallinteris-andreas {{ actuators }} - \ No newline at end of file + diff --git a/gymnasium_robotics/envs/multiagent_mujoco/coupled_half_cheetah.py b/gymnasium_robotics/envs/multiagent_mujoco/coupled_half_cheetah.py index c33eb70d..0ab735d3 100644 --- a/gymnasium_robotics/envs/multiagent_mujoco/coupled_half_cheetah.py +++ b/gymnasium_robotics/envs/multiagent_mujoco/coupled_half_cheetah.py @@ -10,6 +10,7 @@ - fixed `_get_obs()` (now also returns tendon related observations) - renamed CoupledHalfCheetah -> CoupledHalfCheetahEnv """ + import os import typing diff --git a/gymnasium_robotics/envs/multiagent_mujoco/many_segment_swimmer.py b/gymnasium_robotics/envs/multiagent_mujoco/many_segment_swimmer.py index 88475815..5841a00d 100644 --- a/gymnasium_robotics/envs/multiagent_mujoco/many_segment_swimmer.py +++ b/gymnasium_robotics/envs/multiagent_mujoco/many_segment_swimmer.py @@ -8,7 +8,6 @@ - Removed the class (but kept the `gen_asset` function) """ - import os import gymnasium diff --git a/gymnasium_robotics/envs/multiagent_mujoco/mujoco_multi.py b/gymnasium_robotics/envs/multiagent_mujoco/mujoco_multi.py old mode 100755 new mode 100644 index ac71c754..2452de19 --- a/gymnasium_robotics/envs/multiagent_mujoco/mujoco_multi.py +++ b/gymnasium_robotics/envs/multiagent_mujoco/mujoco_multi.py @@ -14,7 +14,6 @@ This project is covered by the Apache 2.0 License. """ - from __future__ import annotations import os @@ -106,7 +105,7 @@ def __init__( The default is: `("qpos", "qvel")` render_mode: See [Gymansium/MuJoCo](https://gymnasium.farama.org/environments/mujoco/), valid values: 'human', 'rgb_array', 'depth_array' - gym_env: A custom `MujocoEnv` envinronment, overrides generation of environment by `MaMuJoCo`. + gym_env: A custom `MujocoEnv` environment, overrides generation of environment by `MaMuJoCo`. kwargs: Additional arguments passed to the [Gymansium/MuJoCo](https://gymnasium.farama.org/environments/mujoco/) environment, Note: arguments that change the observation space will not work. @@ -185,13 +184,13 @@ def __init__( shape=(len(partition),), dtype=np.float32, ) - self.observation_spaces[ - self.possible_agents[agent_id] - ] = gymnasium.spaces.Box( - low=-np.inf, - high=np.inf, - shape=(len(self._get_obs_agent(agent_id)),), - dtype=self.single_agent_env.observation_space.dtype, + self.observation_spaces[self.possible_agents[agent_id]] = ( + gymnasium.spaces.Box( + low=-np.inf, + high=np.inf, + shape=(len(self._get_obs_agent(agent_id)),), + dtype=self.single_agent_env.observation_space.dtype, + ) ) def _create_base_gym_env( @@ -238,12 +237,9 @@ def _create_base_gym_env( elif scenario in ["CoupledHalfCheetah"]: return TimeLimit(CoupledHalfCheetahEnv(render_mode), max_episode_steps=1000) else: - breakpoint() raise NotImplementedError("Custom env not implemented!") - def step( - self, actions: dict[str, np.ndarray] - ) -> tuple[ + def step(self, actions: dict[str, np.ndarray]) -> tuple[ dict[str, np.ndarray], dict[str, np.ndarray], dict[str, np.ndarray], diff --git a/gymnasium_robotics/envs/shadow_dexterous_hand/reach.py b/gymnasium_robotics/envs/shadow_dexterous_hand/reach.py index 377b7e41..19665424 100644 --- a/gymnasium_robotics/envs/shadow_dexterous_hand/reach.py +++ b/gymnasium_robotics/envs/shadow_dexterous_hand/reach.py @@ -346,7 +346,7 @@ class MujocoHandReachEnv(get_base_hand_reanch_env(MujocoHandEnv)): | robot0:THJ1 | -0.0015229223564485414 | | robot0:THJ0 | -0.7894883021600622 | - For the target cartersian position of the fingers there are two possible initializations chosen randomly. With a probability of 10 % the episodes goal will be to keep the initial position of the finger tips for an indefinete perido of time. + For the target cartersian position of the fingers there are two possible initializations chosen randomly. With a probability of 10 % the episodes goal will be to keep the initial position of the finger tips for an indefinite period of time. The initial position of the finger tips will then be: | Finger Tip | Coordinate | Position (m) | diff --git a/gymnasium_robotics/utils/rotations.py b/gymnasium_robotics/utils/rotations.py index d5210402..b9c8fdad 100644 --- a/gymnasium_robotics/utils/rotations.py +++ b/gymnasium_robotics/utils/rotations.py @@ -47,7 +47,7 @@ - All functions accept batches as well as individual rotations - All rotation conventions match respective MuJoCo defaults - All angles are in radians - - Matricies follow LR convention + - Matrices follow LR convention - Euler Angles are all relative with 'xyz' axes ordering - See specific representation for more information @@ -102,7 +102,7 @@ - More representations (SO3, etc) - Random sampling (e.g. sample uniform random rotation) - Performance benchmarks/measurements - - (Maybe) define everything as to/from matricies, for simplicity + - (Maybe) define everything as to/from matrices, for simplicity """ # For testing whether a number is close to zero diff --git a/pyproject.toml b/pyproject.toml index dd0542b0..81c1f74b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,6 @@ testing = [ "cython<3", "PettingZoo>=1.23.0", "Jinja2>=3.0.3", - "disutils" ] mujoco_py = ["mujoco_py<2.2,>=2.1", "cython<3"] diff --git a/tests/envs/MaMuJoCo/test_MaMuJoCo.py b/tests/envs/MaMuJoCo/test_MaMuJoCo.py index feeb05c4..c8dcbc9f 100644 --- a/tests/envs/MaMuJoCo/test_MaMuJoCo.py +++ b/tests/envs/MaMuJoCo/test_MaMuJoCo.py @@ -114,7 +114,7 @@ def test_general(observation_depth, task) -> None: @pytest.mark.parametrize("observation_depth", observation_depths) @pytest.mark.parametrize("task", pre_defined_factorizations) def test_action_and_observation_mapping(observation_depth, task): - """Assert that converting local <-> global <-> local obervations/actions results in the same observation/actions.""" + """Assert that converting local <-> global <-> local observations/actions results in the same observation/actions.""" test_env = mamujoco_v1.parallel_env( task.scenario, task.conf, agent_obsk=observation_depth, **task.kwargs ) diff --git a/tests/test_envs.py b/tests/test_envs.py index fa49f90a..f880b297 100644 --- a/tests/test_envs.py +++ b/tests/test_envs.py @@ -30,7 +30,7 @@ @pytest.mark.parametrize( - "spec", all_testing_env_specs, ids=[spec.id for spec in all_testing_env_specs] + "spec", non_mujoco_py_env_specs, ids=[spec.id for spec in non_mujoco_py_env_specs] ) def test_env(spec): # Capture warnings diff --git a/tests/utils.py b/tests/utils.py index a86a9367..349d57a6 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,4 +1,5 @@ """Finds all the specs that we can test with""" + import gymnasium as gym import numpy as np