Commit Graph
79 Commits
Author SHA1 Message Date
Carles Fernandez 75ae5ce4e4 Allow BeiDou B2a signals in multi-band configurations 2026-09-16 07:47:19 +02:00
Carles Fernandez e6ebb77c75 WARMSTART keeps the almanac already in memory instead of clearing it
and reloading it from the XML assistance files, which could replace a
fresher, live-decoded almanac with a stale snapshot from disk, and the
handler now uses the visible-satellite list it computed instead of
prioritizing an empty one.
2026-09-14 16:37:38 +02:00
Carles Fernandez bcb5b7228b Extend visibility-aware search and fix dual-band acquisition scheduling
Visibility-aware acquisition search (GNSS-SDR.enable_visibility_aware_search):
- Classify GLONASS and QZSS satellites too. GLONASS positions come from the
  GNAV almanac (new Glonass_Gnav_Almanac::satellite_position with the
  standard perturbation model), so the search order benefits before any
  GLONASS ephemeris is decoded.
- PVT publishes a lock-free navigation snapshot (ephemeris, almanac, UTC
  models per system) that the classifier reads instead of locking the PVT
  maps on every recompute.
- Recompute on new navigation data, on position changes larger than
  visibility_recompute_position_threshold_m, every
  visibility_recompute_interval_s, and when the almanac ages out; fix the
  periodic and position-triggered recomputes that never fired, and the
  off-by-one that excluded satellites in [mask, mask+1) degrees.
- Enter the start-up standby only when the feature is enabled, so the
  default search order is untouched.

Secondary-frequency acquisition assistance:
- Do not start an acquisition on the PRN 0 placeholder left on assisted
  channels at connect time; it threw inside the control thread and left the
  flowgraph running headless with the secondary band never acquired.
- Match GLONASS assistance by FDMA frequency channel: the search pool keeps
  one slot per channel while tracked L1 channels report the decoded slot, so
  L2 was never picked.
- Assist from locked channels before their telemetry is decoded: the
  observables status now reports tracking-only channels and the flowgraph
  keeps a separate tracking map for the assisted search.
2026-09-12 14:15:00 +02:00
joebre f87e07513d Warm start: keep in-memory almanac instead of reloading from XML
WARMSTART used to clear ephemeris and almanac and then reload both
from local XML assistance files, which can silently regress the
receiver's live-accumulated almanac (new satellites/pages demodulated
since last start) back to whatever stale snapshot happens to be on
disk. It also never wrote anything back to disk first, so this was a
one-way loss with no merge.

Add PvtInterface::clear_ephemeris_keep_almanac(), which clears only
the ephemeris maps and leaves almanac untouched, and use it in
WARMSTART instead of clear_ephemeris() + read_assistance_from_XML().
This matches the classic cold/warm/hot start table (warm: almanac
current, ephemeris unknown/stale) using whatever almanac the receiver
already has, rather than a file that can't be any more current than
that.

Also fixes get_visible_sats()'s return value never being assigned to
visible_satellites in the WARMSTART handler, so priorize_satellites()
was always reordering the queue with an empty list.
2026-09-09 16:42:17 +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
joebre aba6cfaeb6 Narrow acquisition Doppler search when dual-frequency-assisted
When acquiring a secondary frequency (e.g. Galileo E5a) of a satellite
whose primary frequency (e.g. E1) is already tracked, the primary's
Doppler can be projected onto the secondary and passed in as an
already-known estimate (GNSS-SDR.assist_dual_frequency_acq). Even so,
the acquisition still searched the full configured Doppler grid around
that estimate rather than trusting it.

Adds Acquisition_<Sig>.enable_doppler_narrowing (default false): when
the projected Doppler is passed in as exact (doppler_uncertanty == 0),
collapses the search to just that bin plus one reference bin (used as
the existing noise-power estimate, at the same separation the full
grid search already uses for its own "opposite" bin), instead of
running the full multi-bin grid. Falls back to the full grid whenever
the Doppler isn't known this precisely (single-frequency acquisition,
or dual-frequency assist disabled/unavailable).

set_doppler_uncertanty() threads through
AcquisitionInterface -> PcpsAcquisitionAdapter -> pcps_acquisition,
and Channel::assist_acquisition_doppler() gains a doppler_uncertanty
parameter (default 1, i.e. "not known precisely") so existing callers
are unaffected unless they opt in.

Also fixes max_to_input_power_statistic()'s "opposite bin" index to
wrap using its own num_doppler_bins parameter instead of the
always-full-grid d_num_doppler_bins member, which was already
inconsistent with step-two's narrower bin count and would have been
wrong for the narrowed 2-bin case introduced here.

Signed-off-by: joebre <joel.brenner@saphyrion.ch>
2026-08-28 17:39:36 +02:00
Carles Fernandez 5454bc22ee Complete BeiDou D1/D2 DNAV decoding 2026-07-31 19:11:58 +02:00
Mathieu Favreau ec309bd22f Remove set_threshold from acquisition 2025-11-20 17:22:27 +00:00
Mathieu Favreau 95b424dd3c Remove init from acquisition 2025-11-13 19:19:16 +00:00
Mathieu Favreau 900c4b12b4 Remove set_state from acquisition classes 2025-11-13 17:59:49 +00:00
Mathieu Favreau 7d4e175235 Make doppler step const in acquisition 2025-11-05 18:40:55 +00:00
Mathieu Favreau 10a75f1ab2 Make acquisition doppler max const 2025-11-04 21:57:31 +00:00
Victor Castillo 4db7f775b5 feat: refactored configuration & renamed to sensor data 2025-07-09 16:33:54 +02:00
Carles Fernandez 700d4403d5 Transition to clang-format 19 2024-12-26 11:18:41 +01:00
Carles Fernandez 95596b8f91 Soft transition from Gflags and Glog to Abseil. Some CI fixes 2024-04-29 08:27:33 +02:00
Carles Fernandez a152226f50 Fix potenctial data race condition 2023-12-02 12:54:28 +01:00
Carles Fernandez f703990a09 Fix building when using C++11
Update changelog
2021-02-17 09:43:05 +01:00
Jim Melton fb6fef74e3 fix clang-tidy CI issues 2021-02-15 14:13:54 -07:00
Jim Melton 78362e7cba add signal_source_interface
also adds a base implementation that most signal sources should inherit from.
The gen_signal_source is inexplicably different (probably as a test fixture,
commonality was not valued).

Only the file_signal_source has been tested; all the sources are modified in the same
way, but we all know the only proof of correctness is testing.

The block factory was simplified a bit. Handling for legacy config files was pulled out
of the flowgraph; now when the "0" instance of a component (Foo0) is created, if there is
no config for it, then the legacy version (Foo) will be tried. This is different from
passing -1 for the item number (which is still supported). Theoretically, all existing
config files should still work.
2021-02-15 11:47:13 -07:00
Jim Melton 8407acb7a7 WIP: initial commit for collaboration 2021-02-15 11:47:13 -07:00
Carles Fernandez 7308745f05 Apply more concise file header format
Re-license CMake scripts with BSD-3-Clause
2020-12-30 13:35:06 +01:00
Carles Fernandez f24064e245 Fixes for changed behavior of clang-format 2020-11-06 10:41:20 +01:00
Carles Fernandez f0e1ef6f9a Add a common shared pointer definition
Makes transition to GNU Radio 3.9 API less verbose
2020-11-03 20:51:57 +01:00
Carles Fernandez 287284261c Make use of Doxygen grouping feature
Improve Modules page in generated HTML documentation
2020-11-01 13:37:19 +01:00
Josh Schindehette ed93af11ac Added acquisition and tracking monitors
Added acquisition and tracking monitors to view intermediate outputs of
GNSS-SDR from monitoring clients. Each monitor (acquisition, tracking,
original monitor, and pvt) pushes its data to a different UDP port.
2020-10-21 16:26:56 +02:00
Marc Majoral 933873c265 When using the FPGA in post-processing mode, start the DMA after instantiating the complete flowgraph, not before. 2020-09-10 10:08:25 +02:00
Carles Fernandez 499de7a9f1 Update file headers 2020-07-28 16:57:15 +02:00
Carles Fernandez bcd5bfa6ff Indicate that the property method of configuration is a getter 2020-06-23 11:05:31 +02:00
Carles Fernandez 955348b080 Remove trailing underscore in header guards 2020-02-08 10:10:46 +01:00
Carles Fernandez 4d0d263280 Make the software package compliant with the REUSE Specification v3.0 (see https://reuse.software/spec/)
Update license headers to SPDX format (see https://spdx.org/)
Add license to all files
Add CI job in GitHub Actions to ensure compliance
2020-02-08 01:20:02 +01:00
Carles Fernandez 9023f19794 Use C++ comments for final #endif in headers 2020-01-26 22:23:22 +01:00
Carles Fernandez c31d9dea40 Fix errors risen by include_what_you_use 2019-08-17 13:56:54 +02:00
Carles Fernandez a4d6800e22 Update copyright year
Applied on files changed since last release
clang-format applied
2019-07-26 12:38:20 +02:00
Javier Arribas 27b1baf0b7 completing the acquisition assistance option from primary frequencies (e.g. L1, E1) to secondary frequencies (e.g. L5, E5) 2019-07-23 17:56:02 +02:00
Javier Arribas 141e101363 Bug fix that restores the acquisition and tracking destructor calls due to circular smart pointer references 2019-04-09 17:39:48 +02:00
Javier Arribas 0be8c657de Reducing the latency in the acquisition to tracking transition 2019-03-20 15:13:17 +01:00
Carles Fernandez 62a7e54359 Introduce readability-identifier-naming check
This commit enforces naming style for Classes and global constants:
Camel_Snake_Case for Classes
UPPER_CASE for global constants
CamelCase for abstract classes
2019-02-22 10:47:24 +01:00
Carles Fernandez 5b79f8ac50 Merge branch 'next' into smart_acq_resampler 2018-12-10 14:24:42 +01:00
Carles Fernandez 5f79053d65 Sort includes automatically with clang-format
Order:
1.- Main header
2.- Local headers
3.- Third-party library headers
4.- System headers

each category sorted lexicographically
2018-12-09 22:00:09 +01:00
Javier Arribas 63b19692e7 Completing the smart acquisition resampler 2018-12-05 16:50:32 +01:00
Javier Arribas 4b80451630 Adding initial functional changes for the smart acquisition resampler 2018-12-03 17:58:18 +01:00
Carles Fernandez 96f34cabb1 clang-tidy: apply modernize-use-equals-default fix. See https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-equals-default.html 2018-12-03 11:12:10 +01:00
Carles Fernandez 3bb47ff755 Improve const correctness, fix string comparisons 2018-12-02 05:29:11 +01:00
Carles Fernandez 98726ef036 Improve const correctess, change name of variable to a more meaningful name 2018-11-08 14:25:38 +01:00
Javier ea3db59fd7 Adding Tele Command status for reporting the Position, Speed and Course over ground and Time 2018-11-06 14:39:57 +01:00
Javier 01a1954b15 Adding the Hotstart telecommand implementation to predict visible satellites for GPS and Galileo constellations 2018-11-05 17:53:53 +01:00
Javier 5b3eb12998 Implementation of new receiver telecommands standby and coldstart 2018-10-28 11:09:01 +01:00
Carles Fernandez 3f0a7ef4fa Extend acquisition performance test to other implementations. set_state(int state) is now amandatory member for acquisition adapters 2018-07-04 13:05:44 +02:00
Carles Fernandez 0d60d97c24 Use https instead of http in links when available
Update copyright year in headers
2018-05-13 22:49:11 +02:00
Carles Fernandez 34f24562cf Apply automated code formatting
Documented at .clang-format
See http://clang.llvm.org/docs/ClangFormat.html and http://clang.llvm.org/docs/ClangFormatStyleOptions.html
2018-03-03 02:03:39 +01:00