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

Command to move an actuator to a target position.

## Fields

- `position` - Target position (radians for revolute, metres for prismatic)
- `velocity` - Optional velocity hint (rad/s or m/s)
- `duration` - Optional duration hint (milliseconds)
- `command_id` - Optional reference for correlating with feedback messages

## Examples

    alias BB.Message
    alias BB.Message.Actuator.Command.Position

    # Simple position command
    {:ok, msg} = Message.new(Position, :shoulder,
      position: 1.57
    )

    # With velocity hint
    {:ok, msg} = Message.new(Position, :shoulder,
      position: 1.57,
      velocity: 0.5
    )

    # With correlation ID for tracking
    {:ok, msg} = Message.new(Position, :shoulder,
      position: 1.57,
      command_id: make_ref()
    )

# `t`

```elixir
@type t() :: %BB.Message.Actuator.Command.Position{
  command_id: reference() | nil,
  duration: pos_integer() | nil,
  position: float(),
  velocity: float() | nil
}
```

# `new`

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

---

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