navground-learning


Namenavground-learning JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryA Python package that interfaces navground with gymnasium to learn navigating using IL and RL.
upload_time2024-12-16 10:52:03
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License Copyright (c) 2024 IDSIA Robotics Group Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords navigation navground gymnasium pettingzoo imitation-learning reinforcement-learning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # navground_learning

A Python package that adds Imitation or Reinforcement Learning to the tools user can play with in the **Nav**igation Play**ground** [navground](https://github.com/idsia-robotics/navground).

The package provides configurable single-agent [Gymnasium](https://gymnasium.farama.org/index.html)  and multi-agent Parallel [PettingZoo](https://pettingzoo.farama.org/index.html) environments. Users, by combining navigation scenarios and sensors, can build any kind of environment where to learn navigation policies.

## Main features

- Single-agent Gymnasium environment that expose actions, obervations and rewards of a single agent in a navground scenario.
- Multi-agent PettingZoo environment that expose actions, observations and rewards of multiple agents, possibly heterogenous, in a navground scenario.
- Ability to execute a navigation policy in navground, with support for [ONNX](https://onnx.ai) and [Stable-Baselines3](https://stable-baselines3.readthedocs.io).
- User-extendable configuration for translating between navground commands/states and the POMDP actions/observations.
- Reward functions for navigation tasks.
- Import/export from/to YAML, like common in navground.
- Tools to evaluate the policies during and after training, inside and outside of the environments.

## Installation

```
pip install navground_learning[all]
```

We support Python>=3.10. Users should prefer Python<=3.12 because important third-party packages like Stable-BaseLine3 or PyTorch do not support Python3.13 yet.

## Example

Note that to run the example, you need to install the `rl` and `inference` optional dependecies:

```
pip install navground_learning[rl,inference]
```

which are installed if you installed `navground_learning[all]`.


The example instantiate the environment of [one of the tutorials](https://idsia-robotics.github.io/navground_learning/tutorials/corridor_with_obstacle.html), in which it trains a policy using `SAC`.
Then, it export the policy as an `ONNX`, which it uses to run a navground experiment, recording the trajectories to an HDF5 file.

```python
from navground.learning import evaluation, io
from navground.learning.examples import corridor_with_obstacle
from stable_baselines3 import SAC

# Creates a Gymnasium environment 
env = corridor_with_obstacle.get_env()
# Train using Stable-Baseline3
model = SAC("MlpPolicy", env).learn(total_timesteps=1_000)
# Export the model to ONNX
io.export_behavior(model, "model")

# Evaluate the policy with a navground experiment
exp = evaluation.make_experiment_with_env(env, policy="model/policy.onnx")
exp.number_of_runs = 100
exp.record_config.pose = True
exp.save_directory = '.'
exp.run()
```
## Documentation

The [project documentation](https://idsia-robotics.github.io/navground_learning) in addition to the API reference, includes 
several [tutorials](https://idsia-robotics.github.io/navground_learning/tutorials) of Machine-Learning policies in navigation, ranging from very basics to complex multi-agent scenarios. 

## License and copyright

This software is free for reuse according to the attached MIT license.

## Acknowledgement and disclaimer

The work was supported in part by [REXASI-PRO](https://rexasi-pro.spindoxlabs.com) H-EU project, call HORIZON-CL4-2021-HUMAN-01-01, Grant agreement no. 101070028.

<img src="https://rexasi-pro.spindoxlabs.com/wp-content/uploads/2023/01/Bianco-Viola-Moderno-Minimalista-Logo-e1675187551324.png"  width="300">

The work has been partially funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Commission. Neither the European Union nor the European Commission can be held responsible for them.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "navground-learning",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "Jerome Guzzi <jerome@idsia.ch>",
    "keywords": "navigation, navground, gymnasium, pettingzoo, imitation-learning, reinforcement-learning",
    "author": null,
    "author_email": "Jerome Guzzi <jerome@idsia.ch>",
    "download_url": "https://files.pythonhosted.org/packages/c1/0b/ac8ae648dda19aa62fef2af6e15149331928fdc44bf97d68e5ee60a1d589/navground_learning-0.1.0.tar.gz",
    "platform": null,
    "description": "# navground_learning\n\nA Python package that adds Imitation or Reinforcement Learning to the tools user can play with in the **Nav**igation Play**ground** [navground](https://github.com/idsia-robotics/navground).\n\nThe package provides configurable single-agent [Gymnasium](https://gymnasium.farama.org/index.html)  and multi-agent Parallel [PettingZoo](https://pettingzoo.farama.org/index.html) environments. Users, by combining navigation scenarios and sensors, can build any kind of environment where to learn navigation policies.\n\n## Main features\n\n- Single-agent Gymnasium environment that expose actions, obervations and rewards of a single agent in a navground scenario.\n- Multi-agent PettingZoo environment that expose actions, observations and rewards of multiple agents, possibly heterogenous, in a navground scenario.\n- Ability to execute a navigation policy in navground, with support for [ONNX](https://onnx.ai) and [Stable-Baselines3](https://stable-baselines3.readthedocs.io).\n- User-extendable configuration for translating between navground commands/states and the POMDP actions/observations.\n- Reward functions for navigation tasks.\n- Import/export from/to YAML, like common in navground.\n- Tools to evaluate the policies during and after training, inside and outside of the environments.\n\n## Installation\n\n```\npip install navground_learning[all]\n```\n\nWe support Python>=3.10. Users should prefer Python<=3.12 because important third-party packages like Stable-BaseLine3 or PyTorch do not support Python3.13 yet.\n\n## Example\n\nNote that to run the example, you need to install the `rl` and `inference` optional dependecies:\n\n```\npip install navground_learning[rl,inference]\n```\n\nwhich are installed if you installed `navground_learning[all]`.\n\n\nThe example instantiate the environment of [one of the tutorials](https://idsia-robotics.github.io/navground_learning/tutorials/corridor_with_obstacle.html), in which it trains a policy using `SAC`.\nThen, it export the policy as an `ONNX`, which it uses to run a navground experiment, recording the trajectories to an HDF5 file.\n\n```python\nfrom navground.learning import evaluation, io\nfrom navground.learning.examples import corridor_with_obstacle\nfrom stable_baselines3 import SAC\n\n# Creates a Gymnasium environment \nenv = corridor_with_obstacle.get_env()\n# Train using Stable-Baseline3\nmodel = SAC(\"MlpPolicy\", env).learn(total_timesteps=1_000)\n# Export the model to ONNX\nio.export_behavior(model, \"model\")\n\n# Evaluate the policy with a navground experiment\nexp = evaluation.make_experiment_with_env(env, policy=\"model/policy.onnx\")\nexp.number_of_runs = 100\nexp.record_config.pose = True\nexp.save_directory = '.'\nexp.run()\n```\n## Documentation\n\nThe [project documentation](https://idsia-robotics.github.io/navground_learning) in addition to the API reference, includes \nseveral [tutorials](https://idsia-robotics.github.io/navground_learning/tutorials) of Machine-Learning policies in navigation, ranging from very basics to complex multi-agent scenarios. \n\n## License and copyright\n\nThis software is free for reuse according to the attached MIT license.\n\n## Acknowledgement and disclaimer\n\nThe work was supported in part by [REXASI-PRO](https://rexasi-pro.spindoxlabs.com) H-EU project, call HORIZON-CL4-2021-HUMAN-01-01, Grant agreement no. 101070028.\n\n<img src=\"https://rexasi-pro.spindoxlabs.com/wp-content/uploads/2023/01/Bianco-Viola-Moderno-Minimalista-Logo-e1675187551324.png\"  width=\"300\">\n\nThe work has been partially funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Commission. Neither the European Union nor the European Commission can be held responsible for them.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 IDSIA Robotics Group  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A Python package that interfaces navground with gymnasium to learn navigating using IL and RL.",
    "version": "0.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/idsia-robotics/navground_learning/issues",
        "Changelog": "https://github.com/idsia-robotics/navground_learning/blob/main/CHANGELOG.md",
        "Documentation": "https://idsia-robotics.github.io/navground_learning",
        "Homepage": "https://github.com/idsia-robotics/navground_learning",
        "Repository": "https://github.com/idsia-robotics/navground_learning.git"
    },
    "split_keywords": [
        "navigation",
        " navground",
        " gymnasium",
        " pettingzoo",
        " imitation-learning",
        " reinforcement-learning"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "88c805841999d846adb8632402d8e482077de1b5c03aab90df80316b6e938eb3",
                "md5": "431189a740ba4ac33d8dbeac328ff2ec",
                "sha256": "2c01ecb50665e393d70bdb0204da22d3c138fd1610c27615518934b539075a68"
            },
            "downloads": -1,
            "filename": "navground_learning-0.1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "431189a740ba4ac33d8dbeac328ff2ec",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.10",
            "size": 94029,
            "upload_time": "2024-12-16T10:52:01",
            "upload_time_iso_8601": "2024-12-16T10:52:01.536926Z",
            "url": "https://files.pythonhosted.org/packages/88/c8/05841999d846adb8632402d8e482077de1b5c03aab90df80316b6e938eb3/navground_learning-0.1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c10bac8ae648dda19aa62fef2af6e15149331928fdc44bf97d68e5ee60a1d589",
                "md5": "f5a934c9d54c3bd25b869830d4d6548a",
                "sha256": "195c1d5699497eaee7d1b2bc5447ce5b2889e6d813e057c5ab6906c5d03999db"
            },
            "downloads": -1,
            "filename": "navground_learning-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f5a934c9d54c3bd25b869830d4d6548a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 69994,
            "upload_time": "2024-12-16T10:52:03",
            "upload_time_iso_8601": "2024-12-16T10:52:03.737668Z",
            "url": "https://files.pythonhosted.org/packages/c1/0b/ac8ae648dda19aa62fef2af6e15149331928fdc44bf97d68e5ee60a1d589/navground_learning-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-16 10:52:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "idsia-robotics",
    "github_project": "navground_learning",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "navground-learning"
}
        
Elapsed time: 0.38759s