# `BB.Actuator.Server`
[🔗](https://github.com/beam-bots/bb/blob/main/lib/bb/actuator/server.ex#L5)

Wrapper GenServer for actuator callback modules.

This module manages the lifecycle of user-defined actuator modules, handling:
- Parameter reference resolution at startup
- Subscription to parameter changes
- Subscription to the actuator's own command topic
- Delegation of GenServer callbacks to user module
- Automatic safety registration

User modules implement the `BB.Actuator` behaviour and define callbacks.
This server wraps them, providing the actual GenServer implementation.

## The inbound command pipeline

Commands reach an actuator by three transports - published to
`[:actuator | path]`, cast via `BB.Process.cast/3`, or called via
`BB.Process.call/4`. All three converge here and pass through the same
checks before the driver sees them:

1. The actuator must accept the payload — see
   `c:BB.Actuator.command_payloads/1`. A driver is never handed a command it
   didn't declare, so it can't be crashed by one it has no clause for.
2. The robot must be armed.
3. The payload is translated from joint-space into motor-space using the
   joint's transmission.

The driver then receives it in `c:BB.Actuator.handle_command/2`, and its
reply is routed back to whichever transport delivered the command. Messages
from topics the driver subscribed to itself are not part of this pipeline -
they reach `c:BB.Actuator.handle_info/2` untouched.

# `t`

```elixir
@type t() :: %BB.Actuator.Server{
  actuator_name: atom() | nil,
  bb: %{robot: module(), path: [atom()]},
  callback_module: module(),
  command_payloads: [module()],
  command_topic: [atom()],
  joint: map() | nil,
  joint_name: atom() | nil,
  param_subscriptions: %{required([atom()]) =&gt; atom()},
  raw_opts: keyword(),
  resolved_opts: keyword(),
  transmission: BB.Transmission.t() | nil,
  transmission_subscriptions: %{required(atom()) =&gt; [atom()]},
  user_state: term()
}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

---

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