mixer
Array API mixer for mapping thrust/moment demands to rotor speeds.
Classes:
| Name | Description |
|---|---|
Mixer |
Map batched thrust and moment demands to rotor speed commands. |
Mixer
Mixer(params: VehicleParams = VehicleParams(), num_envs: int = 1, device=None, *, backend: BackendName | None = None, xp: ModuleType | None = None, allocation_mode: Literal['pinv', 'saturation'] = 'pinv')
Map batched thrust and moment demands to rotor speed commands.
The default "pinv" allocator applies direct pseudo-inverse allocation.
"saturation" enables a staged trim strategy: roll/pitch authority is
trimmed first if needed, and yaw authority is allocated from the remaining
rotor-speed margin.
Initialize the mixer matrix and backend namespace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VehicleParams
|
Vehicle parameters used to build the allocation matrix. |
VehicleParams()
|
|
int
|
Number of parallel environments represented by the batch. |
1
|
|
Optional backend device, mainly used by Torch. |
None
|
|
|
BackendName | None
|
Explicit Array API backend. If omitted, NumPy is used when
|
None
|
|
ModuleType | None
|
Pre-resolved Array API namespace. Overrides |
None
|
|
Literal['pinv', 'saturation']
|
|
'pinv'
|
Methods:
| Name | Description |
|---|---|
randomize |
Randomize mixer parameters for selected environments. |
calculate_rotor_commands |
Allocate |
randomize
randomize(env_ids=None, randomization: dict | None = None)
Randomize mixer parameters for selected environments.
calculate_rotor_commands
calculate_rotor_commands(control: ArrayLike) -> ArrayLike
Allocate [thrust, roll, pitch, yaw] controls to rotor RPM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ArrayLike
|
Batched control array with shape |
required |
Returns:
| Type | Description |
|---|---|
ArrayLike
|
Batched rotor speed magnitudes with shape |