diff --git a/Project.toml b/Project.toml index dd69408..3e76187 100755 --- a/Project.toml +++ b/Project.toml @@ -33,7 +33,7 @@ Dates = "1" Dictionaries = "0.4" DocStringExtensions = "0.6, 0.7, 0.8, 0.9" Downloads = "1" -GNSSDecoder = "3.6" +GNSSDecoder = "3.7" GNSSSignals = "3.3" Geodesy = "0.5, 1.0" LinearAlgebra = "1" diff --git a/src/PositionVelocityTime.jl b/src/PositionVelocityTime.jl index c0f1ef9..aede5b6 100755 --- a/src/PositionVelocityTime.jl +++ b/src/PositionVelocityTime.jl @@ -552,7 +552,12 @@ function calc_pvt( ) length(states) < 4 && throw(ArgumentError("You'll need at least 4 satellites to calculate PVT")) - healthy_indices = findall(x -> is_sat_healthy(x.decoder), states) + # Keep a satellite only if its full nav-data set is decoded and it reports healthy. + # Checking completeness first guarantees the health bit has been decoded. + healthy_indices = findall( + x -> is_decoding_completed_for_positioning(x.decoder) && is_sat_healthy(x.decoder), + states, + ) length(healthy_indices) < 4 && return prev_pvt healthy_states = view(states, healthy_indices) num_sats = length(healthy_states)