mapping
Control-mode mapping utilities for NumPy-based controller pipelines.
Classes:
| Name | Description |
|---|---|
FlightMappingLimits |
Per-channel limits used when mapping normalized actions to targets. |
FlightMappingResult |
Mapped result for a normalized flight action or action batch. |
FlightActionMapper |
Map normalized actions into controller targets, wrench commands, or RPM. |
Functions:
| Name | Description |
|---|---|
target_to_command |
Convert a full 12D target into a compact command vector. |
FlightMappingLimits
dataclass
FlightMappingLimits(vel_limits: tuple[float, float, float] = (5.0, 5.0, 5.0), att_limits: tuple[float, float, float] = (1.0, 1.0, math.pi), br_limits: tuple[float, float, float] = (2.0, 2.0, 2.0))
Per-channel limits used when mapping normalized actions to targets.
FlightMappingResult
dataclass
FlightMappingResult(clamped_action: ndarray | Tensor, rpm_command: ndarray | Tensor, control: ndarray | Tensor | None = None, target: ndarray | Tensor | None = None)
Mapped result for a normalized flight action or action batch.
FlightActionMapper
FlightActionMapper(control_mode: str, params: VehicleParams = VehicleParams(), limits: FlightMappingLimits = FlightMappingLimits())
Map normalized actions into controller targets, wrench commands, or RPM.
Initialize a NumPy flight action mapper for the selected control mode.
Methods:
| Name | Description |
|---|---|
map_action |
Map a normalized action into an RPM command and optional intermediates. |
Attributes:
| Name | Type | Description |
|---|---|---|
requires_controller |
bool
|
Whether this mode needs a controller target expansion step. |
requires_controller
property
requires_controller: bool
Whether this mode needs a controller target expansion step.
map_action
map_action(action: ndarray, mixer: Mixer, *, state: ndarray | None = None, flight_controller: ControllerBase | None = None) -> FlightMappingResult
Map a normalized action into an RPM command and optional intermediates.
target_to_command
target_to_command(target: ndarray, command_mode: str, state: ndarray | None = None) -> np.ndarray
Convert a full 12D target into a compact command vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ndarray
|
Full target state ordered as
|
required |
|
str
|
Supported target command mode. Valid values are
|
required |
|
ndarray | None
|
Current 12D vehicle state. Required only for |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ndarray
|
np.ndarray: A compact command vector matching the requested command |
|
mode |
ndarray
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |