BB.Message.Actuator.EndMotion (bb v0.15.0)
View SourceMessage published by actuators when motion ends.
Optional counterpart to BeginMotion. Useful for actuators with partial
feedback (limit switches, stall detection) that can report when motion
completes but may not have continuous position sensing.
Fields
position- Position when motion ended (radians or metres)reason- Why motion ended (:completed,:cancelled,:limit_reached,:fault)detail- Optional atom with additional context (e.g.:end_stop,:stall)message- Optional human-readable information for operatorscommand_id- Optional correlation ID from the originating command
Examples
alias BB.Message
alias BB.Message.Actuator.EndMotion
# Simple completion
{:ok, msg} = Message.new(EndMotion, :shoulder,
position: 1.57,
reason: :completed
)
# Limit reached with detail
{:ok, msg} = Message.new(EndMotion, :shoulder,
position: 0.0,
reason: :limit_reached,
detail: :end_stop
)
# Fault with message
{:ok, msg} = Message.new(EndMotion, :shoulder,
position: 0.52,
reason: :fault,
detail: :stall,
message: "Motor stall detected at 30% travel"
)
Summary
Types
Functions
@spec new( atom(), keyword() ) :: {:ok, BB.Message.t()} | {:error, term()}