pub trait Fallback: Commander {
// Provided methods
fn engage(&mut self, state: &VehicleState, last: &Command) { ... }
fn can_release(&self) -> bool { ... }
}Expand description
A Commander that flies while a FailsafeCommander’s primary is stale.
Provided Methods§
Sourcefn engage(&mut self, state: &VehicleState, last: &Command)
fn engage(&mut self, state: &VehicleState, last: &Command)
The failsafe switched to this fallback, with the vehicle in state and last the
command that flew the tick before (disarmed and neutral before the first tick), so a
fallback can keep its arm state or finish what it was doing, e.g. a land. Called once
per switch, before this tick’s next_command. The default
does nothing.
Sourcefn can_release(&self) -> bool
fn can_release(&self) -> bool
Whether the primary may take over again once fresh. false keeps the fallback flying,
e.g. a landing that must finish. The default always releases.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".