# voxelgym2D
[![MIT License](https://img.shields.io/github/license/harisankar95/voxelgym2D)](LICENSE)
[![PyPI](https://img.shields.io/pypi/v/voxelgym2D)](https://pypi.org/project/voxelgym2D/)
[![Pipeline](https://github.com/harisankar95/voxelgym2D/actions/workflows/test-main.yml/badge.svg?branch=main)](https://github.com/harisankar95/voxelgym2D/actions/workflows/test-main.yml)
[![codestyle](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
A gymnasium environment for voxel/grid based reinforcement learning for path planning.
<div id="solution-table">
<table>
<tr>
<td style="padding:10px">
<img src="https://github.com/harisankar95/voxelgym2D/raw/main/resources/solution_1.gif" width="375"/>
</td>
<td style="padding:10px">
<img src="https://github.com/harisankar95/voxelgym2D/raw/main/resources/solution_2.gif" width="375"/>
</td>
</tr>
</table>
</div>
## Results with [SB3](https://github.com/DLR-RM/stable-baselines3) (v1.6.2) : PPO :smile:
Here are the results of training a PPO agent on the `onestep-v0` using the example [here](examples/train_ppo.py). Below you will find the episode reward and episode length over steps during training. As the agent learns, the episode reward increases and the episode length reduces are the agent learns to identify the goal and reach it in the shortest possible path.
<div id="solution-table">
<table>
<tr>
<td style="padding:10px">
<img src="https://github.com/harisankar95/voxelgym2D/raw/main/resources/ep_reward.png" width="375"/>
</td>
<td style="padding:10px">
<img src="https://github.com/harisankar95/voxelgym2D/raw/main/resources/ep_length.png" width="375"/>
</td>
</tr>
</table>
</div>
## Installation
```bash
pip install git+https://github.com/harisankar95/voxelgym2D.git
```
or directly from PyPI :smile:
```bash
pip install voxelgym2D
```
## Development
To install the package in development mode, run the following command in the root directory of the repository:
```bash
git clone https://github.com/harisankar95/voxelgym2D.git ~/path/to/repo
cd ~/path/to/repo
pip install -e .[dev]
# to aditionally install stable_baselines 3 and pytorch (optional)
pip install -e .[dev,sb3]
```
## Usage
```python
import voxelgym2D
import gymnasium as gym
env = gym.make("voxelgym2D:onestep-v0")
observation, info = env.reset(seed=123456)
env.render()
```
## Examples
The examples can be found [here](examples).
## License
This project is licensed under the terms of the [MIT license](LICENSE).
## Documentation
The documentation can be found [here](https://harisankar95.github.io/voxelgym2D/).
## Changelog
### 0.1.0
- Initial release of voxelgym 2D environments tested with stable_baselines 3 (v1.6.2) and python 3.8
### 0.2.0
- Available on PyPI, sphinx documentation in work
### 0.3.0
- Migration to gymnasium
- Agent can now be reset to multiple start positions
### 0.3.1
- License updated
- Documentation updated
## TODO
- [x] Add 2D environments
- [ ] Add documentation
## Contributing
Contributions are welcome! Please open an issue or a pull request.
## Citation
If you find this project useful, please cite it as:
```bibtex
@misc{Babu_2023,
author={Babu, Harisankar},
title={Reinforcement Learning Based Path Planning for Autonomous Flight},
url={https://publica.fraunhofer.de/handle/publica/442672},
year={2023},
month={Jan},
}
```
## References
- [Gymnasium](https://gymnasium.farama.org/)
- [OpenAI Gym](https://arxiv.org/abs/1606.01540)
- [Stable Baselines 3](http://jmlr.org/papers/v22/20-1364.html)
Raw data
{
"_id": null,
"home_page": "https://github.com/harisankar95/voxelgym2D.git",
"name": "voxelgym2D",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "reinforcement-learning,machine-learning,gym,openai,python,gymnasium",
"author": "Harisankar Babu",
"author_email": "harisankar995@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/12/32/375411b211e87085d9173fb9f74f7de0cdc8145606e5524a1c6c69733bd7/voxelgym2D-0.3.2.post1.tar.gz",
"platform": "any",
"description": "# voxelgym2D\n\n[![MIT License](https://img.shields.io/github/license/harisankar95/voxelgym2D)](LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/voxelgym2D)](https://pypi.org/project/voxelgym2D/)\n[![Pipeline](https://github.com/harisankar95/voxelgym2D/actions/workflows/test-main.yml/badge.svg?branch=main)](https://github.com/harisankar95/voxelgym2D/actions/workflows/test-main.yml)\n[![codestyle](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nA gymnasium environment for voxel/grid based reinforcement learning for path planning.\n\n<div id=\"solution-table\">\n <table>\n <tr>\n <td style=\"padding:10px\">\n <img src=\"https://github.com/harisankar95/voxelgym2D/raw/main/resources/solution_1.gif\" width=\"375\"/>\n </td>\n <td style=\"padding:10px\">\n <img src=\"https://github.com/harisankar95/voxelgym2D/raw/main/resources/solution_2.gif\" width=\"375\"/>\n </td>\n </tr>\n </table>\n</div>\n\n## Results with [SB3](https://github.com/DLR-RM/stable-baselines3) (v1.6.2) : PPO :smile:\n\nHere are the results of training a PPO agent on the `onestep-v0` using the example [here](examples/train_ppo.py). Below you will find the episode reward and episode length over steps during training. As the agent learns, the episode reward increases and the episode length reduces are the agent learns to identify the goal and reach it in the shortest possible path.\n\n<div id=\"solution-table\">\n <table>\n <tr>\n <td style=\"padding:10px\">\n <img src=\"https://github.com/harisankar95/voxelgym2D/raw/main/resources/ep_reward.png\" width=\"375\"/>\n </td>\n <td style=\"padding:10px\">\n <img src=\"https://github.com/harisankar95/voxelgym2D/raw/main/resources/ep_length.png\" width=\"375\"/>\n </td>\n </tr>\n </table>\n</div>\n\n## Installation\n\n```bash\npip install git+https://github.com/harisankar95/voxelgym2D.git\n```\n\nor directly from PyPI :smile:\n\n```bash\npip install voxelgym2D\n```\n\n## Development\n\nTo install the package in development mode, run the following command in the root directory of the repository:\n\n```bash\ngit clone https://github.com/harisankar95/voxelgym2D.git ~/path/to/repo\ncd ~/path/to/repo\npip install -e .[dev]\n\n# to aditionally install stable_baselines 3 and pytorch (optional)\npip install -e .[dev,sb3]\n```\n\n## Usage\n\n```python\nimport voxelgym2D\nimport gymnasium as gym\n\nenv = gym.make(\"voxelgym2D:onestep-v0\")\nobservation, info = env.reset(seed=123456)\nenv.render()\n```\n\n## Examples\n\nThe examples can be found [here](examples).\n\n## License\n\nThis project is licensed under the terms of the [MIT license](LICENSE).\n\n## Documentation\n\nThe documentation can be found [here](https://harisankar95.github.io/voxelgym2D/).\n\n## Changelog\n\n### 0.1.0\n\n- Initial release of voxelgym 2D environments tested with stable_baselines 3 (v1.6.2) and python 3.8\n\n### 0.2.0\n\n- Available on PyPI, sphinx documentation in work\n\n### 0.3.0\n\n- Migration to gymnasium\n- Agent can now be reset to multiple start positions\n\n### 0.3.1\n\n- License updated\n- Documentation updated\n\n## TODO\n\n- [x] Add 2D environments\n- [ ] Add documentation\n\n## Contributing\n\nContributions are welcome! Please open an issue or a pull request.\n\n## Citation\n\nIf you find this project useful, please cite it as:\n\n```bibtex\n@misc{Babu_2023,\n author={Babu, Harisankar}, \n title={Reinforcement Learning Based Path Planning for Autonomous Flight},\n url={https://publica.fraunhofer.de/handle/publica/442672},\n year={2023}, \n month={Jan},\n}\n```\n\n## References\n\n- [Gymnasium](https://gymnasium.farama.org/)\n- [OpenAI Gym](https://arxiv.org/abs/1606.01540)\n- [Stable Baselines 3](http://jmlr.org/papers/v22/20-1364.html)\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Gym environment for 2D grid path planning",
"version": "0.3.2.post1",
"project_urls": {
"Homepage": "https://github.com/harisankar95/voxelgym2D.git"
},
"split_keywords": [
"reinforcement-learning",
"machine-learning",
"gym",
"openai",
"python",
"gymnasium"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "98e798aedf2e14e81fe7590e667b07bcdbf8db166bf66f2c3df501e213ac573a",
"md5": "61071a72e53bce75efe531243f0c48e9",
"sha256": "2cd13d3889e40485205019ac998476306354620b762e33a1d4e1e45ac710a317"
},
"downloads": -1,
"filename": "voxelgym2D-0.3.2.post1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "61071a72e53bce75efe531243f0c48e9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 38936,
"upload_time": "2024-02-28T12:15:15",
"upload_time_iso_8601": "2024-02-28T12:15:15.375022Z",
"url": "https://files.pythonhosted.org/packages/98/e7/98aedf2e14e81fe7590e667b07bcdbf8db166bf66f2c3df501e213ac573a/voxelgym2D-0.3.2.post1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1232375411b211e87085d9173fb9f74f7de0cdc8145606e5524a1c6c69733bd7",
"md5": "72b8382304dd14995d35a53521017107",
"sha256": "f05ee0688579a0ec9a52ee5f19583c5f44fa2d820fee5e2f7af169a023d93713"
},
"downloads": -1,
"filename": "voxelgym2D-0.3.2.post1.tar.gz",
"has_sig": false,
"md5_digest": "72b8382304dd14995d35a53521017107",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 34653,
"upload_time": "2024-02-28T12:15:17",
"upload_time_iso_8601": "2024-02-28T12:15:17.367503Z",
"url": "https://files.pythonhosted.org/packages/12/32/375411b211e87085d9173fb9f74f7de0cdc8145606e5524a1c6c69733bd7/voxelgym2D-0.3.2.post1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-28 12:15:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "harisankar95",
"github_project": "voxelgym2D",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "voxelgym2d"
}