Skip to main content

WindowNoise

Struct WindowNoise 

Source
#[non_exhaustive]
pub struct WindowNoise { pub gyro_white: [f32; 3], pub accel_white: [f32; 3], pub baro: Option<AltitudeNoise>, pub blocks: u64, pub baro_readings: u64, }
Expand description

The white noise a still window measured on each sensor, as StaticWindow::noise reports it: a floor under the noise the filter should be told, never the noise itself.

A floor because the window is the quietest the sensors will be in the air. A vehicle sitting still sees no propeller wash on its static port and no dynamic pressure, and vibration only what its motors make at idle; several corpus windows carry some, from props spinning on the ground or aliased near the sample rate. In flight each of these grows. ImuNoise::default’s white noise is ten times PX4’s density for that reason and others its doc comment measures, so a figure here copied into Config::imu is the datasheet-grade Q that default exists to avoid. What the figure is for: a default below it is wrong, and a default far above it is a statement about the airframe rather than the sensor.

A density N is what ImuNoise takes: an increment over Δt carries N √Δt of noise, and (16)–(21) add N² Δt to Q, so a sample’s rates scatter by N / √Δt, twenty times N at 400 Hz. Reading that scatter as the density is the mistake (8″) avoids.

Per axis, in body axes; ImuNoise takes the worst, which worst_gyro_white and worst_accel_white give. The bias random walks and each source’s correlation time are not here: both need hours of data rather than seconds, an Allan variance and a replay log’s autocorrelation, and belong to the replay harness’s --derive. How well a figure is known is MIN_READINGS’s and BLOCK’s to say, and the block length is the larger share.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§gyro_white: [f32; 3]

Gyroscope white noise per body axis, rad s⁻¹ / √Hz: a floor under ImuNoise::gyro_white.

§accel_white: [f32; 3]

Accelerometer white noise per body axis, m s⁻² / √Hz: a floor under ImuNoise::accel_white.

§baro: Option<AltitudeNoise>

The barometer readings’ variance: a floor under the R_m a barometric altitude is fused with, the white part (24′) multiplies by its correlation factor. None under MIN_READINGS distinct readings, where the IMU’s figures can still be taken and the window can still have set α₀, which takes two.

A held reading counts once, as it does for α₀, and two genuine readings that agree are merged by the same test, so a barometer quantized coarsely enough to repeat itself reads a variance larger than its own.

Fused as R_m it is too small, which is what calling it a floor claims: on five of the six real logs that report it, nis_baro reads past 1 (evidence).

§blocks: u64

The BLOCKs the densities were taken over, the fewer of the two sensors’.

§baro_readings: u64

The distinct barometer readings baro was taken over.

Implementations§

Source§

impl WindowNoise

Source

pub const MIN_READINGS: u64 = 9

The fewest readings a sensor’s figure is taken from, a barometer’s readings or an IMU’s BLOCKs: under it, StaticWindow::noise reports none for that sensor.

A standard deviation taken from n readings is known to about 1/√(2(n − 1)) of itself, so nine is ±25 % and a 2 s window’s 40 blocks ±11 %, and a variance, the barometer’s, to twice that. Fewer is the two-sample variance a window too short to measure anything would otherwise report as a measurement.

The barometric reference α₀ does not wait for it, and takes a variance from two readings: that variance starts an estimate (30′) goes on refining, where a figure reported here is final. Holding α₀ to nine would leave the corpus no real vehicle whose short still start sets its own reference (evidence).

Source

pub const BLOCK: Seconds

The span an IMU’s increments are summed over before their scatter is taken: the time scale its white-noise density is read at, T of (8″).

Long enough to average out what a still airframe adds near the sample rate, and short enough that a 2 s window holds 40 blocks. Shorter still reads the aliasing; longer does not settle the figure either, which moves by up to 2.3× between 50 and 125 ms on the corpus: that is its real uncertainty, larger than the ±11 % of its 40 blocks (evidence). A time rather than a count, so the figure means the same at every IMU rate.

Source

pub fn worst_gyro_white(&self) -> f32

The gyroscope’s worst axis, the one density ImuNoise::gyro_white takes.

Source

pub fn worst_accel_white(&self) -> f32

The accelerometer’s worst axis, the one density ImuNoise::accel_white takes.

Trait Implementations§

Source§

impl Clone for WindowNoise

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 WindowNoise

Source§

impl Debug for WindowNoise

Source§

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

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

impl Format for WindowNoise

Available on crate feature defmt only.
Source§

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

Writes the defmt representation of self to fmt.
Source§

impl PartialEq for WindowNoise

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 WindowNoise

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.