/DTPP

[ICRA 2024] Differentiable Joint Conditional Prediction and Cost Evaluation for Tree Policy Planning

Primary LanguagePythonApache License 2.0Apache-2.0

DTPP

This repository contains the source code for the ICRA'24 paper:

DTPP: Differentiable Joint Conditional Prediction and Cost Evaluation for Tree Policy Planning in Autonomous Driving

Zhiyu Huang1, Peter Karkus2, Boris Ivanovic2, Yuxiao Chen2, Marco Pavone2,3, and Chen Lv1

1 Nanyang Technological University, 2 NVIDIA Research, 3 Stanford University

Getting Started

1. Configure devkit and environment

To set up your development environment, please follow these steps:

  • Download the nuPlan dataset and configure the dataset as described here.
  • Install the nuPlan devkit as instructed here (tested version: v1.2.2).
  • Clone the DTPP repository and enter the directory:
git clone https://github.com/MCZhi/DTPP.git && cd DTPP
  • Activate the environment created when installing the nuPlan-devkit:
conda activate nuplan
  • Install PyTorch:
conda install pytorch==2.0.1 pytorch-cuda=11.7 -c pytorch -c nvidia
  • Add the following environment variable to your ~/.bashrc file (customizable):
export NUPLAN_EXP_ROOT="$HOME/nuplan/exp"

2. Data processing

Before training the DTPP model, you need to preprocess the raw data from nuPlan using:

python data_process.py \
--data_path nuplan/dataset/nuplan-v1.1/splits/val \
--map_path nuplan/dataset/maps \
--save_path nuplan/processed_data

Three arguments are mandatory: --data_path to specify the path to the stored nuPlan dataset, --map_path to specify the path to the nuPlan map data, and --save_path to specify the path to save the processed data. Optionally, limit the number of scenarios with --total_scenarios argument.

3. Training

To train the DTPP model, run:

python train.py \
--train_set nuplan/processed_data/train \
--valid_set nuplan/processed_data/valid

Two arguments are mandatory: --train_set to specify the path to the processed training data and --valid_set to specify the path to the processed validation data.

Optional training parameters: --train_epochs, --batch_size, and --learning_rate.

4. Testing

To test the DTPP planning framework in nuPlan simulation scenarios, use:

python test.py \
--test_type closed_loop_nonreactive_agents \
--data_path nuplan/dataset/nuplan-v1.1/splits/test \
--map_path nuplan/dataset/maps \
--model_path base_model.pth \
--load_test_set

Choose one of the three options ('open_loop_boxes', 'closed_loop_nonreactive_agents', 'closed_loop_reactive_agents') for --test_type, and specify the path to your trained model --model_path. Ensure to provide --data_path and --map_path arguments as done in the data process step. Use --load_test_set and --model_path base_model.pth to test the performance of the base pre-trained model on selected testing scenarios.

Adjust the --scenarios_per_type argument to control the number of scenarios tested per type.

Ensure that the model parameters in planner.py under _initialize_model match those used in training.

Citation

If you find this project useful in your research, please consider citing:

@article{huang2023dtpp,
  title={DTPP: Differentiable joint conditional prediction and cost evaluation for tree policy planning in autonomous driving},
  author={Huang, Zhiyu and Karkus, Peter and Ivanovic, Boris and Chen, Yuxiao and Pavone, Marco and Lv, Chen},
  journal={arXiv preprint arXiv:2310.05885},
  year={2023}
}

Contact

If you have any questions or suggestions, please feel free to open an issue or contact us (zhiyu001@e.ntu.edu.sg).

(back to top)