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

Command an actuator to actively maintain its current position.

Unlike `Stop`, the actuator will actively resist external forces to
stay at its current position. This consumes power but provides rigidity.

## Fields

- `command_id` - Optional reference for correlating with feedback messages

## Examples

    alias BB.Message
    alias BB.Message.Actuator.Command.Hold

    {:ok, msg} = Message.new(Hold, :shoulder, [])

    # With correlation ID
    {:ok, msg} = Message.new(Hold, :shoulder,
      command_id: make_ref()
    )

## Notes

Not all actuators distinguish between stop and hold. RC servos, for example,
always hold their position when given a command. This command is most relevant
for motors with encoders or steppers where passive vs active holding differs.

# `t`

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

# `new`

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

---

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