# RAP: Rasterization Augmented Planning

This repository contains the official implementation of RAP (Rasterization Augmented Planning).  
The code is organized into two main components:

---

## Repository Structure

- **`3d_rasterization/`**  
  Code for generating rasterized synthetic data from driving logs.  
  - `DriveEngine/process_data/create_openscene_metadata.py`  
    Generate rasterized **ego-trajectory data**.  
  - `DriveEngine/process_data/create_openscene_metadata_purturbed.py`  
    Generate **perturbed trajectory data** for counterfactual augmentation.  

- **`training/`**  
  Training code for RAP models. The pipeline follows the design of [NAVSIM](https://github.com/autonomousvision/navsim).  
  You can directly adapt NAVSIM’s training/evaluation commands by replacing the agent with RAP agents defined in this folder.

---

## Usage

### 1. Generate Synthetic Data
```bash
# Generate rasterized ego data
python 3d_rasterization/DriveEngine/process_data/create_openscene_metadata.py

# Generate perturbed trajectories
python 3d_rasterization/DriveEngine/process_data/create_openscene_metadata_purturbed.py
```

### 2. Train and Evaluate

Please refer to the NAVSIM documentation for details on training and evaluation.
This repo follows the same workflow. Replace the NAVSIM agent with RAP agents defined in training/.