# `BB.Message.Sensor.JointState`
[🔗](https://github.com/beam-bots/bb/blob/main/lib/bb/message/sensor/joint_state.ex#L5)

State of a set of joints.

## Fields

- `names` - List of joint names as atoms
- `positions` - Joint positions in radians (revolute) or metres (prismatic)
- `velocities` - Joint velocities in rad/s or m/s
- `efforts` - Joint efforts in Nm or N

All lists must have the same length. Missing values can be represented
as empty lists.

## Examples

    alias BB.Message.Sensor.JointState

    {:ok, msg} = JointState.new(:arm,
      names: [:joint1, :joint2],
      positions: [0.0, 1.57],
      velocities: [0.1, 0.0],
      efforts: [0.5, 0.2]
    )

# `t`

```elixir
@type t() :: %BB.Message.Sensor.JointState{
  efforts: [float()],
  names: [atom()],
  positions: [float()],
  velocities: [float()]
}
```

# `new`

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

---

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