roboglia.move.StepLoop

class StepLoop(name='STEPLOOP', patience=1.0, times=1)[source]

Bases: roboglia.base.thread.BaseThread

A thread that runs in the background and runs a sequence of steps.

Parameters
  • name (str) – The name of the step loop.

  • patience (float) – A duration in seconds that the main thread will wait for the background thread to finish setup activities and indicate that it is in started mode.

  • times (int) – How many times the loop should be played. If a negative number is given (ex. -1) the loop will play to infinite

__init__(name='STEPLOOP', patience=1.0, times=1)[source]

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

play()[source]

Provides the step data. Should be overridden by subclasses and implement a yield logic. run() invokes next on this method to get the data and the duration needed to perform one step.

setup()[source]

Resets the loop from the begining.

run()[source]

Wraps the execution between the duration provided and decrements iteration run.

atomic(data)[source]

Executes the step.

Must be overridden in subclass to perform the specific operation on data.

property name

Returns the name of the thread.

pause()

Requests the thread to pause.

property paused

Indicates the thread was paused.

resume()

Requests the thread to resume.

property running

Indicates if the thread is running.

start(wait=True)

Starts the task in it’s own thread.

property started

Indicates if the thread was started.

stop(wait=True)

Sends the stopping signal to the thread. By default waits for the thread to finish.

property stopped

Indicates if the thread was stopped.

teardown()

Thread cleanup. Subclasses should override.