Fork me on GitHub

Representation

Everything that has to be stored not only temporarily in BOLeRo is located in bolero.representation.

Behaviors

The purpose of this library is learning behaviors. Behaviors typically implement the interface Behavior. It is important to know that there are some conventions regarding the inputs and outputs of the generic behavior interface:

  • Often get_output and set_input deal with the same kind of data, e.g. a DMPBehavior generates a set of positions, velocities and accelerations in Cartesian space or in joint angle space and then they expect to get back the same information from a sensor that measures the actual positions, velocities and accelerations. However, that does not have to be the case for other kind of behaviors.
  • If a behavior generates multiple derivatives of the same attribute, e.g. positions, velocities and accelerations, it is not per se clear which layout would be to best to put these information in a flat vector. We agreed that all positions (p), all velocities (v) and all accelerations (a) should be stored contiguously, e.g. when the behavior controls 3 joints, the output would have the layout pppvvvaaa. The reason is that it is easy to extract e.g. the position vector with a slice from the output vector.

The following table gives an overview of the behaviors that are provided by BOLeRo.

Behavior name Usecase Inputs Outputs Parameters
Constant anything anything constant none
Random anything anything random none
Linear anything anything linear combination of the inputs weights of the linear mapping
Dummy function optimization parameters will be used as output allows direct optimization of the objective function
Dynamical Movement Primitive trajectories in joint space or Cartesian space positions, velocities, accelerations positions, velocities, accelerations weights of the internal function approximator
Sequence of DMPs trajectories in joint space positions, velocities, accelerations positions, velocities, accelerations weights of the internal function approximators and subgoals

Constant Behavior

A ConstantBehavior always produces a constant output that cannot be changed. It can be used as a behavior baseline.

Random Behavior

A RandomBehavior always produces a random output that is completely random and normal distributed. It can be used as a behavior baseline.

Linear Behavior

A LinearBehavior generates a linear mapping \(y = W x\) from an input vector \(x\) (with an additional bias component that is always 1) to an output vector \(y\).

Dummy Behavior

A DummyBehavior always produces the output that has been given as parameters from the optimizer. It can be used in cases where no behavior is required actually, e.g. for plain function optimization or where the behavior is encoded in the environment.

Dynamical Movement Primitive

Dynamical movement primitives represent trajectories DMPBehavior, e.g. in joint space. They can generalize over several meta-parameters (goal, velocity at the goal, execution time) and can be learned from demonstrations. A variant of DMPs that works in Cartesian space is CartesianDMPBehavior.

Examples using bolero.representation.DMPBehavior

Examples using bolero.representation.CartesianDMPBehavior

Sequence of DMPs

We can learn a sequence of DMPs. In the class DMPSequence allows us to optimize the DMP weights and the subgoals of the DMPs.