#[non_exhaustive]pub struct Saturation {
pub tilt: bool,
pub thrust: bool,
pub moments: [bool; 3],
pub mixer_thrust: bool,
pub mixer_moments: bool,
}Expand description
Which limits the pipeline hit on one tick, as reported by Guidance::saturation,
Stabilizer::saturation, and Mixer::saturation, merged by FlightLoop into
TelemetryRecord::saturation.
A saturated tick is not an error: limits are how the pipeline stays safe. Flags that stay
set across many ticks point at tuning or authority problems (e.g. a rate loop pinned at
full moment, or a mixer giving up collective to hold attitude). New flags may be added, so
the struct is #[non_exhaustive]; build one with Saturation::default and set fields.
§Examples
use stable_flight::Saturation;
let mut guidance = Saturation::default();
guidance.tilt = true;
let mut mixer = Saturation::default();
mixer.mixer_thrust = true;
let tick = guidance.merge(mixer);
assert!(tick.tilt && tick.mixer_thrust && tick.any());
assert!(!Saturation::default().any());Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.tilt: boolA requested tilt was capped: guidance’s waypoint tilt limit, or the stabilizer’s maximum roll/pitch angle.
thrust: boolCollective thrust was clipped to [0, 1] (the altitude loop, or the attitude-mode
boost). The altitude loop’s flag means its thrust sits on a bound, so it is also set
when the tilt boost cuts thrust to 0 while inverted, and in a steady hover if
hover_thrust is 1.
moments: [bool; 3]The rate loop’s moment output hit ±1, per axis (roll, pitch, yaw).
mixer_thrust: boolThe mixer lowered collective thrust to keep the moments (a motor would pass full throttle).
mixer_moments: boolThe mixer couldn’t deliver the moments in full: it scaled them down, its upward shift was limited near idle, or a motor was clipped. Expected while armed at idle on the ground, where any attitude error is clipped at zero thrust.
Implementations§
Trait Implementations§
Source§impl Clone for Saturation
impl Clone for Saturation
impl Copy for Saturation
Source§impl Debug for Saturation
impl Debug for Saturation
Source§impl Default for Saturation
impl Default for Saturation
Source§impl<'de> Deserialize<'de> for Saturation
impl<'de> Deserialize<'de> for Saturation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Saturation
Source§impl PartialEq for Saturation
impl PartialEq for Saturation
Source§impl Serialize for Saturation
impl Serialize for Saturation
impl StructuralPartialEq for Saturation
Auto Trait Implementations§
impl Forget for Saturation
impl Freeze for Saturation
impl Move for Saturation
impl RefUnwindSafe for Saturation
impl Send for Saturation
impl Sync for Saturation
impl Unpin for Saturation
impl UnsafeUnpin for Saturation
impl UnwindSafe for Saturation
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.