pub struct TouchdownConfig {
pub stopped_mps: f32,
pub hold_s: f32,
}Expand description
What counts as stopped on the ground for a TouchdownDetector.
Fields§
§stopped_mps: f32Vertical speed below this, in m/s either way, counts as stopped. Wider: a landing gear
that bounces, or a noisy vertical speed, still reads as stopped; too wide, and a slow
final sink does too, disarming above the ground. Must be positive and below
DESCENDING_MPS. Defaults to DEFAULT_STOPPED_MPS.
hold_s: f32How long, in seconds, the vehicle must stay stopped after descending to count as down.
Longer: a bounce or a pause in the sink is less likely to disarm in the air, but the
motors run longer on the ground. Must be positive and finite. Defaults to
DEFAULT_TOUCHDOWN_HOLD_S.
Implementations§
Source§impl TouchdownConfig
impl TouchdownConfig
Sourcepub fn validate(&self) -> Result<(), InvalidConfig>
pub fn validate(&self) -> Result<(), InvalidConfig>
Checks that stopped_mps is in (0, DESCENDING_MPS) and hold_s is positive and
finite.
§Errors
InvalidConfig naming the first field out of range.
§Examples
use stable_flight::commanders::TouchdownConfig;
let config = TouchdownConfig { hold_s: 0.0, ..TouchdownConfig::default() };
assert_eq!(config.validate().unwrap_err().to_string(), "hold_s must be positive and finite");Trait Implementations§
Source§impl Clone for TouchdownConfig
impl Clone for TouchdownConfig
impl Copy for TouchdownConfig
Source§impl Debug for TouchdownConfig
impl Debug for TouchdownConfig
Source§impl Default for TouchdownConfig
impl Default for TouchdownConfig
Source§impl PartialEq for TouchdownConfig
impl PartialEq for TouchdownConfig
impl StructuralPartialEq for TouchdownConfig
Auto Trait Implementations§
impl Forget for TouchdownConfig
impl Freeze for TouchdownConfig
impl Move for TouchdownConfig
impl RefUnwindSafe for TouchdownConfig
impl Send for TouchdownConfig
impl Sync for TouchdownConfig
impl Unpin for TouchdownConfig
impl UnsafeUnpin for TouchdownConfig
impl UnwindSafe for TouchdownConfig
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
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.