Skip to content

Code for the paper "Control Barriers in Bayesian Learning of System Dynamics"

Notifications You must be signed in to change notification settings

roothyb/Bayesian_CBF

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Control Barriers in Bayesian Learning of System Dynamics

Python package

Website

Demo

Installation

  1. If you are using a Python virtual environment, edit setup.bash to point to the activate script of the virtual environment. One way to do that is:
python3_ver () 
{ 
    python3 -V 2>&1 | sed -e 's/.*3.\([0-9]\).*/py3\1/'
}
mkdir -p .tox/
virtualenv --python=python3 .tox/$(python3_ver)
  1. Install gurobi. Edit setup.bash to set GUROBI_LIB_PATH

  2. Activate environment and install current package in edit mode

source setup.bash
pip install -e .

Run tests

pytest

Unicycle demos

  1. To run experiment where unicycle with mean CBF collides with the obstacle run

    python -c 'from bayes_cbf.unicycle_move_to_pose import unicycle_mean_cbf_collides_obstacle; unicycle_mean_cbf_collides_obstacle()'

  2. To run experiment where unicycle with Bayes CBF drives safely between the obstacles

    python -c 'from bayes_cbf.unicycle_move_to_pose import unicycle_bayes_cbf_safe_obstacle; unicycle_bayes_cbf_safe_obstacle()'

  3. To run experiment where unicycle gets stuck without learning run

    python -c 'from bayes_cbf.unicycle_move_to_pose import unicycle_no_learning_gets_stuck; unicycle_no_learning_gets_stuck()'

  4. To run experiment where unicycle passes safely through obstacles due to learning run

    python -c 'from bayes_cbf.unicycle_move_to_pose import unicycle_learning_helps_avoid_getting_stuck; unicycle_learning_helps_avoid_getting_stuck()'

Pendulum demos

  1. A script to run pendulum example with random controller (No learning)
run_pendulum_control_trivial
  1. A script to run pendulum example with CBF-CLF-controller (No learning)
run_pendulum_control_cbf_clf
  1. A script to run Bayesian learning on pendulum example with random controller.
pendulum_learn_dynamics
  1. A script to run Bayesian learning on pendulum example with CBF-CLF controller.
pendulum_control_online_learning

About

Code for the paper "Control Barriers in Bayesian Learning of System Dynamics"

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 57.9%
  • Python 42.0%
  • Other 0.1%