pycozmo.behavior¶
Behavior representation and reading.
Functions
get_behavior_class_from_dict (data) |
Choose a behavior class, based on the behaviorClass JSON attribute. |
load_behaviors (resource_dir, cli) |
|
load_reaction_trigger_behavior_map (resource_dir) |
Classes
Behavior (cli, conf) |
Behavior representation class. |
BehaviorDriveOffCharger (cli, conf) |
|
BehaviorPlayAnim (cli, conf) |
Play a sequence of animation triggers. |
BehaviorPlayArbitraryAnim (cli, conf) |
Play a random animation trigger. |
BehaviorReactToCliff (cli, conf) |
ReactToCliff behavior - currently, just plays animation. |
ReactionTrigger (name, behavior_id, …) |
Reaction trigger representation class. |
-
class
pycozmo.behavior.
ReactionTrigger
(name: str, behavior_id: str, should_resume_last: Optional[bool] = False)¶ Bases:
object
Reaction trigger representation class.
-
behavior_id
¶
-
classmethod
from_json
(data: Dict[KT, VT])¶
-
name
¶
-
should_resume_last
¶
-
-
class
pycozmo.behavior.
Behavior
(cli: pycozmo.client.Client, conf: Any)¶ Bases:
pycozmo.event.Dispatcher
Behavior representation class.
-
activate
() → None¶
-
add_child_dispatcher
(child)¶
-
add_handler
(event, f, one_shot=False)¶
-
deactivate
() → None¶
-
del_all_handlers
()¶
-
del_child_dispatcher
(child)¶
-
del_handler
(event, handler)¶
-
dispatch
(event, *args, **kwargs)¶
-
get_id
() → str¶
-
wait_for
(evt, timeout: Optional[float] = None) → None¶
-
-
pycozmo.behavior.
load_behaviors
(resource_dir: str, cli: pycozmo.client.Client) → Dict[str, pycozmo.behavior.Behavior]¶
-
pycozmo.behavior.
load_reaction_trigger_behavior_map
(resource_dir: str) → Dict[str, pycozmo.behavior.ReactionTrigger]¶