API Reference

Types

PositionVelocityTime.SatelliteStateType
SatelliteState{CP<:Real}

Combines the GNSS decoder state with code and carrier phase measurements for a single satellite.

Fields

  • decoder::GNSSDecoderState: GNSS decoder state containing decoded navigation data
  • system::AbstractGNSS: GNSS system (e.g., GPSL1(), GalileoE1B())
  • code_phase::CP: Code phase measurement
  • carrier_doppler: Carrier Doppler frequency in Hz
  • carrier_phase::CP: Carrier phase measurement (default: 0.0)

Constructors

SatelliteState(; decoder, system, code_phase, carrier_doppler, carrier_phase=0.0)
SatelliteState(decoder, system, sat_state::SatState)

The second constructor extracts code phase, carrier Doppler, and carrier phase from a Tracking.SatState.

source
PositionVelocityTime.PVTSolutionType
PVTSolution

Complete Position, Velocity, and Time solution from GNSS measurements.

Fields

  • position::ECEF: User position in ECEF coordinates (meters)
  • velocity::ECEF: User velocity in ECEF coordinates (m/s)
  • time_correction::Float64: Estimated receiver clock bias (meters)
  • time::Union{TAIEpoch{Float64}, Nothing}: Estimated time as a TAI epoch
  • relative_clock_drift::Float64: Relative receiver clock drift (dimensionless)
  • dop::Union{DOP, Nothing}: Dilution of precision values
  • sats::Dict{Int, SatInfo}: Dictionary mapping PRN to satellite info (position and time)
source

PVT Computation

PositionVelocityTime.calc_pvtFunction
calc_pvt(states::AbstractVector{<:SatelliteState}, prev_pvt::PVTSolution=PVTSolution()) -> PVTSolution

Calculate Position, Velocity, and Time (PVT) from GNSS satellite measurements.

Requires at least 4 healthy satellites from the same GNSS system. Uses least-squares estimation for position and time, and solves for velocity and clock drift from carrier Doppler measurements.

Arguments

  • states: Vector of SatelliteState for observed satellites
  • prev_pvt: Previous PVT solution used as initial guess (default: origin)

Returns

A PVTSolution containing position, velocity, time, DOP values, and satellite information. Returns prev_pvt if fewer than 4 healthy satellites are available or if the GDOP is negative.

Throws

  • ArgumentError: If fewer than 4 satellite states are provided
source

Position and Velocity

PositionVelocityTime.get_LLAFunction
get_LLA(pvt::PVTSolution) -> LLA

Convert the ECEF position in the PVT solution to geodetic coordinates (latitude, longitude, altitude) using the WGS84 ellipsoid.

source
PositionVelocityTime.calc_satellite_positionFunction
calc_satellite_position(decoder::GNSSDecoder.GNSSDecoderState, t)
calc_satellite_position(state::SatelliteState)

Calculate the satellite ECEF position from orbital parameters at time t.

The first method takes a decoder state and explicit time. The second method computes the corrected transmission time from the SatelliteState automatically.

Arguments

  • decoder: GNSS decoder state containing ephemeris data
  • t: Transmission time in system time (seconds)
  • state: A SatelliteState combining decoder, system, and phase measurements

Returns

An SVector{3, Float64} with the satellite position in ECEF coordinates (meters).

source
PositionVelocityTime.calc_satellite_position_and_velocityFunction
calc_satellite_position_and_velocity(decoder::GNSSDecoder.GNSSDecoderState, t)
calc_satellite_position_and_velocity(state::SatelliteState)

Calculate the satellite ECEF position and velocity from orbital parameters at time t.

Uses Keplerian orbital mechanics with perturbation corrections (harmonic corrections for argument of latitude, radius, and inclination) to propagate the satellite ephemeris.

Arguments

  • decoder: GNSS decoder state containing ephemeris data
  • t: Transmission time in system time (seconds)
  • state: A SatelliteState combining decoder, system, and phase measurements

Returns

A named tuple (position, velocity) where each is an SVector{3, Float64} in ECEF coordinates (meters and m/s respectively).

source
PositionVelocityTime.get_sat_enuFunction
get_sat_enu(user_pos_ecef::ECEF, sat_pos_ecef::ECEF) -> Spherical

Convert satellite position to East-North-Up (ENU) spherical coordinates (azimuth and elevation) relative to the user position.

Arguments

  • user_pos_ecef::ECEF: User position in ECEF coordinates
  • sat_pos_ecef::ECEF: Satellite position in ECEF coordinates

Returns

Spherical coordinates containing azimuth and elevation of the satellite as seen from the user position.

source

Dilution of Precision

Utilities

PositionVelocityTime.get_frequency_offsetFunction
get_frequency_offset(pvt::PVTSolution, base_frequency) -> typeof(base_frequency)

Calculate the receiver frequency offset from the relative clock drift and a base frequency.

Arguments

  • pvt::PVTSolution: PVT solution containing the relative clock drift
  • base_frequency: Reference frequency (e.g., the carrier frequency of the GNSS signal)

Returns

The frequency offset as relative_clock_drift * base_frequency.

source