Skip to main content

solve_with_fallback

Function solve_with_fallback 

Source
pub fn solve_with_fallback(
    precise: &[Sp3],
    broadcast: &dyn EphemerisSource,
    inputs: &SolveInputs,
    policy: StalenessPolicy,
    with_geodetic: bool,
) -> Result<SourcedSolution, FallbackError>
Expand description

Solve a receiver position, preferring precise products and falling back to broadcast ephemeris, reporting which source was used and how stale it is.

The precise path is tried first through the product-staleness selection layer (select_sp3) at the receive epoch (inputs.t_rx_j2000_s):

A broadcast fix is therefore never substituted silently: its BroadcastReason always records why precise was not used.

policy bounds how stale a precise product may be before broadcast is preferred; a generous cap keeps precise in use across normal product latency, a zero cap forces broadcast whenever no product covers the exact epoch.