BB.Kino.Shared.PubSubHandler (bb_kino v0.3.3)
View SourceCommon patterns for subscribing and unsubscribing from BB PubSub.
Used by widgets that need to receive real-time updates from robots.
Summary
Functions
Subscribes to one or more paths on a robot's PubSub.
Subscribes to all actuator messages.
Subscribes to all sensor messages.
Subscribes to state machine transitions.
Unsubscribes from one or more paths on a robot's PubSub.
Functions
Subscribes to one or more paths on a robot's PubSub.
Options
:message_types- list of message type modules to filter by
Examples
subscribe(MyRobot, [[:sensor], [:actuator]])
subscribe(MyRobot, [[:sensor, :joint1]], message_types: [BB.Message.Sensor.JointState])
Subscribes to all actuator messages.
Subscribes to all sensor messages.
@spec subscribe_state_machine(module()) :: :ok
Subscribes to state machine transitions.
State transitions are published to [:state_machine] and contain
from and to states.
Unsubscribes from one or more paths on a robot's PubSub.