# `BB.Actuator.MotorProfile`
[🔗](https://github.com/beam-bots/bb/blob/main/lib/bb/actuator/motor_profile.ex#L5)

Motor-space limits and starting position for an actuator.

Built by `BB.Actuator.Server` from a joint's limits and resolved
transmission, then injected into the driver's resolved options as
`:motor_profile`. Drivers read what they need from the profile instead of
fetching the joint and applying the transmission themselves.

Position fields are signed motor-space values; rate and effort fields are
positive magnitudes. Any field may be `nil` if the corresponding joint
limit is unset.

`motor_initial_position` is the midpoint of `motor_lower` and
`motor_upper`, falling back to `0.0` when either is `nil`.

# `t`

```elixir
@type t() :: %BB.Actuator.MotorProfile{
  motor_acceleration_limit: float() | nil,
  motor_effort_limit: float() | nil,
  motor_initial_position: float(),
  motor_lower: float() | nil,
  motor_upper: float() | nil,
  motor_velocity_limit: float() | nil
}
```

# `from_joint`

```elixir
@spec from_joint(map() | nil, BB.Transmission.t() | nil) :: t()
```

Build a motor profile for an actuator attached to `joint`, applying
`transmission` (which may be `nil`) to convert joint-space limits into
motor-space.

When the joint is `nil` or has no limits, returns a profile with every
field set to `nil` apart from `motor_initial_position`, which defaults to
`0.0`.

---

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