pub struct TouchdownDetector { /* private fields */ }Expand description
Detects touchdown during a land (ControlInput::Land) from
the vertical speed alone.
Landing guidance keeps lowering its altitude target, so a vehicle still in the air can’t
hold a vertical speed near zero for long: its thrust falls until it sinks. Once the vehicle
has sunk faster than DESCENDING_MPS, staying within ±STOPPED_MPS for
TOUCHDOWN_HOLD_S means the ground stopped it. Before the descent begins (the hover the
land started from), nothing counts. Touchdown latches until reset.
It works only while a land is flown; hovering would read as touchdown. A non-finite speed restarts the stopped timer without clearing the descent.
§Examples
use stable_flight::commanders::TouchdownDetector;
let mut detector = TouchdownDetector::default();
assert!(!detector.update(0.5, 0.0)); // hovering before the descent: not down
assert!(!detector.update(0.5, -0.7)); // descending
assert!(!detector.update(0.5, 0.0)); // stopped for 0.5 s
assert!(detector.update(0.6, 0.0)); // stopped for 1.1 s: downImplementations§
Source§impl TouchdownDetector
impl TouchdownDetector
Trait Implementations§
Source§impl Clone for TouchdownDetector
impl Clone for TouchdownDetector
Source§impl Debug for TouchdownDetector
impl Debug for TouchdownDetector
Auto Trait Implementations§
impl Freeze for TouchdownDetector
impl RefUnwindSafe for TouchdownDetector
impl Send for TouchdownDetector
impl Sync for TouchdownDetector
impl Unpin for TouchdownDetector
impl UnsafeUnpin for TouchdownDetector
impl UnwindSafe for TouchdownDetector
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,
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.