Skip to content

CMU-IntentLab/AnySafeReachability

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnySafe: Adapting Latent Safety Filters at Runtime via Safety Constraint Parameterization in the Latent Space (ICRA, 2026)

Homepage   •   Paper   •   Video

This is the official repository for AnySafe: Adapting Latent Safety Filters at Runtime via Safety Constraint Parameterization in the Latent Space.

Flow Diagram


🗂️ Code Structure

git clone https://github.com/CMU-IntentLab/AnySafeReachability.git
cd AnySafeReachability

The project is organized into separate branches:

  • dubins: 3D Dubins Car. Link
git checkout dubins
  • franka: Implementation for real world experiment with Franka Panda arm. Link
git checkout franka

This repository provides the implementation of Constraint-Conditioned Latent Safety Filters for adapting safety behavior at runtime in robotics tasks both in simulation and hardware.


💻 Installation

# Clone the repository
git clone https://github.com/CMU-IntentLab/AnySafeReachability.git
git checkout franka
cd AnySafe Reachability

# Create and activate the conda environment
conda env create -f environment.yaml
conda activate anysafe

Full AnySafe Pipeline

🌍 Step 1: Train World Model

  1. Train decoder
python train_dino_decoder.py

The best decoder model is saved as checkpoints/testing_decoder.pth

  1. Train transistion model
python train_dino_wm.py

The best transistion model is saved as checkpoints/best_testing.pth

🧩 Step 2: Train Semantic Encoder

python dino_wm/train_failure_classifier.py

The best transistion model is saved as checkpoints_sem/encoder_priv.pth

You can download the pre-trained world model for the "Sweeper" task: sweeper model.

# Download sweeper world model with semantic encoder
pip install gdown
mkdir -p dino_wm/checkpoints_sem
gdown "https://drive.google.com/file/d/1AOBipzDxCQDCHAqT_ieUbocK8J2u9AlD/view?usp=sharing" \
    -O dino_wm/checkpoints_sem/encoder_priv.pth

🛡️ Step 3: Constraint-Conditioned Reachability

python scripts/run_training_ddpg-dinowm.py # save policy

You can download the pre-trained policy for the "Sweeper" task: sweeper policy.

# Download sweeper policy
pip install gdown
mkdir -p logs/dinowm/epoch_id_16
gdown "https://drive.google.com/file/d/1C3b9bYIZ6ayaGTkQKumICSArmGPJpDD1/view?usp=sharing" \
    -O logs/dinowm/epoch_id_16/rotvec_policy_priv.pth

🎯 Step 4: Conformal Prediction

python scripts/sweeper_cp.py

📈 Evaluation Tools

Coming soon!

🙏 Acknowledgements

This implementation builds on the following open-source projects:

  1. dreamerv3-pytorch
  2. HJReachability
  3. latent-safety
  4. UNISafe

If you build upon this work, please consider citing our research.

📄 Citation

@article{agrawal2025anysafe,
  title={AnySafe: Adapting Latent Safety Filters at Runtime via Safety Constraint Parameterization in the Latent Space},
  author={Agrawal, Sankalp and Seo, Junwon and Nakamura, Kensuke and Tian, Ran and Bajcsy, Andrea},
  journal={IEEE International Conference on Robotics and Automation (ICRA)},
  year={2026}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published