Replace the C stdio calls in the GNSS-SDR.dump_flowgraph code with
std::ofstream. This removes the reliance on <cstdio>, <cstring> and
<cerrno>, which were only included transitively, and closes the file
on every path.
A failure to open or write the file is now reported with a single
warning, and the success message is logged only if the file was
actually written.
The flag that makes the preamble search skip the head of the buffer
after a CRC failure was set and consumed within the same call to
cnav_add_symbol_(), so it does not need to be stored in
cnav_v27_part_t. Pass it to cnav_rescan_preamble_() as a parameter and
keep it as a local variable. The decoder behaves as before.
Shorten the changelog entry.
EVK1029_CtrlApp writes a 16 KiB metadata header at the start of every
recording. In file mode, EVK1029_Signal_Source now starts reading after
it instead of decoding it as samples. seconds_to_skip is counted from
the end of the header.
Signed-off-by: joebre <joel.brenner@saphyrion.ch>
The BeiDou DNAV and GLONASS GNAV decoders find from the sign of the
preamble (or time mark) correlation that the carrier loop is locked
180 degrees off and invert the symbols they decode, but they never set
Flag_PLL_180_deg_phase_locked, so the flag that reaches the
observables is the one the tracking block set.
Keep the sign of the last frame that passed its CRC check and, as the
GPS and Galileo decoders do, report it in
Flag_PLL_180_deg_phase_locked and add half a cycle to the carrier
phase while it is set.
The new unit tests feed BeiDou D1 subframes and GLONASS strings,
normal and inverted, to the decoders and check the reported flag and
carrier phase, a polarity change, and a GLONASS string that fails its
Hamming check.
Signed-off-by: Oleksandr Suvorov <cryosay@gmail.com>
The preamble search of the CNAV message decoder (libswiftcnav) started
at position 1 of the decoded bits buffer and stopped one window short
of its end, and when it found nothing it kept the last 7 bits, which
became positions 0 to 6 of the next search. The Viterbi decoder
delivers 32 bits at a time, so every search saw 39 bits and tested the
windows starting at 1 to 30. A preamble starting at position 31 was
complete in the buffer but not tested, and lost its first bit in the
shift; one starting at position 32 landed at position 0 of the next
search, which was skipped. For 2 of the 32 positions of the preamble
with respect to the 32-bit blocks, the first message after the start
of tracking was lost although all its symbols were received. With a
short capture this can leave a GPS L2C or L5 satellite without the
MT10, MT11 and clock messages needed for an ephemeris set.
Skipping position 0 is right only when the search follows a CRC
failure, where the buffer starts with the preamble pattern that has
just been rejected. Test every complete 8-bit window, from position 0
to n_decoded - 8, and skip position 0 only in that rescan (new
skip_first flag of cnav_v27_part_t, set where the CRC failure is
handled and cleared by the search).
The new unit tests encode two consecutive CNAV messages (CRC-24Q,
rate 1/2 K=7 convolutional code) and feed them to the decoder with the
first preamble at each of the 32 positions, for both symbol-pair
phases and both polarities, and with a preamble pattern that fails
the CRC check at each distance from 8 to 371 bits ahead of the first
message.
Signed-off-by: Ben Gant <indigma04@gmail.com>
Build the Bancroft matrix only from satellites with a valid position,
usable ephemeris (satexclude) and a pseudorange.
Correct the pseudoranges for the satellite clock offset.
Initialize both candidate totals to zero and sum the absolute residuals
from every satellite. Add six-satellite ordering and four-observation
noiseless regression tests to the PVT test suite.
Fixesgnss-sdr/gnss-sdr#1000
Signed-off-by: daoyyy7777 <354528186+daoyyy7777@users.noreply.github.com>
With libc++, clang-tidy suggests replacing std::vector<float>(n, 0.0F)
with {n, 0.0F}, which would select the initializer_list constructor.
Return the zero-initialized LLR vector instead.
Tracking_XX.pull_in_time_s of tracking. It was counted from the acquisition
sample stamp, so an acquisition that does not block the stream, such as
GPS_L1_CA_PCPS_OpenCl_Acquisition, could leave no pull-in at all when it
delivered its result seconds of signal later, as happens when processing
faster than real time. Tracking then locked onto a drifting frequency and lost
the satellite some seconds later.
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.
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>