# `BB.Message.Actuator.Command.Stop`
[🔗](https://github.com/beam-bots/bb/blob/main/lib/bb/message/actuator/command/stop.ex#L5)

Command to stop an actuator's motion.

After stopping, the actuator becomes passive and will not actively resist
external forces. Use `Hold` if you need the actuator to maintain position.

## Fields

- `mode` - Stop mode: `:immediate` (default) or `:decelerate`
- `command_id` - Optional reference for correlating with feedback messages

## Modes

- `:immediate` - Stop as quickly as possible (may be abrupt)
- `:decelerate` - Slow down smoothly before stopping

## Examples

    alias BB.Message
    alias BB.Message.Actuator.Command.Stop

    # Immediate stop
    {:ok, msg} = Message.new(Stop, :shoulder, [])

    # Decelerate to stop
    {:ok, msg} = Message.new(Stop, :shoulder,
      mode: :decelerate
    )

# `mode`

```elixir
@type mode() :: :immediate | :decelerate
```

# `t`

```elixir
@type t() :: %BB.Message.Actuator.Command.Stop{
  command_id: reference() | nil,
  mode: mode()
}
```

# `new`

```elixir
@spec new(
  atom(),
  keyword()
) :: {:ok, BB.Message.t()} | {:error, term()}
```

---

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