Sidereon.GNSS.Fusion (Sidereon v3.0.0)

Copy Markdown View Source

Stateful GNSS/INS fusion filters.

The filter is an opaque native resource. Calls mutate the native filter and return snapshots, update reports, or versioned state bytes.

Summary

Types

Unit quaternion in scalar-first component order.

Fusion filter configuration map.

Initial closed-loop INS state and covariance.

IMU sample accepted by propagate/2.

IMU specification map accepted by filter_config/2.

Loose GNSS position or position-velocity fix.

Three-by-three row-major matrix.

Tight GNSS raw-observation epoch.

Three-vector in ECEF or body axes, depending on field name.

One position and velocity sample used by outage velocity matching.

Functions

Convert a scalar-first quaternion to its body-to-ECEF direction cosine matrix.

Convert a body-to-ECEF direction cosine matrix to a normalized quaternion.

Return yaw, pitch, and roll in radians for a body-to-ECEF matrix.

Configure retained IMU samples and GNSS checkpoints for time synchronization.

Alias for configure_time_sync/2 matching Python's retained-history name.

Encode the current filter state and retained time-sync history as bytes.

Build a fusion filter config from an IMU spec and options.

Alias for from_state_bytes/2 matching Python's encoded-state constructor.

Restore a new stateful filter from versioned fusion state bytes.

Return a first-order Gauss-Markov bias decay factor.

Return the Gauss-Markov bias variance increment over a time interval.

Return per-fix-status sigma multipliers for loose GNSS updates.

Return the WGS84 normal-gravity vector at an ECEF position.

Return standard IGG-III measurement reweighting settings for loose updates.

Return the simulator's current Gauss-Markov bias state.

Return the simulator's current rate-random-walk state.

Return an IMU stochastic specification.

Read a navigation state's body-to-ECEF attitude as a normalized quaternion.

Read a navigation state's attitude as yaw, pitch, and roll in radians.

Build a new stateful filter.

Create a deterministic stateful IMU simulator.

Create a standalone ECEF strapdown mechanizer from a navigation state.

Return wheeled-vehicle lateral and vertical velocity constraint settings.

Return WGS84 normal-gravity magnitude at geodetic latitude and height.

Propagate the filter by one IMU sample.

Propagate the filter by one IMU sample and record the transition for RTS smoothing.

Alias for restore_state/2 matching Python's encoded-state restore method.

Restore an existing filter from bytes produced by encode_state/1.

Generate one simulated sample from a truth IMU increment.

Generate a batch of samples from a navigation-state truth trajectory.

Generate a batch of samples from explicit corrected truth increments.

Apply fixed-interval RTS smoothing to recorded GNSS/INS fusion history.

Return the current closed-loop filter state.

Return windowed IMU thresholds for stationary update detection.

Return zero-velocity and zero-angular-rate stationary update settings.

Return a strapdown mechanization config.

Propagate a standalone mechanizer by one IMU sample.

Return the current standalone mechanizer navigation state.

Return the tight receiver-clock state.

Alias for time_sync_status/1 matching Python's retained-history name.

Return retained-history occupancy for time synchronization.

Reconstruct the mechanization-consistent truth increment between two navigation states.

Apply a loose GNSS position or position-velocity fix at the current filter epoch.

Apply a loose GNSS fix and record before/after checkpoints for RTS smoothing.

Apply a time-synchronized loose GNSS fix, replaying retained history if needed.

Apply configured non-holonomic vehicle constraints.

Apply configured non-holonomic constraints and record checkpoints when applied.

Apply configured stationary zero-velocity and zero-angular-rate constraints.

Apply configured stationary constraints and record checkpoints when applied.

Apply a tight raw GNSS epoch at the current filter epoch.

Apply a tight raw GNSS epoch and record before/after checkpoints for RTS smoothing.

Apply a time-synchronized tight raw GNSS epoch.

Blend a first good post-outage position/velocity fix back over an outage span.

Return endpoint velocity matching settings for one GNSS outage.

Alias for new/2 matching the Python InertialFilter.with_config constructor.

Return standard Yang predicted-covariance adaptation settings for loose updates.

Types

attitude_quaternion()

@type attitude_quaternion() ::
  Sidereon.GNSS.Fusion.AttitudeQuaternion.t()
  | {number(), number(), number(), number()}

Unit quaternion in scalar-first component order.

filter_config()

@type filter_config() :: map()

Fusion filter configuration map.

filter_state()

@type filter_state() :: map()

Initial closed-loop INS state and covariance.

imu_sample()

@type imu_sample() :: Sidereon.GNSS.Fusion.ImuSample.t() | map()

IMU sample accepted by propagate/2.

imu_spec()

@type imu_spec() ::
  Sidereon.GNSS.Fusion.ImuSpec.t() | map() | :mems | :tactical | :navigation

IMU specification map accepted by filter_config/2.

inertial_error()

@type inertial_error() ::
  {:invalid_input, String.t(), String.t()}
  | :non_monotonic_sample
  | :singular_calibration
  | :degenerate_attitude

loose_measurement()

@type loose_measurement() :: Sidereon.GNSS.Fusion.GnssFixMeasurement.t() | map()

Loose GNSS position or position-velocity fix.

mat3()

@type mat3() :: [vec3()]

Three-by-three row-major matrix.

tight_epoch()

@type tight_epoch() :: Sidereon.GNSS.Fusion.TightGnssEpoch.t() | map()

Tight GNSS raw-observation epoch.

vec3()

@type vec3() :: {number(), number(), number()} | [number()]

Three-vector in ECEF or body axes, depending on field name.

velocity_match_state()

@type velocity_match_state() :: Sidereon.GNSS.Fusion.VelocityMatchState.t() | map()

One position and velocity sample used by outage velocity matching.

Functions

attitude_dcm_from_quaternion(quaternion)

@spec attitude_dcm_from_quaternion(attitude_quaternion()) ::
  {:ok, mat3()} | {:error, inertial_error()}

Convert a scalar-first quaternion to its body-to-ECEF direction cosine matrix.

attitude_quaternion_from_dcm(dcm)

@spec attitude_quaternion_from_dcm(mat3()) ::
  {:ok, Sidereon.GNSS.Fusion.AttitudeQuaternion.t()}
  | {:error, inertial_error()}

Convert a body-to-ECEF direction cosine matrix to a normalized quaternion.

attitude_yaw_pitch_roll_rad(dcm)

@spec attitude_yaw_pitch_roll_rad(mat3()) :: {:ok, vec3()} | {:error, term()}

Return yaw, pitch, and roll in radians for a body-to-ECEF matrix.

configure_time_sync(filter, opts)

@spec configure_time_sync(Sidereon.GNSS.Fusion.Filter.t(), keyword() | map()) ::
  {:ok, map()} | {:error, term()}

Configure retained IMU samples and GNSS checkpoints for time synchronization.

configure_time_sync_history(filter, config)

@spec configure_time_sync_history(
  Sidereon.GNSS.Fusion.Filter.t(),
  Sidereon.GNSS.Fusion.TimeSyncHistoryConfig.t() | keyword() | map()
) :: {:ok, map()} | {:error, term()}

Alias for configure_time_sync/2 matching Python's retained-history name.

encode_state(filter)

@spec encode_state(Sidereon.GNSS.Fusion.Filter.t()) ::
  {:ok, binary()} | {:error, term()}

Encode the current filter state and retained time-sync history as bytes.

filter_config(spec \\ :mems, opts \\ [])

@spec filter_config(imu_spec(), keyword() | map()) :: filter_config()

Build a fusion filter config from an IMU spec and options.

Options include :filter_kind (:ekf or :ukf), :mechanization, :loose, :tight, :imu_model, :imu_to_body_dcm, and :ukf_update_options. Loose config may include :fix_status_weighting, :measurement_reweighting, :prediction_adaptation, :stationary_updates, and :non_holonomic.

from_encoded_state(bytes, config)

@spec from_encoded_state(binary(), filter_config()) ::
  {:ok, Sidereon.GNSS.Fusion.Filter.t()} | {:error, term()}

Alias for from_state_bytes/2 matching Python's encoded-state constructor.

from_state_bytes(bytes, config \\ filter_config())

@spec from_state_bytes(binary(), filter_config()) ::
  {:ok, Sidereon.GNSS.Fusion.Filter.t()} | {:error, term()}

Restore a new stateful filter from versioned fusion state bytes.

gauss_markov_bias_decay(dt_s, tau_s)

@spec gauss_markov_bias_decay(number(), number() | :infinity | nil) ::
  {:ok, float()} | {:error, inertial_error()}

Return a first-order Gauss-Markov bias decay factor.

gauss_markov_bias_variance_increment(instability, dt_s, tau_s)

@spec gauss_markov_bias_variance_increment(
  number(),
  number(),
  number() | :infinity | nil
) ::
  {:ok, float()} | {:error, inertial_error()}

Return the Gauss-Markov bias variance increment over a time interval.

gnss_fix_status_weighting(opts \\ [])

@spec gnss_fix_status_weighting(keyword() | map()) :: map()

Return per-fix-status sigma multipliers for loose GNSS updates.

gravity_ecef_mps2(position_ecef_m)

@spec gravity_ecef_mps2(vec3()) :: {:ok, vec3()} | {:error, inertial_error()}

Return the WGS84 normal-gravity vector at an ECEF position.

igg_iii_measurement_reweighting(opts \\ [])

@spec igg_iii_measurement_reweighting(keyword() | map()) :: map()

Return standard IGG-III measurement reweighting settings for loose updates.

imu_simulator_bias(handle)

@spec imu_simulator_bias(reference()) :: {:ok, map()} | {:error, term()}

Return the simulator's current Gauss-Markov bias state.

imu_simulator_rate_random_walk(handle)

@spec imu_simulator_rate_random_walk(reference()) :: {:ok, map()} | {:error, term()}

Return the simulator's current rate-random-walk state.

imu_spec(spec)

@spec imu_spec(imu_spec()) :: map()

Return an IMU stochastic specification.

Presets are :mems, :tactical, and :navigation. A map is passed through after numeric normalization.

new(state, config \\ filter_config())

@spec new(filter_state(), filter_config()) ::
  {:ok, Sidereon.GNSS.Fusion.Filter.t()} | {:error, term()}

Build a new stateful filter.

new_imu_simulator(spec, opts \\ [])

@spec new_imu_simulator(imu_spec(), keyword() | map()) ::
  {:ok, Sidereon.GNSS.Fusion.ImuSimulator.t()} | {:error, term()}

Create a deterministic stateful IMU simulator.

new_strapdown_mechanizer(state, opts \\ [])

@spec new_strapdown_mechanizer(
  Sidereon.GNSS.Fusion.NavState.t() | map(),
  keyword() | map()
) ::
  {:ok, Sidereon.GNSS.Fusion.StrapdownMechanizer.t()} | {:error, term()}

Create a standalone ECEF strapdown mechanizer from a navigation state.

non_holonomic_constraint_config(opts)

@spec non_holonomic_constraint_config(keyword() | map()) :: map()

Return wheeled-vehicle lateral and vertical velocity constraint settings.

normal_gravity_mps2(lat_rad, height_m)

@spec normal_gravity_mps2(number(), number()) ::
  {:ok, float()} | {:error, inertial_error()}

Return WGS84 normal-gravity magnitude at geodetic latitude and height.

propagate(filter, sample)

@spec propagate(Sidereon.GNSS.Fusion.Filter.t(), imu_sample()) ::
  {:ok, map()} | {:error, term()}

Propagate the filter by one IMU sample.

propagate_recorded(filter, sample, fusion_rts_history_builder)

@spec propagate_recorded(
  Sidereon.GNSS.Fusion.Filter.t(),
  imu_sample(),
  Sidereon.GNSS.Fusion.FusionRtsHistoryBuilder.t()
) :: {:ok, map()} | {:error, term()}

Propagate the filter by one IMU sample and record the transition for RTS smoothing.

restore_encoded_state(filter, bytes)

@spec restore_encoded_state(Sidereon.GNSS.Fusion.Filter.t(), binary()) ::
  {:ok, map()} | {:error, term()}

Alias for restore_state/2 matching Python's encoded-state restore method.

restore_state(filter, bytes)

@spec restore_state(Sidereon.GNSS.Fusion.Filter.t(), binary()) ::
  {:ok, map()} | {:error, term()}

Restore an existing filter from bytes produced by encode_state/1.

simulate_imu_increment(handle, truth)

@spec simulate_imu_increment(reference(), map()) ::
  {:ok, Sidereon.GNSS.Fusion.ImuSample.t()} | {:error, term()}

Generate one simulated sample from a truth IMU increment.

simulate_imu_samples(trajectory, spec, opts \\ [])

@spec simulate_imu_samples(
  [Sidereon.GNSS.Fusion.NavState.t() | map()],
  imu_spec(),
  keyword() | map()
) ::
  {:ok, Sidereon.GNSS.Fusion.SimulatedImuSequence.t()} | {:error, term()}

Generate a batch of samples from a navigation-state truth trajectory.

simulate_imu_samples_from_increments(increments, spec, opts \\ [])

@spec simulate_imu_samples_from_increments(
  [Sidereon.GNSS.Fusion.CorrectedImuIncrement.t() | map()],
  imu_spec(),
  keyword() | map()
) :: {:ok, Sidereon.GNSS.Fusion.SimulatedImuSequence.t()} | {:error, term()}

Generate a batch of samples from explicit corrected truth increments.

smooth_fusion_rts(fusion_rts_history)

Apply fixed-interval RTS smoothing to recorded GNSS/INS fusion history.

state(filter)

@spec state(Sidereon.GNSS.Fusion.Filter.t()) :: {:ok, map()} | {:error, term()}

Return the current closed-loop filter state.

stationary_detector_config(opts)

@spec stationary_detector_config(keyword() | map()) :: map()

Return windowed IMU thresholds for stationary update detection.

stationary_update_config(opts)

@spec stationary_update_config(keyword() | map()) :: map()

Return zero-velocity and zero-angular-rate stationary update settings.

strapdown_config(opts \\ [])

@spec strapdown_config(keyword() | map()) :: map()

Return a strapdown mechanization config.

The current core surface exposes :off coning correction.

strapdown_propagate(handle, sample)

@spec strapdown_propagate(reference(), Sidereon.GNSS.Fusion.ImuSample.t() | map()) ::
  {:ok, Sidereon.GNSS.Fusion.NavState.t()} | {:error, term()}

Propagate a standalone mechanizer by one IMU sample.

strapdown_state(handle)

@spec strapdown_state(reference()) ::
  {:ok, Sidereon.GNSS.Fusion.NavState.t()} | {:error, term()}

Return the current standalone mechanizer navigation state.

tight_clock_state(filter)

@spec tight_clock_state(Sidereon.GNSS.Fusion.Filter.t()) ::
  {:ok, map()} | {:error, term()}

Return the tight receiver-clock state.

time_sync_history_status(filter)

@spec time_sync_history_status(Sidereon.GNSS.Fusion.Filter.t()) ::
  {:ok, map()} | {:error, term()}

Alias for time_sync_status/1 matching Python's retained-history name.

time_sync_status(filter)

@spec time_sync_status(Sidereon.GNSS.Fusion.Filter.t()) ::
  {:ok, map()} | {:error, term()}

Return retained-history occupancy for time synchronization.

true_imu_increment_between(start_state, end_state)

@spec true_imu_increment_between(
  Sidereon.GNSS.Fusion.NavState.t() | map(),
  Sidereon.GNSS.Fusion.NavState.t() | map()
) :: {:ok, Sidereon.GNSS.Fusion.CorrectedImuIncrement.t()} | {:error, term()}

Reconstruct the mechanization-consistent truth increment between two navigation states.

update_loose(filter, measurement)

@spec update_loose(Sidereon.GNSS.Fusion.Filter.t(), loose_measurement()) ::
  {:ok, map()} | {:error, term()}

Apply a loose GNSS position or position-velocity fix at the current filter epoch.

update_loose_recorded(filter, measurement, fusion_rts_history_builder)

@spec update_loose_recorded(
  Sidereon.GNSS.Fusion.Filter.t(),
  loose_measurement(),
  Sidereon.GNSS.Fusion.FusionRtsHistoryBuilder.t()
) :: {:ok, map()} | {:error, term()}

Apply a loose GNSS fix and record before/after checkpoints for RTS smoothing.

update_loose_time_sync(filter, measurement)

@spec update_loose_time_sync(Sidereon.GNSS.Fusion.Filter.t(), loose_measurement()) ::
  {:ok, map()} | {:error, term()}

Apply a time-synchronized loose GNSS fix, replaying retained history if needed.

update_non_holonomic(filter)

@spec update_non_holonomic(Sidereon.GNSS.Fusion.Filter.t()) ::
  {:ok, map() | nil} | {:error, term()}

Apply configured non-holonomic vehicle constraints.

update_non_holonomic_recorded(filter, fusion_rts_history_builder)

@spec update_non_holonomic_recorded(
  Sidereon.GNSS.Fusion.Filter.t(),
  Sidereon.GNSS.Fusion.FusionRtsHistoryBuilder.t()
) :: {:ok, map() | nil} | {:error, term()}

Apply configured non-holonomic constraints and record checkpoints when applied.

update_stationary(filter)

@spec update_stationary(Sidereon.GNSS.Fusion.Filter.t()) ::
  {:ok, map() | nil} | {:error, term()}

Apply configured stationary zero-velocity and zero-angular-rate constraints.

update_stationary_recorded(filter, fusion_rts_history_builder)

@spec update_stationary_recorded(
  Sidereon.GNSS.Fusion.Filter.t(),
  Sidereon.GNSS.Fusion.FusionRtsHistoryBuilder.t()
) :: {:ok, map() | nil} | {:error, term()}

Apply configured stationary constraints and record checkpoints when applied.

update_tight(filter, arg2, epoch)

@spec update_tight(
  Sidereon.GNSS.Fusion.Filter.t(),
  Sidereon.GNSS.SP3.t() | Sidereon.GNSS.Broadcast.t(),
  tight_epoch()
) :: {:ok, map()} | {:error, term()}

Apply a tight raw GNSS epoch at the current filter epoch.

The ephemeris source must be an existing SP3 or broadcast resource. The single-frequency code model subtracts the broadcast group delay of the record a broadcast clock came from, and takes the relativistic clock term RTKLIB peph2pos applies to a precise clock. A satellite state the source refuses because it reads UT1 outside the UT1 table fails the update with {:error, {:ut1_outside_coverage, :before_coverage | :after_coverage}} and leaves the filter unchanged; every update map carries :ut1_degraded, nil or the side of the table a state was read outside under a permissive UT1 policy.

update_tight_recorded(filter, arg2, epoch, fusion_rts_history_builder)

Apply a tight raw GNSS epoch and record before/after checkpoints for RTS smoothing.

update_tight_time_sync(filter, arg2, epoch)

@spec update_tight_time_sync(
  Sidereon.GNSS.Fusion.Filter.t(),
  Sidereon.GNSS.SP3.t() | Sidereon.GNSS.Broadcast.t(),
  tight_epoch()
) :: {:ok, map()} | {:error, term()}

Apply a time-synchronized tight raw GNSS epoch.

velocity_match_outage(states, first_good_fix, config)

@spec velocity_match_outage(
  [velocity_match_state()],
  loose_measurement(),
  keyword() | map()
) ::
  {:ok, map()} | {:error, term()}

Blend a first good post-outage position/velocity fix back over an outage span.

velocity_matching_config(opts)

@spec velocity_matching_config(keyword() | map()) :: map()

Return endpoint velocity matching settings for one GNSS outage.

with_config(state, config)

@spec with_config(filter_state(), filter_config()) ::
  {:ok, Sidereon.GNSS.Fusion.Filter.t()} | {:error, term()}

Alias for new/2 matching the Python InertialFilter.with_config constructor.

yang_prediction_adaptive_factor(opts \\ [])

@spec yang_prediction_adaptive_factor(keyword() | map()) :: map()

Return standard Yang predicted-covariance adaptation settings for loose updates.