gymnasium-robotics


Namegymnasium-robotics JSON
Version 1.2.4 PyPI version JSON
download
home_page
SummaryRobotics environments for the Gymnasium repo.
upload_time2023-12-24 09:59:21
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT License
keywords reinforcement learning gymnasium rl ai robotics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com/) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

<p align="center">
  <img src="https://raw.githubusercontent.com/Farama-Foundation/Gymnasium-Robotics/main/gymrobotics-revised-text.png" width="500px"/>
</p>

This library contains a collection of Reinforcement Learning robotic environments that use the [Gymansium](https://gymnasium.farama.org/) API. The environments run with the [MuJoCo](https://mujoco.org/) physics engine and the maintained [mujoco python bindings](https://mujoco.readthedocs.io/en/latest/python.html).

The documentation website is at [robotics.farama.org](https://robotics.farama.org/), and we have a public discord server (which we also use to coordinate development work) that you can join here: [https://discord.gg/YymmHrvS](https://discord.gg/YymmHrvS)

## Installation

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).  

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]`

We support and test for Python 3.8, 3.9, 3.10 and 3.11 on Linux and macOS. We will accept PRs related to Windows, but do not officially support it.

## Environments

`Gymnasium-Robotics` includes the following groups of environments:

* [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.

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:

* [Maze Environments](https://robotics.farama.org/envs/maze/) - An agent has to navigate through a maze to reach certain goal position. Two different agents can be used: a 2-DoF force-controlled ball, or the classic `Ant` agent from the [Gymnasium MuJoCo environments](https://gymnasium.farama.org/environments/mujoco/ant/). The environment can be initialized with a variety of maze shapes with increasing levels of difficulty.
* [Adroit Arm](https://robotics.farama.org/envs/adroit_hand/) - A collection of environments that use the Shadow Dexterous Hand with additional degrees of freedom for the arm movement.
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.

**WIP**: generate new `D4RL` environment datasets with [Minari](https://github.com/Farama-Foundation/Minari).

## Multi-goal API

The robotic environments use an extension of the core Gymansium API by inheriting from [GoalEnv](https://robotics.farama.org/envs/#) class. The new API forces the environments to have a dictionary observation space that contains 3 keys:

* `observation` - The actual observation of the environment
* `desired_goal` - The goal that the agent has to achieved
* `achieved_goal` - The goal that the agent has currently achieved instead. The objective of the environments is for this value to be close to `desired_goal`

This API also exposes the function of the reward, as well as the terminated and truncated signals to re-compute their values with different goals. This functionality is useful for algorithms that use Hindsight Experience Replay (HER).

The following example demonstrates how the exposed reward, terminated, and truncated functions
can be used to re-compute the values with substituted goals. The info dictionary can be used to store
additional information that may be necessary to re-compute the reward, but that is independent of the
goal, e.g. state derived from the simulation.

```python
import gymnasium as gym

env = gym.make("FetchReach-v2")
env.reset()
obs, reward, terminated, truncated, info = env.step(env.action_space.sample())

# The following always has to hold:
assert reward == env.compute_reward(obs["achieved_goal"], obs["desired_goal"], info)
assert truncated == env.compute_truncated(obs["achieved_goal"], obs["desired_goal"], info)
assert terminated == env.compute_terminated(obs["achieved_goal"], obs["desired_goal"], info)

# However goals can also be substituted:
substitute_goal = obs["achieved_goal"].copy()
substitute_reward = env.compute_reward(obs["achieved_goal"], substitute_goal, info)
substitute_terminated = env.compute_terminated(obs["achieved_goal"], substitute_goal, info)
substitute_truncated = env.compute_truncated(obs["achieved_goal"], substitute_goal, info)
```

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) 

Maintenance for this project is also contributed by the broader Farama team: [farama.org/team](https://farama.org/team).

## Citation

If you use this in your research, please cite:
```
@software{gymnasium_robotics2023github,
  author = {Rodrigo de Lazcano and Kallinteris Andreas and Jun Jet Tai and Seungjae Ryan Lee and Jordan Terry},
  title = {Gymnasium Robotics},
  url = {http://github.com/Farama-Foundation/Gymnasium-Robotics},
  version = {1.2.4},
  year = {2023},
}
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "gymnasium-robotics",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "Reinforcement Learning,Gymnasium,RL,AI,Robotics",
    "author": "",
    "author_email": "Farama Foundation <contact@farama.org>",
    "download_url": "https://files.pythonhosted.org/packages/ef/13/123ca19354a42d4a2bda8f2109f273a48562eb2528b961d1310720961d89/gymnasium-robotics-1.2.4.tar.gz",
    "platform": null,
    "description": "[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com/) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n<p align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/Farama-Foundation/Gymnasium-Robotics/main/gymrobotics-revised-text.png\" width=\"500px\"/>\n</p>\n\nThis library contains a collection of Reinforcement Learning robotic environments that use the [Gymansium](https://gymnasium.farama.org/) API. The environments run with the [MuJoCo](https://mujoco.org/) physics engine and the maintained [mujoco python bindings](https://mujoco.readthedocs.io/en/latest/python.html).\n\nThe documentation website is at [robotics.farama.org](https://robotics.farama.org/), and we have a public discord server (which we also use to coordinate development work) that you can join here: [https://discord.gg/YymmHrvS](https://discord.gg/YymmHrvS)\n\n## Installation\n\nTo install the Gymnasium-Robotics environments use `pip install gymnasium-robotics`\n\nThese 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).  \n\nNote 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]`\n\nWe support and test for Python 3.8, 3.9, 3.10 and 3.11 on Linux and macOS. We will accept PRs related to Windows, but do not officially support it.\n\n## Environments\n\n`Gymnasium-Robotics` includes the following groups of environments:\n\n* [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.\n* [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.\n\nThe [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:\n\n* [Maze Environments](https://robotics.farama.org/envs/maze/) - An agent has to navigate through a maze to reach certain goal position. Two different agents can be used: a 2-DoF force-controlled ball, or the classic `Ant` agent from the [Gymnasium MuJoCo environments](https://gymnasium.farama.org/environments/mujoco/ant/). The environment can be initialized with a variety of maze shapes with increasing levels of difficulty.\n* [Adroit Arm](https://robotics.farama.org/envs/adroit_hand/) - A collection of environments that use the Shadow Dexterous Hand with additional degrees of freedom for the arm movement.\nThe different tasks involve hammering a nail, opening a door, twirling a pen, or picking up and moving a ball.\n* [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.\n\n**WIP**: generate new `D4RL` environment datasets with [Minari](https://github.com/Farama-Foundation/Minari).\n\n## Multi-goal API\n\nThe robotic environments use an extension of the core Gymansium API by inheriting from [GoalEnv](https://robotics.farama.org/envs/#) class. The new API forces the environments to have a dictionary observation space that contains 3 keys:\n\n* `observation` - The actual observation of the environment\n* `desired_goal` - The goal that the agent has to achieved\n* `achieved_goal` - The goal that the agent has currently achieved instead. The objective of the environments is for this value to be close to `desired_goal`\n\nThis API also exposes the function of the reward, as well as the terminated and truncated signals to re-compute their values with different goals. This functionality is useful for algorithms that use Hindsight Experience Replay (HER).\n\nThe following example demonstrates how the exposed reward, terminated, and truncated functions\ncan be used to re-compute the values with substituted goals. The info dictionary can be used to store\nadditional information that may be necessary to re-compute the reward, but that is independent of the\ngoal, e.g. state derived from the simulation.\n\n```python\nimport gymnasium as gym\n\nenv = gym.make(\"FetchReach-v2\")\nenv.reset()\nobs, reward, terminated, truncated, info = env.step(env.action_space.sample())\n\n# The following always has to hold:\nassert reward == env.compute_reward(obs[\"achieved_goal\"], obs[\"desired_goal\"], info)\nassert truncated == env.compute_truncated(obs[\"achieved_goal\"], obs[\"desired_goal\"], info)\nassert terminated == env.compute_terminated(obs[\"achieved_goal\"], obs[\"desired_goal\"], info)\n\n# However goals can also be substituted:\nsubstitute_goal = obs[\"achieved_goal\"].copy()\nsubstitute_reward = env.compute_reward(obs[\"achieved_goal\"], substitute_goal, info)\nsubstitute_terminated = env.compute_terminated(obs[\"achieved_goal\"], substitute_goal, info)\nsubstitute_truncated = env.compute_truncated(obs[\"achieved_goal\"], substitute_goal, info)\n```\n\nThe `GoalEnv` class can also be used for custom environments.\n\n## Project Maintainers\nMain Contributors: [Rodrigo Perez-Vicente](https://github.com/rodrigodelazcano), [Kallinteris Andreas](https://github.com/Kallinteris-Andreas), [Jet Tai](https://github.com/jjshoots) \n\nMaintenance for this project is also contributed by the broader Farama team: [farama.org/team](https://farama.org/team).\n\n## Citation\n\nIf you use this in your research, please cite:\n```\n@software{gymnasium_robotics2023github,\n  author = {Rodrigo de Lazcano and Kallinteris Andreas and Jun Jet Tai and Seungjae Ryan Lee and Jordan Terry},\n  title = {Gymnasium Robotics},\n  url = {http://github.com/Farama-Foundation/Gymnasium-Robotics},\n  version = {1.2.4},\n  year = {2023},\n}\n```\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Robotics environments for the Gymnasium repo.",
    "version": "1.2.4",
    "project_urls": {
        "Bug Report": "https://github.com/Farama-Foundation/Gymnasium-Robotics/issues",
        "Documentation": "https://robotics.farama.org",
        "Homepage": "https://farama.org",
        "Repository": "https://github.com/Farama-Foundation/Gymnasium-Robotics"
    },
    "split_keywords": [
        "reinforcement learning",
        "gymnasium",
        "rl",
        "ai",
        "robotics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3f91f934af16a5517a9602bc585620e51683d9e49bcfdc9632355158d188a3b3",
                "md5": "ef71fc5c44ab3dc7585b04e4ef5ecbbe",
                "sha256": "c2cb23e087ca0280ae6802837eb7b3a6d14e5bd24c00803ab09f015fcff3eef5"
            },
            "downloads": -1,
            "filename": "gymnasium_robotics-1.2.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ef71fc5c44ab3dc7585b04e4ef5ecbbe",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 26139344,
            "upload_time": "2023-12-24T09:59:18",
            "upload_time_iso_8601": "2023-12-24T09:59:18.442462Z",
            "url": "https://files.pythonhosted.org/packages/3f/91/f934af16a5517a9602bc585620e51683d9e49bcfdc9632355158d188a3b3/gymnasium_robotics-1.2.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ef13123ca19354a42d4a2bda8f2109f273a48562eb2528b961d1310720961d89",
                "md5": "fd02bc017cf1a925449ec944e8165aee",
                "sha256": "d304192b066f8b800599dfbe3d9d90bba9b761ee884472bdc4d05968a8bc61cb"
            },
            "downloads": -1,
            "filename": "gymnasium-robotics-1.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "fd02bc017cf1a925449ec944e8165aee",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 26064781,
            "upload_time": "2023-12-24T09:59:21",
            "upload_time_iso_8601": "2023-12-24T09:59:21.662272Z",
            "url": "https://files.pythonhosted.org/packages/ef/13/123ca19354a42d4a2bda8f2109f273a48562eb2528b961d1310720961d89/gymnasium-robotics-1.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-24 09:59:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Farama-Foundation",
    "github_project": "Gymnasium-Robotics",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "gymnasium-robotics"
}
        
Elapsed time: 0.15564s