Benchmark for Robustness Tests of Control Alrogithms
This repository contains classical control benchmarks for evaluating robustnesses of control and reinforcement learning algorithms. It can be used as zero-shot control performence evaluations. It is built upon OpenAI Gym.
Installation
Clone repository, then 'pip install -e .' or 'pip3 install -e .' based on your environment.
Or you can manually install dependencies:
- numpy
- gym
How to Run Example
You can run our test example by:
python unstable_pendulum.py
It's a inverted pendulum in gym environment. The sample results of the four different controllers are shown below:
Sine wave side wind | Random side wind |
---|---|
How to Use
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()
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"
Related Works
You can test the robustness of MPPI and Smooth_MPPI