Skip to content

idiap/mp-df-ds

Repository files navigation

From Movement Primitives to Distance Fields to Dynamical Systems

📄 Paper | 🌐 Interactive Webpage


A simple module to represent trajectories using quadratic splines, enabling smooth transitions from movement primitives to distance fields and dynamical systems—all with analytical gradients and PyTorch support.


What is this?

This project provides a simple and lightweight implementation to convert a trajectory into:

  • Movement Primitives (MP)
  • Distance Fields (DF)
  • Dynamical Systems (DS)

by representing it as a series of concatenated quadratic splines. Thanks to the analytical gradients, it's easy to compute distances and directions at any point around the trajectory.


Key Features

  • ✅ Minimal dependencies (built with PyTorch, no heavy libraries needed)
  • ✅ Fully vectorized and parallelizable
  • ✅ Supports gradient-based learning, optimization, and control
  • Efficient computation

Requirements

  • pytorch
  • numpy
  • matplotlib

Project Structure

File Description
data Trajectories for testing
quadratic_spline.py Core implementation of spline representation and gradient computation
run_mp_df_ds.py Example: Convert a quadratic spline into distance field, and dynamical system
run_single_traj.py Similar to above, but for a trajectory that represented using discrete points
run_multiple_traj.py Combine and fuse multiple trajectories
run_LASA.py Run experiments on the LASA dataset (requires pylasadataset)

Citation

If you find this work useful in your research, please cite:

@article{Li25arXiv,
	author={Li, Y. and Calinon, S.},
	title={From Movement Primitives to Distance Fields to Dynamical Systems},
	journal={arXiv:2504.09705},
	year={2025}
}

This code is maintained by Yiming LI and licensed under the MIT License.

Copyright (c) 2025 Idiap Research Institute [email protected]

About

From Movement Primitives to Distance Fields to Dynamical Systems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages