This repository contains the implementation of three different failure probability estimation methods for robotic grasping tasks: Direct Estimation (DE), Importance Sampling (IS), and Adaptive Importance Sampling (AIS). Using a simulated robotic arm with a parallel-jaw gripper in PyBullet, we compare these methods in terms of efficiency, accuracy, and computational cost.
Reliable grasping is fundamental for robotic manipulation tasks, and understanding failure modes is crucial for deployment in real-world applications. This project aims to:
- Implement and compare three different approaches for estimating the probability of failures in robotic grasping
- Evaluate these methods in terms of sample efficiency, convergence rate, and failure case coverage
- Analyze the sources of discrepancies and propose validation techniques to ensure accurate estimation
- Clone this repository:
git clone https://github.com/jfrausto7/FPERG.git
cd FPERG- Create a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install the required packages:
pip install -r requirements.txtTo train a hill climbing grasping policy:
python train.py --episodes 2000 --gui # Use GUI for visualizationOptions:
--episodes: Number of training episodes (default: 2000)--gui: Use GUI mode instead of DIRECT mode (default: False)--load: Load existing policy (default: False)--eval: Evaluate only (no training) (default: False)
To run failure probability estimation experiments:
python main.py [OPTIONS]Options:
--gui: Use GUI mode instead of DIRECT mode--multiple N: Run N grasp attempts--seed N: Set random seed--hill: Use Hill Climbing policy instead of default policy--policy-file PATH: Path to policy file (default: src/best_hill_climbing_policy.pkl)
python main.py --estimate --trials 1000 --hillpython main.py --importance --trials 1000 --depth 1000 --hillpython main.py --adaptive_importance --trials 1000 --depth 1000 --hillTo run a comparison of all three methods with 1000 trials each:
python main.py --estimate --trials 1000 --hill
python main.py --importance --trials 1000 --depth 1000 --hill
python main.py --adaptive_importance --trials 1000 --depth 1000 --hillThe results will be saved in the results/ directory and printed to the console.
To visualize and compare results from different methods, use the analysis notebook.
- Yasmina Abukhadra (yasabukh@stanford.edu)
- Jacob Frausto (jfrausto@stanford.edu)
- Ian Lasic-Ellis (ianlasic@stanford.edu)


