cozmo.action

Actions encapsulate specific high-level tasks that the Cozmo robot can perform. They have a definite beginning and end.

These tasks include picking up an object, rotating in place, saying text, etc.

Actions are usually triggered by a call to a method on the cozmo.robot.Robot class such as turn_in_place()

The call will return an object that subclasses Action that can be used to cancel the action, or be observed to wait or be notified when the action completes (or fails) by calling its wait_for() or add_event_handler() methods.

Warning

Unless you pass in_parallel=True when starting the action, no other action can be active at the same time. Attempting to trigger a non-parallel action when another action is already in progress will result in a RobotBusy exception being raised.

When using in_parallel=True you may see an action fail with the result ActionResults.TRACKS_LOCKED - this indicates that another in-progress action has already locked that movement track (e.g. two actions cannot move the head at the same time).

Module Attributes

ACTION_IDLE

Action idle state

ACTION_RUNNING

Action running state

ACTION_SUCCEEDED

Action succeeded state

ACTION_FAILED

Action failed state

ACTION_ABORTING

Action failed state

Classes

Action(*, conn, robot, **kw)

An action holds the state of an in-progress robot action

ActionResults()

The possible result values for an Action.

EvtActionCompleted(**kwargs)

Triggered when a robot action has completed or failed.

EvtActionStarted(**kwargs)

Triggered when a robot starts an action.