Skip to content

CurryChen77/ForSim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ForSim: Stepwise Forward Simulation for Traffic Policy Fine-Tuning

Custom badge Custom badge

✨ News

  • 2026-03 Explore our project page, now live here🔗!
  • 2026-02 ForSim is accepted by ICRA 2026🎉🎉!
  • 2026-02 Our paper is available on arXiv📄!

This repository contains the implementation of the paper.

ForSim: Stepwise Forward Simulation for Traffic Policy Fine-Tuning

Keyu Chen1 , Wenchao Sun1, Hao Cheng1, Zheng Fu1, Sifa Zheng1

1School of Vehicle and Mobility, Tsinghua University

If you find our work useful, Please give us a star 🌟!

💫 ForSim achieves high-fidelity traffic simulation by combining stepwise closed-loop trajectory propagation with physical dynamics for multimodal diversity and interaction-aware agent updates for realistic behavioral consistency.

Method

TODO List

  • training code
  • initial repo & paper

Outline

Setup

Recommended system: Ubuntu 20.04 or 22.04

Step 1: Install Carla

mkdir carla
cd carla
wget https://carla-releases.s3.us-east-005.backblazeb2.com/Linux/CARLA_0.9.15.tar.gz
tar -xvf CARLA_0.9.15.tar.gz
cd Import && wget https://carla-releases.s3.us-east-005.backblazeb2.com/Linux/AdditionalMaps_0.9.15.tar.gz
cd .. && bash ImportAssets.sh
export CARLA_ROOT=YOUR_CARLA_PATH
echo "$CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.15-py3.7-linux-x86_64.egg" >> YOUR_CONDA_PATH/envs/YOUR_CONDA_ENV_NAME/lib/python3.7/site-packages/carla.pth # python 3.8 also works well, please set YOUR_CONDA_PATH and YOUR_CONDA_ENV_NAME

Step 2: Setup conda environment

conda create -n forsim python=3.8
conda activate forsim

Step 3: Clone this git repo in an appropriate folder

git clone git@github.com:CurryChen77/ForSim.git
cd ForSim

Step 4: Install packages

pip install -r requirements.txt
pip install -e .

Data and Ckpt

  • Carla Map Data

Doc of HD Map

Name Google Drive Approx. Size Storage Place
HD Map Data Link 714 MB Folder
Speed Limits Data Link 79 MB Folder
  • AV Checkpoint
AV Name Google Drive Approx. Size Storage Place
PlanT_medium Link 695 MB Folder
  • CBV Checkpoint
CBV Name Google Drive Approx. Size Storage Place
Pluto Link 51.4 MB Folder

Usage

Fine Tune CBV Policy

Run with Python

Parallel execution of Python scripts is allowed as long as each script is assigned a different CUDA_VISIBLE_DEVICES.

# Train forsim pluto
CUDA_VISIBLE_DEVICES=0 python scripts/run.py --ego_cfg pdm_lite.yaml --cbv_cfg forsim_pluto.yaml --mode train_cbv

Configure forward simulator

# Train forsim pluto
CUDA_VISIBLE_DEVICES=0 python scripts/run.py --ego_cfg pdm_lite.yaml --cbv_cfg forsim_pluto.yaml --mode train_cbv -s 0  -exp 'step_pred_greedy' datamodule.fwd_sim.name='step_tracker' datamodule.fwd_sim.others_rollout='pred'

# Eval forsim pluto
CUDA_VISIBLE_DEVICES=0 python scripts/run.py --ego_cfg pdm_lite.yaml --cbv_cfg forsim_pluto.yaml --mode eval --render -rep 1 -s 0  -exp 'step_pred_greedy' -pre_exp 'step_pred_greedy'

Run with Bash (with Resume)

Multiple Runs for Resume (Carla will crash for some reasons in Fine-tuning)

bash scripts/run_multi.sh \
  -t 3 \                         # max try
  -e pdm_lite.yaml \             # ego file
  -c forsim_pluto.yaml \         # cbv file
  -m train_cbv \                 # run mode (train_cbv, train_ego, eval, collect_data)
  -r 2 \                         # scenario repeat time
  -s 0 \                         # random seed
  -g 0 \                         # GPU_ID
  -v                             # render or not

Evaluation

Evaluating for specific CBV and AV

# Eval forsim pluto
CUDA_VISIBLE_DEVICES=0 python scripts/run.py --ego_cfg pdm_lite.yaml --cbv_cfg forsim_pluto.yaml --mode eval -rep 1

Plot Evaluation Result

  • Plot Speed and Acceleration Distribution
python tools/plot/plot_distribution.py
  • Plot Evaluation Results
python tools/plot/plot_eval_results.py

Visualization

# Eval forsim pluto
CUDA_VISIBLE_DEVICES=0 python scripts/run.py --ego_cfg pdm_lite.yaml --cbv_cfg forsim_pluto.yaml --mode eval --render -rep 1  # add --render

Citation

If you find our paper useful, please kindly cite us via:

@misc{chen2026forsimstepwiseforwardsimulation,
      title={ForSim: Stepwise Forward Simulation for Traffic Policy Fine-Tuning}, 
      author={Keyu Chen and Wenchao Sun and Hao Cheng and Zheng Fu and Sifa Zheng},
      year={2026},
      eprint={2602.01916},
      archivePrefix={arXiv},
      primaryClass={cs.RO},
      url={https://arxiv.org/abs/2602.01916}, 
}

Acknowledgement

This implementation is based on code from several repositories. We sincerely thank the authors for their awesome work.

About

[ICRA 2026] ForSim: Stepwise Forward Simulation for Traffic Policy Fine-Tuning

Resources

License

Stars

Watchers

Forks

Contributors