Skip to content

simpleflight

SimpleFlight-specific sim2real runtime helpers.

Classes:

Name Description
SimpleFlightRuntimeConfig

Non-ROS configuration for SimpleFlight policy deployment.

SimpleFlightRuntime

Runtime for policy-only SimpleFlight deployments.

Functions:

Name Description
build_internal_trajectory

Return the default internal reference trajectory.

SimpleFlightRuntimeConfig dataclass

SimpleFlightRuntimeConfig(model_path: str = '', trajectory: BaseTrajectory = build_internal_trajectory(), params: VehicleParams = VehicleParams(), device: str = 'cpu', trajectory_time_offset: float = 0.0, future_steps: int = 10, future_step_size: int = 5, mapping: FlightMappingConfig = FlightMappingConfig(), thrust_model: ThrustModelConfig = ThrustModelConfig())

Non-ROS configuration for SimpleFlight policy deployment.

Methods:

Name Description
__post_init__

Validate SimpleFlight runtime configuration.

__post_init__

__post_init__()

Validate SimpleFlight runtime configuration.

SimpleFlightRuntime

SimpleFlightRuntime(cfg: SimpleFlightRuntimeConfig)

Runtime for policy-only SimpleFlight deployments.

Initialize runtime state and policy backend.

Methods:

Name Description
update_target

Advance the internal trajectory target unless an external target is active.

set_external_target

Override the internal trajectory with an externally supplied target.

set_external_collective_acc

Set an external total collective-acceleration sample for thrust estimation.

update_fsm

Update runtime FSM from transport-specific vehicle status.

build_observation

Build the SimpleFlight policy observation.

step

Run one runtime step and return the transport-agnostic command.

update_target

update_target(now_sec: float) -> None

Advance the internal trajectory target unless an external target is active.

set_external_target

set_external_target(data: ndarray) -> bool

Override the internal trajectory with an externally supplied target.

set_external_collective_acc

set_external_collective_acc(measured_collective_acc: float | None) -> None

Set an external total collective-acceleration sample for thrust estimation.

update_fsm

update_fsm(has_state: bool, is_active: bool) -> str

Update runtime FSM from transport-specific vehicle status.

build_observation

build_observation(position_world: ndarray, quaternion_xyzw: ndarray, linear_velocity_body: ndarray, now_sec: float, *, rotation: Rotation | None = None, world_linvel: ndarray | None = None) -> np.ndarray

Build the SimpleFlight policy observation.

step

step(position_world: ndarray | None, quaternion_xyzw: ndarray | None, linear_velocity_body: ndarray | None, now_sec: float) -> BasePlayStepResult | None

Run one runtime step and return the transport-agnostic command.

build_internal_trajectory

build_internal_trajectory() -> BaseTrajectory

Return the default internal reference trajectory.