Signal Types Reference

Copy Markdown View Source

All signal types emitted or routed by bb_jido. Type strings are stable public API.

Signals the bridge emits

These signals are produced by BB.Jido.PubSubBridge and cast into the agent via Jido.AgentServer.cast/2.

bb.state.transition

Robot state-machine transition.

FieldValue
:type"bb.state.transition"
:source"/bb/<robot module>"
:data.robotrobot module
:data.path[:state_machine]
:data.message%BB.Message{payload: %BB.StateMachine.Transition{from: from, to: to}}

bb.safety.error

Safety hardware error.

FieldValue
:type"bb.safety.error"
:source"/bb/<robot module>"
:data.robotrobot module
:data.path[:safety, :error]
:data.message%BB.Message{payload: %BB.Safety.HardwareError{path: path, error: error}}

bb.pubsub.<dotted source path>

Generic envelope for any other PubSub event. The path component is the publisher's full source path joined by . — so a publish on [:sensor, :joint_state] yields type bb.pubsub.sensor.joint_state.

FieldValue
:type"bb.pubsub.<path>"
:source"/bb/<robot module>"
:data.robotrobot module (or message.robot if unset on the bridge)
:data.paththe source path as a list of atoms
:data.messagethe full %BB.Message{}

Signals routed by BB.Jido.Plugin.Robot

These signal types are intended for application code to send into the agent. The plugin's signal_routes: dispatches them to actions.

bb.command.executeBB.Jido.Action.Command

Execute a robot command.

Required :data keys:

KeyTypeDescription
:robotmodule()Robot module
:commandatom()Command name

Optional:

KeyTypeDefault
:goalmap()%{}
:timeoutpos_integer() (ms)30_000

bb.reactor.runBB.Jido.Action.Reactor

Run a bb_reactor workflow.

Required :data keys:

KeyTypeDescription
:robotmodule()Robot module
:reactormodule()Reactor module

Optional:

KeyTypeDefault
:inputsmap()%{}

bb.state.waitBB.Jido.Action.WaitForState

Block the agent until the robot reaches a target state.

Required :data keys:

KeyTypeDescription
:robotmodule()Robot module
:targetatom()Desired robot state

Optional:

KeyTypeDefault
:timeoutpos_integer() (ms)30_000

Custom signals

Anything outside the bb.* namespace is application-defined. Recommended convention:

  • <app>.<domain>.<event> for state changes (my_robot.pick.completed)
  • <app>.<domain>.<command> for imperative requests (my_robot.pick.start)
  • Avoid the bb.* prefix to keep BB-originating signals identifiable.

Building a signal

Jido.Signal.new!(
  "bb.command.execute",
  %{robot: MyRobot, command: :home, goal: %{}}
)

Or via the keyword/map form:

Jido.Signal.new!(%{
  type: "bb.command.execute",
  source: "/my_app/teleop",
  data: %{robot: MyRobot, command: :home, goal: %{}}
})

:id and :time are generated for you. :specversion is set to CloudEvents 1.0.2.