RealEngine: Simulating Autonomous Driving in Realistic Context

June 3, 2025 Β· View on GitHub

[Project] [Paper]

RealEngine: Simulating Autonomous Driving in Realistic Context,
Junzhe Jiang, Nan Song, Jingyu Li, Xiatian Zhu, Li Zhang

Official implementation of "RealEngine: Simulating Autonomous Driving in Realistic Context".

πŸ› οΈ Pipeline


▢️ Get started

πŸ“¦ Environment

  1. Prepare the environment.
# Clone the repo.
git clone https://github.com/fudan-zvg/RealEngine.git
cd RealEngine

# Make a conda environment.
conda create --name realengine python=3.9
conda activate realengine

# Install PyTorch according to your CUDA version
# CUDA 11.7
pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2

# Install nuplan devkits
git clone https://github.com/motional/nuplan-devkit.git && cd nuplan-devkit
pip install -e .

# Install raytracing
git clone https://github.com/ashawkey/raytracing
cd raytracing
pip install .
  1. Install and download Navsim-mini as Navsim install, and download RealEngine scene checkpoints in HuggingFace RealEngine. The folder tree is as follows:
dataset
β”œβ”€β”€ openscene
β”‚   β”œβ”€β”€ maps
β”‚   └── openscene-v1.1
β”‚       β”œβ”€β”€ navsim_logs
β”‚       └── sensor_blobs
└── realengine
    β”œβ”€β”€ background
    β”‚   β”œβ”€β”€ cam
    β”‚   └── lidar
    β”œβ”€β”€ irrmaps
    β”œβ”€β”€ relighting
    └── vehicles

Then, build cache for navsim-mini

chmod +x scripts/evaluation/run_metric_caching.sh
./scripts/evaluation/run_metric_caching.sh
  1. For the DriveX and GSLiDAR submodules, please refer to their respective README.md files for installation instructions.

  2. Download navsim AD agent checkpoints to ./model.

AgentCheckpoint
TransFusertransfuser_seed_0.ckpt
VADvad_epoch_99.ckpt
DiffusionDrivediffusiondrive_navsim_88p1_PDMS.pth

The folder tree is as follows:

model
β”œβ”€β”€ diffusiondrive_navsim_88p1_PDMS.pth
β”œβ”€β”€ kmeans_navsim_traj_20.npy
β”œβ”€β”€ transfuser_seed_0.ckpt
└── vad_epoch_99.ckpt
  1. Due to the complexity of the environment setup, we provide the final pip list of our environment to facilitate verification and reproducibility.

πŸš— Evaluating

You can use the following command to simulating autonomous driving in realistic context.

# DiffusionDrive
# Non-reactive simulation.
CUDA_VISIBLE_DEVICES=0 python navsim/planning/script/run_pdm_score_with_render_base.py \
train_test_split=mini agent=diffusiondrive_agent worker=single_machine_thread_pool \
agent.checkpoint_path=model/diffusiondrive_navsim_88p1_PDMS.pth \
experiment_name=diffusiondrive_agent_eval

# Safety test simulation.
CUDA_VISIBLE_DEVICES=1 python navsim/planning/script/run_pdm_score_with_render_edit.py \
train_test_split=mini agent=diffusiondrive_agent worker=single_machine_thread_pool \
agent.checkpoint_path=model/diffusiondrive_navsim_88p1_PDMS.pth \
experiment_name=diffusiondrive_agent_eval

# Multi-agent interaction simulation.
CUDA_VISIBLE_DEVICES=1 python navsim/planning/script/run_pdm_score_with_render_multi_agent.py \
train_test_split=mini agent=diffusiondrive_agent worker=single_machine_thread_pool \
agent.checkpoint_path=model/diffusiondrive_navsim_88p1_PDMS.pth \
experiment_name=diffusiondrive_agent_eval

πŸ—οΈ Design your custom test cases

You can use scripts/gui.py to construct the testing scenarios you require.

python scripts/gui.py

We model the trajectories using BΓ©zier curves, allowing you to freely configure the trajectories of the inserted vehicles by controlling four control points, as illustrated in the figure below.


πŸ“Š Benchmark

Non-reactive simulation

MethodLoopEgo stat.ImageLiDARNC ↑DAC ↑TTC ↑Comf. ↑EP ↑PDMS ↑
Constant velocityβœ“92.964.385.710029.446.8
Open-loop
ST-P3Open-loopβœ“βœ“92.971.492.910046.259.6
VADOpen-loopβœ“βœ“92.985.792.910048.566.1
TransFuserOpen-loopβœ“βœ“βœ“92.985.792.910055.969.1
DiffusionDriveOpen-loopβœ“βœ“βœ“92.985.792.910056.769.5
Closed-loop
ST-P3Closed-loopβœ“βœ“10064.385.710035.647.5
VADClosed-loopβœ“βœ“85.778.692.910034.353.0
TransFuserClosed-loopβœ“βœ“βœ“92.971.485.710046.057.9
DiffusionDriveClosed-loopβœ“βœ“βœ“92.971.492.910047.161.3
Ground truth
Human10010092.910068.383.8

Safety test simulation

MethodEgo stat.ImageLiDARNC ↑DAC ↑TTC ↑Conf. ↑EP ↑PDMS ↑
Constant velocityβœ“47.671.438.110036.736.3
ST-P3βœ“βœ“47.610042.910044.744.4
VADβœ“βœ“47.695.228.610041.237.0
TransFuserβœ“βœ“βœ“47.610038.110044.142.2
DiffusionDriveβœ“βœ“βœ“57.110052.410054.053.8

Multi-agent interaction simulation

MethodEgo stat.ImageLiDARNC ↑DAC ↑TTC ↑Conf. ↑EP ↑PDMS ↑
Constant velocityβœ“42.860.739.310027.827.4
ST-P3βœ“βœ“53.696.450.010044.646.3
VADβœ“βœ“32.171.432.110027.728.8
TransFuserβœ“βœ“βœ“60.796.453.610054.355.0
DiffusionDriveβœ“βœ“βœ“57.196.450.010051.751.9

πŸ“œ BibTeX

@article{jiang2025realengine,
    title={RealEngine: Simulating Autonomous Driving in Realistic Context},
    author={Jiang, Junzhe and Song, Nan and Li, Jingyu and Zhu, Xiatian and Zhang, Li},
    year={2025},
    journal={arXiv preprint arXiv:2505.16902},
}