API Documentation

This is the detailed documentation of all public classes and functions. You can also search for specific modules, classes, or functions in the Index.

movement_primitives.dmp

Dynamical Movement Primitive (DMP)

This module provides implementations of various DMP types. DMPs consist of a goal-directed movement generated by the transformation system and a forcing term that defines the shape of the trajectory. They are time-dependent and usually converge to the goal after a constant execution time.

Every implementation is slightly different, but we use a similar notation for all of them:

  • \(y,\dot{y},\ddot{y}\) - position, velocity, and acceleration; these might be translation components only, orientation, or both

  • \(y_0\) - start position

  • \(g\) - goal of the movement (attractor of the DMP)

  • \(\tau\) - execution time

  • \(z\) - phase variable, starts at 1 and converges to 0

  • \(f(z)\) - forcing term, learned component that defines the shape of the movement

  • \(C_t\) - coupling term that is added to the acceleration of the DMP

DMP(n_dims[, execution_time, dt, ...])

Dynamical movement primitive (DMP).

DMPWithFinalVelocity(n_dims[, ...])

Dynamical movement primitive (DMP) with final velocity.

CartesianDMP([execution_time, dt, ...])

Cartesian dynamical movement primitive.

DualCartesianDMP([execution_time, dt, ...])

Dual cartesian dynamical movement primitive.

DMPBase(n_pos_dims, n_vel_dims)

Base class of Dynamical Movement Primitives (DMPs).

WeightParametersMixin()

Mixin class providing common access methods to forcing term weights.

CouplingTermPos1DToPos1D(desired_distance, lf)

Couples position components of a 2D DMP with a virtual spring.

CouplingTermObstacleAvoidance2D(...[, ...])

Coupling term for obstacle avoidance in 2D.

CouplingTermObstacleAvoidance3D(...[, ...])

Coupling term for obstacle avoidance in 3D.

CouplingTermPos3DToPos3D(desired_distance, lf)

Couples position components of a 6D DMP with a virtual spring in 3D.

CouplingTermDualCartesianPose(...[, ...])

Couples relative poses of dual Cartesian DMP.

CouplingTermObstacleAvoidance3D(...[, ...])

Coupling term for obstacle avoidance in 3D.

CouplingTermDualCartesianDistance(...[, k, ...])

Couples distance between 3D positions of a dual Cartesian DMP.

CouplingTermDualCartesianTrajectory(offset, ...)

Couples relative pose in dual Cartesian DMP with a given trajectory.

dmp_transformation_system(Y, V, alpha_y, ...)

Compute acceleration generated by transformation system of DMP.

canonical_system_alpha(goal_z, goal_t, start_t)

Compute parameter alpha of canonical system.

phase(t, alpha, goal_t, start_t[, int_dt, eps])

Map time to phase.

obstacle_avoidance_acceleration_2d(y, yd, ...)

Compute acceleration for obstacle avoidance in 2D.

obstacle_avoidance_acceleration_3d(y, yd, ...)

Compute acceleration for obstacle avoidance in 3D.

movement_primitives.promp

Probabilistic Movement Primitive (ProMP)

ProMPs represent distributions of trajectories.

ProMP(n_dims[, n_weights_per_dim])

Probabilistic Movement Primitive (ProMP).

movement_primitives.io

Input / Output

Input and output from and to files of movement primitives.

write_pickle(filename, obj)

Write object to pickle format.

read_pickle(filename)

Read object from pickle format.

write_yaml(filename, obj)

Write object to YAML format.

read_yaml(filename)

Read object from YAML format.

write_json(filename, obj)

Write object to JSON format.

read_json(filename)

Read object from JSON format.

movement_primitives.base

Base Classes

Base classes of movement primitives.

PointToPointMovement(n_pos_dims, n_vel_dims)

Base class for point to point movements (discrete motions).

movement_primitives.data

Data

Tools for loading datasets.

load_lasa(shape_idx)

Load demonstrations from LASA dataset.

generate_minimum_jerk(start, goal[, ...])

Create a minimum jerk trajectory.

generate_1d_trajectory_distribution(n_demos, ...)

Generates toy data for testing and demonstration.

movement_primitives.kinematics

Kinematics

Forward kinematics and a simple implementation of inverse kinematics.

Kinematics(urdf[, mesh_path])

Robot kinematics.

Chain(tm, joint_names, base_frame, ee_frame)

Kinematic chain.

movement_primitives.plot

Plotting Tools

Tools for plotting multi-dimensional trajectories.

plot_trajectory_in_rows(trajectory[, t, ...])

Plot trajectories of N dimensions in N 2D subplots.

plot_distribution_in_rows(mean, std_dev[, ...])

Plot distribution of N dimensions in N 2D subplots.

movement_primitives.visualization

Visualization Tools

3D visualization tools for movement primitives.

plot_pointcloud(fig, pcl_points, color[, ...])

Plot point cloud.

to_ellipsoid(mean, cov)

Compute error ellipsoid.

movement_primitives.dmp_potential_field

Potential Field of DMP

Visualization of DMP as potential field.

plot_potential_field_2d(ax, dmp, x_range, ...)

Plot 2D potential field of a DMP.

movement_primitives.spring_damper

Spring-Damper Based Attractors

Spring-damper based attractors are the basis of a DMP’s transformation system.

SpringDamper(n_dims[, dt, k, c, int_dt])

Spring-damper system.

SpringDamperOrientation([dt, k, c, int_dt])

Spring-damper system for quaternions.