https://github.com/sash-a/hrl_pybullet_envs
Locomotion HRL envs in pybullet
https://github.com/sash-a/hrl_pybullet_envs
heirarchicalrl hrl pybullet reinforcement-learning-environments
Last synced: 8 months ago
JSON representation
Locomotion HRL envs in pybullet
- Host: GitHub
- URL: https://github.com/sash-a/hrl_pybullet_envs
- Owner: sash-a
- License: gpl-3.0
- Created: 2021-02-21T12:40:26.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-30T10:58:25.000Z (over 4 years ago)
- Last Synced: 2025-04-28T12:10:00.369Z (8 months ago)
- Topics: heirarchicalrl, hrl, pybullet, reinforcement-learning-environments
- Language: Python
- Homepage:
- Size: 189 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Hierarchical Reinforcement envs in pybullet
This package was created because all of the HRL locomotion envs are only available in mujoco. This is an implementation of as many as possible in pybullet.
### Install
`pip install pybullet hrl_pybullet_envs`
This project requires [pybullet-gym](https://github.com/benelot/pybullet-gym/) which must be installed along side this package.
### Envs:
* AntGatherBulletEnv-v0
* AntMazeBulletEnv-v0
* AntMjBulletEnv-0
* AntFlagrunBulletEnv-v0
* PointGatherBulletEnv-v0
### Example
Also see [this notebook](https://colab.research.google.com/drive/17FX7UM1-DDb3oxg1ei64dw9Xa6JFE_zF?usp=sharing)
```
import hrl_pybullet_envs
import gym
import numpy as np
env = gym.make('AntGatherBulletEnv-v0')
env.render()
ob = env.reset()
tot_rew = 0
for i in range(1000):
# Take random actions
ob, rew, done, _ = env.step(np.random.uniform(-1, 1, env.action_space.shape))
tot_rew += rew
if done: break
print(f'Achieved total reward of: {tot_rew}')
```