baxter-flowers / promplib

Python implementation of Probabilistic Motor Primitives including a ROS overlay to be used with JointTrajectory, JointState and RobotTrajectory, RobotState (Move It) messages
GNU Lesser General Public License v3.0
25 stars 11 forks source link

Vocal interactive learning of Clustered Probabilistic Movement Primitives

Python implementation of Probabilistic Movement Primitives (ProMP) with an optional ROS overlay.

Joint-space primitives with a task-space constraint

The primitives are stored in joint-space but demonstrations are provided both in joint space and task space, context. Thanks to this context, task-space goals can be requested to these joint-space primitives. The benefit is that requesting a new task-space goal does not require to call an IK method which would return demonstrations-agnostic joint configurations.

Vocal interactive learning and clustering

This work includes an interactive learning aspect which allows to automatically cluster motor primitives based on the standard deviation of their demonstrations. A new primitive is created automatically if the provided demonstration is out of 2 standard deviation of the existing primitives, otherwise the demonstration is distributed to an existing one.

Classes

Class diagram

In general it is a good idea to always use the highest level (ReplayableInteractiveProMP) to be able to reproduce and compare results, but (InteractiveProMP) has the same behaviour and API without file persistence, recorded primitives die at program closure.

Note: QCartProMP and NDProMP share the same concept, except that the first allows to set goals in cartesian space, the second in joint space. Depending of your usage your must select the primitive your need: QCartProMP handles most casual picking situations when the object pose is given in cartesian space, NDPRoMP is much more precise but requires to call in IK first since it only accepts joint space targets.

Usage

Direct usage with Baxter

This package works out-of-the-box on ROS + Baxter with the following dependencies installed:

Use a different robot

Using a different robot only requires replacing the forward kinematics -and optionnally inverse kinematics- class(es) to produce answers accordingly to your robot. The only constraint is that the constructors, get(...), and joints exist and keep the same signature.

Since this package is both non and non-ROS compatible, standard ROS messages for FK and IK are not used, so you must replace or overload these classes by respecting the format of the inputs/outputs described in the code.

The provided IK is optimization-based, you may keep this implementation and override only the FK or replace both.

Execute

Demonstrations are recorded and clustered in the mean time, through one of these methods:

Movements can be computed and played, through one of these methods: