pub struct FailsafeConfig {
pub timeout_s: f32,
pub recover_after_s: f32,
pub takeover_stick_delta: f32,
}Expand description
When a FailsafeCommander falls back, and when it returns.
Fields§
§timeout_s: f32The primary is stale once this many seconds pass without a message. Must be positive and finite.
recover_after_s: f32The primary takes over again only after it has been fresh this long without a break, so a flapping link doesn’t toggle control. Must be non-negative and finite.
takeover_stick_delta: f32How far a stick axis (normalized) must move before the primary’s sticks take back an armed vehicle from the fallback, so a forgotten joystick resending the same positions can’t drop the vehicle out of a hold. Must be positive and finite.
Implementations§
Source§impl FailsafeConfig
impl FailsafeConfig
Sourcepub fn validate(&self) -> Result<(), InvalidConfig>
pub fn validate(&self) -> Result<(), InvalidConfig>
Checks the documented requirements of every field.
§Errors
InvalidConfig naming the first field out of range.
Trait Implementations§
Source§impl Clone for FailsafeConfig
impl Clone for FailsafeConfig
impl Copy for FailsafeConfig
Source§impl Debug for FailsafeConfig
impl Debug for FailsafeConfig
Source§impl Default for FailsafeConfig
impl Default for FailsafeConfig
Source§impl PartialEq for FailsafeConfig
impl PartialEq for FailsafeConfig
impl StructuralPartialEq for FailsafeConfig
Auto Trait Implementations§
impl Freeze for FailsafeConfig
impl RefUnwindSafe for FailsafeConfig
impl Send for FailsafeConfig
impl Sync for FailsafeConfig
impl Unpin for FailsafeConfig
impl UnsafeUnpin for FailsafeConfig
impl UnwindSafe for FailsafeConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.