Skip to content

tier4/Diffusion-Planner

Β 
Β 

Repository files navigation

README

1. Setup

(Optional) create venv

sudo apt install python3-pip -y
sudo apt install python3-venv -y
python3 -m venv .venv
source ./.venv/bin/activate

Install libraries

# Diffusion-Planner
cd diffusion_planner
python -m pip install pip==24.1

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

# check torch
python3 -c "import torch; print(torch.cuda.is_available())"

# install ros-humble
./ros_scripts/download_ros-humble.sh

# prepare data_converter
./data_converter/build_data_converter.sh

2. Create dataset

2.1. Prepare rosbags

We assume the following directory structure:

driving_dataset$ tree . -L 2
.
β”œβ”€β”€ bag
β”‚   β”œβ”€β”€ 2024-07-18
β”‚   β”‚ β”œβ”€β”€ 10-05-28
β”‚   β”‚ β”œβ”€β”€ 10-05-51
β”‚   β”‚ β”œβ”€β”€ ...
β”‚   β”‚ β”œβ”€β”€ 16-10-07
β”‚   β”‚ └── 16-27-15
β”‚   β”œβ”€β”€ 2024-12-11
β”‚   β”œβ”€β”€ 2025-01-24
β”‚   β”œβ”€β”€ 2025-02-04
β”‚   β”œβ”€β”€ 2025-03-25
β”‚   └── 2025-04-16
└── map
     β”œβ”€β”€ 2024-07-18
     β”‚   β”œβ”€β”€ lanelet2_map.osm
     β”‚   β”œβ”€β”€ pointcloud_map_metadata.yaml
     β”‚   β”œβ”€β”€ pointcloud_map.pcd
     β”‚   └── stop_points.csv
     β”œβ”€β”€ 2024-12-11
     β”œβ”€β”€ 2025-01-24
     β”œβ”€β”€ 2025-02-04
     β”œβ”€β”€ 2025-03-25
     └── 2025-04-16

2.2. Convert to diffusion_planner's format (npz)

use parse_rosbag_for_directory.py directly.

python3 ./ros_scripts/parse_rosbag_for_directory.py <target_dir_list> --save_root <save_root> [--step <step>] [--limit <limit>]

2.3. Generate path_list.json

This script search *.npz files and create path_list.json.

python3 ./diffusion_planner/util_scripts/create_train_set_path.py <root_dir_list>

3. Train

Edit train_run.sh and run

cd ./diffusion_planner
./train_run.sh

About

[ICLR 2025 Oral] The official implementation of "Diffusion-Based Planning for Autonomous Driving with Flexible Guidance"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 84.6%
  • C++ 7.8%
  • TypeScript 5.5%
  • Shell 1.6%
  • JavaScript 0.3%
  • CMake 0.1%
  • CSS 0.1%