Project Website: https://siddancha.github.io/projects/active-safety-envelopes-with-guarantees
This is the official code for our paper:
Siddharth Ancha, Gaurav Pathak, Srinivasa Narasimhan, and David Held.
Active Safety Envelopes using Light Curtains with Probabilistic Guarantees.
In Proceedings of Robotics: Science and Systems (RSS), July 2021.
git clone --recursive [email protected]:CMU-Light-Curtains/SafetyEnvelopes.git
cd SafetyEnvelopes
Note: this repository uses Python 3.6+.
pip install fire easydict sacred stable-baselines3 Flask scikit-image pyzmq
3. Set up the light curtain simulator package Simulator
.
cd Simulator
mkdir build && cd build
ANACONDA_ENV_PATH=/path/to/anaconda/env
cmake -DCMAKE_BUILD_TYPE=Release \
-DPYTHON_EXECUTABLE:FILEPATH=$ANACONDA_ENV_PATH/bin/python \
-DPYTHON_LIBRARY=$ANACONDA_ENV_PATH/lib/libpython3.so \
-DPYTHON_INCLUDE_DIR=$ANACONDA_ENV_PATH/include/python3.7m ..
make -j
cd ../..
4. Set up the light curtain planning and optimization package ConstraintGraph
.
cd ConstraintGraph
mkdir build && cd build
ANACONDA_ENV_PATH=/path/to/anaconda/env
cmake -DCMAKE_BUILD_TYPE=Release \
-DBIND_PY=ON \
-DPYTHON_EXECUTABLE:FILEPATH=$ANACONDA_ENV_PATH/bin/python \
-DPYTHON_LIBRARY=$ANACONDA_ENV_PATH/lib/libpython3.so \
-DPYTHON_INCLUDE_DIR=$ANACONDA_ENV_PATH/include/python3.7m ..
make -j
cd ../..
cd cpp
mkdir build && cd build
ANACONDA_ENV_PATH=/path/to/anaconda/env
cmake -DCMAKE_BUILD_TYPE=Release \
-DPYTHON_EXECUTABLE:FILEPATH=$ANACONDA_ENV_PATH/bin/python \
-DPYTHON_LIBRARY=$ANACONDA_ENV_PATH/lib/libpython3.so \
-DPYTHON_INCLUDE_DIR=$ANACONDA_ENV_PATH/include/python3.7m ..
make -j
cd ../..
Note: $DATADIR/synthia
should be the location of the SYNTHIA-AL dataset.
# Ideally add these to your .bashrc file
export DATADIR=/path/to/data/dir
export SE_DIR=/path/to/SafetyEnvelopes
export PYTHONPATH=$PYTHONPATH:$SE_DIR:$SE_DIR/Simulator/python:$SE_DIR/ConstraintGraph/apis/py:$SE_DIR/cpp/build
python data/synthia.py create_video_infos_file --split=mini_train # creates video info file in $DATADIR
In separate windows, run:
python ./visualizer/backend/backend.py --actor=ACTOR_NAME --horizon=HORIZON --load_weights_from_run=RUN_ID
cd ./visualizer/frontend
python -m http.server
The following set of commands fully reproduces all experiments in our paper.
python dagger.py with bevnet_all -p -m sacred
python dagger.py with bevnet_all env.use_random_curtain=True -p -m sacred
python dagger.py with cnn1d_all -p -m sacred
python dagger.py with cnn1d_all env.use_random_curtain=True -p -m sacred
python dagger.py with vres_all -p -m sacred
python dagger.py with vres_all env.use_random_curtain=True -p -m sacred
- Change to
gt_action = prev_frame.annos["se_ranges"].copy()
in line 256 ofenvs/env.py
- Appropriately modify
policies/actors/nn/networks/bevnet.py
.
python dagger.py with bevnet_all bevnet.history=2 -p -m sacred
python dagger.py with bevnet_all bevnet.history=2 env.use_random_curtain=True -p -m sacred
python eval/main.py --actor=BaselineActor --horizon=50 --split=mini_test
python eval/main.py --actor=BaselineActor --horizon=50 --split=mini_test with env.use_random_curtain=True
python eval/main.py --actor=BevNet --horizon=50 --split=mini_test --load_weights_from_run=154
python eval/main.py --actor=BevNet --horizon=50 --split=mini_test --load_weights_from_run=154 with env.use_random_curtain=True