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

Command to apply a specific effort (torque/force) to an actuator.

The actuator will apply the specified effort until stopped, a new
command is received, or the optional duration expires.

## Fields

- `effort` - Target effort (Nm for revolute, N for prismatic)
- `duration` - Optional duration (milliseconds), nil = until stopped
- `command_id` - Optional reference for correlating with feedback messages

## Examples

    alias BB.Message
    alias BB.Message.Actuator.Command.Effort

    # Apply torque
    {:ok, msg} = Message.new(Effort, :gripper,
      effort: 0.5
    )

    # Apply torque for fixed duration
    {:ok, msg} = Message.new(Effort, :gripper,
      effort: 0.5,
      duration: 1000
    )

# `t`

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

# `new`

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

---

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