Struct Params

Source
pub struct Params {
Show 25 fields pub tau_acc: Float, pub tau_mag: Float, pub motion_bias_est_enabled: bool, pub rest_bias_est_enabled: bool, pub mag_dist_rejection_enabled: bool, pub bias_sigma_init: Float, pub bias_forgetting_time: Float, pub bias_clip: Float, pub bias_sigma_motion: Float, pub bias_vertical_forgetting_factor: Float, pub bias_sigma_rest: Float, pub rest_min_t: Float, pub rest_filter_tau: Float, pub rest_th_gyr: Float, pub rest_th_acc: Float, pub mag_current_tau: Float, pub mag_ref_tau: Float, pub mag_norm_th: Float, pub mag_dip_th: Float, pub mag_new_time: Float, pub mag_new_first_time: Float, pub mag_new_min_gyr: Float, pub mag_min_undisturbed_time: Float, pub mag_max_rejection_time: Float, pub mag_rejection_factor: Float,
}
Expand description

Struct containing all tuning parameters used by the VQF class.

The parameters influence the behavior of the algorithm and are independent of the sampling rate of the IMU data. The constructor sets all parameters to the default values.

The parameters motion_bias_est_enabled, rest_bias_est_enabled, and mag_dist_rejection_enabled can be used to enable/disable the main features of the VQF algorithm. The time constants tau_acc and tau_mag can be tuned to change the trust on the accelerometer and magnetometer measurements, respectively. The remaining parameters influence bias estimation and magnetometer rejection.

Fields§

§tau_acc: Float

Time constant $\tau_\mathrm{acc}$ for accelerometer low-pass filtering in seconds.

Small values for $\tau_\mathrm{acc}$ imply trust on the accelerometer measurements and while large values of $\tau_\mathrm{acc}$ imply trust on the gyroscope measurements.

The time constant $\tau_\mathrm{acc}$ corresponds to the cutoff frequency $f_\mathrm{c}$ of the second-order Butterworth low-pass filter as follows: $f_\mathrm{c} = \frac{\sqrt{2}}{2\pi\tau_\mathrm{acc}}$.

Default value: 3.0 s

§tau_mag: Float

Time constant $\tau_\mathrm{mag}$ for magnetometer update in seconds.

Small values for $\tau_\mathrm{mag}$ imply trust on the magnetometer measurements and while large values of $\tau_\mathrm{mag}$ imply trust on the gyroscope measurements.

The time constant $\tau_\mathrm{mag}$ corresponds to the cutoff frequency $f_\mathrm{c}$ of the first-order low-pass filter for the heading correction as follows: $f_\mathrm{c} = \frac{1}{2\pi\tau_\mathrm{mag}}$.

Default value: 9.0 s

§motion_bias_est_enabled: bool

Enables gyroscope bias estimation during motion phases.

If set to true (default), gyroscope bias is estimated based on the inclination correction only, i.e. without using magnetometer measurements.

§rest_bias_est_enabled: bool

Enables rest detection and gyroscope bias estimation during rest phases.

If set to true (default), phases in which the IMU is at rest are detected. During rest, the gyroscope bias is estimated from the low-pass filtered gyroscope readings.

§mag_dist_rejection_enabled: bool

Enables magnetic disturbance detection and magnetic disturbance rejection.

If set to true (default), the magnetic field is analyzed. For short disturbed phases, the magnetometer-based correction is disabled totally. If the magnetic field is always regarded as disturbed or if the duration of the disturbances exceeds mag_max_rejection_time, magnetometer-based updates are performed, but with an increased time constant.

§bias_sigma_init: Float

Standard deviation of the initial bias estimation uncertainty (in degrees per second).

Default value: 0.5 °/s

§bias_forgetting_time: Float

Time in which the bias estimation uncertainty increases from 0 °/s to 0.1 °/s (in seconds).

This value determines the system noise assumed by the Kalman filter.

Default value: 100.0 s

§bias_clip: Float

Maximum expected gyroscope bias (in degrees per second).

This value is used to clip the bias estimate and the measurement error in the bias estimation update step. It is further used by the rest detection algorithm in order to not regard measurements with a large but constant angular rate as rest.

Default value: 2.0 °/s

§bias_sigma_motion: Float

Standard deviation of the converged bias estimation uncertainty during motion (in degrees per second).

This value determines the trust on motion bias estimation updates. A small value leads to fast convergence.

Default value: 0.1 °/s

§bias_vertical_forgetting_factor: Float

Forgetting factor for unobservable bias in vertical direction during motion.

As magnetometer measurements are deliberately not used during motion bias estimation, gyroscope bias is not observable in vertical direction. This value is the relative weight of an artificial zero measurement that ensures that the bias estimate in the unobservable direction will eventually decay to zero.

Default value: 0.0001

§bias_sigma_rest: Float

Standard deviation of the converged bias estimation uncertainty during rest (in degrees per second).

This value determines the trust on rest bias estimation updates. A small value leads to fast convergence.

Default value: 0.03 °

§rest_min_t: Float

Time threshold for rest detection (in seconds).

Rest is detected when the measurements have been close to the low-pass filtered reference for the given time.

Default value: 1.5 s

§rest_filter_tau: Float

Time constant for the low-pass filter used in rest detection (in seconds).

This time constant characterizes a second-order Butterworth low-pass filter used to obtain the reference for rest detection.

Default value: 0.5 s

§rest_th_gyr: Float

Angular velocity threshold for rest detection (in °/s).

For rest to be detected, the norm of the deviation between measurement and reference must be below the given threshold. (Furthermore, the absolute value of each component must be below bias_clip).

Default value: 2.0 °/s/

§rest_th_acc: Float

Acceleration threshold for rest detection (in m/s²).

For rest to be detected, the norm of the deviation between measurement and reference must be below the given threshold.

Default value: 0.5 m/s²

§mag_current_tau: Float

Time constant for current norm/dip value in magnetic disturbance detection (in seconds).

This (very fast) low-pass filter is intended to provide additional robustness when the magnetometer measurements are noisy or not sampled perfectly in sync with the gyroscope measurements. Set to -1 to disable the low-pass filter and directly use the magnetometer measurements.

Default value: 0.05 s

§mag_ref_tau: Float

Time constant for the adjustment of the magnetic field reference (in seconds).

This adjustment allows the reference estimate to converge to the observed undisturbed field.

Default value: 20.0 s

§mag_norm_th: Float

Relative threshold for the magnetic field strength for magnetic disturbance detection.

This value is relative to the reference norm.

Default value: 0.1 (10%)

§mag_dip_th: Float

Threshold for the magnetic field dip angle for magnetic disturbance detection (in degrees).

Default vaule: 10 °

§mag_new_time: Float

Duration after which to accept a different homogeneous magnetic field (in seconds).

A different magnetic field reference is accepted as the new field when the measurements are within the thresholds mag_norm_th and mag_dip_th for the given time. Additionally, only phases with sufficient movement, specified by mag_new_min_gyr, count.

Default value: 20.0

§mag_new_first_time: Float

Duration after which to accept a homogeneous magnetic field for the first time (in seconds).

This value is used instead of mag_new_time when there is no current estimate in order to allow for the initial magnetic field reference to be obtained faster.

Default value: 5.0

§mag_new_min_gyr: Float

Minimum angular velocity needed in order to count time for new magnetic field acceptance (in °/s).

Durations for which the angular velocity norm is below this threshold do not count towards reaching mag_new_time.

Default value: 20.0 °/s

§mag_min_undisturbed_time: Float

Minimum duration within thresholds after which to regard the field as undisturbed again (in seconds).

Default value: 0.5 s

§mag_max_rejection_time: Float

Maximum duration of full magnetic disturbance rejection (in seconds).

For magnetic disturbances up to this duration, heading correction is fully disabled and heading changes are tracked by gyroscope only. After this duration (or for many small disturbed phases without sufficient time in the undisturbed field in between), the heading correction is performed with an increased time constant (see mag_rejection_factor).

Default value: 60.0 s

§mag_rejection_factor: Float

Factor by which to slow the heading correction during long disturbed phases.

After mag_max_rejection_time of full magnetic disturbance rejection, heading correction is performed with an increased time constant. This parameter (approximately) specifies the factor of the increase.

Furthermore, after spending mag_max_rejection_time/mag_rejection_factor seconds in an undisturbed magnetic field, the time is reset and full magnetic disturbance rejection will be performed for up to mag_max_rejection_time again.

Default value: 2.0

Trait Implementations§

Source§

impl Clone for Params

Source§

fn clone(&self) -> Params

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Default for Params

Source§

fn default() -> Self

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

impl Copy for Params

Auto Trait Implementations§

§

impl Freeze for Params

§

impl RefUnwindSafe for Params

§

impl Send for Params

§

impl Sync for Params

§

impl Unpin for Params

§

impl UnwindSafe for Params

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.