Event

Enum Event 

Source
pub enum Event {
    Imu {
        dt_s: f64,
        imu: IMUData,
        elapsed_s: f64,
    },
    Gnss {
        meas: GPSPositionAndVelocityMeasurement,
        elapsed_s: f64,
    },
    Altitude {
        meas: RelativeAltitudeMeasurement,
        elapsed_s: f64,
    },
    GravityAnomaly {
        meas: GravityAnomalyMeasurement,
        elapsed_s: f64,
    },
    MagneticAnomaly {
        meas: MagneticAnomalyMeasurement,
        elapsed_s: f64,
    },
}
Expand description

A simulation event delivered to the filter in time order.

Events represent sensor updates or other observations that occur during playback of recorded data. The event stream is built by combining raw logged records with a GnssDegradationConfig (for GNSS scheduling and fault injection), and then fed to the UKF loop.

Each variant bundles both the measurement itself and the elapsed simulation time when it occurred. This allows the filter to advance its state correctly and to process updates at realistic intervals.

§Variants

  • Imu: An inertial measurement unit (IMU) step, including the time delta since the previous step. Drives the prediction step.
  • Gnss: A GNSS position/velocity fix (possibly degraded or spoofed).
  • Altitude: A relative altitude or barometric measurement, constraining vertical drift.
  • GravityAnomaly: A gravity anomaly measurement, derived from accelerometer or dedicated gravimeter data and matched against a gravity anomaly map.
  • MagneticAnomaly: A magnetic anomaly measurement, derived from magnetometer data (magnitude or components) and matched against a magnetic anomaly map.

§Extensibility

You can add further variants (e.g., Pressure, SonarDepth, StarTracker) in the same style if more sensors are to be fused.

§Example

use strapdown::messages::Event;
use strapdown::IMUData;
use strapdown::filter::{GPSPositionAndVelocityMeasurement, GravityAnomalyMeasurement, MagneticAnomalyMeasurement};
use nalgebra::Vector3;
// An IMU event with 0.01 s timestep
let imu_event = Event::Imu {
    dt_s: 0.01,
    imu: IMUData { accel: Vector3::new(0.0, 0.1, -9.8),
                   gyro: Vector3::new(0.001, 0.0, 0.0) },
    elapsed_s: 1.23,
};

// A GNSS event
let gnss_meas = GPSPositionAndVelocityMeasurement {
    latitude: 39.95,
    longitude: -75.16,
    altitude: 30.0,
    northward_velocity: 0.1,
    eastward_velocity: -0.2,
    horizontal_noise_std: 5.0,
    vertical_noise_std: 10.0,
    velocity_noise_std: 0.2,
};
let gnss_event = Event::Gnss { meas: gnss_meas, elapsed_s: 2.0 };

Variants§

§

Imu

IMU prediction step.

  • dt_s: Time delta since the previous event (seconds).
  • imu: Inertial data record (accelerometer, gyroscope, etc.).
  • elapsed_s: Elapsed simulation time at this event (seconds).

Fields

§dt_s: f64
§elapsed_s: f64
§

Gnss

GNSS position/velocity measurement (possibly degraded or spoofed).

  • meas: GNSS measurement structure.
  • elapsed_s: Elapsed simulation time at this fix (seconds).
§

Altitude

Relative altitude or barometric measurement.

  • meas: Altitude measurement structure.
  • elapsed_s: Elapsed simulation time at this measurement (seconds).

Fields

§elapsed_s: f64
§

GravityAnomaly

Gravity anomaly measurement, used for map matching against known gravity anomalies.

Typically expressed in milligals (mGal).

  • meas: Gravity anomaly measurement structure.
  • elapsed_s: Elapsed simulation time (seconds).

Fields

§elapsed_s: f64
§

MagneticAnomaly

Magnetic anomaly measurement, used for map matching against magnetic anomaly maps.

Typically expressed in nanoteslas (nT).

  • meas: Magnetic anomaly measurement structure.
  • elapsed_s: Elapsed simulation time (seconds).

Fields

§elapsed_s: f64

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Event

Returns a duplicate 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 Debug for Event

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

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<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<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> 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V