Commit Graph
11306 Commits
Author SHA1 Message Date
Carles Fernandez 2bf5b6f242 Factor out the CFAR reference separation in pcps_acquisition
Fix FIFO buffer deallocation in the IP packet source
2026-11-07 16:08:10 +01:00
Carles Fernandez c8a7ce26a5 Fix defects detected by Coverity Scan 2026-11-07 14:45:27 +01:00
Carles Fernandez e16346e4e2 Fix Galileo E5a outputs, Iono-Free-LC fallback and RTCM MSM encoding
Since v0.0.22, Galileo observables reached RINEX and RTCM only through
select_galileo_ephemeris(), which rejects the E5 signal that the solver
leaves out. With E5a and E5b enabled, the PVT uses I/NAV and E5b, so the
E5a RINEX fields stayed blank and E5a was missing from MSM. Admit that
signal when its own F/NAV ephemeris is usable and reports it healthy (or
PVT.use_unhealthy_sats is set). The solver still never sees it.

With PVT.iono_model=Iono-Free-LC, prange() drops every satellite that
lacks either band of its system's pair, so receivers such as Galileo
E5a+E5b without E1, or any single-band one, computed no position and
wrote no RINEX. Fall back to the broadcast model, with a log warning,
when no enabled constellation provides a pair, and log the constellations
left out otherwise.

The MSM fine pseudorange, phase-range and phase-range-rate fields (DF400,
DF401, DF404, DF405, DF406) were computed against a rough value rounded
from each signal's own measurement instead of the satellite's DF397 to
DF399, so the other signals of a satellite were occasionally decoded
292.77 m or 1 m/s off. DF401/DF406 also moved the phase-range to within
one cycle of the rough range at every epoch, which broke its integer
continuity. Reference all fine fields to the satellite's rough values and
send the phase-range as is, or as invalid beyond 1171 m.

Keep RTCM lock times per signal instead of per PRN and band group (GPS
L2C/L5 and Galileo E5a/E5b shared one), and restart them on cycle and
half-cycle slips and when the PVT block realigns a channel's carrier
phase.
2026-11-06 16:07:50 +01:00
Carles Fernandez 96bd30f067 Add Galileo BGD and GPS TGD regression tests 2026-11-05 19:02:59 +01:00
Carles Fernandez 9d6f48d113 Fix bugs in signal generator 2026-11-05 16:20:13 +01:00
Carles Fernandez e8750f88a4 Fix (unused) secondary codes in Galileo E5a 2026-11-05 15:42:23 +01:00
Carles Fernandez f89d327e15 Merge branch 'yangli-cnasp-fix/l5-iono-double-scale' into next 2026-11-05 14:36:39 +01:00
Carles Fernandez fbfd0b8eeb Fix iono and BGD band factors when slot 0 does not hold GPS L1
Reference the Galileo E5a/E5b BGD factor to E1 instead of to the wavelength
in slot 0, which holds L5 in GPS L5 + Galileo E5b receivers.
2026-11-05 09:28:17 +01:00
yangli-cnasp dcbdcdb49b Fix double scaling of broadcast iono for single-band L2C/L5
prange() already returns iono_scale=(f_L1/f_band)^2 for single-band measurements on the second slot. The SPP solver then applied the wavelength factor (lambda_band/lambda_L1)^2 again, so L2C/L5 iono corrections were over-scaled by 1.65x/1.79x. For L5 this biases the height solution by about -4 m on an otherwise sub-metre 2D fix.

Only apply the legacy wavelength factor when prange() did not already provide a band factor (iono_scale == 1.0). L1 is unaffected.

Signed-off-by: yangli-cnasp <66191093+yangli-cnasp@users.noreply.github.com>
2026-11-05 09:30:44 +08:00
Carles Fernandez 9e7c783b4c Fix SBAS decode type 6 info 2026-11-02 10:01:45 +01:00
Carles Fernandez 0507d312de Fix defects detected by Coverity Scan 2026-11-01 13:56:58 +01:00
Carles Fernandez 36ce582f1c Merge branch 'gps-l1c' into next 2026-11-01 10:39:41 +01:00
Carles Fernandez 8f0b310ef9 Add L1C signals to utility scripts 2026-11-01 10:12:05 +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 af9d2972c2 Detect libiio v1.x and pin the build instructions to libiio v0.x
GNSS-SDR uses the libiio v0.x API. FindLIBIIO.cmake now compiles and
links a v0.x program before setting LIBIIO_FOUND, and reports a libiio
v1.x installation instead of saying that libiio was not found.
ENABLE_AD936X_SDR now also requires libiio at configure time. The
README and the CMake hints now point to the libiio-v0 and
libad9361-iio-v0 branches, since the default branches of both libraries
now target libiio v1.x
2026-10-27 15:43:35 +01:00
Carles Fernandez 85e5df0b9f Merge branch 'joebre-fix/pvt-combined-flag-ionoopt' into next 2026-10-27 14:08:05 +01:00
Carles Fernandez dcc5821af5 Fix monitor used/combined flags outside single-point and for shared slots
Pick the band rule from the estimator that produced the fix:
prange() pairing for single-point fixes, vsat[] for DGPS/RTK.
Check that each signal's slot holds its own obs code, via the new
rtklib_obs_code() helper shared with insert_obs_to_rtklib(), so
B1I next to B1C and excluded E5/E6 signals are not reported as used.
Move prange_band_pair() to rtklib_pntpos and document the per-signal
semantics in monitor_pvt.proto.
2026-10-27 14:07:42 +01:00
Carles Fernandez 135a6f48e6 Merge branch 'fix/pvt-combined-flag-ionoopt' of https://github.com/joebre/gnss-sdr into joebre-fix/pvt-combined-flag-ionoopt 2026-10-27 13:24:33 +01:00
Carles Fernandez a6978da3d9 Merge branch 'timothyanderson096-ocdealcheck-docs/1066-rtlsdr-calibration-comments' into next 2026-10-27 13:12:59 +01:00
Carles Fernandez b33fe4ceb1 Merge branch 'docs/1066-rtlsdr-calibration-comments' of https://github.com/timothyanderson096-ocdealcheck/gnss-sdr into timothyanderson096-ocdealcheck-docs/1066-rtlsdr-calibration-comments 2026-10-27 13:12:36 +01:00
Carles Fernandez 4d4ae83d41 Merge branch 'vladisslav2011-beidou_b2a_pilot' into next 2026-10-27 13:04:04 +01:00
Carles Fernandez 4b9d66e813 Fix B2a pilot tracking output during pull-in 2026-10-27 13:00:32 +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 ed46d1f9ad Merge branch 'joebre-evk1029-shm-pr-v2' into next 2026-10-27 12:28:25 +01:00
Carles Fernandez 36fbc0e4cc Add forgotten fix 2026-10-27 12:28:06 +01:00
Carles Fernandez 5ce2f5ad2f Merge branch 'next' into joebre-evk1029-shm-pr-v2
Resolve the CHANGELOG conflict, and fix the EVK1029 shared-memory input
on top of the merge:

- In shared-memory mode, Evk1029SignalSource is real-time and cannot
  wait, so the deterministic mode refuses it and the Signal Conditioner
  no longer plans it as an unthrottled replay. Read
  shm_stop_on_buffer_overflow only on Linux, avoiding an unused variable
  warning elsewhere.
- Stopping the receiver no longer hangs when EVK1029_CtrlApp is idle,
  has crashed or has been restarted. ReadBlock() waits at most 100 ms at
  a time, RawStreamReader::read() then returns to its caller (see
  end_of_stream()), and Evk1029Source releases a decode worker waiting
  for data when GNU Radio stops the flowgraph. The stream ends if the
  producer publishes nothing for SignalSource.shm_stall_timeout_s
  seconds (default 5, 0 waits forever).
- request_stop() bumps data_event before waking the reader, and
  ReadBlock() takes its snapshot of data_event before checking the stop
  flag, the ring and the stream state, so that no wake-up is lost.
- Count overflows and producer silence from the first sample read, not
  from the attach: nothing reads the ring while the flowgraph is built,
  so shm_stop_on_buffer_overflow=true stopped the receiver at startup.

Update the CHANGELOG entry with the actual parameter names and the new
shm_stall_timeout_s parameter.
2026-10-27 12:27:16 +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 96cf62225f Fix Matlab script 2026-10-27 09:55:49 +01:00
TIM ANDERSON e1371c6a32 docs: clarify nominal and calibrated RTL-SDR sample rates
Distinguish the hardware sample-rate request from the calibrated
processing rate and RF center from the baseband IF offset.
Keep every active configuration assignment unchanged.

Refs: #1066

Prepared with AI assistance; submitted under Timothy Anderson's
review and task-specific authorization.

Signed-off-by: Timothy Anderson <timothyanderson096@gmail.com>
2026-10-27 18:38:37 +10: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 4baba9d479 Fix tracking blocks 2026-10-27 08:49:26 +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 ffde5f91d2 Merge branch 'ObvMamut-fix-tracking-forced-loss-of-lock' into next 2026-10-26 16:08:44 +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 422b2a6c36 Merge branch 'deterministic' into next 2026-10-26 14:46:42 +01:00
Carles Fernandez e01ce536bf Delete move operations in StreamBatcherDeadline and its Impl 2026-10-26 12:43:24 +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
Carles Fernandez 002b41804e The SUPL client now verifies the server certificate and DNS name or IP address 2026-10-25 13:37:34 +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
joebre b44795de69 Fix CHANGELOG.md line wrapping for prettier-markdown CI check
Signed-off-by: joebre <joel.brenner@saphyrion.ch>
2026-10-22 13:52:49 +02:00
joebre 7c01385b9d Address review on EVK1029 SHM input: build, correctness, backpressure
carlesfernandez's review of this PR (gnss-sdr/gnss-sdr#1154) raised several
issues. This addresses all but the DCO/signing requirement (handled
separately via rebase) and the GPL licensing question on shm_ring.h (his
call, not mine to answer in code):

- Build: shared_memory_stream_reader.cc/shm_ring.h are now gated to Linux
  only (CMAKE_SYSTEM_NAME), matching the EVK1029_SHM_INPUT compile
  definition the adapter checks before including/constructing
  SharedMemoryStreamReader; an unavailable shared_memory input now throws
  std::invalid_argument instead of failing to build.
- librt is linked on glibc < 2.34, same as core_receiver already does for
  its own shm_open use.
- ReadBlock() now treats StreamState::Error as terminal (it previously
  blocked forever), and rejects a length prefix larger than the block can
  hold instead of reading past it (reproduced his reported 64 MiB ASan
  overread).
- An unrecognized SignalSource.input value now throws instead of silently
  falling back to file mode; enable_throttle_control is ignored with a
  warning in shared_memory mode.
- Dangling references to the (not-in-repo) spec doc removed; diagnostics
  moved from std::cout to LOG(INFO)/LOG(WARNING); added the missing
  gnss_sdr_make_unique.h include; fixed the clang-tidy violations he listed
  (brace-less ifs, long -> int64_t).

Backpressure and loss detection redesigned per further discussion: the SHM
ring's WriteBlock() blocks (not drops) a full ring, so a stalled GNSS-SDR
consumer backs up through EVK1029_CtrlApp's own buffering instead of ever
reaching the USB/target side -- the target must never see an overflow
condition from this path. Real, unrecoverable loss is instead detected on
EVK1029_CtrlApp's side via the existing IF_TO_AXIS hardware overflow flag
(now also polled during SHM streaming, not just recording) and surfaced
through the ring's Header as overflow_event_count (protocol bumped to v3).
It's a count of occurrences, not bytes -- the hardware only latches a
sticky bit -- so SharedMemoryStreamReader can't zero-fill a known gap; it
either stops the stream (new SignalSource.shm_stop_on_buffer_overflow,
default false) or logs and continues, leaving the sample count to jump in
place.

Also fixes request_stop() not waking a blocked read(): setting the stop
flag alone doesn't wake a ReadBlock() already asleep in FUTEX_WAIT on
data_event, so Evk1029Source's join() of the decode-ahead thread could hang
on shutdown with an idle producer -- the same class of bug his review
caught elsewhere, found while re-checking this change for others like it.

Verified with standalone tests (plain and under AddressSanitizer), not
just a clean build: round-trip, terminal Error, corrupted-length
rejection, WriteBlock's blocking-plus-abortFlag-wake behavior, overflow
detection (both log-and-continue and stop-on-overflow), and request_stop()
unblocking a waiting read(). Full gnss-sdr build (including install/)
clean throughout.

Signed-off-by: joebre <joel.brenner@saphyrion.ch>
2026-10-22 08:54:39 +02:00
joebre 254b2e6c7d Update EVK1029 reference conf: real-time SHM input and in-source CUDA DDC
Replaces the existing dual-band Galileo E1+E5a / GPS L1+L5 reference
conf, which only demonstrated the traditional SignalConditioner-based
decode/filter/decimate chain, with one that documents and exercises
EVK1029_Signal_Source's current full capability:

- Two input modes: batch (a recorded capture file, as before) or real
  time via EVK1029_CtrlApp's shared-memory stream
  (SignalSource0.input/.shm_name).
- In-source downconversion/decimation (enable_freq_xlating), on CPU or
  GPU (bandN_cuda) -- the recommended configuration, since it removes
  that work from the CPU entirely. SignalConditioner0/1 are set to
  Bypass accordingly. The traditional SignalConditioner chain is still
  fully supported and documented as the fallback when CUDA isn't
  available.

Verified end-to-end against this exact file: file-mode parses and
initializes cleanly (fails only on the placeholder capture path, as
expected), and shared-memory mode reaches a full attach/read/decode/
CUDA-DDC/EOF/shutdown cycle against a synthetic producer with no
errors.

Signed-off-by: joebre <joel.brenner@saphyrion.ch>
2026-10-22 08:54:38 +02:00
joebre d02b573a87 Add RawStreamReader abstraction: file playback or live SHM input
First step of EVK1029_shared_memory_input_spec(2).md on the GNSS-SDR side:
Evk1029Source now reads raw bytes through a RawStreamReader interface
instead of owning an ifstream directly, so the exact same OBA-decode/FIR/
CUDA pipeline can run against either a recorded capture file or a live
shared-memory stream from EVK1029_CtrlApp.

- raw_stream_reader.h: the interface (read(), request_stop()).
- file_stream_reader.{h,cc}: wraps the original file-reading behavior
  (open, optional word-aligned seek, buffered read) verbatim.
- shm_ring.h: verbatim copy of EVK1029_CtrlApp's evk1029/shm_ring.hpp wire
  protocol -- the two repos build completely separately; only the struct
  layout and kMagic/kVersion need to match, since both sides mmap the same
  region. Keep both copies in sync if the format ever changes.
- shared_memory_stream_reader.{h,cc}: attaches to the ring (retrying up to
  30s if the producer hasn't started yet -- a late producer is recoverable,
  not a hard failure like a missing file), bridges SHM block granularity
  into read()'s byte-stream semantics, EOF on Stopped/EndOfStream with the
  ring drained. Wakes a producer that might be stuck waiting for space on
  destruction.
- Evk1029Source's destructor now calls reader_->request_stop() before
  joining the decode-ahead thread -- that thread's read() can block
  indefinitely on a live stream, so without this the join could hang
  forever on shutdown (a no-op for FileStreamReader, which never blocks).
- evk1029_signal_source.cc: new SignalSource.input=file|shared_memory
  (default file, every existing config keeps working untouched) and
  .shm_name config keys.

Verified: file-mode regression (same capture file, full GPS+Galileo
tracking lock, unchanged from before this refactor) and a synthetic
SHM-mode smoke test (sustained attach/read/EOF/shutdown with no real
hardware). Confirmed on real hardware: EVK1029_CtrlApp's live SHM stream
reaches a real position fix through this path.

Signed-off-by: joebre <joel.brenner@saphyrion.ch>
2026-10-22 08:54:38 +02: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