#[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
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: u64The BLOCKs the densities were taken over, the fewer of the two
sensors’.
baro_readings: u64The distinct barometer readings baro was taken over.
Implementations§
Source§impl WindowNoise
impl WindowNoise
Sourcepub const MIN_READINGS: u64 = 9
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).
Sourcepub const BLOCK: Seconds
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.
Sourcepub fn worst_gyro_white(&self) -> f32
pub fn worst_gyro_white(&self) -> f32
The gyroscope’s worst axis, the one density ImuNoise::gyro_white takes.
Sourcepub fn worst_accel_white(&self) -> f32
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
impl Clone for WindowNoise
impl Copy for WindowNoise
Source§impl Debug for WindowNoise
impl Debug for WindowNoise
Source§impl Format for WindowNoise
Available on crate feature defmt only.
impl Format for WindowNoise
defmt only.Source§impl PartialEq for WindowNoise
impl PartialEq for WindowNoise
impl StructuralPartialEq for WindowNoise
Auto Trait Implementations§
impl Freeze for WindowNoise
impl RefUnwindSafe for WindowNoise
impl Send for WindowNoise
impl Sync for WindowNoise
impl Unpin for WindowNoise
impl UnsafeUnpin for WindowNoise
impl UnwindSafe for WindowNoise
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.