GNSS Pseudorange Positioning (gnc-autonomy/navigation/gnss-pseudorange-positioning)
Use when the task is computing a single-epoch GNSS receiver position
fix from pseudorange measurements. Each measurement is the geometric
range to the satellite plus the receiver clock bias expressed in
metres, so the four unknowns (receiver ECEF position x, y, z and clock
bias) need at least four satellites and a nonlinear solve. This leaf
linearizes the range equations about the current state, builds the
geometry matrix H with rows [-(sx-rx)/range, -(sy-ry)/range,
-(sz-rz)/range, 1], solves the 4x4 normal equations (H^T H) dx = H^T dr
with a Gaussian elimination solver, and iterates until the correction
norm falls below tolerance. It pairs with dilution-of-precision for the
geometry quality read, kalman-filter-design for time-domain fusion of
successive fixes, and navigation-frames for the coordinate conventions.
The leaf is a snapshot solution: no smoothing, no dynamics model, and
the geodetic conversion uses a spherical Earth approximation only.
Domain quick reference
- Measurement model: pseudorange_i = geometric range_i + clock bias,
with geometric range |sat_i - recv| from the ECEF positions.
- Geometry row: the partial of the i-th range equation with respect to
the receiver position is the negated line of sight, so row i of H is
[-(sx-rx)/range, -(sy-ry)/range, -(sz-rz)/range, 1]; the 1 is the
clock-bias partial.
- Linearized system: H dx = dr with dr_i = measured_i - predicted_i.
- Normal equations: dx = (H^T H)^-1 H^T dr, a 4x4 solve each iteration.
- Update: x, y, z, clock bias all shift by dx, then ranges and H are
recomputed (iterated least squares, converges in a few iterations
from the origin start).
- Convergence test: stop when the correction norm falls below tol.
- Post-fit residual RMS: sqrt(mean(residual_i^2)) after convergence.
- Post-fit position error: pos_1sigma = uere_equiv * pdop with
uere_equiv = residual RMS and pdop from the trace of (H^T H)^-1,
companion to the dilution-of-precision leaf.
- Spherical geodetic conversion: lat = atan2(z, sqrt(x^2 + y^2)),
lon = atan2(y, x), alt = radius - R_EARTH with R_EARTH =
6378137.0 m (WGS-84 ellipsoid out of scope, flagged approximate).
- Units are metres throughout: satellite positions, pseudoranges and
clock bias all in m. Requires at least four satellites.
- ARP4754A frames the development context for the navigation function;
the relations above are standard engineering methodology,
summary-only.
Workflow
- Gather the satellite record list: each entry needs ECEF x, y, z and
the measured pseudorange in metres; reject sets under four
satellites and records with missing or non-finite values
(ValueError).
- Optionally seed the iteration with a prior x0, y0, z0, b0; the
default start is the ECEF origin with zero clock bias.
- Run solve_iterated(satellites, iters=8, tol=1e-6): the function
rebuilds the geometry matrix each pass, solves the 4x4 normal
equations, updates the state, and stops on a small correction.
- Read the fix dict: x, y, z, clock_bias, the per-satellite
residuals, residual_rms, iterations and the converged flag.
- Gate navigation processing on the fix-quality flags: converged
state, iteration count and the residual RMS level.
- For the geometry quality read, call position_error_estimate on the
fix to get the post-fit gdop, pdop, uere_equiv and pos_1sigma.
- Convert to latitude, longitude and altitude with
to_geodetic_approx when a geodetic output is needed, and flag the
spherical-Earth approximation.
- Confirm the deterministic checks with the contract test
scripts/test_gnss_pseudorange_positioning.py.
Worked example
Four satellites around a receiver at the ECEF origin (0, 0, 0) with a
true clock bias of 100 m (documented test constellation):
- sat1 (0, 0, 20000 km), pseudorange 20000000 + 100 m.
- sat2 (20000 km, 0, 0), pseudorange 20000000 + 100 m.
- sat3 (0, 20000 km, 0), pseudorange 20000000 + 100 m.
- sat4 on the diagonal at 10^7*sqrt(2) m per axis (about 14142 km per
axis, the spec's rounded 14142 km label), true range
sqrt(6)*10^7 = 24494897.42 m, pseudorange 24494897.42 + 100 m.
Run solve_iterated on the four records: the iterated least squares
fix converges to x = -1.44e-13, y = -1.28e-13, z = -1.28e-13 m (the
origin within 0.5 m on every axis), clock bias 100.0 m within 0.5 m,
residual RMS 0.0 m (the exact +100 m bias model solves exactly),
iterations 2 and converged True.
Add a fifth satellite at (-10000 km, -10000 km, 0) with true range
sqrt(2)*10^7 m plus the same 100 m bias, then perturb the z-axis
pseudorange by +3 m: the fix shifts by about 2.53 m in 3D and the
residual RMS becomes 0.596 m, showing how redundant measurements turn
a single measurement error into observable post-fit residuals.
Verification
- Confirm solve_iterated on the worked constellation returns the
origin within 0.5 m per axis and a clock bias within 0.5 m of
100.0 m, with residual RMS below 0.5 m, iterations at most 8 and
converged True.
- Confirm the +3 m perturbation of the redundant set shifts the fix by
about 2.53 m and gives residual_rms above zero.
- Confirm position_error_estimate satisfies pos_1sigma = uere_equiv *
pdop and gives gdop 1.7216197603949122, pdop 1.6202812472328787 on
the clean redundant constellation.
- Confirm every invalid input raises ValueError: fewer than four
satellites, missing satellite keys, non-finite pseudoranges,
iters below 1, a satellite coincident with the receiver and a
singular normal matrix.
- Run the contract test offline: python3
scripts/test_gnss_pseudorange_positioning.py (41 tests,
deterministic).
Pitfalls
- Solving with fewer than four satellites: four unknowns (x, y, z, clock
bias) need at least four measurements and fewer raise ValueError; a
4-satellite exact set solves with zero residual RMS while redundancy is
what exposes measurement errors as post-fit residuals.
- Reading residual RMS as position error on a minimal set: with exactly four
satellites the residual RMS is 0.0 even with a common bias (the worked
+100 m bias solves exactly); position error needs the redundant
constellation or the position_error_estimate read.
- Ignoring the converged flag and iteration count: solve_iterated stops when
the correction norm falls below tol and reports converged and iterations;
gate navigation processing on those flags before quoting the fix.
- Forgetting the spherical approximation: to_geodetic_approx uses a
spherical Earth (R_EARTH = 6378137.0 m) with WGS-84 out of scope, so
geodetic outputs carry that approximation.
- A satellite coincident with the receiver (zero range), singular normal
matrix, missing keys, non-finite pseudoranges and iters below 1 raise
ValueError; pos_1sigma = uere_equiv*pdop ties into the
dilution-of-precision leaf.
Related leaves
- gnc-autonomy/navigation/dilution-of-precision: the geometry quality
read (DOP values and elevation mask) for subset selection around
this snapshot fix.
- gnc-autonomy/navigation/kalman-filter-design: time-domain fusion of
successive snapshot fixes with a dynamics model and process noise.
- gnc-autonomy/navigation/navigation-frames: ECEF and frame rotation
conventions for the satellite and receiver coordinates.
- gnc-autonomy/space/orbit-determination: satellite orbit state used
to form the satellite positions in ECEF.
Behavior contract (gate 3)
Run the deterministic contract test (stdlib unittest, offline):
python3 scripts/test_gnss_pseudorange_positioning.py
The test covers the geometric range and predicted pseudorange model,
measured minus predicted residuals, the geometry matrix rows (unit
lines of sight, clock column of ones, coincident satellite rejection),
the 4x4 Gaussian elimination solver (identity, diagonal, coupled and
singular systems), the worked example convergence to the origin with
the 100 m bias recovered, the exact module output anchors, the
perturbation shift of the redundant constellation, the post-fit
position error estimate identity, the spherical geodetic conversion
at the origin, equator and pole, and ValueError rejection of every
non-physical input in the validation list.
Compliance
- Standards referenced, not reproduced: ARP4754A frames the airborne
system development context (arp4754a, reference-only per
standards-map.yaml); the GNSS pseudorange positioning relations above
are standard engineering methodology, summary-only.
- compliance: STANDARDS-REF, gated: false.
1---2name: gnss-pseudorange-positioning3description: Use when you must compute a GNSS receiver position fix from pseudorange measurements: given satellite positions in ECEF and their pseudoranges (geometric range plus receiver clock bias), solve the four-unknown navigation equations for x, y, z and clock bias with an iterated least-squares adjustment and 4x4 normal equation solves. Produces the converged ECEF position, clock bias, post-fit residuals with RMS, and post-fit position error from the geometry matrix. Requires at least four satellites; treats the Earth as spherical for geodetic conversion only. Trigger: pseudorange positioning, GNSS position fix, receiver clock bias, iterated least squares fix, ECEF position solution, satellite pseudorange residual, snapshot navigation solution.4license: Apache-2.05---67# GNSS Pseudorange Positioning (gnc-autonomy/navigation/gnss-pseudorange-positioning)89Use when the task is computing a single-epoch GNSS receiver position10fix from pseudorange measurements. Each measurement is the geometric11range to the satellite plus the receiver clock bias expressed in12metres, so the four unknowns (receiver ECEF position x, y, z and clock13bias) need at least four satellites and a nonlinear solve. This leaf14linearizes the range equations about the current state, builds the15geometry matrix H with rows [-(sx-rx)/range, -(sy-ry)/range,16-(sz-rz)/range, 1], solves the 4x4 normal equations (H^T H) dx = H^T dr17with a Gaussian elimination solver, and iterates until the correction18norm falls below tolerance. It pairs with dilution-of-precision for the19geometry quality read, kalman-filter-design for time-domain fusion of20successive fixes, and navigation-frames for the coordinate conventions.21The leaf is a snapshot solution: no smoothing, no dynamics model, and22the geodetic conversion uses a spherical Earth approximation only.2324## Domain quick reference2526- Measurement model: pseudorange_i = geometric range_i + clock bias,27 with geometric range |sat_i - recv| from the ECEF positions.28- Geometry row: the partial of the i-th range equation with respect to29 the receiver position is the negated line of sight, so row i of H is30 [-(sx-rx)/range, -(sy-ry)/range, -(sz-rz)/range, 1]; the 1 is the31 clock-bias partial.32- Linearized system: H dx = dr with dr_i = measured_i - predicted_i.33- Normal equations: dx = (H^T H)^-1 H^T dr, a 4x4 solve each iteration.34- Update: x, y, z, clock bias all shift by dx, then ranges and H are35 recomputed (iterated least squares, converges in a few iterations36 from the origin start).37- Convergence test: stop when the correction norm falls below tol.38- Post-fit residual RMS: sqrt(mean(residual_i^2)) after convergence.39- Post-fit position error: pos_1sigma = uere_equiv * pdop with40 uere_equiv = residual RMS and pdop from the trace of (H^T H)^-1,41 companion to the dilution-of-precision leaf.42- Spherical geodetic conversion: lat = atan2(z, sqrt(x^2 + y^2)),43 lon = atan2(y, x), alt = radius - R_EARTH with R_EARTH =44 6378137.0 m (WGS-84 ellipsoid out of scope, flagged approximate).45- Units are metres throughout: satellite positions, pseudoranges and46 clock bias all in m. Requires at least four satellites.47- ARP4754A frames the development context for the navigation function;48 the relations above are standard engineering methodology,49 summary-only.5051## Workflow52531. Gather the satellite record list: each entry needs ECEF x, y, z and54 the measured pseudorange in metres; reject sets under four55 satellites and records with missing or non-finite values56 (ValueError).572. Optionally seed the iteration with a prior x0, y0, z0, b0; the58 default start is the ECEF origin with zero clock bias.593. Run solve_iterated(satellites, iters=8, tol=1e-6): the function60 rebuilds the geometry matrix each pass, solves the 4x4 normal61 equations, updates the state, and stops on a small correction.624. Read the fix dict: x, y, z, clock_bias, the per-satellite63 residuals, residual_rms, iterations and the converged flag.645. Gate navigation processing on the fix-quality flags: converged65 state, iteration count and the residual RMS level.666. For the geometry quality read, call position_error_estimate on the67 fix to get the post-fit gdop, pdop, uere_equiv and pos_1sigma.687. Convert to latitude, longitude and altitude with69 to_geodetic_approx when a geodetic output is needed, and flag the70 spherical-Earth approximation.718. Confirm the deterministic checks with the contract test72 scripts/test_gnss_pseudorange_positioning.py.7374## Worked example7576Four satellites around a receiver at the ECEF origin (0, 0, 0) with a77true clock bias of 100 m (documented test constellation):7879- sat1 (0, 0, 20000 km), pseudorange 20000000 + 100 m.80- sat2 (20000 km, 0, 0), pseudorange 20000000 + 100 m.81- sat3 (0, 20000 km, 0), pseudorange 20000000 + 100 m.82- sat4 on the diagonal at 10^7*sqrt(2) m per axis (about 14142 km per83 axis, the spec's rounded 14142 km label), true range84 sqrt(6)*10^7 = 24494897.42 m, pseudorange 24494897.42 + 100 m.8586Run solve_iterated on the four records: the iterated least squares87fix converges to x = -1.44e-13, y = -1.28e-13, z = -1.28e-13 m (the88origin within 0.5 m on every axis), clock bias 100.0 m within 0.5 m,89residual RMS 0.0 m (the exact +100 m bias model solves exactly),90iterations 2 and converged True.9192Add a fifth satellite at (-10000 km, -10000 km, 0) with true range93sqrt(2)*10^7 m plus the same 100 m bias, then perturb the z-axis94pseudorange by +3 m: the fix shifts by about 2.53 m in 3D and the95residual RMS becomes 0.596 m, showing how redundant measurements turn96a single measurement error into observable post-fit residuals.9798## Verification99100- Confirm solve_iterated on the worked constellation returns the101 origin within 0.5 m per axis and a clock bias within 0.5 m of102 100.0 m, with residual RMS below 0.5 m, iterations at most 8 and103 converged True.104- Confirm the +3 m perturbation of the redundant set shifts the fix by105 about 2.53 m and gives residual_rms above zero.106- Confirm position_error_estimate satisfies pos_1sigma = uere_equiv *107 pdop and gives gdop 1.7216197603949122, pdop 1.6202812472328787 on108 the clean redundant constellation.109- Confirm every invalid input raises ValueError: fewer than four110 satellites, missing satellite keys, non-finite pseudoranges,111 iters below 1, a satellite coincident with the receiver and a112 singular normal matrix.113- Run the contract test offline: python3114 scripts/test_gnss_pseudorange_positioning.py (41 tests,115 deterministic).116117## Pitfalls118119- Solving with fewer than four satellites: four unknowns (x, y, z, clock120 bias) need at least four measurements and fewer raise ValueError; a121 4-satellite exact set solves with zero residual RMS while redundancy is122 what exposes measurement errors as post-fit residuals.123- Reading residual RMS as position error on a minimal set: with exactly four124 satellites the residual RMS is 0.0 even with a common bias (the worked125 +100 m bias solves exactly); position error needs the redundant126 constellation or the position_error_estimate read.127- Ignoring the converged flag and iteration count: solve_iterated stops when128 the correction norm falls below tol and reports converged and iterations;129 gate navigation processing on those flags before quoting the fix.130- Forgetting the spherical approximation: to_geodetic_approx uses a131 spherical Earth (R_EARTH = 6378137.0 m) with WGS-84 out of scope, so132 geodetic outputs carry that approximation.133- A satellite coincident with the receiver (zero range), singular normal134 matrix, missing keys, non-finite pseudoranges and iters below 1 raise135 ValueError; pos_1sigma = uere_equiv*pdop ties into the136 dilution-of-precision leaf.137138## Related leaves139140- gnc-autonomy/navigation/dilution-of-precision: the geometry quality141 read (DOP values and elevation mask) for subset selection around142 this snapshot fix.143- gnc-autonomy/navigation/kalman-filter-design: time-domain fusion of144 successive snapshot fixes with a dynamics model and process noise.145- gnc-autonomy/navigation/navigation-frames: ECEF and frame rotation146 conventions for the satellite and receiver coordinates.147- gnc-autonomy/space/orbit-determination: satellite orbit state used148 to form the satellite positions in ECEF.149150## Behavior contract (gate 3)151152Run the deterministic contract test (stdlib unittest, offline):153154 python3 scripts/test_gnss_pseudorange_positioning.py155156The test covers the geometric range and predicted pseudorange model,157measured minus predicted residuals, the geometry matrix rows (unit158lines of sight, clock column of ones, coincident satellite rejection),159the 4x4 Gaussian elimination solver (identity, diagonal, coupled and160singular systems), the worked example convergence to the origin with161the 100 m bias recovered, the exact module output anchors, the162perturbation shift of the redundant constellation, the post-fit163position error estimate identity, the spherical geodetic conversion164at the origin, equator and pole, and ValueError rejection of every165non-physical input in the validation list.166167## Compliance168169- Standards referenced, not reproduced: ARP4754A frames the airborne170 system development context (arp4754a, reference-only per171 standards-map.yaml); the GNSS pseudorange positioning relations above172 are standard engineering methodology, summary-only.173- compliance: STANDARDS-REF, gated: false.