{"id":48274887,"url":"https://github.com/idiap/mp-df-ds","last_synced_at":"2026-04-04T22:25:38.340Z","repository":{"id":290381806,"uuid":"974258295","full_name":"idiap/mp-df-ds","owner":"idiap","description":"From Movement Primitives to Distance Fields to Dynamical Systems","archived":false,"fork":false,"pushed_at":"2025-08-12T12:36:19.000Z","size":47335,"stargazers_count":12,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-12T14:38:11.575Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://idiap.github.io/mp-df-ds/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idiap.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-28T13:51:41.000Z","updated_at":"2025-08-12T06:23:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"011f07f5-3c05-4567-8336-a384ced0814c","html_url":"https://github.com/idiap/mp-df-ds","commit_stats":null,"previous_names":["idiap/mp-df-ds"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/idiap/mp-df-ds","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fmp-df-ds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fmp-df-ds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fmp-df-ds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fmp-df-ds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idiap","download_url":"https://codeload.github.com/idiap/mp-df-ds/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fmp-df-ds/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31416764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-04T22:25:37.729Z","updated_at":"2026-04-04T22:25:38.325Z","avatar_url":"https://github.com/idiap.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# From Movement Primitives to Distance Fields to Dynamical Systems\n\n[📄 Paper](https://arxiv.org/pdf/2504.09705) | [🌐 Interactive Webpage](https://idiap.github.io/mp-df-ds/)\n\n---\n**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.**\n\n---\n\n## What is this?\n\nThis project provides a simple and lightweight implementation to convert a trajectory into:\n\n- **Movement Primitives (MP)**\n- **Distance Fields (DF)**\n- **Dynamical Systems (DS)**\n\nby 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.\n\n---\n\n## Key Features\n\n- ✅ Minimal dependencies (built with **PyTorch**, no heavy libraries needed)\n- ✅ Optional **JAX** implementation with matching API\n- ✅ Fully vectorized and **parallelizable**\n- ✅ Supports **gradient-based learning**, **optimization**, and **control**\n- ✅ **Efficient** computation\n\n## Requirements\n\n- pytorch\n- numpy\n- matplotlib\n- jax (optional, for JAX version)\n\n## Project Structure\n\n| File | Description |\n|------|-------------|\n| `data` | Trajectories for testing|\n| `quadratic_spline.py` | Core implementation of spline representation and gradient computation |\n| `quadratic_spline_jax.py` | JAX version of the core spline implementation (API aligned with PyTorch version) |\n| `run_mp_df_ds.py` | Example: Convert a quadratic spline into distance field, and dynamical system |\n| `run_mp_df_ds_jax.py` | JAX example mirroring `run_mp_df_ds.py` |\n| `run_single_traj.py` | Similar to above, but for a trajectory that represented using discrete points|\n| `run_multiple_traj.py` | Combine and fuse multiple trajectories |\n| `run_LASA.py` | Run experiments on the LASA dataset (requires [pylasadataset](https://github.com/justagist/pyLasaDataset)) \n---\n\n## Citation\n\nIf you find this work useful in your research, please cite:\n\n```bibtex\n@article{Li25RAL,\n    author={Li, Y. and Calinon, S.},\n    title={From Movement Primitives to Distance Fields to Dynamical Systems},\n    journal={{IEEE} Robotics and Automation Letters ({RA-L})},\n    year={2025},\n    volume={10}, \n    number={9},\n    pages={9550--9556},\n    doi={10.1109/LRA.2025.3595073}\n}\n```\n\nThis code is maintained by Yiming LI and licensed under the MIT License.\n\nCopyright (c) 2025 Idiap Research Institute \u003ccontact@idiap.ch\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidiap%2Fmp-df-ds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidiap%2Fmp-df-ds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidiap%2Fmp-df-ds/lists"}