This repository contains classical control benchmarks for evaluating robustnesses of control and reinforcement learning algorithms. It can be used as zero-shot control performance evaluations. It is built upon OpenAI Gym.
Clone repository, then 'pip install -e .' or 'pip3 install -e .' based on your environment.
Or you can manually install dependencies:
- numpy
- gym
You can run our test example by:
For pendulum,
python unstable_pendulum.py
For cartpole(continuous action),
python unstable_cartpole_cont.py
It's an inverted pendulum in gym environment. The sample results of the two different winds are shown below:
Sine wave side wind | Random side wind |
---|---|
It's a cartpole (continuous action) environment. The sample results of the two different winds are shown below:
Sine wave side wind | Random side wind |
---|---|
Simply import environments from 'unstable_gym'. For examples, for inverted pendulum:
from unstable_gym.unstable_pendulum import UnstablePendulumEnv
env = UnstablePendulumEnv(wind_type="sine", max_wind=1.0)
obs = env.reset()
for step in range(500):
action = env.action_space.sample()
nobs, reward, done, info = env.step(action)
env.render()
For cartpole:
from unstable_gym.unstable_cartpole_cont import UnstableCartPoleContEnv
env = UnstableCartPoleContEnv(wind_type="sine", max_wind=1.0)
for ep in range(10):
obs = env.reset()
for step in range(1000):
action = env.action_space.sample()
nobs, reward, done, info = env.step(action)
env.render()
if done:
break
There are two options for "wind type":
- "sine" : sine wave side wind
- "random" : random side wind
You can also adjust the magnitude of the side wind (in [N]): "max_wind"
You can test the robustness of MPPI and Smooth_MPPI