# `BB.Servo.Feetech.Actuator`
[🔗](https://github.com/beam-bots/bb_servo_feetech/blob/main/lib/bb/servo/feetech/actuator.ex#L5)

An actuator that uses a Feetech controller to drive a serial bus servo.

This actuator derives its configuration from the joint constraints defined in the robot:
- Position limits from `joint.limits.lower` and `joint.limits.upper`
- Velocity limit from `joint.limits.velocity`
- Position range maps to the servo's goal_position register

When initialised, the actuator:
1. Disables torque on the servo
2. Registers with the controller, receiving the shared ETS table reference
3. Subscribes to position commands

When a position command is received, the actuator:
1. Clamps the position to joint limits
2. Converts to servo position units (0-4095 for 360 degrees)
3. Writes goal_position and goal_speed to the controller's ETS table
4. Publishes a `BB.Message.Actuator.BeginMotion` message

The controller picks up pending commands on its next loop tick and batches them
into efficient `sync_write` operations on the serial bus.

## Example DSL Usage

    controller :feetech, {BB.Servo.Feetech.Controller,
      port: "/dev/ttyUSB0",
      baud_rate: 1_000_000
    }

    joint :shoulder, type: :revolute do
      limit lower: ~u(-90 degree), upper: ~u(90 degree), velocity: ~u(60 degree_per_second)

      actuator :servo, {BB.Servo.Feetech.Actuator, servo_id: 1, controller: :feetech}
    end

# `disarm`

Safety disarm callback.

Returns :ok because torque management is handled by the controller.
The controller receives all registered servo IDs and disables torque
for all of them in a single sync_write operation, which is more
efficient for bus-based protocols.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
