Commit Graph
208 Commits
Author SHA1 Message Date
Carles Fernandez 66782155ec Fix clang-tidy job 2026-09-16 12:23:45 +02:00
Carles Fernandez 4d3ad83957 Fix polarity, Doppler rate, and timers after the frequency-error scan
Follow-ups to the frequency-error-reduction merge (tracking state 5):

- Anchor Flag_PLL_180_deg_phase_locked to the sign of the last Prompt
  symbol. The differential bit/secondary-code detector reconstructs bits
  relative to an arbitrary first bit, so the previous corr_value sign rule
  was independent of the actual carrier polarity.
- Do not feed the deliberate Doppler bin hops of the scan into the
  high_dyn carrier/code phase-rate smoothers: clear the histories and
  zero the rate steps while scanning.
- Start the pull_in_time_s and bit_synchronization_time_limit_s budgets
  at the first sample after the scan instead of at acquisition, so long
  scans no longer consume the FLL pull-in or the sync time limit. Scan
  completion re-arms pull-in and resets the lock-fail counters. The
  non-scan path keeps the acquisition time origin.
- Clamp f_error_accumulation to at least 1, both when parsed from the
  configuration and in the block constructor, to avoid an out-of-bounds
  write and a scan that never advances.
- Add unit tests for polarity, rate suppression, timers, and a full L2C
  scan, and document the new options in the CHANGELOG.
2026-09-11 09:00:01 +02:00
Carles Fernandez 379c99a9de Merge branch 'freq-error-reduction' of https://github.com/joebre/gnss-sdr into joebre-freq-error-reduction 2026-09-09 16:20:53 +02:00
Carles Fernandez 352e1e9fea Fix formatting 2026-09-09 16:00:13 +02:00
Carles Fernandez 4e0d7837e9 Let PVT.iono_model decide band combination in the single point solution 2026-09-09 15:57:41 +02:00
Carles Fernandez 08d24faa9d Restrict Galileo nav-service fallback to E1 and make it stateless
Follow-up to the galileo-navtype-fallback merge. The original fallback let
E5a/E5b/E6 observations use the other service's ephemeris, but the BGD index
for those signals is fixed by frequency, so an E5a range modeled with an
I/NAV clock would be off by BGD(E1,E5a) - BGD(E1,E5b). Only E1 selects its
BGD from the ephemeris clock model, so only E1 may fall back.

Drop the per-PRN locked set: I/NAV and F/NAV carry the same IODnav/toe,
so they expire together, and an E1 switch between services costs only BGD
quantization. select_galileo_ephemeris() is const again and simply prefers
the primary service while its ephemeris is fresh.

Also normalize a legacy Unknown provenance to the primary service on the
returned ephemeris, and allow E1 Reduced CED in F/NAV-primary receivers.
2026-09-08 11:16:34 +02:00
Carles Fernandez 1ba1f37d3b Polish the gnss_synchro_monitor decimation fix 2026-09-05 12:46:30 +02:00
joebreandClaude Sonnet 5 9f3b4a16da Add unit tests for tracking frequency-error reduction
Covers Dll_Pll_Conf::SetFromConfiguration() parsing of f_error_step_num
(default disabled, odd values pass through, even values round up to
odd, zero stays disabled) and f_error_accumulation/f_error_doppler_step
pass-through, plus dll_pll_veml_tracking::f_error_bin_multiplier()'s
bin-index-to-Doppler-offset mapping, including that step_num=5
reproduces the original fixed 5-bin scan order.

f_error_bin_multiplier() is made public so it can be exercised
directly from the test.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: joebre <joel.brenner@saphyrion.ch>
2026-09-05 10:45:16 +02:00
Carles Fernandez 3053cebd3a Merge branch 'monitor_decimation_fix' of https://github.com/vladisslav2011/gnss-sdr into vladisslav2011-monitor_decimation_fix 2026-09-04 20:22:17 +02:00
Vladslav P 0437bd8c65 Add gnss_syncro_monitor test
Test basic gnss_syncro_monitor operation.
Test decimation at different decimation factors.

Signed-off-by: Vladslav P <vladisslav2011@gmail.com>
2026-09-04 18:13:33 +03:00
Carles Fernandez 8c116a7d1e Make RinexPrinterTest more robust in CI environments 2026-09-03 21:45:37 +02:00
Carles Fernandez 1f8f688ed1 Fix test building in some environments 2026-09-01 10:09:41 +02:00
Carles Fernandez 0af508713a Fix Acquisition dump readers
Update changelog
Add Joel to the CITATION.cff file
2026-09-01 09:22:38 +02:00
Carles Fernandez b980b55ed2 Fix one-bin assisted acquisition narrowing 2026-08-31 15:19:58 +02:00
joebre 8f67752b9e Address review: memory safety, candidate selection, PFA, dump, naming
- Rename doppler_uncertanty -> doppler_uncertainty throughout (interface,
  adapter, block, comments, log message).

- Fix the out-of-bounds write and mis-detection in narrowed-mode
  activation: track it with an explicit d_doppler_search_narrowed flag,
  set directly in set_doppler_uncertainty() and guarded on
  d_num_doppler_bins > 1, instead of inferring it from
  "d_num_doppler_bins_active < d_num_doppler_bins". That inferred check
  broke two ways: for a 1-bin full grid (a valid, already-accepted
  config), it still forced 2 active bins, writing past the grid/wipeoff
  allocations sized to d_num_doppler_bins; for a 2-bin full grid, an
  actually-narrowed request computes the same active count as the full
  grid (2 < 2 is false), so it silently searched the full grid's own
  bin layout instead of the assisted {center, center + doppler_max}
  pair. Reproduced the out-of-bounds write directly (temporarily
  reverting to the inferred check crashes with "corrupted double-linked
  list" under the new NarrowingEnabledOneBinGrid test) and the
  mis-detection (NarrowingEnabledTwoBinGrid).

- Keep the noise-reference bin out of candidate selection: both
  max_to_input_power_statistic() and first_vs_second_peak_statistic()
  now take a separate candidate_count, used only for the peak-search
  loop bound; the CFAR path's own num_doppler_bins (used for the
  "opposite bin" reference lookup) is unchanged. In narrowed mode,
  candidate_count is 1 -- the noise-reference bin can no longer win and
  be reported as the acquisition result, regardless of its own power
  (verified against a live signal deliberately placed in the reference
  bin instead of the known/candidate bin: reverting this fix, both the
  CFAR and peak-ratio statistic mistakenly report the reference bin's
  Doppler as if it were the assisted center).

- Recalibrate the acceptance threshold for narrowed acquisition: adds
  d_threshold_narrowed, computed like d_threshold but with
  num_doppler_bins = 1 (the true candidate count in narrowed mode)
  instead of the full grid's bin count, since compute_threshold() folds
  the candidate count into the false-alarm probability and reusing the
  full-grid threshold in narrowed mode was effectively far stricter
  than the requested PFA. get_threshold() returns it whenever
  d_doppler_search_narrowed is true.

- Fix narrowed dump layout/metadata: ensure_dump_grid_allocated() now
  sizes acq_grid to d_num_doppler_bins_active (not the full grid width),
  matching what copy_magnitude_grid_to_dump_grid() actually writes each
  cycle -- this also makes narrow<->full transitions between dumps
  self-correcting. dump_results() writes accurate, mode-appropriate
  doppler_max/doppler_step (the same {0, doppler_max} encoding
  compute_statistics() uses internally when narrowed), plus new
  doppler_center and doppler_narrowed fields so offline post-processing
  can tell which encoding is in effect. Verified end to end against a
  live dump (NarrowedDumpMetadata).

- Strengthen Acq_Conf::enable_doppler_narrowing's doc comment (default,
  which implementations it applies to, its dependency on the caller
  passing doppler_uncertainty == 0) and add a commented usage example
  next to GNSS-SDR.assist_dual_frequency_acq in a dual-frequency
  Galileo E1B+E5a example config.

- Add tests/.../pcps_acquisition_doppler_narrowing_test.cc: 8 focused
  tests (narrowing enabled/disabled, 1-bin and 2-bin full-grid
  configurations, CFAR and peak-ratio statistics, a full-narrow-full
  transition, two-step acquisition with step-1 narrowing, and narrowed
  dump metadata), built on the same real-capture/known-ground-truth
  pattern as gps_l1_ca_pcps_acquisition_test.cc. Confirmed each targeted
  regression test actually fails without its corresponding fix before
  finalizing them.

Signed-off-by: joebre <joel.brenner@saphyrion.ch>
2026-08-31 09:38:13 +02:00
Carles Fernandez fac0496787 Fix segfault when testing with -DENABLE_OPENCL=ON in some environments 2026-08-27 16:38:30 +02:00
Carles Fernandez 7169a02c60 Merge branch 'fix/opencl-test' of https://github.com/MrCry0/gnss-sdr into MrCry0-fix/opencl-test 2026-08-27 16:13:59 +02:00
Carles Fernandez 8ac0737031 Fix application of BDS B1C corrections 2026-08-23 08:08:04 +02:00
Carles Fernandez 59b52c87a9 Improve DNS threads handling in NTRIP client 2026-08-22 22:27:31 +02:00
Carles Fernandez ac3f3f8e4c Improve robustness against a corrupted reference satellite 2026-08-22 11:10:08 +02:00
Carles Fernandez cb7366d2d9 Improve robustness against code outliers 2026-08-22 10:11:55 +02:00
Carles Fernandez 2f5322c20e Fix handling of malformed HTTP chunks 2026-08-22 10:01:31 +02:00
Carles Fernandez 07a0bed246 Improve snapshot caching in NTRIP client 2026-08-22 09:40:56 +02:00
Carles Fernandez 3867acb595 Fix DNS stalls in NTRIP client 2026-08-22 09:08:30 +02:00
Carles Fernandez e66c9a9538 Fix B3I-only Single Point Positioning ionosphere scaling 2026-08-22 08:47:13 +02:00
Carles Fernandez 6b1a2e2560 GnuTLS now verifies the leaf certificate for TLS server purpose 2026-08-22 08:35:43 +02:00
Carles Fernandez ac0e54bcab Address the findings of a third deep review of the RTK and NTRIP code 2026-08-19 20:49:12 +02:00
Carles Fernandez d9cdc16daa Address the findings of a second deep review of the RTK and NTRIP code 2026-08-18 21:31:57 +02:00
Carles Fernandez dd7931fc5b Fix defects found in a deep review of the RTK and NTRIP code 2026-08-18 12:56:49 +02:00
Carles Fernandez 9accccdbaa Add BeiDou B1C signals to RTK 2026-08-18 08:07:20 +02:00
Carles Fernandez e368102bfb Add single-frequency RTK 2026-08-17 20:29:25 +02:00
Carles Fernandez 43bff15976 Fix formatting 2026-08-17 14:19:31 +02:00
Carles Fernandez 59f2cb4509 Add L5 to RTK 2026-08-17 13:19:37 +02:00
Carles Fernandez 0ee669f59f Add Galileo E1+E5a to RTK 2026-08-17 11:52:41 +02:00
Carles Fernandez a936c4d2d8 Enable usage of Virtual Reference Stations 2026-08-17 09:37:25 +02:00
Carles Fernandez f65e43b72f Make the reacquisition-gap boundary robust to x87 excess precision 2026-08-16 19:35:48 +02:00
Carles Fernandez 3b94087b20 Fix rtklib_tls_test building against GoogleTest < 1.10
GTEST_SKIP() does not exist before GoogleTest 1.10, which breaks the
build on Ubuntu 16.04 with the distro-provided GoogleTest. Wrap it in
a guarded macro that records a success and returns on older versions,
following the pattern already used in osnma_test_vectors.cc.¡
2026-08-16 00:32:46 +02:00
Carles Fernandez 87d8a6991e Improve carrier phase integrity in the RTK engine 2026-08-15 21:22:41 +02:00
Carles Fernandez f5337b8fc9 Merge branch 'next' into add-rtk 2026-08-15 13:23:31 +02:00
Carles Fernandez 1ceb98e4a8 Fix gnss-simulator building against Boost 1.92 2026-08-15 13:00:52 +02:00
Carles Fernandez 9b8e047885 Enforce TLS 1.2 or newer, improve NTRIP v2 to v1 fallback 2026-08-15 11:30:28 +02:00
Oleksandr Suvorov d76ff5f0f5 acquisition: fix stale include in OpenCL acquisition test
gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc still included
gps_l1_ca_pcps_opencl_acquisition.h, which was deleted when the old
per-variant custom acquisition adapters (OpenCL, QuickSync, Tong,
CCCWSR, 8ms) were consolidated into the generic
PcpsAcquisitionAdapterCustom. This broke any build combining
-DENABLE_UNIT_TESTING=ON with -DENABLE_OPENCL=ON, even though the
rest of the file already used the generic AcquisitionInterface /
block_factory::GetAcqBlock() pattern, matching its already-working
QuickSync/Tong siblings.

Drop the dead include. The test also called acquisition->opencl_ready(),
a method that only ever existed on the concrete GNU Radio block
(pcps_opencl_acquisition_cc), never on the generic AcquisitionInterface
returned by the factory; reach it instead via a dynamic_pointer_cast on
get_right_block(), the same pattern already used elsewhere in this
codebase to recover a concrete type from a generic block interface.

Fixes: 8f29c4f88e ("Cleanup custom acquisition adapters")
Signed-off-by: Oleksandr Suvorov <cryosay@gmail.com>
2026-08-11 12:23:50 +03:00
Carles Fernandez 5470aafe85 Add RTKLIB engine improvements 2026-08-11 08:57:04 +02:00
Carles Fernandez 1f9afe4431 Implement SBAS/EGNOS correction path 2026-08-09 07:55:04 +02:00
Carles Fernandez 02ac2ff616 Merge branch 'fix_beidou_geo_posvel' of https://github.com/vladisslav2011/gnss-sdr into vladisslav2011-fix_beidou_geo_posvel 2026-08-08 13:50:25 +02:00
Carles Fernandez e45f231a32 Merge branch 'fix-IbyteToComplexValidationOfResults' of https://github.com/vladisslav2011/gnss-sdr into vladisslav2011-fix-IbyteToComplexValidationOfResults 2026-08-08 13:16:35 +02:00
Vladslav P 55fcdea42a GnssEphemerisPosVelTest: add BeiDou GEO/IGSO tests
Signed-off-by: Vladslav P <vladisslav2011@gmail.com>
2026-08-08 14:11:08 +03:00
Carles Fernandez f0e75ce558 Improve SBAS L1 telemetry decoder and simplify SBAS adapters
Compensate the Viterbi traceback delay when timestamping decoded SBAS
messages by carrying per-sample reception timestamps through the sample
and symbol aligners (removes a ~140 ms bias), with a deterministic unit
test covering the FIFO pairing.
Protect decoder state with d_setlock in reset(), set_satellite(),
set_channel() and general_work(), following the convention of the other
telemetry decoders.
Share per-PRN EMS dump files through a per-run dump session: the first
open in a run truncates stale data, later opens append, so channel
reassignments no longer wipe previously decoded messages.
2026-08-08 12:10:10 +02:00
Vladslav P 59830231a0 Fix broken test IbyteToComplexValidationOfResults
Call run_ibyte_to_complex_block instead of run_ibyte_to_cbyte_block
before valudating the result.

Signed-off-by: Vladslav P <vladisslav2011@gmail.com>
2026-08-08 12:31:26 +03:00
Carles Fernandez 697f3fab66 Merge branch 'ft/sbas' of https://github.com/gnss-sdr/gnss-sdr-vtl into gnss-sdr-ft/sbas 2026-08-08 10:38:50 +02:00