movement_primitives.spring_damper.SpringDamperOrientation

class movement_primitives.spring_damper.SpringDamperOrientation(dt=0.01, k=1.0, c=None, int_dt=0.001)

Bases: PointToPointMovement

Spring-damper system for quaternions.

This is similar to a Quaternion DMP without the forcing term.

Parameters:
dtfloat, optional (default: 0.01)

Time difference between DMP steps.

kfloat, optional (default: 1)

Spring constant.

cfloat, optional (default: 2 * sqrt(k) (critical damping))

Damping coefficient.

int_dtfloat, optional (default: 0.001)

Time difference for Euler integration.

Methods

configure([t, start_y, start_yd, start_ydd, ...])

Set meta parameters.

n_steps_open_loop(last_y, last_yd, n_steps)

Perform 'n_steps' steps.

open_loop([run_t, coupling_term])

Run open loop.

reset()

Reset time.

step(last_y, last_yd[, coupling_term])

Perform step.

__init__(dt=0.01, k=1.0, c=None, int_dt=0.001)

Methods

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

configure([t, start_y, start_yd, start_ydd, ...])

Set meta parameters.

n_steps_open_loop(last_y, last_yd, n_steps)

Perform 'n_steps' steps.

open_loop([run_t, coupling_term])

Run open loop.

reset()

Reset time.

step(last_y, last_yd[, coupling_term])

Perform step.

configure(t=None, start_y=None, start_yd=None, start_ydd=None, goal_y=None, goal_yd=None, goal_ydd=None)

Set meta parameters.

Parameters:
tfloat, optional

Time at current step.

start_yarray, shape (n_dims,)

Initial state.

start_ydarray, shape (n_vel_dims,)

Initial velocity.

start_yddarray, shape (n_vel_dims,)

Initial acceleration.

goal_yarray, shape (n_dims,)

Goal state.

goal_ydarray, shape (n_vel_dims,)

Goal velocity.

goal_yddarray, shape (n_vel_dims,)

Goal acceleration.

n_steps_open_loop(last_y, last_yd, n_steps)

Perform ‘n_steps’ steps.

Parameters:
last_yarray, shape (n_dims,)

Last state.

last_ydarray, shape (n_dims,)

Last time derivative of state (e.g., velocity).

n_stepsint

Number of steps.

Returns:
yarray, shape (n_dims,)

Next state.

ydarray, shape (n_dims,)

Next time derivative of state (e.g., velocity).

open_loop(run_t=1.0, coupling_term=None)

Run open loop.

Parameters:
run_tfloat, optional (default: execution_time)

Run time. Can be shorter or longer than execution_time.

coupling_termobject, optional (default: None)

Coupling term that will be added to velocity.

Returns:
Tarray, shape (n_steps,)

Time for each step.

Yarray, shape (n_steps, n_dims)

State at each step.

reset()

Reset time.

step(last_y, last_yd, coupling_term=None)

Perform step.

Parameters:
last_yarray, shape (n_dims,)

Last state.

last_ydarray, shape (n_dims,)

Last time derivative of state (e.g., velocity).

coupling_termobject, optional (default: None)

Coupling term that will be added to velocity.

Returns:
yarray, shape (n_dims,)

Next state.

ydarray, shape (n_dims,)

Next time derivative of state (e.g., velocity).