Expand description
Test doubles for the pipeline traits. Enabled by the testing feature (and in this
crate’s own tests); off by default.
Use these in tests of anything built on the core — runners, backends, firmware glue — instead
of writing per-crate mocks. They allocate nothing, so they also work in no_std tests.
NullVehicle: returns a fixed state and counts calls.ConstantCommander: emits the sameCommandevery tick.RecordingTelemetry: keeps copies of the lastNticks in a fixed-size ring.settled_yaw_rate: closed-loop check of a body-rate config’s yaw loop against a constant torque, e.g. an airframe’s measured hover yaw imbalance.conformance: physical scenarios that check a backend’sVehicleStateagainst the frame contract, andconformance_tests!to run them.
Recover a double after running a FlightLoop with
FlightLoop::into_parts.
[dev-dependencies]
stable-flight = { version = "0.3", features = ["testing"] }Modules§
- conformance
- Frame-conformance kit for state sources: simulator backends and estimators.
Structs§
- Constant
Commander - A commander that emits the same command every tick. The default is a disarmed, zero-throttle attitude command.
- Null
Vehicle - A vehicle that reports a fixed state, ignores commands, and counts both.
- Recorded
Tick - An owned copy of one
TelemetryRecord; fields mean what they do there. - Recording
Telemetry - A telemetry sink that keeps the last
Nticks (a fixed-size ring, no allocation) and counts all of them.
Functions§
- settled_
yaw_ rate - The yaw rate in rad/s that a
BodyRateControllerwithconfigsettles at while commanding zero rate against a constant yawdisturbancetorque (normalized moment, nose right positive).