Commit Graph
288 Commits
Author SHA1 Message Date
Carles Fernandez c8a7ce26a5 Fix defects detected by Coverity Scan 2026-11-07 14:45:27 +01:00
Carles Fernandez 96bd30f067 Add Galileo BGD and GPS TGD regression tests 2026-11-05 19:02:59 +01:00
Carles Fernandez 36ce582f1c Merge branch 'gps-l1c' into next 2026-11-01 10:39:41 +01:00
Carles Fernandez 724a17c429 Add a guard at GPS L1C TMBOC tracking against off-peak DLL locks
Add a configuration file for the FGI-GSRx GPS L1C dataset (Skydel simulation at 25 Msps)
2026-11-01 09:08:13 +01:00
Carles Fernandez 1c7c52d5ab Fix L1C+L2C ionosphere-free positioning 2026-11-01 07:39:12 +01:00
Carles Fernandez 999a64ec56 Add the GPS L1C receiver chain with signal identifier 1S
Deterministic mode now accepts Galileo E6 channels together with E1, E5a or E5b
Fix CNAV MT33 UTC fields reading
2026-10-31 15:31:44 +01:00
Carles Fernandez aa08924514 Fix uninitialized scalar fields 2026-10-30 13:40:34 +01:00
Carles Fernandez 497c2a4492 Merge branch 'beidou_b2a_pilot' of https://github.com/vladisslav2011/gnss-sdr into vladisslav2011-beidou_b2a_pilot 2026-10-27 12:43:59 +01:00
Carles Fernandez bdbe5e803b Merge branch 'ObvMamut-tracking-dump-carrier-phase-double' into next 2026-10-27 09:57:36 +01:00
Carles Fernandez 53b877a4dc Fixes for GNU Radio 3.7 2026-10-27 09:35:38 +01:00
Carles Fernandez 28ee074f75 Fix for GNU Radio 3.7 2026-10-27 09:32:38 +01:00
Carles Fernandez 6564d6148f Write the accumulated carrier phase as double in all tracking dumps
Extend the change of the previous merge to the remaining tracking
blocks: kf_tracking and gps_l1_ca_gaussian_tracking_cc (binary dump and
.mat file; records grow from 96 to 100 bytes), and the GPS L1 C/A and
Galileo E1 TCP connector and GPS L1 C/A GPU blocks (records grow from 88
to 92 bytes). The Galileo E1 TCP connector block accumulated the carrier
phase in a float, which is now a double.

Update the KF readers in utils/matlab and utils/python accordingly.

Tracking_Dump_Reader now takes the record layout, since the FPGA and
Gaussian tests read dumps that lack the TOW and WN fields (and, for the
Gaussian block, have the carrier noise variance in place of the code
frequency rate) with the dll_pll_veml_tracking layout.

Add a CHANGELOG entry.
2026-10-26 16:56:47 +01:00
Carles FernandezandClaude Opus 5.5 459653dfda Merge branch 'tracking-dump-carrier-phase-double' of https://github.com/ObvMamut/gnss-sdr into ObvMamut-tracking-dump-carrier-phase-double
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 16:54:35 +01:00
Carles Fernandez 2ff7d73bf8 Merge branch 'fix-tracking-forced-loss-of-lock' of https://github.com/ObvMamut/gnss-sdr into ObvMamut-fix-tracking-forced-loss-of-lock
Resolve the conflicts with the deterministic processing mode: keep the
deterministic loss-of-lock dispatch together with the "forced" suffix in
the loss-of-lock log line, and convert the two deterministic telemetry
fault paths in dll_pll_veml_tracking and kf_tracking, which still forced
the loss of lock by writing 200000 into the carrier lock fail counter,
to d_force_loss_of_lock.

Remove the conflict markers left in docs/CHANGELOG.md by the merge of
the deterministic branch, and add a CHANGELOG entry for this fix.
2026-10-26 15:39:59 +01:00
Carles Fernandez e873769aa4 Fix CI failures 2026-10-26 11:25:51 +01:00
Carles Fernandez 7d4f65d863 Add a deterministic processing mode for recorded signals
Add a deterministic processing mode for recorded signals
Processing the same file twice was not repeatable, even with
Acquisition_XX.blocking=true: the control thread started searches,
assigned satellites and applied channel events at whatever sample
each block had reached, and the PVT and observables applied each
other's messages whenever they arrived.

With GNSS-SDR.deterministic=true (default: false), events and
messages carry the sample at which they happened, the control
thread handles channel events in sample order, and their effects
take place a fixed lookahead later (deterministic_lookahead_ms,
default 100 ms). A gate at the Signal Conditioner output keeps the
stream within that horizon, blocks take their stamped messages at
the start of each work call, maintenance runs on signal time
(deterministic_tick_ms), and the receiver stops once the whole
input has reached the PVT. Dumps, RINEX, NMEA, KML, GPX and GeoJSON
outputs are then bit-identical from run to run on the same machine
(same FFTW wisdom and VOLK configuration), whatever the CPU load.

Supported: all file sources (throttled or not, including LabSat,
EVK1029 and ION), all acquisitions except assisted and FPGA, and
the DLL/PLL VEML, KF and Gaussian trackers. Live front ends, HAS
and NTRIP corrections, strict OSNMA, Galileo E6 with the TOW map,
GNSS assistance and visibility-aware search are refused.
2026-10-26 08:21:51 +01:00
Vladislav P 0d628166ef BeiDou B2a: Pilot tracking/acquisition
Implemented B2a pilot secondary code generation.
Added B2a pilot secondary code generation test.
Renamed beidou_b2a_code_gen_* to beidou_b2a_data_code_gen_*.
Updated DLL/PLL VEML tracking and PCPS acquisition blocks/adapters.

Signed-off-by: Vladislav P <vladisslav2011@gmail.com>
2026-10-25 05:20:25 +03:00
Carles Fernandez 9480760215 Make Galileo E6 and SBAS channels reach the Monitor. Fixes #1145
The Monitor is fed from the Observables, which since ed5a75e31 fill
channels without a valid time reference with their latest tracking
data. That never worked in Galileo E6-only configurations: the GPS L1
C/A, GPS L5, Galileo, BeiDou D1/D2 and BeiDou B1C telemetry decoders
produced no output until they decoded the time of week, so the
Observables never received E6 tracking data. The GLONASS, GPS L2C,
BeiDou B2a and SBAS decoders already forwarded every symbol with
Flag_valid_word unset; now all telemetry decoders do. Dumps,
telemetry_to_trk and nav-data monitor messages are still issued only
with a valid time of week.

The tracking-only entries also had fs set to 0, which gnss-sdr-monitor
takes as an empty channel, hiding SBAS channels. fs is now kept, with
the validity flags still unset; the PVT only uses observations with
Flag_valid_pseudorange.

As a side effect, the secondary-band acquisition assistance can use a
primary-band channel as soon as its tracking locks, instead of after
its time of week is decoded. The Galileo F/NAV test sink now records
the first item with a valid word.

Alternative to PR #1122, without new options or changes to tracking
and to the PVT time-of-week reset handling. Related to #1018.
2026-10-20 16:25:56 +02:00
ObvMamut a81888f2ae Write the accumulated carrier phase as double in tracking dumps
log_data() in dll_pll_veml_tracking and dll_pll_veml_tracking_fpga casts
d_acc_carrier_phase_rad, a double, to float before writing it to the
binary dump, and save_matfile() reads it back as a float. The
accumulated phase grows by 2*pi times the Doppler shift every second
(about 31400 rad/s at 5 kHz), so it reaches 1e6 rad after about 30 s of
tracking at 5 kHz, or under 3 minutes at 1 kHz. The float spacing is
0.0625 rad at 1e6 rad, 0.25 rad at 3e6 rad and 1 rad at 1e7 rad. At
3e6 rad, for instance, the phase difference between two 1 ms epochs of
the dump is only known to within +/-0.25 rad, about 40 Hz in frequency
terms. The phase used by the receiver (Gnss_Synchro::Carrier_phase_rads)
is a double and is not affected; only the dump is.

Write the field as a double, and read it back as a double in
save_matfile(), so that the .mat file also holds a double.

This changes the dump record layout. The field keeps its position but
grows from 4 to 8 bytes, so a record is now 112 bytes long in
dll_pll_veml_tracking (it was 108) and 100 bytes long in
dll_pll_veml_tracking_fpga (it was 96). The readers of this format are
updated accordingly: Tracking_Dump_Reader, used by the unit tests, and
dll_pll_veml_read_tracking_dump in utils/matlab and utils/python.

Signed-off-by: ObvMamut <obvmamut@proton.me>
2026-10-20 14:17:46 +02:00
ObvMamut 323d1ab8fe Force tracking loss of lock regardless of max_carrier_lock_fail
Two fail-safes in the tracking blocks force a loss of lock: the bit or
secondary code synchronization time limit
(bit_synchronization_time_limit_s), and the telemetry fault message sent
by the telemetry decoders. Both did it by writing a large value into
d_carrier_lock_fail_counter (300000 and 200000, respectively) and
relying on the lock check to find it above max_carrier_lock_fail. When
max_carrier_lock_fail is configured above those values, neither
fail-safe drops the channel: unless the lock detectors drop it for
other reasons, a channel that never achieves bit synchronization keeps
tracking past the time limit, and a channel whose telemetry decoder
reports a fault keeps tracking.

Replace the magic counter values with a d_force_loss_of_lock flag. Both
fail-safes set it, cn0_and_tracking_lock_status() declares the loss of
lock when it is set, whatever the lock fail counters, and it is cleared
when the loss of lock is declared and when a new tracking attempt
starts. The loss-of-lock log line now says when the loss was forced,
since the counter values no longer show it.

The same change is applied to dll_pll_veml_tracking,
dll_pll_veml_tracking_fpga and kf_tracking, the three blocks that used
this pattern.

Add two tests to trk_test that set max_carrier_lock_fail = 1000000 and
check that a telemetry fault and the synchronization time limit still
drop the channel.

Signed-off-by: ObvMamut <obvmamut@proton.me>
2026-10-20 14:17:46 +02:00
Carles Fernandez 5cd2346215 Fix data race in acquisition tests 2026-10-20 13:51:42 +02:00
Carles Fernandez d1f9171ed5 Fix flaky test 2026-10-20 09:15:54 +02:00
Carles Fernandez 22f8a9ef20 Remove sign-flip Doppler bias in PCPS acquisition
A one-code-period PCPS window starts at an arbitrary code phase, so a
secondary-code or data sign transition at the code epoch inside it
splits the correlation peak up to +-0.74/T away from the true Doppler.
For GPS L5 (the I5 NH10 code changes sign at 6 of every 10 epochs),
about 40 % of the acquisitions started tracking 250-900 Hz off. The
1 ms Costas loop then either held a false lock at exactly +-500 Hz
(lock test 0.97, C/N0 3.9 dB low, secondary-code sync impossible)
until bit_synchronization_time_limit_s, or never locked and lost lock
a few seconds after pull-in.

After a positive decision, refine_doppler() despreads the dwells with
the replica aligned to the detected code epoch, scores the two sides
of the epoch under both sign hypotheses (summed non-coherently over
dwells), and re-estimates the Doppler over +-1/T around the grid peak.
It only runs on positive acquisitions, so its cost is negligible, also
with the CUDA grid. It applies to every pcps_acquisition search over
one code period without bit_transition_flag. The new
Acquisition_XX.refine_doppler parameter (default true) disables it.
2026-10-19 22:33:36 +02:00
Carles Fernandez f7efcf54d9 Fix minor performance ineficiencies 2026-10-19 12:26:55 +02:00
Carles Fernandez 6205aec6f6 Fix RINEX tests 2026-10-19 11:15:31 +02:00
Carles Fernandez ea533140aa Fix for GNU Radio 3.7 2026-10-18 14:27:52 +02:00
Carles Fernandez 66dcfe3f09 Bound configured batches by the observables timing budget
Replace the fixed 20 ms limit on SignalConditioner.batch_size_ms and
max_batch_latency_ms. A configured batch is accepted if it is no longer
than the automatic one (min(10 ms, observable_interval_ms)), or if the
buffer it needs (whole batches, with room for one on top of the largest
reader window) fits the alignment budget: the signal time channels can
trail the receiver clock before the observables miss epochs. Batches
are also limited to 4 MiB, since GNU Radio allocates two of them on
each side of the batching block.

At observable_interval_ms=20 and 4 MSps gr_complex this allows about
90 ms instead of 20 ms. At 5 ms it now rejects batches that the old
limit let through. In automatic mode, an explicit max_batch_latency_ms
sets the batch size, so that batch gets the same check. Defaults are
unchanged.
2026-10-17 15:04:10 +02:00
Carles Fernandez bb74c0f76d Add work on the new stream batcher 2026-10-14 20:08:59 +02:00
Carles Fernandez 60983c6ce3 Fix for old GoogleTest 2026-10-12 11:57:41 +02:00
Carles Fernandez 79f1247f44 Set 10 ms as default batch in the Signal Conditioner 2026-10-10 22:01:22 +02:00
Carles Fernandez dd077fa0d2 Set maximum of max_batch_latency_ms to 20 ms, fix building with old GNU Radio 2026-10-10 16:39:03 +02:00
Carles Fernandez 1dab504b09 Optimize Signal Conditioner scheduling with portable automatic batching
Select batch targets from sample rate, latency and memory limits, and
consumer buffer requirements. Replace eligible pass-through stages before
channel fan-out without machine-specific profiles or configuration edits.

Preserve samples and tags across partial batches, deadlines, and EOF.
Handle conditioned output ports consistently and clean up stream and
message connections on disconnect or connection failure.
2026-10-10 15:56:55 +02:00
Carles Fernandez 37e830c0e0 benchmark_pcps_grid: skip all channel threads when setup fails
If the multi-channel fixture setup fails on thread 0 (no CUDA device,
or out of device memory at high channel counts), thread 0 skips and
returns before the timed loop. Google Benchmark then releases the other
threads from the start barrier, and they call compute_grid() on engines
that were never created, which crashes the whole benchmark binary.

Add a ready flag that setup() sets only on success. Every thread checks
it at the top of the timed loop, which is the first point where threads
1..N-1 can see the outcome of the setup, and skips the run instead.

Also add the missing <string> include for the fixture's error member.
2026-10-08 19:06:32 +02:00
Phillip Vu 1b146c4654 benchmark_pcps_grid: add concurrent channel throughput case
The existing cases time a single engine, but each acquisition block owns
its own engine and CUDA stream, so the figure that bounds how many
channels can search at once is the aggregate rate with several engines
resident on the device.

Add bm_pcps_grid_cuda_channels, which gives every benchmark thread its
own engine, wipe-off grid and output buffers, and sweeps 1 to 8 threads.
Rate counters are summed across threads and are fed the iteration count
already totaled over threads, so kAvgThreads yields the aggregate device
rate and a 1/channels scale yields the per-channel rate; both were
checked against the reported per-thread time.

On a Jetson Orin Nano at 4000 samples and 41 Doppler bins the aggregate
rate is 2757, 3839, 5943 and 5307 dwells/s for 1, 2, 4 and 8 channels,
so the device saturates at about four concurrent channels.

Signed-off-by: Phillip Vu <36169227+phillipvu@users.noreply.github.com>
2026-10-08 06:51:05 -07:00
Carles Fernandez 9638a4f53d Bump local version of gnsstk to 15.3.1 and change the repository 2026-10-05 10:28:46 +02:00
Carles Fernandez b23a2af572 Fix building 2026-10-01 11:57:15 +02:00
Carles Fernandez 3c256e991b Compute PCPS dwell length with integer arithmetic
Replace std::clamp with std::min/std::max for C++11/14 compatibility
2026-10-01 10:58:13 +02:00
Carles Fernandez 2185dc647d Merge branch 'fix-pcps-acquisition-sample-truncation' of https://github.com/joebre/gnss-sdr into joebre-fix-pcps-acquisition-sample-truncation 2026-10-01 09:58:08 +02:00
joebre 9bd56d4cfe Add a unit test for pcps_acquisition's per-dwell sample-count fix
Covers the exact configuration the fix is for: GNSS-SDR.internal_fs_sps
not a multiple of 1 kHz (4000123 Hz), coherent_integration_time_ms (4)
spanning more than one code period (GPS L1 C/A's own code period is
1 ms), and max_dwells (5) > 1. Asserts a successful acquisition and
checks the reported Doppler/delay against the known synthetic signal's
truth, with tolerances the dwell-boundary drift this fix addresses
would clearly exceed.

Registering it in acq_test (tests/CMakeLists.txt) surfaced that the
target had apparently never actually linked successfully in this
environment before: it links FirFilter/SignalGenerator/GenSignalSource
but was missing input_filter_adapters/signal_generator_adapters/
signal_source_adapters, and separately hit a Linux-only undefined
libboost_thread symbol inside the system's packaged
libgnuradio-runtime.so, fixed with the standard
--copy-dt-needed-entries linker workaround (guarded to Linux only).
Neither is specific to this new test; fixing them was necessary to
build and run the suite at all, and the rest of acq_test (20 tests
total) now passes too.
2026-10-01 08:18:17 +02:00
Carles Fernandez c6405d824a Improve BeiDou B-CNAV1 decoding sensitivity 2026-09-30 12:08:49 +02:00
Carles Fernandez 28e14a3c7c Merge branch 'b1c_enable_sumproduct' of https://github.com/vladisslav2011/gnss-sdr into vladisslav2011-b1c_enable_sumproduct 2026-09-30 09:10:53 +00:00
Vladislav P 543fe28ae9 Fix BeiDou CNAV1 test
And generalize B-CNAV1/B-CNAV2 LDPC encoder.

Signed-off-by: Vladislav P <vladisslav2011@gmail.com>
2026-09-30 02:18:44 +03:00
Carles Fernandez 6c1e01e0b3 Fix data race in test 2026-09-29 18:44:34 +02:00
Carles Fernandez 95c72618f8 Fix Galileo telemetry decoder races during reset and satellite changes 2026-09-28 13:19:07 +02:00
Carles Fernandez fd70179392 Fix Galileo preamble confirmation with intervening payload matches
Preserve the candidate anchor until its expected confirmation point.
Replace it only after confirmation is missed, preventing payload
correlations from repeatedly displacing a valid preamble.
2026-09-28 10:56:34 +02:00
Carles Fernandez 044aee9bc2 Keep a separate logfile for each run with Abseil logging, as google-glog did 2026-09-27 18:26:57 +02:00
Carles Fernandez 20a0a69780 Fix acquisition code phase handed to tracking in GPS L1 C/A tests, restore Doppler search range in GLONASS L1 C/A acquisition test 2026-09-27 13:22:23 +02:00
Carles Fernandez b37cc311d0 Fix race in acquisition tests 2026-09-26 12:02:38 +02:00
Carles Fernandez 28acfb7d9d Fix QuickSync acquisition 2026-09-26 11:38:18 +02:00
Carles Fernandez b2d117018c Split run_tests into per-category translation units
test_main.cc #included every unit test into a single translation unit, which made GCC exceed its variable tracking limit and required several GB of RAM to compile on small machines.
2026-09-25 19:05:01 +02:00