This repository implements Motion Planning Diffusion (MPD) - a method for learning and planning robot motions with diffusion models.
An older version of this project is deprecated, but still available at https://github.com/jacarvalho/mpd-public.
Please contact me if you have any questions -- joao@robot-learning.de
Pre-requisites:
- Ubuntu 22.04 (maybe works with newer versions)
- miniconda
Clone this repository
mkdir -p ~/Projects/MotionPlanningDiffusion/
cd ~/Projects/MotionPlanningDiffusion/
git clone --recurse-submodules git@github.com:joaoamcarvalho/mpd-splines-public.git mpd-splines-public
cd mpd-splines-publicDownload IsaacGym Preview 4 and extract it under deps/isaacgym
mv ~/Downloads/IsaacGym_Preview_4_Package.tar.gz ~/Projects/MotionPlanningDiffusion/mpd-splines-public/deps/
cd ~/Projects/MotionPlanningDiffusion/mpd-splines-public/deps
tar -xvf IsaacGym_Preview_4_Package.tar.gzRun the bash setup script to install everything (it can take a while).
bash setup.shMake sure to set environment variables and activate the conda environment before running any scripts.
source set_env_variables.sh
conda activate mpd-splines-publicDownload https://drive.google.com/file/d/1KG5ejn0g0KkDuUK6tPUqfmRYCNoKzK4K/view?usp=drive_link
tar -xvf data_public.tar.gz
ln -s data_public/data_trajectories data_trajectories
ln -s data_public/data_trained_models data_trained_modelsThe configuration files under scripts/inference/cfgs contain the hyperparameters for inference.
Inside the file scripts/inference/inference.py you can change the cfg_inference_path parameter to try models trained for different environments.
cd scripts/inference
python inference.pyGenerating data takes a long time, so we recommend downloading the dataset.
But if anyway you want to generate your own data, you can do it with the scripts in the scripts/generate_data folder.
Go to the scripts/generate_data folder.
The base script is
python generate_trajectories.pyTo generate multiple datasets in parallel, adapt the launch_generate_trajectories.py script.
python launch_generate_trajectories.pyAfter generating the data, run the post-processing file to combine all data into a hdf5 file. Then you can double the dataset by flipping the trajectory paths.
python post_process_trajectories.py --help
python flip_solution_paths.py (change the PATH_TO_DATASETS variable)To visualize the generated data, use the visualize_trajectories.py script.
python visualize_trajectories.pyThe training scripts are in the scripts/train folder.
The base script is
cd scripts/train
python train.pyTo train multiple models in parallel, use the launch_train_* files.
If you use our work or code base, please cite our articles:
@article{carvalho2025motion,
title={Motion planning diffusion: Learning and adapting robot motion planning with diffusion models},
author={Carvalho, Jo{\~a}o and Le, An T and Kicki, Piotr and Koert, Dorothea and Peters, Jan},
journal={IEEE Transactions on Robotics},
year={2025},
publisher={IEEE}
}
@inproceedings{carvalho2023motion,
title={Motion planning diffusion: Learning and planning of robot motions with diffusion models},
author={Carvalho, Jo{\~a}o and Le, An T and Baierl, Mark and Koert, Dorothea and Peters, Jan},
booktitle={IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
year={2023}
}Parts of this work and software were taken and/or inspired from:

