From 51418850bb9046f60614de66c6de304aac595106 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 3 Apr 2023 13:36:54 +0200 Subject: [PATCH] Add configuration parameter PVT.bancroft_init, by default to true, to opt-out for Bancroft initialization in the first iteration of PVT computation --- docs/CHANGELOG.md | 7 ++++++- src/algorithms/PVT/adapters/rtklib_pvt.cc | 5 ++++- src/algorithms/libs/rtklib/rtklib.h | 1 + src/algorithms/libs/rtklib/rtklib_pntpos.cc | 2 +- src/algorithms/libs/rtklib/rtklib_rtksvr.h | 2 +- .../signal-processing-blocks/pvt/nmea_printer_test.cc | 3 ++- .../signal-processing-blocks/pvt/rinex_printer_test.cc | 3 ++- .../signal-processing-blocks/pvt/rtklib_solver_test.cc | 3 ++- 8 files changed, 19 insertions(+), 7 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 6f6430b13..05d44735a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: GPL-3.0-or-later ) [comment]: # ( -SPDX-FileCopyrightText: 2011-2022 Carles Fernandez-Prades +SPDX-FileCopyrightText: 2011-2023 Carles Fernandez-Prades ) @@ -30,6 +30,11 @@ All notable changes to GNSS-SDR will be documented in this file. - Improved non-coherent acquisition when `Acquisition_XX.blocking=false`. - Implemented processing of BeiDou PRN 34 up to PRN 63 signals. - Implemented Hamming code correction for Glonass navigation message. +- Now the first iteration of the PVT computation is initialized by the Bancroft + method. This allows to get PVT fixes in some unusual geometries (_e.g._, + GNSS-like signals transmitted by LEO satellites). This initialization is + performed by default. You can opt-out by setting `PVT.bancroft_init=false` in + your configuration file. ### Improvements in Interoperability: diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index a607d2655..9ce402bcc 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -764,6 +764,8 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration, const double carrier_phase_error_factor_a = configuration->property(role + ".carrier_phase_error_factor_a", 0.003); const double carrier_phase_error_factor_b = configuration->property(role + ".carrier_phase_error_factor_b", 0.003); + const bool bancroft_init = configuration->property(role + ".bancroft_init", true); + snrmask_t snrmask = {{}, {{}, {}}}; prcopt_t rtklib_configuration_options = { @@ -822,7 +824,8 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration, {{}, {}}, /* odisp[2][6*11] ocean tide loading parameters {rov,base} */ {{}, {{}, {}}, {{}, {}}, {}, {}}, /* exterr_t exterr extended receiver error model */ 0, /* disable L2-AR */ - {} /* char pppopt[256] ppp option "-GAP_RESION=" default gap to reset iono parameters (ep) */ + {}, /* char pppopt[256] ppp option "-GAP_RESION=" default gap to reset iono parameters (ep) */ + bancroft_init /* enable Bancroft initialization for the first iteration of the PVT computation, useful in some geometries */ }; rtkinit(&rtk, &rtklib_configuration_options); diff --git a/src/algorithms/libs/rtklib/rtklib.h b/src/algorithms/libs/rtklib/rtklib.h index b470dca83..b5658641e 100644 --- a/src/algorithms/libs/rtklib/rtklib.h +++ b/src/algorithms/libs/rtklib/rtklib.h @@ -1000,6 +1000,7 @@ typedef struct exterr_t exterr; /* extended receiver error model */ int freqopt; /* disable L2-AR */ char pppopt[256]; /* ppp option */ + bool bancroft_init; /* enable Bancroft initialization for the first iteration of the PVT computation */ } prcopt_t; diff --git a/src/algorithms/libs/rtklib/rtklib_pntpos.cc b/src/algorithms/libs/rtklib/rtklib_pntpos.cc index b9e74dfcb..8528d9f3d 100644 --- a/src/algorithms/libs/rtklib/rtklib_pntpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_pntpos.cc @@ -714,7 +714,7 @@ int estpos(const obsd_t *obs, int n, const double *rs, const double *dts, } // Rough first estimation to initialize the algorithm - if (std::sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]) < 0.1) + if (opt->bancroft_init && (std::sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]) < 0.1)) { arma::mat B = arma::mat(n, 4, arma::fill::zeros); for (i = 0; i < n; i++) diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.h b/src/algorithms/libs/rtklib/rtklib_rtksvr.h index 5c2919e75..48854cd2c 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtksvr.h +++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.h @@ -65,7 +65,7 @@ const prcopt_t PRCOPT_DEFAULT = { /* defaults processing options */ {}, {}, {}, /* baseline, ru, rb */ {"", ""}, /* anttype */ {}, {}, {}, /* antdel, pcv, exsats */ - 0, 0, 0, {"", ""}, {}, 0, {{}, {}}, {{}, {{}, {}}, {{}, {}}, {}, {}}, 0, {}}; + 0, 0, 0, {"", ""}, {}, 0, {{}, {}}, {{}, {{}, {}}, {{}, {}}, {}, {}}, 0, {}, true}; void writesolhead(stream_t *stream, const solopt_t *solopt); diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc index 99c2bc0a3..94c904f95 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc @@ -133,7 +133,8 @@ void NmeaPrinterTest::conf() {{}, {}}, /* odisp[2][6*11] ocean tide loading parameters {rov,base} */ {{}, {{}, {}}, {{}, {}}, {}, {}}, /* exterr_t exterr extended receiver error model */ 0, /* disable L2-AR */ - {} /* char pppopt[256] ppp option "-GAP_RESION=" default gap to reset iono parameters (ep) */ + {}, /* char pppopt[256] ppp option "-GAP_RESION=" default gap to reset iono parameters (ep) */ + true /* enable Bancroft initialization for the first iteration of the PVT computation, useful in some geometries */ }; rtkinit(&rtk, &rtklib_configuration_options); diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc index 2eb6e1987..05f7d115e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc @@ -132,7 +132,8 @@ void RinexPrinterTest::conf() {{}, {}}, /* odisp[2][6*11] ocean tide loading parameters {rov,base} */ {{}, {{}, {}}, {{}, {}}, {}, {}}, /* exterr_t exterr extended receiver error model */ 0, /* disable L2-AR */ - {} /* char pppopt[256] ppp option "-GAP_RESION=" default gap to reset iono parameters (ep) */ + {}, /* char pppopt[256] ppp option "-GAP_RESION=" default gap to reset iono parameters (ep) */ + true /* enable Bancroft initialization for the first iteration of the PVT computation, useful in some geometries */ }; rtkinit(&rtk, &rtklib_configuration_options); diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc index 9804fbde1..4da572895 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc @@ -363,7 +363,8 @@ rtk_t configure_rtklib_options() {{}, {}}, /* odisp[2][6*11] ocean tide loading parameters {rov,base} */ {{}, {{}, {}}, {{}, {}}, {}, {}}, /* exterr_t exterr extended receiver error model */ 0, /* disable L2-AR */ - {} /* char pppopt[256] ppp option "-GAP_RESION=" default gap to reset iono parameters (ep) */ + {}, /* char pppopt[256] ppp option "-GAP_RESION=" default gap to reset iono parameters (ep) */ + true /* enable Bancroft initialization for the first iteration of the PVT computation, useful in some geometries */ }; rtk_t rtk;