Skip to main content

The Movement Primitives Package in PyTorch

Project description

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{li2022prodmps,
  title={ProDMPs: 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={arXiv preprint arXiv:2210.01531},
  year={2022}
}

 

Team

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

Welcome to our GitHub Pages!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mp_pytorch-0.1.2.tar.gz (47.8 kB view details)

Uploaded Source

Built Distribution

mp_pytorch-0.1.2-py3-none-any.whl (58.4 kB view details)

Uploaded Python 3

File details

Details for the file mp_pytorch-0.1.2.tar.gz.

File metadata

  • Download URL: mp_pytorch-0.1.2.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for mp_pytorch-0.1.2.tar.gz
Algorithm Hash digest
SHA256 17260a54989251ea700dd261b62da2b07694453cfa5ab522f69899f79089f5cc
MD5 cffd36d5d1ece4243e848823e55eee9d
BLAKE2b-256 66fbad164de78d185cac9ba41d7e29a891a2897d57e7d5a671bbd19392d58d79

See more details on using hashes here.

Provenance

File details

Details for the file mp_pytorch-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mp_pytorch-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 58.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for mp_pytorch-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3a37c4eea316fea29779a7689f7b56442a707eaef1ebd293daa7280507fa624e
MD5 fef5e1101669236fc419a1a2706536d9
BLAKE2b-256 e69517b76f16be94f0c220c10a6567500578c1b0d2b98e86870e48bbb9620231

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page