Description
The guard in calc_pvt that is meant to reject mixed-constellation input never actually rejects anything — the ArgumentError is constructed but never thrown:
https://github.com/JuliaGNSS/PositionVelocityTime.jl/blob/master/src/PositionVelocityTime.jl#L238-L239
all(state -> state.system == states[1].system, states) ||
ArgumentError("For now all satellites need to be base on the same GNSS")
Because condition || ArgumentError(...) only creates the exception object and discards it, a vector mixing GPS and Galileo satellites passes straight through. The code then proceeds with system = first(states).system and derives the week number / system start time from first(healthy_states).decoder only, silently producing a wrong result instead of erroring.
Fix
all(state -> state.system == states[1].system, states) ||
throw(ArgumentError("For now all satellites need to be based on the same GNSS"))
(also fixes the "base" → "based" typo in the message).
Context
This is a pre-existing bug, surfaced while reviewing #38. That PR's constellation-wide ionospheric model selection assumes a single GNSS per solve, so enforcing this invariant becomes more relevant.
Description
The guard in
calc_pvtthat is meant to reject mixed-constellation input never actually rejects anything — theArgumentErroris constructed but never thrown:https://github.com/JuliaGNSS/PositionVelocityTime.jl/blob/master/src/PositionVelocityTime.jl#L238-L239
Because
condition || ArgumentError(...)only creates the exception object and discards it, a vector mixing GPS and Galileo satellites passes straight through. The code then proceeds withsystem = first(states).systemand derives the week number / system start time fromfirst(healthy_states).decoderonly, silently producing a wrong result instead of erroring.Fix
(also fixes the "base" → "based" typo in the message).
Context
This is a pre-existing bug, surfaced while reviewing #38. That PR's constellation-wide ionospheric model selection assumes a single GNSS per solve, so enforcing this invariant becomes more relevant.