Event class

Dave Touretzky edited this page Dec 31, 2016 · 2 revisions

Event is the base class for all state machine events. The cozmo_fsm package provides its own event class and event router defined in evbase.py that are separate from the Cozmo SDK cozmo.event.Event mechanism. The SDK's event mechanism reports low-level robot events such as cubes being tapped or objects appearing and disappearing. These events all begin with "Evt", such as "EvtActionCompleted". The cozmo_fsm's Event class describes state machine events such as a node reporting success or failure, or one node signalling another.

The two event systems overlap in two areas: actions completing, and sensory events. A Cozmo action such as say_text will post an EvtActionCompleted event when the action ends, either successfully or not. A cozmo_fsm Say node will launch a say_text action, possibly restart it if the action fails due to a "robot busy" error, and eventualy post a cozmo_fsm CompletionEvent when the action succeeds and the state node completes.

cozmo_fsm includes "event generators" that listen for SDK events and generate corresponding cozmo_fsm Events. At present TapEvent and FaceEvent are the two sensory events supported, but more generators are planned.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.