https://github.com/idiap/mp-df-ds
From Movement Primitives to Distance Fields to Dynamical Systems
https://github.com/idiap/mp-df-ds
Last synced: 3 months ago
JSON representation
From Movement Primitives to Distance Fields to Dynamical Systems
- Host: GitHub
- URL: https://github.com/idiap/mp-df-ds
- Owner: idiap
- License: mit
- Created: 2025-04-28T13:51:41.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-12T12:36:19.000Z (10 months ago)
- Last Synced: 2025-08-12T14:38:11.575Z (10 months ago)
- Language: Python
- Homepage: https://idiap.github.io/mp-df-ds/
- Size: 45.1 MB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# From Movement Primitives to Distance Fields to Dynamical Systems
[π Paper](https://arxiv.org/pdf/2504.09705) | [π Interactive Webpage](https://idiap.github.io/mp-df-ds/)
---
**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/JAX 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)
- β
Optional **JAX** implementation with matching API
- β
Fully vectorized and **parallelizable**
- β
Supports **gradient-based learning**, **optimization**, and **control**
- β
**Efficient** computation
## Requirements
- pytorch
- numpy
- matplotlib
- jax (optional, for JAX version)
## Project Structure
| File | Description |
|------|-------------|
| `data` | Trajectories for testing|
| `quadratic_spline.py` | Core implementation of spline representation and gradient computation |
| `quadratic_spline_jax.py` | JAX version of the core spline implementation (API aligned with PyTorch version) |
| `run_mp_df_ds.py` | Example: Convert a quadratic spline into distance field, and dynamical system |
| `run_mp_df_ds_jax.py` | JAX example mirroring `run_mp_df_ds.py` |
| `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](https://github.com/justagist/pyLasaDataset))
---
## Citation
If you find this work useful in your research, please cite:
```bibtex
@article{Li25RAL,
author={Li, Y. and Calinon, S.},
title={From Movement Primitives to Distance Fields to Dynamical Systems},
journal={{IEEE} Robotics and Automation Letters ({RA-L})},
year={2025},
volume={10},
number={9},
pages={9550--9556},
doi={10.1109/LRA.2025.3595073}
}
```
This code is maintained by Yiming LI and licensed under the MIT License.
Copyright (c) 2025 Idiap Research Institute