Skip to main content

Validity

Struct Validity 

Source
pub struct Validity {
    pub tilt: bool,
    pub heading: bool,
    pub horizontal_position: bool,
    pub vertical_position: bool,
    pub horizontal_velocity: bool,
    pub vertical_velocity: bool,
}
Expand description

Which parts of the estimate are good enough to use.

The single Status answers how bad is the worst thing; this answers which outputs can I use, which is the question a controller actually has. They are independent axes, and collapsing them loses real information: a filter that started coarse and has adopted a GNSS fix has position as good as the receiver while its attitude is still converging, and Status::Aligning alone cannot say so.

Every flag is derived from the covariance against Config::accuracy, plus the requirement that the quantity was ever established at all — a coarse start has no position until a fix arrives, a window with no magnetometer has no heading until a heading source is fused, and a tight prior on a number nobody set is not validity. Nor is a covariance the position hold bounded: horizontal position and velocity stay invalid after one until measured again; see Hold.

Horizontal and vertical are separate because sources are: a vehicle with a barometer and no GNSS has a usable height and no horizontal position at all, as one log in the replay corpus does. Another carries neither source, so it has no position of either kind.

Fields§

§tilt: bool

Tilt: rotation about north and about east, each within Accuracy::tilt. Read on navigation axes rather than body ones, which are tilt only while the vehicle is level; see AttitudeVariance.

§heading: bool

Heading. False until something observes the rotation about gravity: a magnetometer in the initialization window, or an accepted Eskf::fuse_mag_heading, fuse_gnss_heading or fuse_course. Stillness does not observe it, so a perfect static alignment on a vehicle with no magnetometer reports tilt and not this.

§horizontal_position: bool

North and east position.

§vertical_position: bool

Down position.

§horizontal_velocity: bool

North and east velocity.

§vertical_velocity: bool

Down velocity.

Implementations§

Source§

impl Validity

Source

pub const NONE: Self

Nothing is valid. What an uninitialized filter reports.

Source

pub const fn all(self) -> bool

Whether every part of the estimate is usable.

Source

pub const fn attitude(self) -> bool

Whether attitude is usable: the part a stabilizing controller needs before anything else.

Source

pub const fn navigation(self) -> bool

Whether the full navigation solution — position and velocity, both axes — is usable.

Trait Implementations§

Source§

impl Clone for Validity

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Validity

Source§

impl Debug for Validity

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Validity

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for Validity

Six flags in the order the struct declares them, a letter where the quantity is usable and - where it is not: att:T- pos:HV vel:HV is tilt without heading, position and velocity on both axes. The shape PX4’s *_valid flags and ArduPilot’s nav_filter_status bits are read in, and short enough for every line of a 1 Hz log.

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Validity

Source§

impl Format for Validity

Available on crate feature defmt only.
Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
Source§

impl PartialEq for Validity

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Validity

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.