Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org, ieee.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.5%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: ssaigarimella
  • License: other
  • Language: Python
  • Default Branch: main
  • Size: 40.3 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 1 year ago · Last pushed 10 months ago
Metadata Files
Readme License Citation

README.md

<<<<<<< HEAD

safe-control-gym

Physics-based CartPole and Quadrotor Gym environments (using PyBullet) with symbolic a priori dynamics (using CasADi) for learning-based control, and model-free and model-based reinforcement learning (RL).

These environments include (and evaluate) symbolic safety constraints and implement input, parameter, and dynamics disturbances to test the robustness and generalizability of control approaches. [PDF]

problem illustration

bibtex @article{brunke2021safe, title={Safe Learning in Robotics: From Learning-Based Control to Safe Reinforcement Learning}, author={Lukas Brunke and Melissa Greeff and Adam W. Hall and Zhaocong Yuan and Siqi Zhou and Jacopo Panerati and Angela P. Schoellig}, journal = {Annual Review of Control, Robotics, and Autonomous Systems}, year={2021}, url = {https://arxiv.org/abs/2108.06266}}

To reproduce the results in the article, see branch ar.

bibtex @article{yuan2021safecontrolgym, author={Yuan, Zhaocong and Hall, Adam W. and Zhou, Siqi and Brunke, Lukas and Greeff, Melissa and Panerati, Jacopo and Schoellig, Angela P.}, journal={IEEE Robotics and Automation Letters}, title={Safe-Control-Gym: A Unified Benchmark Suite for Safe Learning-Based Control and Reinforcement Learning in Robotics}, year={2022}, volume={7}, number={4}, pages={11142-11149}, doi={10.1109/LRA.2022.3196132}}

To reproduce the results in the article, see branch submission.

Install on Ubuntu/macOS

Clone repo

bash git clone https://github.com/utiasDSL/safe-control-gym.git cd safe-control-gym

(optional) Create a conda environment

Create and access a Python 3.10 environment using conda

bash conda create -n safe python=3.10 conda activate safe

Install

Install the safe-control-gym repository

bash python -m pip install --upgrade pip python -m pip install -e .

Note

You may need to separately install gmp, a dependency of pycddlib:

bash conda install -c anaconda gmp

or

bash sudo apt-get install libgmp-dev

#### (optional) Additional requirements for MPC

You may need to separately install acados for fast MPC implementations.

Architecture

Overview of safe-control-gym's API:

block diagram

Configuration

config

Getting Started

Familiarize with APIs and environments with the scripts in examples/

3D Quadrotor Lemniscate Trajectory Tracking with PID

bash cd ./examples/ # Navigate to the examples folder python3 pid/pid_experiment.py \ --algo pid \ --task quadrotor \ --overrides \ ./pid/config_overrides/quadrotor_3D/quadrotor_3D_tracking.yaml

systems trajectory

Cartpole Stabilization with LQR

bash cd ./examples/ # Navigate to the examples folder python3 lqr/lqr_experiment.py \ --algo lqr \ --task cartpole \ --overrides \ ./lqr/config_overrides/cartpole/cartpole_stabilization.yaml \ ./lqr/config_overrides/cartpole/lqr_cartpole_stabilization.yaml

2D Quadrotor Trajectory Tracking with PPO

bash cd ./examples/rl/ # Navigate to the RL examples folder python3 rl_experiment.py \ --algo ppo \ --task quadrotor \ --overrides \ ./config_overrides/quadrotor_2D/quadrotor_2D_track.yaml \ ./config_overrides/quadrotor_2D/ppo_quadrotor_2D.yaml \ --kv_overrides \ algo_config.training=False

Verbose API Example

bash cd ./examples/ # Navigate to the examples folder python3 no_controller/verbose_api.py \ --task cartpole \ --overrides no_controller/verbose_api.yaml

List of Implemented Controllers

List of Implemented Safety Filters

Performance

We compare the sample efficiency of safe-control-gym with the original OpenAI Cartpole and PyBullet Gym's Inverted Pendulum, as well as gym-pybullet-drones. We choose the default physic simulation integration step of each project. We report performance results for open-loop, random action inputs. Note that the Bullet engine frequency reported for safe-control-gym is typically much finer grained for improved fidelity. safe-control-gym quadrotor environment is not as light-weight as gym-pybullet-drones but provides the same order of magnitude speed-up and several more safety features/symbolic models.

| Environment | GUI | Control Freq. | PyBullet Freq. | Constraints & Disturbances^ | Speed-Up^^ | | :------------------------: | :----: | :------------: | :-------------: | :-------------------------------: | :-------------: | | Gym cartpole | True | 50Hz | N/A | No | 1.16x | | InvPenPyBulletEnv | False | 60Hz | 60Hz | No | 158.29x | | cartpole | True | 50Hz | 50Hz | No | 0.85x | | cartpole | False | 50Hz | 1000Hz | No | 24.73x | | cartpole | False | 50Hz | 1000Hz | Yes | 22.39x | | | | | | | | | gym-pyb-drones | True | 48Hz | 240Hz | No | 2.43x | | gym-pyb-drones | False | 50Hz | 1000Hz | No | 21.50x | | quadrotor | True | 60Hz | 240Hz | No | 0.74x | | quadrotor | False | 50Hz | 1000Hz | No | 9.28x | | quadrotor | False | 50Hz | 1000Hz | Yes | 7.62x |

^ Whether the environment includes a default set of constraints and disturbances

^^ Speed-up = Elapsed Simulation Time / Elapsed Wall Clock Time; on a 2.30GHz Quad-Core i7-1068NG7 with 32GB 3733MHz LPDDR4X; no GPU

Run Tests and Linting

Tests can be run locally by executing: bash python3 -m pytest ./tests/ # Run all tests

Linting can be run locally with: bash pre-commit install # Install the pre-commit hooks pre-commit autoupdate # Auto-update the version of the hooks pre-commit run --all # Run the hooks on all files

References

Related Open-source Projects


University of Toronto's Dynamic Systems Lab / Vector Institute for Artificial Intelligence

CS8803-DRL

c3128ed1da488819cce9b1341ec1e1bf8e586211

Owner

  • Login: ssaigarimella
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
preferred-citation:
  type: article
  authors:
  - family-names: "Brunke"
    given-names: "Lukas"
  - family-names: "Greeff"
    given-names: "Melissa"
  - family-names: "Hall"
    given-names: "Adam W."
  - family-names: "Yuan"
    given-names: "Zhaocong"
  - family-names: "Zhou"
    given-names: "SiQi"
  - family-names: "Panerati"
    given-names: "Jacopo"
    orcid: "https://orcid.org/0000-0003-2994-5422"
  - family-names: "Schoellig"
    given-names: "Angela P."
    orcid: "https://orcid.org/0000-0003-4012-4668"
  doi: "10.0000/00000"
  journal: "Annual Review of Control, Robotics, and Autonomous Systems"
  month: 1
  start: 1 # First page number
  end: 35 # Last page number
  title: "Safe Learning in Robotics: From Learning-Based Control to Safe Reinforcement Learning"
  issue: 1
  volume: 1
  year: 2021

GitHub Events

Total
  • Push event: 11
  • Public event: 1
  • Create event: 2
Last Year
  • Push event: 11
  • Public event: 1
  • Create event: 2

Dependencies

pyproject.toml pypi
  • Mosek ^10.0.18
  • PyYAML ^6.0
  • casadi ^3.6.0
  • cvxpy ^1.1.18
  • dict-deep ^4.1.2
  • gpytorch ^1.6.0
  • gymnasium ^0.28
  • imageio ^2.14.1
  • matplotlib ^3.5.1
  • munch ^2.5.0
  • mysql-connector-python 8.0.33
  • numpy ^1.22.1
  • optuna ^3.0
  • optuna-dashboard ^0.9
  • pre-commit ^3.3.2
  • pybullet ^3.2.0
  • pycddlib ^2.1.7
  • pymysql 1.1.1
  • pytest ^7.2.2
  • python ^3.10
  • pytope ^0.0.4
  • scikit-learn ^1.3.0
  • scikit-optimize ^0.9.0
  • tensorboard ^2.12.0
  • termcolor ^1.1.0
  • torch ^1.10.2
setup.py pypi
  • Mosek *
  • casadi *
  • cvxpy *
  • dict-deep *
  • gpytorch *
  • gymnasium *
  • imageio *
  • matplotlib *
  • munch *
  • mysql-connector-python *
  • numpy *
  • optuna *
  • optuna-dashboard *
  • pre-commit *
  • pybullet *
  • pycddlib *
  • pymysql *
  • pytest *
  • pytope *
  • pyyaml *
  • scikit-learn *
  • scikit-optimize *
  • tensorboard *
  • termcolor *
  • torch *