roboglia.move.Sequence

class Sequence(name='SEQUENCE', frames=[], durations=[], times=1)[source]

Bases: object

A Sequence is an ordered list of of frames that have associated durations in seconds and can be played in a loop a number of times.

Parameters
  • name (str) – The name of the sequence

  • frames (list of Frame) – The frames contained in the sequence. The order in which the frames are listed is the order in which they will be played

  • durations (list of float) – The durations in seconds for each frame. If the length of the list is different than the length of the frames there will be a critical error logged and the sequence will not be loaded.

  • times (int) – The number of times the sequence should be played. Default is 1.

__init__(name='SEQUENCE', frames=[], durations=[], times=1)[source]

Initialize self. See help(type(self)) for accurate signature.

property name

The name of the sequence.

property frames

The list of Frame in the sequence.

property durations

The durations associated with each frame.

property times

The number of times the sequence will be played in a loop.

play(reverse=False)[source]

Plays the sequence. Produces an iterator over all the frames, repeating as many times as requested.

Parameters

reverse (bool) – Indicates if the frames should be played in reverse order.

Returns

commands is the list of (pos, vel, load) for each joint from the frame, and duration is the specified duration for the frame.

Return type

iterator of tuple (commands, duration)