cozmo.behavior

Behaviors represent a task that Cozmo may perform for an indefinite amount of time.

For example, the “LookAroundInPlace” behavior causes Cozmo to start looking around him (without driving), which will cause events such as cozmo.objects.EvtObjectObserved to be generated as he comes across objects.

Behaviors must be explicitly stopped before having the robot do something else (for example, pick up the object he just observed).

Behaviors are started by a call to cozmo.robot.Robot.start_behavior(), which returns a Behavior object. Calling the stop() method on that object terminate the behavior.

The BehaviorTypes class in this module holds a list of all available behaviors.

Module Attributes

BEHAVIOR_IDLE

Behavior idle state (not requested to run)

BEHAVIOR_REQUESTED

Behavior requested state (waiting for engine to start it)

BEHAVIOR_RUNNING

Behavior running state

BEHAVIOR_STOPPED

Behavior stopped state

Classes

Behavior(robot, behavior_type[, is_active])

A Behavior instance describes a behavior the robot is currently performing.

BehaviorTypes()

Defines all executable robot behaviors.

EvtBehaviorRequested(**kwargs)

Triggered when a behavior is requested to start.

EvtBehaviorStarted(**kwargs)

Triggered when a behavior starts running on the robot.

EvtBehaviorStopped(**kwargs)

Triggered when a behavior stops.