Skip to main content

MP_PyTorch: The Movement Primitives Package in PyTorch

MP_PyTorch package focus on Movement Primitives(MPs) on Imitation Learning(IL) and Reinforcement Learning(RL) and provides convenient movement primitives interface implemented by PyTorch, including DMPs, ProMPs and ProDMPs. Users can also implement custom Movement Primitives according to the basis and phase generator. Further, advanced NN-based Movement Primitives Algorithm can also be realized according to the convenient PyTorch-based Interface. This package aims to building a movement primitives toolkit which could be combined with modern imitation learning and reinforcement learning algorithm.

 

Installation

For the installation we recommend you set up a conda environment or venv beforehand.

This package will automatically install the following dependencies: addict, numpy, pytorch and matplotlib.

1. Install from PyPI

pip install mp_pytorch

2. Install from source

git clone git@github.com:ALRhub/MP_PyTorch.git
cd mp_pytorch
pip install -e .

After installation, you can import the package easily.

import mp_pytorch
from mp_pytorch import MPFactory

 

Quickstart

For further information, please refer to the User Guide.

The main steps to create ProDMPs instance and generate trajectories are as follows:

1. Edit configuration

Suppose you have edited the required configuration. You can view the demo and check how to edit the configuration in Edit Configuration.

# config, times, params, params_L, init_time, init_pos, init_vel, demos = get_mp_utils("prodmp", True, True)

2. Initial prodmp instance and update inputs

mp = MPFactory.init_mp(**config)
mp.update_inputs(times=times, params=params, params_L=params_L,
                 init_time=init_time, init_pos=init_pos, init_vel=init_vel)

# you can also choose to learn parameters from demonstrations.
params_dict = mp.learn_mp_params_from_trajs(times, demos)

3. Generate trajectories

traj_dict = mp.get_trajs(get_pos=True, get_pos_cov=True,
                         get_pos_std=True, get_vel=True,
                         get_vel_cov=True, get_vel_std=True)

# for probablistic movement primitives, you can also choose to sample trajectories
samples, samples_vel = mp.sample_trajectories(num_smp=10)

The structure of this package can be seen as follows:

Types Classes Description
Phase Generator PhaseGenerator Interface for Phase Generators
RhythmicPhaseGenerator Rhythmic phase generator
SmoothPhaseGenerator Smooth phase generator
LinearPhaseGenerator Linear phase generator
ExpDecayPhaseGenerator Exponential decay phase generator
Basis Generator BasisGenerator Interface for Basis Generators
RhythmicBasisGenerator Rhythmic basis generator
NormalizedRBFBasisGenerator Normalized RBF basis generator
ProDMPBasisGenerator ProDMP basis generator
Movement Primitives MPFactory Create an MP instance given configuration
MPInterface Interface for Deterministic Movement Primitives
ProbabilisticMPInterface Interface for Probablistic Movement Primitives
DMP Dynamic Movement Primitives
ProMP Probablistic Movement Primitives
ProDMP Probablistic Dynamic Movement Primitives

 

Cite

If you interest this project and use it in a scientific publication, we would appreciate citations to the following information:

@article{li2023prodmp,
  title={ProDMP: A Unified Perspective on Dynamic and Probabilistic Movement Primitives},
  author={Li, Ge and Jin, Zeqi and Volpp, Michael and Otto, Fabian and Lioutikov, Rudolf and Neumann, Gerhard},
  journal={IEEE Robotics and Automation Letters},
  year={2023},
  publisher={IEEE}
}

 

Team

MP_PyTorch is developed and maintained by the ALR-Lab(Autonomous Learning Robots Lab), KIT.

Welcome to our GitHub Pages!

Metadata

Release files for mp-pytorch 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mp-pytorch 0.1.4
File Size Uploaded Provenance
mp_pytorch-0.1.4.tar.gz 50.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mp-pytorch 0.1.4
File Interpreter ABI Platform
mp_pytorch-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 109.9 kB

Release files / mp_pytorch-0.1.4.tar.gz

Download URL mp_pytorch-0.1.4.tar.gz
Size 50.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e276623453b0267ecf687d190c465d2200b08e99e632126b923834aed472e366
BLAKE2b-256 checksum
How to use checksums
2a64b64783a20ad184a36ca8c46b8cc63a1db31bbdbe780368aeb5f76b92b85c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release files / mp_pytorch-0.1.4-py3-none-any.whl

Download URL mp_pytorch-0.1.4-py3-none-any.whl
Size 59.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
793c876ef49a1547ac579d628f03d8370a0b4c61362e12920fc2ef3f7a32ee4e
BLAKE2b-256 checksum
How to use checksums
4e7a62485f8ad7c8767de58c037165ccbc0f50653ddd491031b5874796320435
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Security for mp-pytorch 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page