pub enum GnssFaultModel {
None,
Degraded {
rho_pos: f64,
sigma_pos_m: f64,
rho_vel: f64,
sigma_vel_mps: f64,
r_scale: f64,
},
SlowBias {
drift_n_mps: f64,
drift_e_mps: f64,
q_bias: f64,
rotate_omega_rps: f64,
},
Hijack {
offset_n_m: f64,
offset_e_m: f64,
start_s: f64,
duration_s: f64,
},
Combo(Vec<GnssFaultModel>),
}
Expand description
Models how GNSS measurement content is corrupted before it reaches the filter.
This is complementary to GnssScheduler
, which decides when GNSS
updates are delivered. GnssFaultModel
decides what corruption to apply
to each delivered measurement. Together, they allow you to simulate a wide
range of denial, jamming, or spoofing conditions.
Typical usage is to wrap a “truth-like” GNSS fix (from your dataset) with one of these variants before passing it to the UKF update step.
§Variants
None
: deliver the fix unchanged.Degraded
: add AR(1)-correlated noise to position and velocity, and inflate the advertised covariance. Simulates low-SNR or multipath conditions.SlowBias
: apply a slowly drifting offset in N/E position and velocity. Simulates soft spoofing where the trajectory is nudged gradually away from truth.Hijack
: apply a hard constant offset in N/E position during a fixed time window. Simulates hard spoofing where the solution is forced onto a parallel displaced track.Combo
: apply several fault models in sequence (output of one feeds into the next), allowing composition of multiple effects.
§Examples
use strapdown::messages::GnssFaultModel;
// No corruption (baseline)
let fault = GnssFaultModel::None;
// Degraded accuracy: ~3 m wander, ~0.3 m/s vel wander, 5x inflated R
let fault = GnssFaultModel::Degraded {
rho_pos: 0.99,
sigma_pos_m: 3.0,
rho_vel: 0.95,
sigma_vel_mps: 0.3,
r_scale: 5.0,
};
// Slow bias drifting north at 2 cm/s
let fault = GnssFaultModel::SlowBias {
drift_n_mps: 0.02,
drift_e_mps: 0.0,
q_bias: 1e-6,
rotate_omega_rps: 0.0,
};
// Hijack: apply 50 m north offset between 120–180 s
let fault = GnssFaultModel::Hijack {
offset_n_m: 50.0,
offset_e_m: 0.0,
start_s: 120.0,
duration_s: 60.0,
};
// Combo: first drift slowly, then add hijack window
let fault = GnssFaultModel::Combo(vec![
GnssFaultModel::SlowBias { drift_n_mps: 0.02, drift_e_mps: 0.0, q_bias: 1e-6, rotate_omega_rps: 0.0 },
GnssFaultModel::Hijack { offset_n_m: 50.0, offset_e_m: 0.0, start_s: 120.0, duration_s: 60.0 },
]);
Variants§
None
No corruption; GNSS fixes are passed through unchanged.
Degraded
(2) Degraded accuracy: AR(1)-correlated noise on position and velocity, plus inflated advertised covariance. Models low-SNR or multipath cases.
Fields
SlowBias
(5) Slow drifting bias (soft spoof), applied in N/E meters and velocity.
Models gradual displacement of the navigation solution that appears plausible to the filter.
Fields
Hijack
(6) Hard spoof window: apply a constant N/E offset for a fixed time window.
Simulates abrupt hijacking of the trajectory.
Fields
Combo(Vec<GnssFaultModel>)
Compose multiple effects by chaining models together.
The output of one model is fed as the input to the next. This allows
combining e.g. SlowBias
with a Hijack
to simulate multi-stage spoofing.
Trait Implementations§
Source§impl Clone for GnssFaultModel
impl Clone for GnssFaultModel
Source§fn clone(&self) -> GnssFaultModel
fn clone(&self) -> GnssFaultModel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for GnssFaultModel
impl RefUnwindSafe for GnssFaultModel
impl Send for GnssFaultModel
impl Sync for GnssFaultModel
impl Unpin for GnssFaultModel
impl UnwindSafe for GnssFaultModel
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,
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.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.