Joint-space position actuator for xArm joints.
One instance runs per joint. On receiving a %BB.Message.Actuator.Command.Position{}
command, the actuator clamps the angle to joint limits and writes the target
set_position into the controller's ETS table. The controller's 100 Hz loop
reads all pending set_position values and batches them into a single
cmd_move_joints frame.
Commands are accepted via two delivery paths:
- Pubsub (
BB.Actuator.set_position/4): arrives ashandle_info({:bb, [:actuator | path], msg}, state). - Direct cast (
BB.Actuator.set_position!/4): arrives ashandle_cast({:command, msg}, state).
Both paths share the same clamping and ETS write logic.
ETS Write
The actuator reads the current ETS row first to preserve current_position
and current_torque written by the controller's report socket handler, then
writes only the set_position field.
BeginMotion
A BB.Message.Actuator.BeginMotion message is published to
[:actuator | bb.path] after each position command so that the open-loop
position estimator can track expected arrival.