BB.Ufactory.Actuator.LinearTrack (bb_ufactory v0.1.0)

Copy Markdown View Source

Linear track position actuator for xArm arms.

Controls the UFactory linear track via the xArm RS485 RTU proxy. The track position is expressed in millimetres and converted internally to the hardware's native int32 encoding (round(mm * 2000)).

Unlike joint positions which are batched at 100 Hz via ETS, linear track commands are forwarded immediately to the controller via BB.Process.call/3.

Lifecycle

The track motor is not enabled during init/1. Instead, the actuator registers its enable frame with the controller, which sends it at the end of its own arm sequence on every :armed transition. This guarantees no RS485 command reaches the bus before the arm controller is fully initialized (mode 0, state 0) — ordering a separate state-machine subscription could not provide, since pubsub dispatch order across subscribers is unspecified.

Protocol Note

The linear track uses big-endian int32 encoding for position — the only place in the UFactory protocol where position is not little-endian fp32. This is handled transparently by BB.Ufactory.Protocol.cmd_linear_track_move/3, which returns {pos_frame, spd_frame}. Both frames are sent sequentially: speed first, then position.

Command Interface

Receives standard %BB.Message.Actuator.Command.Position{} commands, where position is the target position in millimetres.