Companion code for the paper "Learning Robot Safety from Sparse Human Feedback using Conformal Prediction" by Aaron O. Feldman, Joseph A. Vincent, Maximilian Adang, Jun En Low, and Mac Schwager.
Please reach out to [email protected] for any code issues/questions.
Note: the following procedure was tested using a WSL2 linux environment on a computer with NVIDIA GPU
a. Navigate to conformal-safety-learning
b. Make a new conda environment: conda create --name cp-safety -y python=3.8
c. Activate the environment: conda activate cp-safety
d. Upgrade pip: python -m pip install --upgrade pip
e. Separately install nerfstudio, following https://docs.nerf.studio/quickstart/installation.html
(This can be skipped if you do not want to use nerf functionality)
f. Separately install clip, following https://github.com/openai/CLIP
(This can be skipped if you do not want to use CLIP on the visuomotor policy images)
g. Install other dependencies: pip install -e .
a. Open config.yml found at data\nerf_data\outputs\cp_1203_0\splatfacto\2024-12-03_150258
b. Under the line "data: &id003 !!python/object/apply:pathlib.PosixPath", modify the path to your absolute path to data/nerf_data/cp_1203_0, with a new hyphenated line for each subdirectory
c. Under the line "output_dir: !!python/object/apply:pathlib.PosixPath", similarly modify with the absolute path to data/nerf_data/outputs
a. To recreate experimental results, download zipped data at https://drive.google.com/file/d/1_Y5M49tdPjULlX6H2U2Bfk220svOM7uB/view?usp=drive_link
b. Extract the data and place it at conformal-safety-learning/data
a. Basic Tools: Contains scripts for basic functionality like simulation experiment setup, visualization, etc.
b. Conformal: Contains scripts for basic functionality like simulation experiment setup, visualization, etc.
c. Experiments: Contains scripts for generating the experimental results and figures
d. Policies: Contains scripts for control of drone
e. PolicyModification: Contains scripts for policy modification approaches
f. Transformers: Contains scripts for different representation learning approaches
g. Warning System: Contains scripts for warning system functions and subdirectory for baselines
a. Generate an experiment setup: python -m BasicTools.experiment_info with SAVE = True
b. Generate original policy: under Policies, run scp_mpc.py with SAVE=True
c. Generate warning system: under Experiments, run warning_demo.py
d. Generate modified policy: under Experiments, run backup_demo.py