Plugin & Action Configuration Reference

Copy Markdown View Source

BB.Jido.Plugin.Robot

Attach to an agent's plugins: list with a per-agent config map.

use Jido.Agent,
  name: "my_robot",
  plugins: [{BB.Jido.Plugin.Robot, %{robot: MyRobot}}]

Config

KeyTypeRequiredDefaultDescription
:robotmodule()yesThe Beam Bots robot module
:topics[[atom()]]no[[:state_machine]]PubSub paths the bridge subscribes to
:message_types[module()]no[]Payload modules to filter on ([] = no filter)
:throttle_mspos_integer()nonilMinimum interval between same-type signals

State

The plugin owns the agent's :robot state slice:

FieldTypeInitialDescription
:robotmodule()the configured robotMirror of config[:robot] for convenience
:safety_stateatom():unknownCached safety state; updated when a bb.state.transition signal arrives
:last_joint_statemap()%{}Reserved for joint-state caching (not yet populated)

Built-in actions

ActionDefault routePurpose
BB.Jido.Action.Commandbb.command.executeRun a BB command via BB.Command.await/2
BB.Jido.Action.Reactorbb.reactor.runRun a bb_reactor workflow with context.private.bb_robot set
BB.Jido.Action.WaitForStatebb.state.waitBlock until robot reaches a target state
BB.Jido.Action.GetJointState(none — call directly)Read positions/velocities from BB.Robot.Runtime

Child processes

The plugin's child_spec/1 returns one supervised child:

ChildType:idRestart
BB.Jido.PubSubBridge:worker{BB.Jido.Plugin.Robot, :pub_sub_bridge, robot}:transient

BB.Jido.PubSubBridge options

The bridge is mounted by the plugin, but you can also start it directly under a different supervisor if you want PubSub-to-Signal forwarding without an agent.

{:ok, bridge} =
  BB.Jido.PubSubBridge.start_link(
    robot: MyRobot,
    agent: agent_pid_or_name,
    topics: [[:state_machine]]
  )
OptionTypeRequiredDefaultDescription
:robotmodule()yesRobot module to subscribe against
:agentGenServer.server()yesWhere to cast signals (pid, registered name, via-tuple)
:topics[[atom()]]no[[:state_machine]]PubSub paths
:message_types[module()]no[]Payload filter
:throttle_mspos_integer()nonilSame-type throttle in ms
:nameGenServer.name()noStandard GenServer.start_link option

All standard GenServer.start_link options (:timeout, :debug, :spawn_opt, :hibernate_after) are also accepted.

Action schemas

Each action's :schema is documented below using [type:, required:, default:] notation matching the NimbleOptions format that Jido.Action accepts.

BB.Jido.Action.Command

ParamTypeRequiredDefault
:robot:atom
:command:atom
:goal:map%{}
:timeout:pos_integer30_000

BB.Jido.Action.Reactor

ParamTypeRequiredDefault
:robot:atom
:reactor:atom
:inputs:map%{}

BB.Jido.Action.WaitForState

ParamTypeRequiredDefault
:robot:atom
:target:atom
:timeout:pos_integer30_000

BB.Jido.Action.GetJointState

ParamTypeRequiredDefault
:robot:atom