From 34a250246ad854d8279d5b0c7a8399429572775a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 10 Jun 2020 10:15:59 +0200 Subject: [PATCH] Simplify initializations in system_parameters library --- .../gps_l1_ca_telemetry_decoder_gs.cc | 2 +- .../gps_l5_telemetry_decoder_gs.cc | 4 +- src/core/system_parameters/CMakeLists.txt | 12 - .../system_parameters/agnss_ref_location.cc | 29 -- .../system_parameters/agnss_ref_location.h | 11 +- src/core/system_parameters/agnss_ref_time.cc | 30 -- src/core/system_parameters/agnss_ref_time.h | 13 +- .../system_parameters/beidou_dnav_almanac.cc | 38 --- .../system_parameters/beidou_dnav_almanac.h | 28 +- .../beidou_dnav_ephemeris.cc | 53 +--- .../system_parameters/beidou_dnav_ephemeris.h | 92 +++--- .../system_parameters/beidou_dnav_iono.cc | 33 --- src/core/system_parameters/beidou_dnav_iono.h | 22 +- .../beidou_dnav_navigation_message.cc | 185 +----------- .../beidou_dnav_navigation_message.h | 264 +++++++++-------- .../beidou_dnav_utc_model.cc | 40 --- .../system_parameters/beidou_dnav_utc_model.h | 30 +- src/core/system_parameters/galileo_almanac.cc | 41 --- src/core/system_parameters/galileo_almanac.h | 34 +-- .../galileo_almanac_helper.cc | 58 ---- .../galileo_almanac_helper.h | 97 +++--- .../system_parameters/galileo_ephemeris.cc | 61 ---- .../system_parameters/galileo_ephemeris.h | 94 +++--- .../system_parameters/galileo_fnav_message.cc | 137 --------- .../system_parameters/galileo_fnav_message.h | 231 ++++++++------- src/core/system_parameters/galileo_iono.cc | 39 --- src/core/system_parameters/galileo_iono.h | 34 +-- .../galileo_navigation_message.cc | 188 ------------ .../galileo_navigation_message.h | 276 +++++++++--------- .../system_parameters/galileo_utc_model.cc | 19 -- .../system_parameters/galileo_utc_model.h | 42 +-- .../system_parameters/glonass_gnav_almanac.cc | 44 --- .../system_parameters/glonass_gnav_almanac.h | 44 +-- .../glonass_gnav_ephemeris.cc | 46 --- .../glonass_gnav_ephemeris.h | 80 ++--- .../glonass_gnav_navigation_message.cc | 61 +--- .../glonass_gnav_navigation_message.h | 79 +++-- .../glonass_gnav_utc_model.cc | 12 - .../glonass_gnav_utc_model.h | 16 +- src/core/system_parameters/gnss_satellite.cc | 6 - src/core/system_parameters/gnss_satellite.h | 2 +- src/core/system_parameters/gnss_signal.cc | 5 - src/core/system_parameters/gnss_signal.h | 2 +- src/core/system_parameters/gps_acq_assist.cc | 37 --- src/core/system_parameters/gps_acq_assist.h | 26 +- src/core/system_parameters/gps_almanac.cc | 40 --- src/core/system_parameters/gps_almanac.h | 32 +- .../system_parameters/gps_cnav_ephemeris.cc | 63 ---- .../system_parameters/gps_cnav_ephemeris.h | 100 +++---- src/core/system_parameters/gps_cnav_iono.cc | 35 --- src/core/system_parameters/gps_cnav_iono.h | 22 +- .../gps_cnav_navigation_message.cc | 26 -- .../gps_cnav_navigation_message.h | 33 +-- .../system_parameters/gps_cnav_utc_model.cc | 14 - .../system_parameters/gps_cnav_utc_model.h | 26 +- src/core/system_parameters/gps_ephemeris.cc | 53 +--- src/core/system_parameters/gps_ephemeris.h | 92 +++--- src/core/system_parameters/gps_iono.cc | 35 --- src/core/system_parameters/gps_iono.h | 20 +- .../gps_navigation_message.cc | 112 +------ .../gps_navigation_message.h | 155 +++++----- src/core/system_parameters/gps_utc_model.cc | 15 - src/core/system_parameters/gps_utc_model.h | 26 +- src/core/system_parameters/sbas_ephemeris.h | 23 +- .../glonass_gnav_nav_message_test.cc | 6 +- 65 files changed, 1045 insertions(+), 2580 deletions(-) delete mode 100644 src/core/system_parameters/agnss_ref_location.cc delete mode 100644 src/core/system_parameters/agnss_ref_time.cc delete mode 100644 src/core/system_parameters/beidou_dnav_almanac.cc delete mode 100644 src/core/system_parameters/beidou_dnav_iono.cc delete mode 100644 src/core/system_parameters/beidou_dnav_utc_model.cc delete mode 100644 src/core/system_parameters/galileo_almanac.cc delete mode 100644 src/core/system_parameters/galileo_iono.cc delete mode 100644 src/core/system_parameters/glonass_gnav_almanac.cc delete mode 100644 src/core/system_parameters/gps_acq_assist.cc delete mode 100644 src/core/system_parameters/gps_almanac.cc delete mode 100644 src/core/system_parameters/gps_cnav_iono.cc delete mode 100644 src/core/system_parameters/gps_iono.cc diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index a3df06b25..60769242f 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -159,7 +159,7 @@ bool gps_l1_ca_telemetry_decoder_gs::gps_word_parityCheck(uint32_t gpsword) void gps_l1_ca_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satellite) { - d_nav.reset(); + d_nav = Gps_Navigation_Message(); d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; d_nav.i_satellite_PRN = d_satellite.get_PRN(); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc index cbf0483dd..6ff60cfb6 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc @@ -93,14 +93,14 @@ void gps_l5_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); DLOG(INFO) << "GPS L5 CNAV telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; - d_CNAV_Message.reset(); + d_CNAV_Message = Gps_CNAV_Navigation_Message(); } void gps_l5_telemetry_decoder_gs::set_channel(int32_t channel) { d_channel = channel; - d_CNAV_Message.reset(); + d_CNAV_Message = Gps_CNAV_Navigation_Message(); DLOG(INFO) << "GPS L5 CNAV channel set to " << channel; // ############# ENABLE DATA FILE LOG ################# if (d_dump == true) diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index 5656a8f5e..e4e8e586a 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -13,31 +13,19 @@ set(SYSTEM_PARAMETERS_SOURCES gnss_signal.cc gps_navigation_message.cc gps_ephemeris.cc - gps_iono.cc - gps_almanac.cc gps_utc_model.cc - gps_acq_assist.cc - agnss_ref_time.cc - agnss_ref_location.cc galileo_utc_model.cc galileo_ephemeris.cc - galileo_almanac.cc galileo_almanac_helper.cc - galileo_iono.cc galileo_navigation_message.cc beidou_dnav_navigation_message.cc beidou_dnav_ephemeris.cc - beidou_dnav_iono.cc - beidou_dnav_almanac.cc - beidou_dnav_utc_model.cc sbas_ephemeris.cc galileo_fnav_message.cc gps_cnav_ephemeris.cc gps_cnav_navigation_message.cc - gps_cnav_iono.cc gps_cnav_utc_model.cc glonass_gnav_ephemeris.cc - glonass_gnav_almanac.cc glonass_gnav_utc_model.cc glonass_gnav_navigation_message.cc ) diff --git a/src/core/system_parameters/agnss_ref_location.cc b/src/core/system_parameters/agnss_ref_location.cc deleted file mode 100644 index 77c7eef01..000000000 --- a/src/core/system_parameters/agnss_ref_location.cc +++ /dev/null @@ -1,29 +0,0 @@ -/*! - * \file agnss_ref_location.cc - * \brief Interface of an Assisted GNSS REFERENCE LOCATION storage - * - * \author Javier Arribas, 2013. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "agnss_ref_location.h" - -Agnss_Ref_Location::Agnss_Ref_Location() -{ - valid = false; - lat = 0.0; - lon = 0.0; - uncertainty = 0.0; -} diff --git a/src/core/system_parameters/agnss_ref_location.h b/src/core/system_parameters/agnss_ref_location.h index ec20e1289..433f13682 100644 --- a/src/core/system_parameters/agnss_ref_location.h +++ b/src/core/system_parameters/agnss_ref_location.h @@ -31,14 +31,15 @@ class Agnss_Ref_Location { public: - bool valid; - double lat; - double lon; - double uncertainty; /*! * Default constructor */ - Agnss_Ref_Location(); + Agnss_Ref_Location() = default; + + bool valid{}; + double lat{}; + double lon{}; + double uncertainty{}; template diff --git a/src/core/system_parameters/agnss_ref_time.cc b/src/core/system_parameters/agnss_ref_time.cc deleted file mode 100644 index 0a69784b7..000000000 --- a/src/core/system_parameters/agnss_ref_time.cc +++ /dev/null @@ -1,30 +0,0 @@ -/*! - * \file agnss_ref_time.cc - * \brief Interface of an Assisted GNSS REFERENCE TIME storage - * - * \author Javier Arribas, 2013. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "agnss_ref_time.h" - -Agnss_Ref_Time::Agnss_Ref_Time() -{ - valid = false; - d_TOW = 0.0; - d_Week = 0.0; - d_tv_sec = 0.0; - d_tv_usec = 0.0; -} diff --git a/src/core/system_parameters/agnss_ref_time.h b/src/core/system_parameters/agnss_ref_time.h index 0e764d910..439118ffd 100644 --- a/src/core/system_parameters/agnss_ref_time.h +++ b/src/core/system_parameters/agnss_ref_time.h @@ -31,15 +31,16 @@ class Agnss_Ref_Time { public: - bool valid; - double d_TOW; - double d_Week; - double d_tv_sec; - double d_tv_usec; /*! * Default constructor */ - Agnss_Ref_Time(); + Agnss_Ref_Time() = default; + + bool valid{}; + double d_TOW{}; + double d_Week{}; + double d_tv_sec{}; + double d_tv_usec{}; template diff --git a/src/core/system_parameters/beidou_dnav_almanac.cc b/src/core/system_parameters/beidou_dnav_almanac.cc deleted file mode 100644 index 22827e2ac..000000000 --- a/src/core/system_parameters/beidou_dnav_almanac.cc +++ /dev/null @@ -1,38 +0,0 @@ -/*! - * \file beidou_dnav_almanac.cc - * \brief Interface of a Beidou DNAV Almanac storage - * - * See http://en.beidou.gov.cn/SYSTEMS/Officialdocument/201902/P020190227601370045731.pdf - * \author Sergi Segura, 2018. sergi.segura.munoz(at)gmail.com - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "beidou_dnav_almanac.h" - -Beidou_Dnav_Almanac::Beidou_Dnav_Almanac() -{ - i_satellite_PRN = 0; - d_Delta_i = 0.0; - d_Toa = 0.0; - d_M_0 = 0.0; - d_e_eccentricity = 0.0; - d_sqrt_A = 0.0; - d_OMEGA0 = 0.0; - d_OMEGA = 0.0; - d_OMEGA_DOT = 0.0; - i_SV_health = 0; - d_A_f0 = 0.0; - d_A_f1 = 0.0; -} diff --git a/src/core/system_parameters/beidou_dnav_almanac.h b/src/core/system_parameters/beidou_dnav_almanac.h index dd58afbf2..bc7b24622 100644 --- a/src/core/system_parameters/beidou_dnav_almanac.h +++ b/src/core/system_parameters/beidou_dnav_almanac.h @@ -31,23 +31,23 @@ class Beidou_Dnav_Almanac { public: - unsigned int i_satellite_PRN; //!< SV PRN NUMBER - double d_Delta_i; - double d_Toa; //!< Almanac data reference time of week [s] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_e_eccentricity; //!< Eccentricity [dimensionless] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] - int i_SV_health; // SV Health - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - /*! * Default constructor */ - Beidou_Dnav_Almanac(); + Beidou_Dnav_Almanac() = default; + + unsigned int i_satellite_PRN{}; //!< SV PRN NUMBER + double d_Delta_i{}; + double d_Toa{}; //!< Almanac data reference time of week [s] + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] + double d_e_eccentricity{}; //!< Eccentricity [dimensionless] + double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s] + int i_SV_health{}; //!< SV Health + double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s] template diff --git a/src/core/system_parameters/beidou_dnav_ephemeris.cc b/src/core/system_parameters/beidou_dnav_ephemeris.cc index 423316a0b..3a3d5d3bb 100644 --- a/src/core/system_parameters/beidou_dnav_ephemeris.cc +++ b/src/core/system_parameters/beidou_dnav_ephemeris.cc @@ -22,66 +22,15 @@ #include "gnss_satellite.h" #include + Beidou_Dnav_Ephemeris::Beidou_Dnav_Ephemeris() { - i_satellite_PRN = 0; - d_TOW = 0; - d_Crs = 0; - d_Delta_n = 0; - d_M_0 = 0; - d_Cuc = 0; - d_eccentricity = 0; - d_Cus = 0; - d_sqrt_A = 0; - d_Toe = 0; - d_Toc = 0; - d_Cic = 0; - d_OMEGA0 = 0; - d_Cis = 0; - d_i_0 = 0; - d_Crc = 0; - d_OMEGA = 0; - d_OMEGA_DOT = 0; - d_IDOT = 0; - i_BEIDOU_week = 0; - i_SV_accuracy = 0; - i_SV_health = 0; - d_AODE = 0; - d_TGD1 = 0; - d_TGD2 = 0; - d_AODC = 0; // Issue of Data, Clock - i_AODO = 0; // Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - d_AODC = 0; - b_fit_interval_flag = false; - d_spare1 = 0.0; - d_spare2 = 0.0; - - i_sig_type = 0; - i_nav_type = 0; - - d_A_f0 = 0; // Coefficient 0 of code phase offset model [s] - d_A_f1 = 0; // Coefficient 1 of code phase offset model [s/s] - d_A_f2 = 0; // Coefficient 2 of code phase offset model [s/s^2] - - b_integrity_status_flag = false; - b_alert_flag = false; // If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - b_antispoofing_flag = false; // If true, the AntiSpoofing mode is ON in that SV - auto gnss_sat = Gnss_Satellite(); std::string _system("Beidou"); for (unsigned int i = 1; i < 36; i++) { satelliteBlock[i] = gnss_sat.what_block(_system, i); } - - d_satClkDrift = 0.0; - d_dtr = 0.0; - d_satpos_X = 0.0; - d_satpos_Y = 0.0; - d_satpos_Z = 0.0; - d_satvel_X = 0.0; - d_satvel_Y = 0.0; - d_satvel_Z = 0.0; } diff --git a/src/core/system_parameters/beidou_dnav_ephemeris.h b/src/core/system_parameters/beidou_dnav_ephemeris.h index 9ba9ad4e0..744826add 100644 --- a/src/core/system_parameters/beidou_dnav_ephemeris.h +++ b/src/core/system_parameters/beidou_dnav_ephemeris.h @@ -41,44 +41,44 @@ public: */ Beidou_Dnav_Ephemeris(); - unsigned int i_satellite_PRN; //!< SV PRN NUMBER - double d_TOW; //!< Time of BEIDOU Week of the ephemeris set (taken from subframes TOW) [s] - double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - double d_eccentricity; //!< Eccentricity [dimensionless] - double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] - double d_Toe; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - double d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] - double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] - double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] - double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] - double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] - int i_BEIDOU_week; //!< BEIDOU week number, aka WN [week] - int i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) - int i_SV_health; - double d_TGD1; //!< Estimated Group Delay Differential on B1I [s] - double d_TGD2; //!< Estimated Group Delay Differential on B2I [s] - double d_AODC; //!< Age of Data, Clock - double d_AODE; //!< Age of Data, Ephemeris - int i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + unsigned int i_satellite_PRN{}; //!< SV PRN NUMBER + double d_TOW{}; //!< Time of BEIDOU Week of the ephemeris set (taken from subframes TOW) [s] + double d_Crs{}; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + double d_Delta_n{}; //!< Mean Motion Difference From Computed Value [semi-circles/s] + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] + double d_Cuc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + double d_eccentricity{}; //!< Eccentricity [dimensionless] + double d_Cus{}; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] + double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_Toe{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] + double d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] + double d_Cic{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_Cis{}; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] + double d_i_0{}; //!< Inclination Angle at Reference Time [semi-circles] + double d_Crc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s] + double d_IDOT{}; //!< Rate of Inclination Angle [semi-circles/s] + int i_BEIDOU_week{}; //!< BEIDOU week number, aka WN [week] + int i_SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) + int i_SV_health{}; + double d_TGD1{}; //!< Estimated Group Delay Differential on B1I [s] + double d_TGD2{}; //!< Estimated Group Delay Differential on B2I [s] + double d_AODC{}; //!< Age of Data, Clock + double d_AODE{}; //!< Age of Data, Ephemeris + int i_AODO{}; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - int i_sig_type; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q) */ - int i_nav_type; //!< BDS: nav type (0:unknown,1:IGSO/MEO,2:GEO) */ + int i_sig_type{}; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q) */ + int i_nav_type{}; //!< BDS: nav type (0:unknown,1:IGSO/MEO,2:GEO) */ - bool b_fit_interval_flag; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. - double d_spare1; - double d_spare2; + bool b_fit_interval_flag{}; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. + double d_spare1{}; + double d_spare2{}; - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] + double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s] + double d_A_f2{}; //!< Coefficient 2 of code phase offset model [s/s^2] /*! \brief If true, enhanced level of integrity assurance. * @@ -90,23 +90,23 @@ public: * times the upper bound value of the current broadcast URA index, for more than 5.2 seconds, without an * accompanying alert, is less than 1E-8 per hour. */ - bool b_integrity_status_flag; - bool b_alert_flag; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - bool b_antispoofing_flag; //!< If true, the AntiSpoofing mode is ON in that SV + bool b_integrity_status_flag{}; + bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. + bool b_antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV // clock terms derived from ephemeris data - double d_satClkDrift; //!< GPS clock error - double d_dtr; //!< relativistic clock correction term + double d_satClkDrift{}; //!< GPS clock error + double d_dtr{}; //!< relativistic clock correction term // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] std::map satelliteBlock; //!< Map that stores to which block the PRN belongs diff --git a/src/core/system_parameters/beidou_dnav_iono.cc b/src/core/system_parameters/beidou_dnav_iono.cc deleted file mode 100644 index e24050cff..000000000 --- a/src/core/system_parameters/beidou_dnav_iono.cc +++ /dev/null @@ -1,33 +0,0 @@ -/*! - * \file beidou_dnav_iono.cc - * \brief Interface of a BEIDOU IONOSPHERIC MODEL storage - * \author Sergi Segura, 2018. sergi.segura.munoz(at)gmail.com - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "beidou_dnav_iono.h" - -Beidou_Dnav_Iono::Beidou_Dnav_Iono() -{ - valid = false; - d_alpha0 = 0.0; - d_alpha1 = 0.0; - d_alpha2 = 0.0; - d_alpha3 = 0.0; - d_beta0 = 0.0; - d_beta1 = 0.0; - d_beta2 = 0.0; - d_beta3 = 0.0; -} diff --git a/src/core/system_parameters/beidou_dnav_iono.h b/src/core/system_parameters/beidou_dnav_iono.h index 531de8ec8..8a16a5922 100644 --- a/src/core/system_parameters/beidou_dnav_iono.h +++ b/src/core/system_parameters/beidou_dnav_iono.h @@ -31,18 +31,18 @@ class Beidou_Dnav_Iono { public: - bool valid; //!< Valid flag - // Ionospheric parameters - double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] - double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] - double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] - double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] - double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] - double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] - double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] - double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] + Beidou_Dnav_Iono() = default; //!< Default constructor - Beidou_Dnav_Iono(); //!< Default constructor + bool valid{}; //!< Valid flag + // Ionospheric parameters + double d_alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] + double d_alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] + double d_alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] + double d_alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] + double d_beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s] + double d_beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] + double d_beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] + double d_beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] template diff --git a/src/core/system_parameters/beidou_dnav_navigation_message.cc b/src/core/system_parameters/beidou_dnav_navigation_message.cc index d7604fe89..e57604c59 100644 --- a/src/core/system_parameters/beidou_dnav_navigation_message.cc +++ b/src/core/system_parameters/beidou_dnav_navigation_message.cc @@ -26,187 +26,18 @@ #include // for std::numeric_limits -void Beidou_Dnav_Navigation_Message::reset() +Beidou_Dnav_Navigation_Message::Beidou_Dnav_Navigation_Message() { - // Control variable for message decoding - flag_eph_valid = false; - flag_iono_valid = false; - flag_utc_model_valid = false; - flag_crc_test = false; - - flag_d1_sf1 = false; - flag_d1_sf2 = false; - flag_d1_sf3 = false; - flag_d1_sf4 = false; - flag_d1_sf5 = false; - flag_d1_sf5_p7 = false; - flag_d1_sf5_p8 = false; - flag_d1_sf5_p9 = false; - flag_d1_sf5_p10 = false; - flag_new_SOW_available = false; - d_previous_aode = 0.0; - - flag_sf1_p1 = false; - flag_sf1_p2 = false; - flag_sf1_p3 = false; - flag_sf1_p4 = false; - flag_sf1_p5 = false; - flag_sf1_p6 = false; - flag_sf1_p7 = false; - flag_sf1_p8 = false; - flag_sf1_p9 = false; - flag_sf1_p10 = false; - - // D2 NAV Decoding UNique Attributes - d_A_f1_msb_bits = 0; - d_A_f1_lsb_bits = 0; - d_Cuc_msb_bits = 0; - d_Cuc_lsb_bits = 0; - d_eccentricity_msb_bits = 0; - d_eccentricity_lsb_bits = 0; - d_Cic_msb_bits = 0; - d_Cic_lsb_bits = 0; - d_i_0_msb_bits = 0; - d_i_0_lsb_bits = 0; - d_OMEGA_msb_bits = 0; - d_OMEGA_lsb_bits = 0; - d_OMEGA_DOT_msb_bits = 0; - d_OMEGA_DOT_lsb_bits = 0; - - // D2 NAV Decoding UNique Attributes - d_eccentricity_msb = 0; - d_eccentricity_lsb = 0; - - d_SOW = 0.0; - d_SOW_SF1 = 0.0; - d_SOW_SF2 = 0.0; - d_SOW_SF3 = 0.0; - d_SOW_SF4 = 0.0; - d_SOW_SF5 = 0.0; - d_AODE = 0.0; - d_Crs = 0.0; - d_Delta_n = 0.0; - d_M_0 = 0.0; - d_Cuc = 0.0; - d_eccentricity = 0.0; - d_Cus = 0.0; - d_sqrt_A = 0.0; - d_Toe_sf2 = 0.0; - d_Toe_sf3 = 0.0; - d_Toe = 0.0; - d_Toc = 0.0; - d_Cic = 0.0; - d_OMEGA0 = 0.0; - d_Cis = 0.0; - d_i_0 = 0.0; - d_Crc = 0.0; - d_OMEGA = 0.0; - d_OMEGA_DOT = 0.0; - d_IDOT = 0.0; - i_BEIDOU_week = 0; - i_SV_accuracy = 0; - i_SV_health = 0; - d_TGD1 = 0.0; - d_TGD2 = 0.0; - d_AODC = -1.0; - // i_AODO = 0; - - b_fit_interval_flag = false; - d_spare1 = 0.0; - d_spare2 = 0.0; - - d_A_f0 = 0.0; - d_A_f1 = 0.0; - d_A_f2 = 0.0; - - // clock terms - // d_master_clock=0; - d_dtr = 0.0; - d_satClkCorr = 0.0; - d_satClkDrift = 0.0; - - // satellite positions - d_satpos_X = 0.0; - d_satpos_Y = 0.0; - d_satpos_Z = 0.0; - - // info - i_channel_ID = 0; - i_satellite_PRN = 0; - i_signal_type = 0; - - // time synchro - d_subframe_timestamp_ms = 0.0; - - // flags - b_alert_flag = false; - b_integrity_status_flag = false; - b_antispoofing_flag = false; - - // Ionosphere and UTC - flag_iono_valid = false; - flag_utc_model_valid = false; - d_alpha0 = 0.0; - d_alpha1 = 0.0; - d_alpha2 = 0.0; - d_alpha3 = 0.0; - d_beta0 = 0.0; - d_beta1 = 0.0; - d_beta2 = 0.0; - d_beta3 = 0.0; - d_A1UTC = 0.0; - d_A0UTC = 0.0; - d_DeltaT_LS = 0.0; - i_WN_LSF = 0; - i_DN = 0; - d_DeltaT_LSF = 0.0; - - // Almanac - d_Toa = 0.0; - i_WN_A = 0; - for (int32_t i = 1; i < 36; i++) - { - almanacHealth[i] = 0; - } - - // Satellite velocity - d_satvel_X = 0.0; - d_satvel_Y = 0.0; - d_satvel_Z = 0.0; - d_A1GPS = 0.0; - d_A0GPS = 0.0; - d_A1GAL = 0.0; - d_A0GAL = 0.0; - d_A1GLO = 0.0; - d_A0GLO = 0.0; - d_SQRT_A_ALMANAC = 0.0; - d_A1_ALMANAC = 0.0; - d_A0_ALMANAC = 0.0; - d_OMEGA0_ALMANAC = 0.0; - d_E_ALMANAC = 0.0; - d_DELTA_I = 0.0; - d_TOA = 0.0; - d_OMEGA_DOT_ALMANAC = 0.0; - d_OMEGA_ALMANAC = 0.0; - d_M0_ALMANAC = 0.0; - almanac_WN = 0; - d_toa2 = 0.0; - d_A_f0 = 0.0; - d_A_f1 = 0.0; - d_A_f2 = 0.0; - auto gnss_sat = Gnss_Satellite(); std::string _system("Beidou"); for (uint32_t i = 1; i < 36; i++) { satelliteBlock[i] = gnss_sat.what_block(_system, i); } -} - - -Beidou_Dnav_Navigation_Message::Beidou_Dnav_Navigation_Message() -{ - reset(); + for (uint32_t i = 1; i < 36; i++) + { + almanacHealth[i] = 0; + } } @@ -1060,6 +891,7 @@ Beidou_Dnav_Iono Beidou_Dnav_Navigation_Message::get_iono() return iono; } + Beidou_Dnav_Utc_Model Beidou_Dnav_Navigation_Message::get_utc_model() { Beidou_Dnav_Utc_Model utc_model; @@ -1084,6 +916,7 @@ Beidou_Dnav_Utc_Model Beidou_Dnav_Navigation_Message::get_utc_model() return utc_model; } + bool Beidou_Dnav_Navigation_Message::have_new_ephemeris() // Check if we have a new ephemeris stored in the galileo navigation class { if (i_satellite_PRN > 0 and i_satellite_PRN < 6) @@ -1139,6 +972,7 @@ bool Beidou_Dnav_Navigation_Message::have_new_ephemeris() // Check if we have a return false; } + bool Beidou_Dnav_Navigation_Message::have_new_iono() { // the condition on flag_utc_model is added to have a time stamp for iono @@ -1150,6 +984,7 @@ bool Beidou_Dnav_Navigation_Message::have_new_iono() return false; } + bool Beidou_Dnav_Navigation_Message::have_new_utc_model() { if (flag_d1_sf5_p9 == true and flag_d1_sf5_p10 == true) @@ -1164,6 +999,7 @@ bool Beidou_Dnav_Navigation_Message::have_new_utc_model() return false; } + bool Beidou_Dnav_Navigation_Message::have_new_almanac() { if ((flag_d1_sf4 == true) and (flag_d1_sf5 == true)) @@ -1178,6 +1014,7 @@ bool Beidou_Dnav_Navigation_Message::have_new_almanac() return false; } + bool Beidou_Dnav_Navigation_Message::satellite_validation() { bool flag_data_valid = false; diff --git a/src/core/system_parameters/beidou_dnav_navigation_message.h b/src/core/system_parameters/beidou_dnav_navigation_message.h index 68cb7d5ed..166f8e238 100644 --- a/src/core/system_parameters/beidou_dnav_navigation_message.h +++ b/src/core/system_parameters/beidou_dnav_navigation_message.h @@ -50,112 +50,111 @@ public: Beidou_Dnav_Navigation_Message(); // System flags for data processing - bool flag_eph_valid; - bool flag_utc_model_valid; - bool flag_iono_valid; - bool flag_d1_sf1; - bool flag_d1_sf2; - bool flag_d1_sf3; - bool flag_d1_sf4; - bool flag_d1_sf5; - bool flag_new_SOW_available; - bool flag_crc_test; - double d_previous_aode; + bool flag_eph_valid{}; + bool flag_utc_model_valid{}; + bool flag_iono_valid{}; + bool flag_d1_sf1{}; + bool flag_d1_sf2{}; + bool flag_d1_sf3{}; + bool flag_d1_sf4{}; + bool flag_d1_sf5{}; + bool flag_new_SOW_available{}; + bool flag_crc_test{}; + double d_previous_aode{}; - bool flag_d1_sf5_p7; //!< D1 NAV Message, Subframe 5, Page 09 decoded indicator - bool flag_d1_sf5_p8; //!< D1 NAV Message, Subframe 5, Page 09 decoded indicator - bool flag_d1_sf5_p9; //!< D1 NAV Message, Subframe 5, Page 09 decoded indicator - bool flag_d1_sf5_p10; //!< D1 NAV Message, Subframe 5, Page 10 decoded indicator + bool flag_d1_sf5_p7{}; //!< D1 NAV Message, Subframe 5, Page 09 decoded indicator + bool flag_d1_sf5_p8{}; //!< D1 NAV Message, Subframe 5, Page 09 decoded indicator + bool flag_d1_sf5_p9{}; //!< D1 NAV Message, Subframe 5, Page 09 decoded indicator + bool flag_d1_sf5_p10{}; //!< D1 NAV Message, Subframe 5, Page 10 decoded indicator - - bool flag_sf1_p1; //!< D2 NAV Message, Subframe 1, Page 1 decoded indicator - bool flag_sf1_p2; //!< D2 NAV Message, Subframe 1, Page 2 decoded indicator - bool flag_sf1_p3; //!< D2 NAV Message, Subframe 1, Page 3 decoded indicator - bool flag_sf1_p4; //!< D2 NAV Message, Subframe 1, Page 4 decoded indicator - bool flag_sf1_p5; //!< D2 NAV Message, Subframe 1, Page 5 decoded indicator - bool flag_sf1_p6; //!< D2 NAV Message, Subframe 1, Page 6 decoded indicator - bool flag_sf1_p7; //!< D2 NAV Message, Subframe 1, Page 7 decoded indicator - bool flag_sf1_p8; //!< D2 NAV Message, Subframe 1, Page 8 decoded indicator - bool flag_sf1_p9; //!< D2 NAV Message, Subframe 1, Page 9 decoded indicator - bool flag_sf1_p10; //!< D2 NAV Message, Subframe 1, Page 10 decoded indicator + bool flag_sf1_p1{}; //!< D2 NAV Message, Subframe 1, Page 1 decoded indicator + bool flag_sf1_p2{}; //!< D2 NAV Message, Subframe 1, Page 2 decoded indicator + bool flag_sf1_p3{}; //!< D2 NAV Message, Subframe 1, Page 3 decoded indicator + bool flag_sf1_p4{}; //!< D2 NAV Message, Subframe 1, Page 4 decoded indicator + bool flag_sf1_p5{}; //!< D2 NAV Message, Subframe 1, Page 5 decoded indicator + bool flag_sf1_p6{}; //!< D2 NAV Message, Subframe 1, Page 6 decoded indicator + bool flag_sf1_p7{}; //!< D2 NAV Message, Subframe 1, Page 7 decoded indicator + bool flag_sf1_p8{}; //!< D2 NAV Message, Subframe 1, Page 8 decoded indicator + bool flag_sf1_p9{}; //!< D2 NAV Message, Subframe 1, Page 9 decoded indicator + bool flag_sf1_p10{}; //!< D2 NAV Message, Subframe 1, Page 10 decoded indicator // broadcast orbit 1 - double d_SOW; //!< Time of BeiDou Week of the ephemeris set (taken from subframes SOW) [s] - double d_SOW_SF1; //!< Time of BeiDou Week from HOW word of Subframe 1 [s] - double d_SOW_SF2; //!< Time of BeiDou Week from HOW word of Subframe 2 [s] - double d_SOW_SF3; //!< Time of BeiDou Week from HOW word of Subframe 3 [s] - double d_SOW_SF4; //!< Time of BeiDou Week from HOW word of Subframe 4 [s] - double d_SOW_SF5; //!< Time of BeiDou Week from HOW word of Subframe 5 [s] + double d_SOW{}; //!< Time of BeiDou Week of the ephemeris set (taken from subframes SOW) [s] + double d_SOW_SF1{}; //!< Time of BeiDou Week from HOW word of Subframe 1 [s] + double d_SOW_SF2{}; //!< Time of BeiDou Week from HOW word of Subframe 2 [s] + double d_SOW_SF3{}; //!< Time of BeiDou Week from HOW word of Subframe 3 [s] + double d_SOW_SF4{}; //!< Time of BeiDou Week from HOW word of Subframe 4 [s] + double d_SOW_SF5{}; //!< Time of BeiDou Week from HOW word of Subframe 5 [s] - double d_AODE; - double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] + double d_AODE{}; + double d_Crs{}; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + double d_Delta_n{}; //!< Mean Motion Difference From Computed Value [semi-circles/s] + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] // broadcast orbit 2 - double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - double d_eccentricity; //!< Eccentricity [dimensionless] - double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_Cuc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + double d_eccentricity{}; //!< Eccentricity [dimensionless] + double d_Cus{}; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] + double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] // broadcast orbit 3 - double d_Toe_sf2; //!< Ephemeris data reference time of week in subframe 2, D1 Message - double d_Toe_sf3; //!< Ephemeris data reference time of week in subframe 3, D1 Message - double d_Toe; //!< Ephemeris data reference time of week in subframe 1, D2 Message - double d_Toc; //!< clock data reference time [s] - double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] + double d_Toe_sf2{}; //!< Ephemeris data reference time of week in subframe 2, D1 Message + double d_Toe_sf3{}; //!< Ephemeris data reference time of week in subframe 3, D1 Message + double d_Toe{}; //!< Ephemeris data reference time of week in subframe 1, D2 Message + double d_Toc{}; //!< clock data reference time [s] + double d_Cic{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_Cis{}; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] // broadcast orbit 4 - double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] - double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] + double d_i_0{}; //!< Inclination Angle at Reference Time [semi-circles] + double d_Crc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s] // broadcast orbit 5 - double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] - int32_t i_BEIDOU_week; //!< BeiDou week number, aka WN [week] + double d_IDOT{}; //!< Rate of Inclination Angle [semi-circles/s] + int32_t i_BEIDOU_week{}; //!< BeiDou week number, aka WN [week] // broadcast orbit 6 - int32_t i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV - int32_t i_SV_health; - double d_TGD1; //!< Estimated Group Delay Differential in B1 [s] - double d_TGD2; //!< Estimated Group Delay Differential in B2 [s] - double d_AODC; //!< Age of Data, Clock + int32_t i_SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV + int32_t i_SV_health{}; + double d_TGD1{}; //!< Estimated Group Delay Differential in B1 [s] + double d_TGD2{}; //!< Estimated Group Delay Differential in B2 [s] + double d_AODC{}; //!< Age of Data, Clock // broadcast orbit 7 - // int32_t i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + // int32_t i_AODO{}; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - bool b_fit_interval_flag; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. - double d_spare1; - double d_spare2; + bool b_fit_interval_flag{}; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. + double d_spare1{}; + double d_spare2{}; - double d_A_f0; //!< Clock correction parameters. Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Clock correction parameters. Coefficient 1 of code phase offset model [s/s] - double d_A_f2; //!< Clock correction parameters. Coefficient 2 of code phase offset model [s/s^2] + double d_A_f0{}; //!< Clock correction parameters. Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Clock correction parameters. Coefficient 1 of code phase offset model [s/s] + double d_A_f2{}; //!< Clock correction parameters. Coefficient 2 of code phase offset model [s/s^2] // D2 NAV Message Decoding - uint64_t d_A_f1_msb_bits; //!< Clock correction parameters, D2 NAV MSB - uint64_t d_A_f1_lsb_bits; //!< Clock correction parameters, D2 NAV LSB - uint64_t d_Cuc_msb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - uint64_t d_Cuc_lsb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - uint64_t d_eccentricity_msb; //!< Eccentricity [dimensionless] - uint64_t d_eccentricity_lsb; //!< Eccentricity [dimensionless] - uint64_t d_Cic_msb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - uint64_t d_Cic_lsb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - uint64_t d_eccentricity_msb_bits; //!< Eccentricity [dimensionless] - uint64_t d_eccentricity_lsb_bits; - uint64_t d_i_0_msb_bits; //!< Inclination Angle at Reference Time [semi-circles] - uint64_t d_i_0_lsb_bits; //!< Inclination Angle at Reference Time [semi-circles] - uint64_t d_OMEGA_msb_bits; //!< Argument of Perigee [semi-cicles] - uint64_t d_OMEGA_lsb_bits; //!< Argument of Perigee [semi-cicles] - uint64_t d_OMEGA_DOT_msb_bits; //!< Rate of Right Ascension [semi-circles/s] - uint64_t d_OMEGA_DOT_lsb_bits; //!< Rate of Right Ascension [semi-circles/s] + uint64_t d_A_f1_msb_bits{}; //!< Clock correction parameters, D2 NAV MSB + uint64_t d_A_f1_lsb_bits{}; //!< Clock correction parameters, D2 NAV LSB + uint64_t d_Cuc_msb_bits{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + uint64_t d_Cuc_lsb_bits{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + uint64_t d_eccentricity_msb{}; //!< Eccentricity [dimensionless] + uint64_t d_eccentricity_lsb{}; //!< Eccentricity [dimensionless] + uint64_t d_Cic_msb_bits{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + uint64_t d_Cic_lsb_bits{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + uint64_t d_eccentricity_msb_bits{}; //!< Eccentricity [dimensionless] + uint64_t d_eccentricity_lsb_bits{}; + uint64_t d_i_0_msb_bits{}; //!< Inclination Angle at Reference Time [semi-circles] + uint64_t d_i_0_lsb_bits{}; //!< Inclination Angle at Reference Time [semi-circles] + uint64_t d_OMEGA_msb_bits{}; //!< Argument of Perigee [semi-cicles] + uint64_t d_OMEGA_lsb_bits{}; //!< Argument of Perigee [semi-cicles] + uint64_t d_OMEGA_DOT_msb_bits{}; //!< Rate of Right Ascension [semi-circles/s] + uint64_t d_OMEGA_DOT_lsb_bits{}; //!< Rate of Right Ascension [semi-circles/s] // Almanac - double d_Toa; //!< Almanac reference time [s] - int32_t i_WN_A; //!< Modulo 256 of the GPS week number to which the almanac reference time (d_Toa) is referenced + double d_Toa{}; //!< Almanac reference time [s] + int32_t i_WN_A{}; //!< Modulo 256 of the GPS week number to which the almanac reference time (d_Toa) is referenced std::map almanacHealth; //!< Map that stores the health information stored in the almanac std::map satelliteBlock; //!< Map that stores to which block the PRN belongs @@ -172,73 +171,72 @@ public: * times the upper bound value of the current broadcast URA index, for more than 5.2 seconds, without an * accompanying alert, is less than 1E-8 per hour. */ - bool b_integrity_status_flag; - bool b_alert_flag; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - bool b_antispoofing_flag; //!< If true, the AntiSpoofing mode is ON in that SV + bool b_integrity_status_flag{}; + bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. + bool b_antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV // clock terms - // double d_master_clock; // GPS transmission time - double d_satClkCorr; // GPS clock error - double d_dtr; // relativistic clock correction term - double d_satClkDrift; + // double d_master_clock{}; // GPS transmission time + double d_satClkCorr{}; // GPS clock error + double d_dtr{}; // relativistic clock correction term + double d_satClkDrift{}; // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // satellite identification info - int32_t i_channel_ID; - int32_t i_signal_type; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q) - uint32_t i_satellite_PRN; + int32_t i_channel_ID{}; + int32_t i_signal_type{}; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q) + uint32_t i_satellite_PRN{}; // time synchro - double d_subframe_timestamp_ms; // [ms] + double d_subframe_timestamp_ms{}; // [ms] // Ionospheric parameters - double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] - double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] - double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] - double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] - double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] - double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] - double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] - double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] + double d_alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] + double d_alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] + double d_alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] + double d_alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] + double d_beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s] + double d_beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] + double d_beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] + double d_beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] // UTC parameters - double d_A1UTC; //!< 1st order term of a model that relates GPS and UTC time [s/s] - double d_A0UTC; //!< Constant of a model that relates GPS and UTC time [s] - double d_DeltaT_LS; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. - int32_t i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks] - int32_t i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days] - double d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] - double d_A1GPS; - double d_A0GPS; - double d_A1GAL; - double d_A0GAL; - double d_A1GLO; - double d_A0GLO; + double d_A1UTC{}; //!< 1st order term of a model that relates GPS and UTC time [s/s] + double d_A0UTC{}; //!< Constant of a model that relates GPS and UTC time [s] + double d_DeltaT_LS{}; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. + int32_t i_WN_LSF{}; //!< Week number at the end of which the leap second becomes effective [weeks] + int32_t i_DN{}; //!< Day number (DN) at the end of which the leap second becomes effective [days] + double d_DeltaT_LSF{}; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] + double d_A1GPS{}; + double d_A0GPS{}; + double d_A1GAL{}; + double d_A0GAL{}; + double d_A1GLO{}; + double d_A0GLO{}; - double d_SQRT_A_ALMANAC; - double d_A1_ALMANAC; - double d_A0_ALMANAC; - double d_OMEGA0_ALMANAC; - double d_E_ALMANAC; - double d_DELTA_I; - double d_TOA; - double d_OMEGA_DOT_ALMANAC; - double d_OMEGA_ALMANAC; - double d_M0_ALMANAC; - int32_t almanac_WN; - double d_toa2; + double d_SQRT_A_ALMANAC{}; + double d_A1_ALMANAC{}; + double d_A0_ALMANAC{}; + double d_OMEGA0_ALMANAC{}; + double d_E_ALMANAC{}; + double d_DELTA_I{}; + double d_TOA{}; + double d_OMEGA_DOT_ALMANAC{}; + double d_OMEGA_ALMANAC{}; + double d_M0_ALMANAC{}; + int32_t almanac_WN{}; + double d_toa2{}; // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] // public functions - void reset(); /*! * \brief Obtain a BDS SV Ephemeris class filled with current SV data diff --git a/src/core/system_parameters/beidou_dnav_utc_model.cc b/src/core/system_parameters/beidou_dnav_utc_model.cc deleted file mode 100644 index ae02c5335..000000000 --- a/src/core/system_parameters/beidou_dnav_utc_model.cc +++ /dev/null @@ -1,40 +0,0 @@ -/*! - * \file beidou_dnav_utc_model.cc - * \brief Interface of a BeiDou UTC Model storage - * \author Damian Miralles, 2018. dmiralles2009(at)gmail.com - * \author Sergi Segura, 2018. sergi.segura.munoz(at)gmail.com - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "beidou_dnav_utc_model.h" - - -Beidou_Dnav_Utc_Model::Beidou_Dnav_Utc_Model() -{ - valid = false; - d_A1_UTC = 0; - d_A0_UTC = 0; - d_DeltaT_LS = 0; - i_WN_LSF = 0; - i_DN = 0; - d_DeltaT_LSF = 0; - - d_A0_GPS = 0; - d_A1_GPS = 0; - d_A0_GAL = 0; - d_A1_GAL = 0; - d_A0_GLO = 0; - d_A1_GLO = 0; -} diff --git a/src/core/system_parameters/beidou_dnav_utc_model.h b/src/core/system_parameters/beidou_dnav_utc_model.h index 72c4f32c7..b88f10a0b 100644 --- a/src/core/system_parameters/beidou_dnav_utc_model.h +++ b/src/core/system_parameters/beidou_dnav_utc_model.h @@ -33,29 +33,29 @@ class Beidou_Dnav_Utc_Model { public: - bool valid; + Beidou_Dnav_Utc_Model() = default; + + bool valid{}; // BeiDou UTC parameters - double d_A0_UTC; //!< BDT clock bias relative to UTC [s] - double d_A1_UTC; //!< BDT clock rate relative to UTC [s/s] - double d_DeltaT_LS; //!< Delta time due to leap seconds before the new leap second effective - int i_WN_LSF; //!< Week number of the new leap second - int i_DN; //!< Day number of week of the new leap second - double d_DeltaT_LSF; //!< Delta time due to leap seconds after the new leap second effective [s] + double d_A0_UTC{}; //!< BDT clock bias relative to UTC [s] + double d_A1_UTC{}; //!< BDT clock rate relative to UTC [s/s] + double d_DeltaT_LS{}; //!< Delta time due to leap seconds before the new leap second effective + int i_WN_LSF{}; //!< Week number of the new leap second + int i_DN{}; //!< Day number of week of the new leap second + double d_DeltaT_LSF{}; //!< Delta time due to leap seconds after the new leap second effective [s] // BeiDou to GPS time corrections - double d_A0_GPS; //!< BDT clock bias relative to GPS time [s] - double d_A1_GPS; //!< BDT clock rate relative to GPS time [s/s] + double d_A0_GPS{}; //!< BDT clock bias relative to GPS time [s] + double d_A1_GPS{}; //!< BDT clock rate relative to GPS time [s/s] // BeiDou to Galileo time corrections - double d_A0_GAL; //!< BDT clock bias relative to GAL time [s] - double d_A1_GAL; //!< BDT clock rate relative to GAL time [s/s] + double d_A0_GAL{}; //!< BDT clock bias relative to GAL time [s] + double d_A1_GAL{}; //!< BDT clock rate relative to GAL time [s/s] // BeiDou to GLONASS time corrections - double d_A0_GLO; //!< BDT clock bias relative to GLO time [s] - double d_A1_GLO; //!< BDT clock rate relative to GLO time [s/s] - - Beidou_Dnav_Utc_Model(); + double d_A0_GLO{}; //!< BDT clock bias relative to GLO time [s] + double d_A1_GLO{}; //!< BDT clock rate relative to GLO time [s/s] template /* diff --git a/src/core/system_parameters/galileo_almanac.cc b/src/core/system_parameters/galileo_almanac.cc deleted file mode 100644 index b331628b0..000000000 --- a/src/core/system_parameters/galileo_almanac.cc +++ /dev/null @@ -1,41 +0,0 @@ -/*! - * \file galileo_almanac.cc - * \brief Interface of a Galileo ALMANAC storage - * \author Carles Fernandez, 2018. cfernandez(at)cttc.cat - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "galileo_almanac.h" - - -Galileo_Almanac::Galileo_Almanac() -{ - i_satellite_PRN = 0U; - i_Toa = 0; - i_WNa = 0; - i_IODa = 0; - d_Delta_i = 0.0; - d_M_0 = 0.0; - d_e_eccentricity = 0.0; - d_Delta_sqrt_A = 0.0; - d_OMEGA0 = 0.0; - d_OMEGA = 0.0; - d_OMEGA_DOT = 0.0; - d_A_f0 = 0.0; - d_A_f1 = 0.0; - E5b_HS = 0; - E1B_HS = 0; - E5a_HS = 0; -} diff --git a/src/core/system_parameters/galileo_almanac.h b/src/core/system_parameters/galileo_almanac.h index c09fe5ed5..1bad99c85 100644 --- a/src/core/system_parameters/galileo_almanac.h +++ b/src/core/system_parameters/galileo_almanac.h @@ -30,27 +30,27 @@ class Galileo_Almanac { public: - uint32_t i_satellite_PRN; //!< SV PRN NUMBER - int32_t i_Toa; - int32_t i_WNa; - int32_t i_IODa; - double d_Delta_i; //!< Inclination at reference time relative to i0 = 56º [semi-circles] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_e_eccentricity; //!< Eccentricity [dimensionless] - double d_Delta_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - int32_t E5b_HS; - int32_t E1B_HS; - int32_t E5a_HS; + uint32_t i_satellite_PRN{}; //!< SV PRN NUMBER + int32_t i_Toa{}; + int32_t i_WNa{}; + int32_t i_IODa{}; + double d_Delta_i{}; //!< Inclination at reference time relative to i0 = 56º [semi-circles] + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] + double d_e_eccentricity{}; //!< Eccentricity [dimensionless] + double d_Delta_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s] + double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s] + int32_t E5b_HS{}; + int32_t E1B_HS{}; + int32_t E5a_HS{}; /*! * Default constructor */ - Galileo_Almanac(); + Galileo_Almanac() = default; template diff --git a/src/core/system_parameters/galileo_almanac_helper.cc b/src/core/system_parameters/galileo_almanac_helper.cc index 260f06baa..97f35bb67 100644 --- a/src/core/system_parameters/galileo_almanac_helper.cc +++ b/src/core/system_parameters/galileo_almanac_helper.cc @@ -19,64 +19,6 @@ #include "galileo_almanac_helper.h" -Galileo_Almanac_Helper::Galileo_Almanac_Helper() -{ - // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number - IOD_a_7 = 0; - WN_a_7 = 0; - t0a_7 = 0; - SVID1_7 = 0; - DELTA_A_7 = 0.0; - e_7 = 0.0; - omega_7 = 0.0; - delta_i_7 = 0.0; - Omega0_7 = 0.0; - Omega_dot_7 = 0.0; - M0_7 = 0.0; - - // Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2) - IOD_a_8 = 0; - af0_8 = 0.0; - af1_8 = 0.0; - E5b_HS_8 = 0; - E1B_HS_8 = 0; - E5a_HS_8 = 0; - SVID2_8 = 0; - DELTA_A_8 = 0.0; - e_8 = 0.0; - omega_8 = 0.0; - delta_i_8 = 0.0; - Omega0_8 = 0.0; - Omega_dot_8 = 0.0; - - // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) - IOD_a_9 = 0; - WN_a_9 = 0; - t0a_9 = 0; - M0_9 = 0.0; - af0_9 = 0.0; - af1_9 = 0.0; - E5b_HS_9 = 0; - E1B_HS_9 = 0; - E5a_HS_9 = 0; - SVID3_9 = 0; - DELTA_A_9 = 0.0; - e_9 = 0.0; - omega_9 = 0.0; - delta_i_9 = 0.0; - - // Word type 10: Almanac for SVID3 (2/2) - IOD_a_10 = 0; - Omega0_10 = 0.0; - Omega_dot_10 = 0.0; - M0_10 = 0.0; - af0_10 = 0.0; - af1_10 = 0.0; - E5b_HS_10 = 0; - E1B_HS_10 = 0; - E5a_HS_10 = 0; -} - Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) { Galileo_Almanac galileo_almanac; diff --git a/src/core/system_parameters/galileo_almanac_helper.h b/src/core/system_parameters/galileo_almanac_helper.h index 34b457d4a..15fea7a09 100644 --- a/src/core/system_parameters/galileo_almanac_helper.h +++ b/src/core/system_parameters/galileo_almanac_helper.h @@ -31,62 +31,63 @@ class Galileo_Almanac_Helper { public: + Galileo_Almanac_Helper() = default; //!< Default constructor + // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number - int32_t IOD_a_7; - int32_t WN_a_7; - int32_t t0a_7; - int32_t SVID1_7; - double DELTA_A_7; - double e_7; - double omega_7; - double delta_i_7; - double Omega0_7; - double Omega_dot_7; - double M0_7; + int32_t IOD_a_7{}; + int32_t WN_a_7{}; + int32_t t0a_7{}; + int32_t SVID1_7{}; + double DELTA_A_7{}; + double e_7{}; + double omega_7{}; + double delta_i_7{}; + double Omega0_7{}; + double Omega_dot_7{}; + double M0_7{}; // Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2) - int32_t IOD_a_8; - double af0_8; - double af1_8; - int32_t E5b_HS_8; - int32_t E1B_HS_8; - int32_t E5a_HS_8; - int32_t SVID2_8; - double DELTA_A_8; - double e_8; - double omega_8; - double delta_i_8; - double Omega0_8; - double Omega_dot_8; + int32_t IOD_a_8{}; + double af0_8{}; + double af1_8{}; + int32_t E5b_HS_8{}; + int32_t E1B_HS_8{}; + int32_t E5a_HS_8{}; + int32_t SVID2_8{}; + double DELTA_A_8{}; + double e_8{}; + double omega_8{}; + double delta_i_8{}; + double Omega0_8{}; + double Omega_dot_8{}; // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) - int32_t IOD_a_9; - int32_t WN_a_9; - int32_t t0a_9; - double M0_9; - double af0_9; - double af1_9; - int32_t E5b_HS_9; - int32_t E1B_HS_9; - int32_t E5a_HS_9; - int32_t SVID3_9; - double DELTA_A_9; - double e_9; - double omega_9; - double delta_i_9; + int32_t IOD_a_9{}; + int32_t WN_a_9{}; + int32_t t0a_9{}; + double M0_9{}; + double af0_9{}; + double af1_9{}; + int32_t E5b_HS_9{}; + int32_t E1B_HS_9{}; + int32_t E5a_HS_9{}; + int32_t SVID3_9{}; + double DELTA_A_9{}; + double e_9{}; + double omega_9{}; + double delta_i_9{}; // Word type 10: Almanac for SVID3 (2/2) - int32_t IOD_a_10; - double Omega0_10; - double Omega_dot_10; - double M0_10; - double af0_10; - double af1_10; - int32_t E5b_HS_10; - int32_t E1B_HS_10; - int32_t E5a_HS_10; + int32_t IOD_a_10{}; + double Omega0_10{}; + double Omega_dot_10{}; + double M0_10{}; + double af0_10{}; + double af1_10{}; + int32_t E5b_HS_10{}; + int32_t E1B_HS_10{}; + int32_t E5a_HS_10{}; - Galileo_Almanac_Helper(); //!< Default constructor Galileo_Almanac get_almanac(int i); }; diff --git a/src/core/system_parameters/galileo_ephemeris.cc b/src/core/system_parameters/galileo_ephemeris.cc index 071eb0237..36d1f8c24 100644 --- a/src/core/system_parameters/galileo_ephemeris.cc +++ b/src/core/system_parameters/galileo_ephemeris.cc @@ -22,67 +22,6 @@ #include -Galileo_Ephemeris::Galileo_Ephemeris() -{ - flag_all_ephemeris = false; - IOD_ephemeris = 0; - IOD_nav_1 = 0; - SV_ID_PRN_4 = 0; - M0_1 = 0.0; // Mean anomaly at reference time [semi-circles] - delta_n_3 = 0.0; // Mean motion difference from computed value [semi-circles/sec] - e_1 = 0.0; // Eccentricity - A_1 = 0.0; // Square root of the semi-major axis [meters^1/2] - OMEGA_0_2 = 0.0; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - i_0_2 = 0.0; // Inclination angle at reference time [semi-circles] - omega_2 = 0.0; // Argument of perigee [semi-circles] - OMEGA_dot_3 = 0.0; // Rate of right ascension [semi-circles/sec] - iDot_2 = 0.0; // Rate of inclination angle [semi-circles/sec] - C_uc_3 = 0.0; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - C_us_3 = 0.0; // Amplitude of the sine harmonic correction term to the argument of latitude [radians] - C_rc_3 = 0.0; // Amplitude of the cosine harmonic correction term to the orbit radius [meters] - C_rs_3 = 0.0; // Amplitude of the sine harmonic correction term to the orbit radius [meters] - C_ic_4 = 0.0; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians] - C_is_4 = 0.0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians] - t0e_1 = 0; // Ephemeris reference time [s] - - // Clock correction parameters - t0c_4 = 0; // Clock correction data reference Time of Week [sec] - af0_4 = 0.0; // SV clock bias correction coefficient [s] - af1_4 = 0.0; // SV clock drift correction coefficient [s/s] - af2_4 = 0.0; // SV clock drift rate correction coefficient [s/s^2] - - // GST - WN_5 = 0; - TOW_5 = 0; - - // SV status - SISA_3 = 0; - E5a_HS = 0; - E5b_HS_5 = 0; - E1B_HS_5 = 0; - E5a_DVS = false; - E5b_DVS_5 = false; - E1B_DVS_5 = false; - BGD_E1E5a_5 = 0.0; // E1-E5a Broadcast Group Delay [s] - BGD_E1E5b_5 = 0.0; // E1-E5b Broadcast Group Delay [s] - - Galileo_satClkDrift = 0.0; - Galileo_dtr = 0.0; - - // satellite positions - d_satpos_X = 0.0; - d_satpos_Y = 0.0; - d_satpos_Z = 0.0; - - // Satellite velocity - d_satvel_X = 0.0; - d_satvel_Y = 0.0; - d_satvel_Z = 0.0; - - i_satellite_PRN = 0U; -} - - double Galileo_Ephemeris::Galileo_System_Time(double WN, double TOW) { /* GALIELO SYSTEM TIME, ICD 5.1.2 diff --git a/src/core/system_parameters/galileo_ephemeris.h b/src/core/system_parameters/galileo_ephemeris.h index d4763d55c..bdbeb4d18 100644 --- a/src/core/system_parameters/galileo_ephemeris.h +++ b/src/core/system_parameters/galileo_ephemeris.h @@ -34,71 +34,71 @@ class Galileo_Ephemeris { public: + Galileo_Ephemeris() = default; /* Galileo ephemeris are 16 parameters and here are reported following the ICD order, paragraph 5.1.1. The number in the name after underscore (_1, _2, _3 and so on) refers to the page were we can find that parameter */ - bool flag_all_ephemeris; - int32_t IOD_ephemeris; - int32_t IOD_nav_1; - int32_t SV_ID_PRN_4; - double M0_1; //!< Mean anomaly at reference time [semi-circles] - double delta_n_3; //!< Mean motion difference from computed value [semi-circles/sec] - double e_1; //!< Eccentricity - double A_1; //!< Square root of the semi-major axis [meters^1/2] - double OMEGA_0_2; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - double i_0_2; //!< Inclination angle at reference time [semi-circles] - double omega_2; //!< Argument of perigee [semi-circles] - double OMEGA_dot_3; //!< Rate of right ascension [semi-circles/sec] - double iDot_2; //!< Rate of inclination angle [semi-circles/sec] - double C_uc_3; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - double C_us_3; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians] - double C_rc_3; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters] - double C_rs_3; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters] - double C_ic_4; //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians] - double C_is_4; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians] - int32_t t0e_1; //!< Ephemeris reference time [s] + bool flag_all_ephemeris{}; + int32_t IOD_ephemeris{}; + int32_t IOD_nav_1{}; + int32_t SV_ID_PRN_4{}; + double M0_1{}; //!< Mean anomaly at reference time [semi-circles] + double delta_n_3{}; //!< Mean motion difference from computed value [semi-circles/sec] + double e_1{}; //!< Eccentricity + double A_1{}; //!< Square root of the semi-major axis [meters^1/2] + double OMEGA_0_2{}; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles] + double i_0_2{}; //!< Inclination angle at reference time [semi-circles] + double omega_2{}; //!< Argument of perigee [semi-circles] + double OMEGA_dot_3{}; //!< Rate of right ascension [semi-circles/sec] + double iDot_2{}; //!< Rate of inclination angle [semi-circles/sec] + double C_uc_3{}; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians] + double C_us_3{}; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians] + double C_rc_3{}; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters] + double C_rs_3{}; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters] + double C_ic_4{}; //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians] + double C_is_4{}; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians] + int32_t t0e_1{}; //!< Ephemeris reference time [s] - /*Clock correction parameters*/ - int32_t t0c_4; //!< Clock correction data reference Time of Week [sec] - double af0_4; //!< SV clock bias correction coefficient [s] - double af1_4; //!< SV clock drift correction coefficient [s/s] - double af2_4; //!< SV clock drift rate correction coefficient [s/s^2] + /* Clock correction parameters */ + int32_t t0c_4{}; //!< Clock correction data reference Time of Week [sec] + double af0_4{}; //!< SV clock bias correction coefficient [s] + double af1_4{}; //!< SV clock drift correction coefficient [s/s] + double af2_4{}; //!< SV clock drift rate correction coefficient [s/s^2] - /*GST*/ + /* GST */ // Not belong to ephemeris set (page 1 to 4) - int32_t WN_5; //!< Week number - int32_t TOW_5; //!< Time of Week - double Galileo_satClkDrift; - double Galileo_dtr; //!< relativistic clock correction term + int32_t WN_5{}; //!< Week number + int32_t TOW_5{}; //!< Time of Week + double Galileo_satClkDrift{}; + double Galileo_dtr{}; //!< relativistic clock correction term // SV status - int32_t SISA_3; - int32_t E5a_HS; //!< E5a Signal Health Status - int32_t E5b_HS_5; //!< E5b Signal Health Status - int32_t E1B_HS_5; //!< E1B Signal Health Status - bool E5a_DVS; //!< E5a Data Validity Status - bool E5b_DVS_5; //!< E5b Data Validity Status - bool E1B_DVS_5; //!< E1B Data Validity Status + int32_t SISA_3{}; + int32_t E5a_HS{}; //!< E5a Signal Health Status + int32_t E5b_HS_5{}; //!< E5b Signal Health Status + int32_t E1B_HS_5{}; //!< E1B Signal Health Status + bool E5a_DVS{}; //!< E5a Data Validity Status + bool E5b_DVS_5{}; //!< E5b Data Validity Status + bool E1B_DVS_5{}; //!< E1B Data Validity Status - double BGD_E1E5a_5; //!< E1-E5a Broadcast Group Delay [s] - double BGD_E1E5b_5; //!< E1-E5b Broadcast Group Delay [s] + double BGD_E1E5a_5{}; //!< E1-E5a Broadcast Group Delay [s] + double BGD_E1E5b_5{}; //!< E1-E5b Broadcast Group Delay [s] // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] - uint32_t i_satellite_PRN; //!< SV PRN NUMBER + uint32_t i_satellite_PRN{}; //!< SV PRN NUMBER void satellitePosition(double transmitTime); //!< Computes the ECEF SV coordinates and ECEF velocity double Galileo_System_Time(double WN, double TOW); //!< Galileo System Time (GST), ICD paragraph 5.1.2 double sv_clock_drift(double transmitTime); //!< Satellite Time Correction Algorithm, ICD 5.1.4 double sv_clock_relativistic_term(double transmitTime); //!< Satellite Time Correction Algorithm, ICD 5.1.4 - Galileo_Ephemeris(); template diff --git a/src/core/system_parameters/galileo_fnav_message.cc b/src/core/system_parameters/galileo_fnav_message.cc index 5428d195a..ba050ec8d 100644 --- a/src/core/system_parameters/galileo_fnav_message.cc +++ b/src/core/system_parameters/galileo_fnav_message.cc @@ -33,143 +33,6 @@ using CRC_Galileo_FNAV_type = boost::crc_optimal<24, 0x1864CFBU, 0x0, 0x0, false, false>; -void Galileo_Fnav_Message::reset() -{ - flag_CRC_test = false; - flag_all_ephemeris = false; //!< Flag indicating that all words containing ephemeris have been received - flag_ephemeris_1 = false; //!< Flag indicating that ephemeris 1/3 (word 2) have been received - flag_ephemeris_2 = false; //!< Flag indicating that ephemeris 2/3 (word 3) have been received - flag_ephemeris_3 = false; //!< Flag indicating that ephemeris 3/3 (word 4) have been received - - flag_iono_and_GST = false; //!< Flag indicating that ionospheric and GST parameters (word 1) have been received - flag_TOW_1 = false; - flag_TOW_2 = false; - flag_TOW_3 = false; - flag_TOW_4 = false; - flag_TOW_set = false; //!< it is true when page 1,2,3 or 4 arrives - flag_utc_model = false; //!< Flag indicating that utc model parameters (word 4) have been received - - flag_all_almanac = false; //!< Flag indicating that all almanac have been received - flag_almanac_1 = false; //!< Flag indicating that almanac 1/2 (word 5) have been received - flag_almanac_2 = false; //!< Flag indicating that almanac 2/2 (word 6) have been received - - IOD_ephemeris = 0; - - page_type = 0; - // WORD 1 SVID, Clock correction, SISA, Ionospheric correction, BGD, GST, Signal - // health and Data validity status - FNAV_SV_ID_PRN_1 = 0; - FNAV_IODnav_1 = -1; - FNAV_t0c_1 = 0; - FNAV_af0_1 = 0.0; - FNAV_af1_1 = 0.0; - FNAV_af2_1 = 0.0; - FNAV_SISA_1 = 0; - FNAV_ai0_1 = 0.0; - FNAV_ai1_1 = 0.0; - FNAV_ai2_1 = 0.0; - FNAV_region1_1 = false; - FNAV_region2_1 = false; - FNAV_region3_1 = false; - FNAV_region4_1 = false; - FNAV_region5_1 = false; - FNAV_BGD_1 = 0.0; - FNAV_E5ahs_1 = 0; - FNAV_WN_1 = 0; - FNAV_TOW_1 = 0; - FNAV_E5advs_1 = false; - - // WORD 2 Ephemeris (1/3) and GST - FNAV_IODnav_2 = -2; - FNAV_M0_2 = 0.0; - FNAV_omegadot_2 = 0.0; - FNAV_e_2 = 0.0; - FNAV_a12_2 = 0.0; - FNAV_omega0_2 = 0.0; - FNAV_idot_2 = 0.0; - FNAV_WN_2 = 0; - FNAV_TOW_2 = 0; - - // WORD 3 Ephemeris (2/3) and GST - FNAV_IODnav_3 = -3; - FNAV_i0_3 = 0.0; - FNAV_w_3 = 0.0; - FNAV_deltan_3 = 0.0; - FNAV_Cuc_3 = 0.0; - FNAV_Cus_3 = 0.0; - FNAV_Crc_3 = 0.0; - FNAV_Crs_3 = 0.0; - FNAV_t0e_3 = 0; - FNAV_WN_3 = 0; - FNAV_TOW_3 = 0; - - // WORD 4 Ephemeris (3/3), GST-UTC conversion, GST-GPS conversion and TOW. - // Note that the clock is repeated in this page type - FNAV_IODnav_4 = -4; - FNAV_Cic_4 = 0.0; - FNAV_Cis_4 = 0.0; - FNAV_A0_4 = 0.0; - FNAV_A1_4 = 0.0; - FNAV_deltatls_4 = 0; - FNAV_t0t_4 = 0; - FNAV_WNot_4 = 0; - FNAV_WNlsf_4 = 0; - FNAV_DN_4 = 0; - FNAV_deltatlsf_4 = 0; - FNAV_t0g_4 = 0; - FNAV_A0g_4 = 0.0; - FNAV_A1g_4 = 0.0; - FNAV_WN0g_4 = 0; - FNAV_TOW_4 = 0; - - // WORD 5 Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time - FNAV_IODa_5 = 0; - FNAV_WNa_5 = 0; - FNAV_t0a_5 = 0; - FNAV_SVID1_5 = 0; - FNAV_Deltaa12_1_5 = 0.0; - FNAV_e_1_5 = 0.0; - FNAV_w_1_5 = 0.0; - FNAV_deltai_1_5 = 0.0; - FNAV_Omega0_1_5 = 0.0; - FNAV_Omegadot_1_5 = 0.0; - FNAV_M0_1_5 = 0.0; - FNAV_af0_1_5 = 0.0; - FNAV_af1_1_5 = 0.0; - FNAV_E5ahs_1_5 = 0U; - FNAV_SVID2_5 = 0; - FNAV_Deltaa12_2_5 = 0; - FNAV_e_2_5 = 0.0; - FNAV_w_2_5 = 0.0; - FNAV_deltai_2_5 = 0.0; - - // WORD 6 Almanac (SVID2(2/2) and SVID3) - FNAV_IODa_6 = 0; - FNAV_Omega0_2_6 = 0.0; - FNAV_Omegadot_2_6 = 0.0; - FNAV_M0_2_6 = 0.0; - FNAV_af0_2_6 = 0.0; - FNAV_af1_2_6 = 0.0; - FNAV_E5ahs_2_6 = 0; - FNAV_SVID3_6 = 0; - FNAV_Deltaa12_3_6 = 0.0; - FNAV_e_3_6 = 0.0; - FNAV_w_3_6 = 0.0; - FNAV_deltai_3_6 = 0.0; - FNAV_Omega0_3_6 = 0.0; - FNAV_Omegadot_3_6 = 0.0; - FNAV_M0_3_6 = 0.0; - FNAV_af0_3_6 = 0.0; - FNAV_af1_3_6 = 0.0; - FNAV_E5ahs_3_6 = 0; -} - - -Galileo_Fnav_Message::Galileo_Fnav_Message() -{ - reset(); -} - void Galileo_Fnav_Message::split_page(const std::string& page_string) { diff --git a/src/core/system_parameters/galileo_fnav_message.h b/src/core/system_parameters/galileo_fnav_message.h index 8a2daedc9..d26d127fe 100644 --- a/src/core/system_parameters/galileo_fnav_message.h +++ b/src/core/system_parameters/galileo_fnav_message.h @@ -46,8 +46,9 @@ class Galileo_Fnav_Message { public: + Galileo_Fnav_Message() = default; + void split_page(const std::string& page_string); - void reset(); bool have_new_ephemeris(); bool have_new_iono_and_GST(); bool have_new_utc_model(); @@ -57,135 +58,133 @@ public: Galileo_Utc_Model get_utc_model(); Galileo_Almanac_Helper get_almanac(); - Galileo_Fnav_Message(); + bool flag_CRC_test{}; + bool flag_all_ephemeris{}; //!< Flag indicating that all words containing ephemeris have been received + bool flag_ephemeris_1{}; //!< Flag indicating that ephemeris 1/3 (word 2) have been received + bool flag_ephemeris_2{}; //!< Flag indicating that ephemeris 2/3 (word 3) have been received + bool flag_ephemeris_3{}; //!< Flag indicating that ephemeris 3/3 (word 4) have been received - bool flag_CRC_test; - bool flag_all_ephemeris; //!< Flag indicating that all words containing ephemeris have been received - bool flag_ephemeris_1; //!< Flag indicating that ephemeris 1/3 (word 2) have been received - bool flag_ephemeris_2; //!< Flag indicating that ephemeris 2/3 (word 3) have been received - bool flag_ephemeris_3; //!< Flag indicating that ephemeris 3/3 (word 4) have been received + bool flag_iono_and_GST{}; //!< Flag indicating that ionospheric and GST parameters (word 1) have been received + bool flag_TOW_1{}; + bool flag_TOW_2{}; + bool flag_TOW_3{}; + bool flag_TOW_4{}; + bool flag_TOW_set{}; //!< it is true when page 1,2,3 or 4 arrives + bool flag_utc_model{}; //!< Flag indicating that utc model parameters (word 4) have been received - bool flag_iono_and_GST; //!< Flag indicating that ionospheric and GST parameters (word 1) have been received - bool flag_TOW_1; - bool flag_TOW_2; - bool flag_TOW_3; - bool flag_TOW_4; - bool flag_TOW_set; //!< it is true when page 1,2,3 or 4 arrives - bool flag_utc_model; //!< Flag indicating that utc model parameters (word 4) have been received + bool flag_all_almanac{}; //!< Flag indicating that all almanac have been received + bool flag_almanac_1{}; //!< Flag indicating that almanac 1/2 (word 5) have been received + bool flag_almanac_2{}; //!< Flag indicating that almanac 2/2 (word 6) have been received - bool flag_all_almanac; //!< Flag indicating that all almanac have been received - bool flag_almanac_1; //!< Flag indicating that almanac 1/2 (word 5) have been received - bool flag_almanac_2; //!< Flag indicating that almanac 2/2 (word 6) have been received + int32_t IOD_ephemeris{}; - int32_t IOD_ephemeris; - - int32_t page_type; + int32_t page_type{}; // WORD 1 SVID, Clock correction, SISA, Ionospheric correction, BGD, GST, Signal // health and Data validity status - int32_t FNAV_SV_ID_PRN_1; - int32_t FNAV_IODnav_1; - int32_t FNAV_t0c_1; - double FNAV_af0_1; - double FNAV_af1_1; - double FNAV_af2_1; - int32_t FNAV_SISA_1; - double FNAV_ai0_1; - double FNAV_ai1_1; - double FNAV_ai2_1; - bool FNAV_region1_1; - bool FNAV_region2_1; - bool FNAV_region3_1; - bool FNAV_region4_1; - bool FNAV_region5_1; - double FNAV_BGD_1; - int32_t FNAV_E5ahs_1; - int32_t FNAV_WN_1; - int32_t FNAV_TOW_1; - bool FNAV_E5advs_1; + int32_t FNAV_SV_ID_PRN_1{}; + int32_t FNAV_IODnav_1{}; + int32_t FNAV_t0c_1{}; + double FNAV_af0_1{}; + double FNAV_af1_1{}; + double FNAV_af2_1{}; + int32_t FNAV_SISA_1{}; + double FNAV_ai0_1{}; + double FNAV_ai1_1{}; + double FNAV_ai2_1{}; + bool FNAV_region1_1{}; + bool FNAV_region2_1{}; + bool FNAV_region3_1{}; + bool FNAV_region4_1{}; + bool FNAV_region5_1{}; + double FNAV_BGD_1{}; + int32_t FNAV_E5ahs_1{}; + int32_t FNAV_WN_1{}; + int32_t FNAV_TOW_1{}; + bool FNAV_E5advs_1{}; // WORD 2 Ephemeris (1/3) and GST - int32_t FNAV_IODnav_2; - double FNAV_M0_2; - double FNAV_omegadot_2; - double FNAV_e_2; - double FNAV_a12_2; - double FNAV_omega0_2; - double FNAV_idot_2; - int32_t FNAV_WN_2; - int32_t FNAV_TOW_2; + int32_t FNAV_IODnav_2{}; + double FNAV_M0_2{}; + double FNAV_omegadot_2{}; + double FNAV_e_2{}; + double FNAV_a12_2{}; + double FNAV_omega0_2{}; + double FNAV_idot_2{}; + int32_t FNAV_WN_2{}; + int32_t FNAV_TOW_2{}; // WORD 3 Ephemeris (2/3) and GST - int32_t FNAV_IODnav_3; - double FNAV_i0_3; - double FNAV_w_3; - double FNAV_deltan_3; - double FNAV_Cuc_3; - double FNAV_Cus_3; - double FNAV_Crc_3; - double FNAV_Crs_3; - int32_t FNAV_t0e_3; - int32_t FNAV_WN_3; - int32_t FNAV_TOW_3; + int32_t FNAV_IODnav_3{}; + double FNAV_i0_3{}; + double FNAV_w_3{}; + double FNAV_deltan_3{}; + double FNAV_Cuc_3{}; + double FNAV_Cus_3{}; + double FNAV_Crc_3{}; + double FNAV_Crs_3{}; + int32_t FNAV_t0e_3{}; + int32_t FNAV_WN_3{}; + int32_t FNAV_TOW_3{}; // WORD 4 Ephemeris (3/3), GST-UTC conversion, GST-GPS conversion and TOW. // Note that the clock is repeated in this page type - int32_t FNAV_IODnav_4; - double FNAV_Cic_4; - double FNAV_Cis_4; - double FNAV_A0_4; - double FNAV_A1_4; - int32_t FNAV_deltatls_4; - int32_t FNAV_t0t_4; - int32_t FNAV_WNot_4; - int32_t FNAV_WNlsf_4; - int32_t FNAV_DN_4; - int32_t FNAV_deltatlsf_4; - int32_t FNAV_t0g_4; - double FNAV_A0g_4; - double FNAV_A1g_4; - int32_t FNAV_WN0g_4; - int32_t FNAV_TOW_4; + int32_t FNAV_IODnav_4{}; + double FNAV_Cic_4{}; + double FNAV_Cis_4{}; + double FNAV_A0_4{}; + double FNAV_A1_4{}; + int32_t FNAV_deltatls_4{}; + int32_t FNAV_t0t_4{}; + int32_t FNAV_WNot_4{}; + int32_t FNAV_WNlsf_4{}; + int32_t FNAV_DN_4{}; + int32_t FNAV_deltatlsf_4{}; + int32_t FNAV_t0g_4{}; + double FNAV_A0g_4{}; + double FNAV_A1g_4{}; + int32_t FNAV_WN0g_4{}; + int32_t FNAV_TOW_4{}; // WORD 5 Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time - int32_t FNAV_IODa_5; - int32_t FNAV_WNa_5; - int32_t FNAV_t0a_5; - int32_t FNAV_SVID1_5; - double FNAV_Deltaa12_1_5; - double FNAV_e_1_5; - double FNAV_w_1_5; - double FNAV_deltai_1_5; - double FNAV_Omega0_1_5; - double FNAV_Omegadot_1_5; - double FNAV_M0_1_5; - double FNAV_af0_1_5; - double FNAV_af1_1_5; - uint32_t FNAV_E5ahs_1_5; - int32_t FNAV_SVID2_5; - double FNAV_Deltaa12_2_5; - double FNAV_e_2_5; - double FNAV_w_2_5; - double FNAV_deltai_2_5; + int32_t FNAV_IODa_5{}; + int32_t FNAV_WNa_5{}; + int32_t FNAV_t0a_5{}; + int32_t FNAV_SVID1_5{}; + double FNAV_Deltaa12_1_5{}; + double FNAV_e_1_5{}; + double FNAV_w_1_5{}; + double FNAV_deltai_1_5{}; + double FNAV_Omega0_1_5{}; + double FNAV_Omegadot_1_5{}; + double FNAV_M0_1_5{}; + double FNAV_af0_1_5{}; + double FNAV_af1_1_5{}; + uint32_t FNAV_E5ahs_1_5{}; + int32_t FNAV_SVID2_5{}; + double FNAV_Deltaa12_2_5{}; + double FNAV_e_2_5{}; + double FNAV_w_2_5{}; + double FNAV_deltai_2_5{}; // WORD 6 Almanac (SVID2(2/2) and SVID3) - int32_t FNAV_IODa_6; - double FNAV_Omega0_2_6; - double FNAV_Omegadot_2_6; - double FNAV_M0_2_6; - double FNAV_af0_2_6; - double FNAV_af1_2_6; - int32_t FNAV_E5ahs_2_6; - int32_t FNAV_SVID3_6; - double FNAV_Deltaa12_3_6; - double FNAV_e_3_6; - double FNAV_w_3_6; - double FNAV_deltai_3_6; - double FNAV_Omega0_3_6; - double FNAV_Omegadot_3_6; - double FNAV_M0_3_6; - double FNAV_af0_3_6; - double FNAV_af1_3_6; - int32_t FNAV_E5ahs_3_6; + int32_t FNAV_IODa_6{}; + double FNAV_Omega0_2_6{}; + double FNAV_Omegadot_2_6{}; + double FNAV_M0_2_6{}; + double FNAV_af0_2_6{}; + double FNAV_af1_2_6{}; + int32_t FNAV_E5ahs_2_6{}; + int32_t FNAV_SVID3_6{}; + double FNAV_Deltaa12_3_6{}; + double FNAV_e_3_6{}; + double FNAV_w_3_6{}; + double FNAV_deltai_3_6{}; + double FNAV_Omega0_3_6{}; + double FNAV_Omegadot_3_6{}; + double FNAV_M0_3_6{}; + double FNAV_af0_3_6{}; + double FNAV_af1_3_6{}; + int32_t FNAV_E5ahs_3_6{}; private: bool _CRC_test(std::bitset bits, uint32_t checksum); @@ -193,9 +192,9 @@ private: uint64_t read_navigation_unsigned(std::bitset bits, const std::vector>& parameter); int64_t read_navigation_signed(std::bitset bits, const std::vector>& parameter); - std::string omega0_1; - // std::string omega0_2; - // bool omega_flag; + std::string omega0_1{}; + // std::string omega0_2{}; + // bool omega_flag{}; }; #endif // GNSS_SDR_GALILEO_FNAV_MESSAGE_H diff --git a/src/core/system_parameters/galileo_iono.cc b/src/core/system_parameters/galileo_iono.cc deleted file mode 100644 index 450ef0d34..000000000 --- a/src/core/system_parameters/galileo_iono.cc +++ /dev/null @@ -1,39 +0,0 @@ -/*! - * \file galileo_iono.cc - * \brief Interface of a GPS IONOSPHERIC MODEL storage - * - * \author Javier Arribas, 2013. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "galileo_iono.h" - -Galileo_Iono::Galileo_Iono() -{ - // Ionospheric correction - ai0_5 = 0.0; // Effective Ionisation Level 1st order parameter [sfu] - ai1_5 = 0.0; // Effective Ionisation Level 2st order parameter [sfu/degree] - ai2_5 = 0.0; // Effective Ionisation Level 3st order parameter [sfu/degree] - - // Ionospheric disturbance flag - Region1_flag_5 = false; // Ionospheric Disturbance Flag for region 1 - Region2_flag_5 = false; // Ionospheric Disturbance Flag for region 2 - Region3_flag_5 = false; // Ionospheric Disturbance Flag for region 3 - Region4_flag_5 = false; // Ionospheric Disturbance Flag for region 4 - Region5_flag_5 = false; // Ionospheric Disturbance Flag for region 5 - - TOW_5 = 0; - WN_5 = 0; -} diff --git a/src/core/system_parameters/galileo_iono.h b/src/core/system_parameters/galileo_iono.h index cf882eebe..b8e149586 100644 --- a/src/core/system_parameters/galileo_iono.h +++ b/src/core/system_parameters/galileo_iono.h @@ -32,26 +32,26 @@ class Galileo_Iono { public: - // Ionospheric correction - double ai0_5; //!< Effective Ionisation Level 1st order parameter [sfu] - double ai1_5; //!< Effective Ionisation Level 2st order parameter [sfu/degree] - double ai2_5; //!< Effective Ionisation Level 3st order parameter [sfu/degree] - - // Ionospheric disturbance flag - bool Region1_flag_5; //!< Ionospheric Disturbance Flag for region 1 - bool Region2_flag_5; //!< Ionospheric Disturbance Flag for region 2 - bool Region3_flag_5; //!< Ionospheric Disturbance Flag for region 3 - bool Region4_flag_5; //!< Ionospheric Disturbance Flag for region 4 - bool Region5_flag_5; //!< Ionospheric Disturbance Flag for region 5 - - // from page 5 (UTC) to have a timestamp - int32_t TOW_5; //!< UTC data reference Time of Week [s] - int32_t WN_5; //!< UTC data reference Week number [week] - /*! * Default constructor */ - Galileo_Iono(); + Galileo_Iono() = default; + + // Ionospheric correction + double ai0_5{}; //!< Effective Ionisation Level 1st order parameter [sfu] + double ai1_5{}; //!< Effective Ionisation Level 2st order parameter [sfu/degree] + double ai2_5{}; //!< Effective Ionisation Level 3st order parameter [sfu/degree] + + // Ionospheric disturbance flag + bool Region1_flag_5{}; //!< Ionospheric Disturbance Flag for region 1 + bool Region2_flag_5{}; //!< Ionospheric Disturbance Flag for region 2 + bool Region3_flag_5{}; //!< Ionospheric Disturbance Flag for region 3 + bool Region4_flag_5{}; //!< Ionospheric Disturbance Flag for region 4 + bool Region5_flag_5{}; //!< Ionospheric Disturbance Flag for region 5 + + // from page 5 (UTC) to have a timestamp + int32_t TOW_5{}; //!< UTC data reference Time of Week [s] + int32_t WN_5{}; //!< UTC data reference Week number [week] template diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index 8df2dee5e..045183688 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -31,194 +31,6 @@ using CRC_Galileo_INAV_type = boost::crc_optimal<24, 0x1864CFBU, 0x0, 0x0, false, false>; -void Galileo_Navigation_Message::reset() -{ - Page_type_time_stamp = 0; - - flag_CRC_test = false; - flag_all_ephemeris = false; // flag indicating that all words containing ephemeris have been received - flag_ephemeris_1 = false; // flag indicating that ephemeris 1/4 (word 1) have been received - flag_ephemeris_2 = false; // flag indicating that ephemeris 2/4 (word 2) have been received - flag_ephemeris_3 = false; // flag indicating that ephemeris 3/4 (word 3) have been received - flag_ephemeris_4 = false; // flag indicating that ephemeris 4/4 (word 4) have been received - - flag_iono_and_GST = false; // flag indicating that ionospheric parameters (word 5) have been received - flag_utc_model = false; // flag indicating that utc model parameters (word 6) have been received - - flag_all_almanac = false; // flag indicating that all almanac have been received - flag_almanac_1 = false; // flag indicating that almanac 1/4 (word 7) have been received - flag_almanac_2 = false; // flag indicating that almanac 2/4 (word 8) have been received - flag_almanac_3 = false; // flag indicating that almanac 3/4 (word 9) have been received - flag_almanac_4 = false; // flag indicating that almanac 4/4 (word 10) have been received - - flag_TOW_5 = false; - flag_TOW_set = false; - - flag_GGTO = false; - flag_GGTO_1 = false; - flag_GGTO_2 = false; - flag_GGTO_3 = false; - flag_GGTO_4 = false; - - IOD_ephemeris = 0; - - // Word type 1: Ephemeris (1/4) - IOD_nav_1 = 0; - t0e_1 = 0; - M0_1 = 0.0; - e_1 = 0.0; - A_1 = 0.0; - - // Word type 2: Ephemeris (2/4) - IOD_nav_2 = 0; // IOD_nav page 2 - OMEGA_0_2 = 0.0; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - i_0_2 = 0.0; // Inclination angle at reference time [semi-circles] - omega_2 = 0.0; // Argument of perigee [semi-circles] - iDot_2 = 0.0; // Rate of inclination angle [semi-circles/sec] - - // Word type 3: Ephemeris (3/4) and SISA - IOD_nav_3 = 0; - OMEGA_dot_3 = 0.0; // Rate of right ascension [semi-circles/sec] - delta_n_3 = 0.0; // Mean motion difference from computed value [semi-circles/sec] - C_uc_3 = 0.0; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - C_us_3 = 0.0; // Amplitude of the sine harmonic correction term to the argument of latitude [radians] - C_rc_3 = 0.0; // Amplitude of the cosine harmonic correction term to the orbit radius [meters] - C_rs_3 = 0.0; // Amplitude of the sine harmonic correction term to the orbit radius [meters] - SISA_3 = 0; // - - // Word type 4: Ephemeris (4/4) and Clock correction parameter/ - IOD_nav_4 = 0; - SV_ID_PRN_4 = 0; - C_ic_4 = 0.0; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians] - C_is_4 = 0.0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians] - - // Clock correction parameters - t0c_4 = 0; - af0_4 = 0.0; - af1_4 = 0.0; - af2_4 = 0.0; - spare_4 = 0.0; - - // Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST - // Ionospheric correction - ai0_5 = 0.0; - ai1_5 = 0.0; - ai2_5 = 0.0; - - // Ionospheric disturbance flag - Region1_flag_5 = false; // Region1_flag_5; - Region2_flag_5 = false; - Region3_flag_5 = false; - Region4_flag_5 = false; - Region5_flag_5 = false; - BGD_E1E5a_5 = 0.0; - BGD_E1E5b_5 = 0.0; - E5b_HS_5 = 0; - E1B_HS_5 = 0; - E5b_DVS_5 = false; - E1B_DVS_5 = false; - - // GST - WN_5 = 0; - TOW_5 = 0; - spare_5 = 0.0; - - // Word type 6: GST-UTC conversion parameters - A0_6 = 0.0; - A1_6 = 0.0; - Delta_tLS_6 = 0; - t0t_6 = 0; - WNot_6 = 0; - WN_LSF_6 = 0; - DN_6 = 0; - Delta_tLSF_6 = 0; - TOW_6 = 0; - - // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number - IOD_a_7 = 0; - WN_a_7 = 0; - t0a_7 = 0; - SVID1_7 = 0; - DELTA_A_7 = 0.0; - e_7 = 0.0; - omega_7 = 0.0; - delta_i_7 = 0.0; - Omega0_7 = 0.0; - Omega_dot_7 = 0.0; - M0_7 = 0.0; - - // Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2) - IOD_a_8 = 0; - af0_8 = 0.0; - af1_8 = 0.0; - E5b_HS_8 = 0; - E1B_HS_8 = 0; - SVID2_8 = 0; - DELTA_A_8 = 0.0; - e_8 = 0.0; - omega_8 = 0.0; - delta_i_8 = 0.0; - Omega0_8 = 0.0; - Omega_dot_8 = 0.0; - - // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) - IOD_a_9 = 0; - WN_a_9 = 0; - t0a_9 = 0; - M0_9 = 0.0; - af0_9 = 0.0; - af1_9 = 0.0; - E5b_HS_9 = 0; - E1B_HS_9 = 0; - SVID3_9 = 0; - DELTA_A_9 = 0.0; - e_9 = 0.0; - omega_9 = 0.0; - delta_i_9 = 0.0; - - // Word type 10: Almanac for SVID3 (2/2) and GST-GPS conversion parameters - IOD_a_10 = 0; - Omega0_10 = 0.0; - Omega_dot_10 = 0.0; - M0_10 = 0.0; - af0_10 = 0.0; - af1_10 = 0.0; - E5b_HS_10 = 0; - E1B_HS_10 = 0; - - // GST-GPS - A_0G_10 = 0.0; - A_1G_10 = 0.0; - t_0G_10 = 0; - WN_0G_10 = 0; - - // Word type 0: I/NAV Spare Word - Time_0 = 0; - WN_0 = 0; - TOW_0 = 0; - - flag_TOW_6 = false; - - Galileo_satClkDrift = 0.0; - Galileo_dtr = 0.0; - - // satellite positions - galileo_satpos_X = 0.0; - galileo_satpos_Y = 0.0; - galileo_satpos_Z = 0.0; - // Satellite velocity - galileo_satvel_X = 0.0; - galileo_satvel_Y = 0.0; - galileo_satvel_Z = 0.0; -} - - -Galileo_Navigation_Message::Galileo_Navigation_Message() -{ - reset(); -} - - bool Galileo_Navigation_Message::CRC_test(std::bitset bits, uint32_t checksum) { CRC_Galileo_INAV_type CRC_Galileo; diff --git a/src/core/system_parameters/galileo_navigation_message.h b/src/core/system_parameters/galileo_navigation_message.h index 1e6a36194..44665e52c 100644 --- a/src/core/system_parameters/galileo_navigation_message.h +++ b/src/core/system_parameters/galileo_navigation_message.h @@ -42,185 +42,185 @@ class Galileo_Navigation_Message { public: - Galileo_Navigation_Message(); + Galileo_Navigation_Message() = default; - int32_t Page_type_time_stamp; - std::string page_Even; - bool flag_CRC_test; - bool flag_all_ephemeris; //!< Flag indicating that all words containing ephemeris have been received - bool flag_ephemeris_1; //!< Flag indicating that ephemeris 1/4 (word 1) have been received - bool flag_ephemeris_2; //!< Flag indicating that ephemeris 2/4 (word 2) have been received - bool flag_ephemeris_3; //!< Flag indicating that ephemeris 3/4 (word 3) have been received - bool flag_ephemeris_4; //!< Flag indicating that ephemeris 4/4 (word 4) have been received + int32_t Page_type_time_stamp{}; + std::string page_Even{}; + bool flag_CRC_test{}; + bool flag_all_ephemeris{}; //!< Flag indicating that all words containing ephemeris have been received + bool flag_ephemeris_1{}; //!< Flag indicating that ephemeris 1/4 (word 1) have been received + bool flag_ephemeris_2{}; //!< Flag indicating that ephemeris 2/4 (word 2) have been received + bool flag_ephemeris_3{}; //!< Flag indicating that ephemeris 3/4 (word 3) have been received + bool flag_ephemeris_4{}; //!< Flag indicating that ephemeris 4/4 (word 4) have been received - bool flag_iono_and_GST; //!< Flag indicating that ionospheric and GST parameters (word 5) have been received - bool flag_TOW_5; - bool flag_TOW_6; - bool flag_TOW_set; //!< it is true when page 5 or page 6 arrives - bool flag_utc_model; //!< Flag indicating that utc model parameters (word 6) have been received + bool flag_iono_and_GST{}; //!< Flag indicating that ionospheric and GST parameters (word 5) have been received + bool flag_TOW_5{}; + bool flag_TOW_6{}; + bool flag_TOW_set{}; //!< it is true when page 5 or page 6 arrives + bool flag_utc_model{}; //!< Flag indicating that utc model parameters (word 6) have been received - bool flag_all_almanac; //!< Flag indicating that all almanac have been received - bool flag_almanac_1; //!< Flag indicating that almanac 1/4 (word 7) have been received - bool flag_almanac_2; //!< Flag indicating that almanac 2/4 (word 8) have been received - bool flag_almanac_3; //!< Flag indicating that almanac 3/4 (word 9) have been received - bool flag_almanac_4; //!< Flag indicating that almanac 4/4 (word 10) have been received + bool flag_all_almanac{}; //!< Flag indicating that all almanac have been received + bool flag_almanac_1{}; //!< Flag indicating that almanac 1/4 (word 7) have been received + bool flag_almanac_2{}; //!< Flag indicating that almanac 2/4 (word 8) have been received + bool flag_almanac_3{}; //!< Flag indicating that almanac 3/4 (word 9) have been received + bool flag_almanac_4{}; //!< Flag indicating that almanac 4/4 (word 10) have been received - int32_t IOD_ephemeris; + int32_t IOD_ephemeris{}; - bool flag_GGTO; - bool flag_GGTO_1; - bool flag_GGTO_2; - bool flag_GGTO_3; - bool flag_GGTO_4; + bool flag_GGTO{}; + bool flag_GGTO_1{}; + bool flag_GGTO_2{}; + bool flag_GGTO_3{}; + bool flag_GGTO_4{}; // Word type 1: Ephemeris (1/4) - int32_t IOD_nav_1; //!< IOD_nav page 1 - int32_t t0e_1; //!< Ephemeris reference time [s] - double M0_1; //!< Mean anomaly at reference time [semi-circles] - double e_1; //!< Eccentricity - double A_1; //!< Square root of the semi-major axis [meters^1/2] + int32_t IOD_nav_1{}; //!< IOD_nav page 1 + int32_t t0e_1{}; //!< Ephemeris reference time [s] + double M0_1{}; //!< Mean anomaly at reference time [semi-circles] + double e_1{}; //!< Eccentricity + double A_1{}; //!< Square root of the semi-major axis [meters^1/2] // Word type 2: Ephemeris (2/4) - int32_t IOD_nav_2; //!< IOD_nav page 2 - double OMEGA_0_2; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - double i_0_2; //!< Inclination angle at reference time [semi-circles] - double omega_2; //!< Argument of perigee [semi-circles] - double iDot_2; //!< Rate of inclination angle [semi-circles/sec] + int32_t IOD_nav_2{}; //!< IOD_nav page 2 + double OMEGA_0_2{}; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles] + double i_0_2{}; //!< Inclination angle at reference time [semi-circles] + double omega_2{}; //!< Argument of perigee [semi-circles] + double iDot_2{}; //!< Rate of inclination angle [semi-circles/sec] // Word type 3: Ephemeris (3/4) and SISA - int32_t IOD_nav_3; // - double OMEGA_dot_3; //!< Rate of right ascension [semi-circles/sec] - double delta_n_3; //!< Mean motion difference from computed value [semi-circles/sec] - double C_uc_3; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - double C_us_3; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians] - double C_rc_3; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters] - double C_rs_3; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters] - int32_t SISA_3; + int32_t IOD_nav_3{}; // + double OMEGA_dot_3{}; //!< Rate of right ascension [semi-circles/sec] + double delta_n_3{}; //!< Mean motion difference from computed value [semi-circles/sec] + double C_uc_3{}; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians] + double C_us_3{}; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians] + double C_rc_3{}; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters] + double C_rs_3{}; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters] + int32_t SISA_3{}; // Word type 4: Ephemeris (4/4) and Clock correction parameters*/ - int32_t IOD_nav_4; // - int32_t SV_ID_PRN_4; // - double C_ic_4; //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians] - double C_is_4; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians] + int32_t IOD_nav_4{}; // + int32_t SV_ID_PRN_4{}; // + double C_ic_4{}; //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians] + double C_is_4{}; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians] // Clock correction parameters - int32_t t0c_4; //!< Clock correction data reference Time of Week [sec] - double af0_4; //!< SV clock bias correction coefficient [s] - double af1_4; //!< SV clock drift correction coefficient [s/s] - double af2_4; //!< clock drift rate correction coefficient [s/s^2] - double spare_4; + int32_t t0c_4{}; //!< Clock correction data reference Time of Week [sec] + double af0_4{}; //!< SV clock bias correction coefficient [s] + double af1_4{}; //!< SV clock drift correction coefficient [s/s] + double af2_4{}; //!< clock drift rate correction coefficient [s/s^2] + double spare_4{}; // Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST*/ // Ionospheric correction - double ai0_5; //!< Effective Ionisation Level 1st order parameter [sfu] - double ai1_5; //!< Effective Ionisation Level 2st order parameter [sfu/degree] - double ai2_5; //!< Effective Ionisation Level 3st order parameter [sfu/degree] + double ai0_5{}; //!< Effective Ionisation Level 1st order parameter [sfu] + double ai1_5{}; //!< Effective Ionisation Level 2st order parameter [sfu/degree] + double ai2_5{}; //!< Effective Ionisation Level 3st order parameter [sfu/degree] // Ionospheric disturbance flag - bool Region1_flag_5; //!< Ionospheric Disturbance Flag for region 1 - bool Region2_flag_5; //!< Ionospheric Disturbance Flag for region 2 - bool Region3_flag_5; //!< Ionospheric Disturbance Flag for region 3 - bool Region4_flag_5; //!< Ionospheric Disturbance Flag for region 4 - bool Region5_flag_5; //!< Ionospheric Disturbance Flag for region 5 - double BGD_E1E5a_5; //!< E1-E5a Broadcast Group Delay [s] - double BGD_E1E5b_5; //!< E1-E5b Broadcast Group Delay [s] + bool Region1_flag_5{}; //!< Ionospheric Disturbance Flag for region 1 + bool Region2_flag_5{}; //!< Ionospheric Disturbance Flag for region 2 + bool Region3_flag_5{}; //!< Ionospheric Disturbance Flag for region 3 + bool Region4_flag_5{}; //!< Ionospheric Disturbance Flag for region 4 + bool Region5_flag_5{}; //!< Ionospheric Disturbance Flag for region 5 + double BGD_E1E5a_5{}; //!< E1-E5a Broadcast Group Delay [s] + double BGD_E1E5b_5{}; //!< E1-E5b Broadcast Group Delay [s] - int32_t E5b_HS_5; //!< E5b Signal Health Status - int32_t E1B_HS_5; //!< E1B Signal Health Status - bool E5b_DVS_5; //!< E5b Data Validity Status - bool E1B_DVS_5; //!< E1B Data Validity Status + int32_t E5b_HS_5{}; //!< E5b Signal Health Status + int32_t E1B_HS_5{}; //!< E1B Signal Health Status + bool E5b_DVS_5{}; //!< E5b Data Validity Status + bool E1B_DVS_5{}; //!< E1B Data Validity Status // GST - int32_t WN_5; - int32_t TOW_5; - double spare_5; + int32_t WN_5{}; + int32_t TOW_5{}; + double spare_5{}; // Word type 6: GST-UTC conversion parameters - double A0_6; - double A1_6; - int32_t Delta_tLS_6; - int32_t t0t_6; - int32_t WNot_6; - int32_t WN_LSF_6; - int32_t DN_6; - int32_t Delta_tLSF_6; - int32_t TOW_6; + double A0_6{}; + double A1_6{}; + int32_t Delta_tLS_6{}; + int32_t t0t_6{}; + int32_t WNot_6{}; + int32_t WN_LSF_6{}; + int32_t DN_6{}; + int32_t Delta_tLSF_6{}; + int32_t TOW_6{}; // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number - int32_t IOD_a_7; - int32_t WN_a_7; - int32_t t0a_7; - int32_t SVID1_7; - double DELTA_A_7; - double e_7; - double omega_7; - double delta_i_7; - double Omega0_7; - double Omega_dot_7; - double M0_7; + int32_t IOD_a_7{}; + int32_t WN_a_7{}; + int32_t t0a_7{}; + int32_t SVID1_7{}; + double DELTA_A_7{}; + double e_7{}; + double omega_7{}; + double delta_i_7{}; + double Omega0_7{}; + double Omega_dot_7{}; + double M0_7{}; // Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2) - int32_t IOD_a_8; - double af0_8; - double af1_8; - int32_t E5b_HS_8; - int32_t E1B_HS_8; - int32_t SVID2_8; - double DELTA_A_8; - double e_8; - double omega_8; - double delta_i_8; - double Omega0_8; - double Omega_dot_8; + int32_t IOD_a_8{}; + double af0_8{}; + double af1_8{}; + int32_t E5b_HS_8{}; + int32_t E1B_HS_8{}; + int32_t SVID2_8{}; + double DELTA_A_8{}; + double e_8{}; + double omega_8{}; + double delta_i_8{}; + double Omega0_8{}; + double Omega_dot_8{}; // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) - int32_t IOD_a_9; - int32_t WN_a_9; - int32_t t0a_9; - double M0_9; - double af0_9; - double af1_9; - int32_t E5b_HS_9; - int32_t E1B_HS_9; - int32_t SVID3_9; - double DELTA_A_9; - double e_9; - double omega_9; - double delta_i_9; + int32_t IOD_a_9{}; + int32_t WN_a_9{}; + int32_t t0a_9{}; + double M0_9{}; + double af0_9{}; + double af1_9{}; + int32_t E5b_HS_9{}; + int32_t E1B_HS_9{}; + int32_t SVID3_9{}; + double DELTA_A_9{}; + double e_9{}; + double omega_9{}; + double delta_i_9{}; // Word type 10: Almanac for SVID3 (2/2) and GST-GPS conversion parameters - int32_t IOD_a_10; - double Omega0_10; - double Omega_dot_10; - double M0_10; - double af0_10; - double af1_10; - int32_t E5b_HS_10; - int32_t E1B_HS_10; + int32_t IOD_a_10{}; + double Omega0_10{}; + double Omega_dot_10{}; + double M0_10{}; + double af0_10{}; + double af1_10{}; + int32_t E5b_HS_10{}; + int32_t E1B_HS_10{}; // GST-GPS conversion - double A_0G_10; //!< Constant term of the offset Delta t systems - double A_1G_10; //!< Rate of change of the offset Delta t systems - int32_t t_0G_10; //!< Reference time for Galileo/GPS Time Offset (GGTO) data - int32_t WN_0G_10; //!< Week Number of Galileo/GPS Time Offset (GGTO) reference + double A_0G_10{}; //!< Constant term of the offset Delta t systems + double A_1G_10{}; //!< Rate of change of the offset Delta t systems + int32_t t_0G_10{}; //!< Reference time for Galileo/GPS Time Offset (GGTO) data + int32_t WN_0G_10{}; //!< Week Number of Galileo/GPS Time Offset (GGTO) reference // Word type 0: I/NAV Spare Word - int32_t Time_0; - int32_t WN_0; - int32_t TOW_0; + int32_t Time_0{}; + int32_t WN_0{}; + int32_t TOW_0{}; - double Galileo_satClkDrift; - double Galileo_dtr; //!< Relativistic clock correction term + double Galileo_satClkDrift{}; + double Galileo_dtr{}; //!< Relativistic clock correction term // satellite positions - double galileo_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double galileo_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double galileo_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double galileo_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double galileo_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double galileo_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // Satellite velocity - double galileo_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double galileo_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double galileo_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double galileo_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double galileo_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double galileo_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] /* * \brief Takes in input a page (Odd or Even) of 120 bit, split it according ICD 4.3.2.3 and join Data_k with Data_j @@ -234,8 +234,6 @@ public: */ int32_t page_jk_decoder(const char* data_jk); - void reset(); - /* * \brief Returns true if new Ephemeris has arrived. The flag is set to false when the function is executed */ diff --git a/src/core/system_parameters/galileo_utc_model.cc b/src/core/system_parameters/galileo_utc_model.cc index 54f22d851..f0d40b7dc 100644 --- a/src/core/system_parameters/galileo_utc_model.cc +++ b/src/core/system_parameters/galileo_utc_model.cc @@ -20,25 +20,6 @@ #include "galileo_utc_model.h" #include -Galileo_Utc_Model::Galileo_Utc_Model() -{ - // Word type 6: GST-UTC conversion parameters - A0_6 = 0.0; - A1_6 = 0.0; - Delta_tLS_6 = 0; - t0t_6 = 0; - WNot_6 = 0; - WN_LSF_6 = 0; - DN_6 = 0; - Delta_tLSF_6 = 0; - flag_utc_model = false; - // GPS to Galileo GST conversion parameters - A_0G_10 = 0.0; - A_1G_10 = 0.0; - t_0G_10 = 0; - WN_0G_10 = 0; -} - double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int32_t WN) { diff --git a/src/core/system_parameters/galileo_utc_model.h b/src/core/system_parameters/galileo_utc_model.h index 96971d74a..b4d6946ca 100644 --- a/src/core/system_parameters/galileo_utc_model.h +++ b/src/core/system_parameters/galileo_utc_model.h @@ -33,30 +33,30 @@ class Galileo_Utc_Model { public: - // Word type 6: GST-UTC conversion parameters - double A0_6; - double A1_6; - int32_t Delta_tLS_6; - int32_t t0t_6; //!< UTC data reference Time of Week [s] - int32_t WNot_6; //!< UTC data reference Week number [week] - int32_t WN_LSF_6; - int32_t DN_6; - int32_t Delta_tLSF_6; - bool flag_utc_model; - - // GPS to Galileo GST conversion parameters - double A_0G_10; - double A_1G_10; - int32_t t_0G_10; - int32_t WN_0G_10; - - // double TOW_6; - double GST_to_UTC_time(double t_e, int32_t WN); //!< GST-UTC Conversion Algorithm and Parameters - /*! * Default constructor */ - Galileo_Utc_Model(); + Galileo_Utc_Model() = default; + + // Word type 6: GST-UTC conversion parameters + double A0_6{}; + double A1_6{}; + int32_t Delta_tLS_6{}; + int32_t t0t_6{}; //!< UTC data reference Time of Week [s] + int32_t WNot_6{}; //!< UTC data reference Week number [week] + int32_t WN_LSF_6{}; + int32_t DN_6{}; + int32_t Delta_tLSF_6{}; + bool flag_utc_model{}; + + // GPS to Galileo GST conversion parameters + double A_0G_10{}; + double A_1G_10{}; + int32_t t_0G_10{}; + int32_t WN_0G_10{}; + + // double TOW_6; + double GST_to_UTC_time(double t_e, int32_t WN); //!< GST-UTC Conversion Algorithm and Parameters template diff --git a/src/core/system_parameters/glonass_gnav_almanac.cc b/src/core/system_parameters/glonass_gnav_almanac.cc deleted file mode 100644 index 47ffe0784..000000000 --- a/src/core/system_parameters/glonass_gnav_almanac.cc +++ /dev/null @@ -1,44 +0,0 @@ -/*! - * \file glonass_gnav_almanac.cc - * \brief Interface of a GLONASS GNAV ALMANAC storage as described in GLONASS ICD (Edition 5.1) - * \note Code added as part of GSoC 2017 program - * \author Damian Miralles, 2017. dmiralles2009(at)gmail.com - * \see GLONASS ICD - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "glonass_gnav_almanac.h" - -Glonass_Gnav_Almanac::Glonass_Gnav_Almanac() -{ - i_satellite_freq_channel = 0; - i_satellite_PRN = 0U; - i_satellite_slot_number = 0U; - - d_n_A = 0.0; - d_H_n_A = 0.0; - d_lambda_n_A = 0.0; - d_t_lambda_n_A = 0.0; - d_Delta_i_n_A = 0.0; - d_Delta_T_n_A = 0.0; - d_Delta_T_n_A_dot = 0.0; - d_epsilon_n_A = 0.0; - d_omega_n_A = 0.0; - d_M_n_A = 0.0; - d_KP = 0.0; - d_tau_n_A = 0.0; - d_C_n = false; - d_l_n = false; -} diff --git a/src/core/system_parameters/glonass_gnav_almanac.h b/src/core/system_parameters/glonass_gnav_almanac.h index 1a3c769ca..9fc4557da 100644 --- a/src/core/system_parameters/glonass_gnav_almanac.h +++ b/src/core/system_parameters/glonass_gnav_almanac.h @@ -34,25 +34,30 @@ class Glonass_Gnav_Almanac { public: - double d_n_A; //!< Conventional number of satellite within GLONASS space segment [dimensionless] - double d_H_n_A; //!< Carrier frequency number of navigation RF signal transmitted by d_nA satellite as table 4.10 (0-31) [dimensionless] - double d_lambda_n_A; //!< Longitude of the first (within the d_NA day) ascending node of d_nA [radians] - double d_t_lambda_n_A; //!< Time of first ascending node passage [s] - double d_Delta_i_n_A; //!< Correction of the mean value of inclination of d_n_A satellite at instant t_lambda_n_A [radians] - double d_Delta_T_n_A; //!< Correction to the mean value of Draconian period of d_n_A satellite at instant t_lambda_n_A [s / orbital period] - double d_Delta_T_n_A_dot; //!< Rate of change of Draconian period of d_n_A satellite at instant t_lambda_n_A [s / orbital period^2] - double d_epsilon_n_A; //!< Eccentricity of d_n_A satellite at instant t_lambda_n_A [dimensionless] - double d_omega_n_A; //!< Argument of perigee of d_n_A satellite at instant t_lambdan_A [radians] - double d_M_n_A; //!< Type of satellite n_A [dimensionless] - double d_KP; //!< Notification on forthcoming leap second correction of UTC [dimensionless] - double d_tau_n_A; //!< Coarse value of d_n_A satellite time correction to GLONASS time at instant t_lambdan_A[s] - bool d_C_n; //!< Generalized “unhealthy flag” of n_A satellite at instant of almanac upload [dimensionless] - bool d_l_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] + /*! + * Default constructor + */ + Glonass_Gnav_Almanac() = default; + + double d_n_A{}; //!< Conventional number of satellite within GLONASS space segment [dimensionless] + double d_H_n_A{}; //!< Carrier frequency number of navigation RF signal transmitted by d_nA satellite as table 4.10 (0-31) [dimensionless] + double d_lambda_n_A{}; //!< Longitude of the first (within the d_NA day) ascending node of d_nA [radians] + double d_t_lambda_n_A{}; //!< Time of first ascending node passage [s] + double d_Delta_i_n_A{}; //!< Correction of the mean value of inclination of d_n_A satellite at instant t_lambda_n_A [radians] + double d_Delta_T_n_A{}; //!< Correction to the mean value of Draconian period of d_n_A satellite at instant t_lambda_n_A [s / orbital period] + double d_Delta_T_n_A_dot{}; //!< Rate of change of Draconian period of d_n_A satellite at instant t_lambda_n_A [s / orbital period^2] + double d_epsilon_n_A{}; //!< Eccentricity of d_n_A satellite at instant t_lambda_n_A [dimensionless] + double d_omega_n_A{}; //!< Argument of perigee of d_n_A satellite at instant t_lambdan_A [radians] + double d_M_n_A{}; //!< Type of satellite n_A [dimensionless] + double d_KP{}; //!< Notification on forthcoming leap second correction of UTC [dimensionless] + double d_tau_n_A{}; //!< Coarse value of d_n_A satellite time correction to GLONASS time at instant t_lambdan_A[s] + bool d_C_n{}; //!< Generalized “unhealthy flag” of n_A satellite at instant of almanac upload [dimensionless] + bool d_l_n{}; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] // Satellite Identification Information - int32_t i_satellite_freq_channel; //!< SV Frequency Channel Number - uint32_t i_satellite_PRN; //!< SV PRN Number, equivalent to slot number for compatibility with GPS - uint32_t i_satellite_slot_number; //!< SV Slot Number + int32_t i_satellite_freq_channel{}; //!< SV Frequency Channel Number + uint32_t i_satellite_PRN{}; //!< SV PRN Number, equivalent to slot number for compatibility with GPS + uint32_t i_satellite_slot_number{}; //!< SV Slot Number template /*! @@ -83,11 +88,6 @@ public: archive& make_nvp("d_C_n", d_C_n); archive& make_nvp("d_l_n", d_l_n); } - - /*! - * Default constructor - */ - Glonass_Gnav_Almanac(); }; #endif diff --git a/src/core/system_parameters/glonass_gnav_ephemeris.cc b/src/core/system_parameters/glonass_gnav_ephemeris.cc index 11cfe6a33..d69601f39 100644 --- a/src/core/system_parameters/glonass_gnav_ephemeris.cc +++ b/src/core/system_parameters/glonass_gnav_ephemeris.cc @@ -27,52 +27,6 @@ #include -Glonass_Gnav_Ephemeris::Glonass_Gnav_Ephemeris() -{ - d_m = 0.0; //!< String number within frame [dimensionless] - d_t_k = 0.0; //!< GLONASS Time (UTC(SU) + 3 h) referenced to the beginning of the frame within the current day [s] - d_t_b = 0.0; //!< Reference ephemeris relative time in GLONASS Time (UTC(SU) + 3 h). Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [s] - d_M = 0.0; //!< Type of satellite transmitting navigation signal [dimensionless] - d_gamma_n = 0.0; //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless] - d_tau_n = 0.0; //!< Correction to the nth satellite time (tn) relative to GLONASS time (te), - d_Xn = 0.0; //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km]. - d_Yn = 0.0; //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km] - d_Zn = 0.0; //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km] - d_VXn = 0.0; //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s] - d_VYn = 0.0; //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s] - d_VZn = 0.0; //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s] - d_AXn = 0.0; //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2] - d_AYn = 0.0; //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2] - d_AZn = 0.0; //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2] - d_B_n = 0.0; //!< Health flag [dimensionless] - d_P = 0.0; //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless] - d_N_T = 0.0; //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days] - d_F_T = 0.0; //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless] - d_n = 0.0; //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation - d_Delta_tau_n = 0.0; //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless] - d_E_n = 0.0; //!< Characterises "age" of a current information [days] - d_P_1 = 0.0; //!< Flag of the immediate data updating [minutes] - d_P_2 = false; //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless] - d_P_3 = false; //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless] - d_P_4 = false; //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless] - d_l3rd_n = false; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] - d_l5th_n = false; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] - - // Satellite Identification Information - i_satellite_freq_channel = 0; //!< SV Frequency Channel Number - i_satellite_PRN = 0U; //!< SV PRN Number, equivalent to slot number for compatibility with GPS - i_satellite_slot_number = 0U; //!< SV Slot Number - d_yr = 1972; //!< Current year, defaults to 1972 (UTC Epoch with leap seconds) - d_satClkDrift = 0.0; //!< GLONASS clock error - d_dtr = 0.0; //!< relativistic clock correction term - d_iode = 0.0; //!< Issue of data, ephemeris (Bit 0-6 of tb) - d_tau_c = 0.0; - d_TOW = 0.0; // tow of the start of frame - d_WN = 0.0; // week number of the start of frame - d_tod = 0.0; -} - - boost::posix_time::ptime Glonass_Gnav_Ephemeris::compute_GLONASS_time(const double offset_time) const { boost::posix_time::time_duration t(0, 0, offset_time + d_tau_c + d_tau_n); diff --git a/src/core/system_parameters/glonass_gnav_ephemeris.h b/src/core/system_parameters/glonass_gnav_ephemeris.h index b0a474509..ebb03022a 100644 --- a/src/core/system_parameters/glonass_gnav_ephemeris.h +++ b/src/core/system_parameters/glonass_gnav_ephemeris.h @@ -39,50 +39,50 @@ public: /*! * Default constructor */ - Glonass_Gnav_Ephemeris(); + Glonass_Gnav_Ephemeris() = default; - double d_m; //!< String number within frame [dimensionless] - double d_t_k; //!< GLONASS Time (UTC(SU) + 3 h) referenced to the beginning of the frame within the current day [s] - double d_t_b; //!< Reference ephemeris relative time in GLONASS Time (UTC(SU) + 3 h). Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [s] - double d_M; //!< Type of satellite transmitting navigation signal [dimensionless] - double d_gamma_n; //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless] - double d_tau_n; //!< Correction to the nth satellite time (tn) relative to GLONASS time (te), - double d_Xn; //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km]. - double d_Yn; //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km] - double d_Zn; //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km] - double d_VXn; //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s] - double d_VYn; //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s] - double d_VZn; //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s] - double d_AXn; //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2] - double d_AYn; //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2] - double d_AZn; //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2] - double d_B_n; //!< Health flag [dimensionless] - double d_P; //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless] - double d_N_T; //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days] - double d_F_T; //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless] - double d_n; //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation - double d_Delta_tau_n; //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless] - double d_E_n; //!< Characterises "age" of a current information [days] - double d_P_1; //!< Flag of the immediate data updating [minutes] - bool d_P_2; //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless] - bool d_P_3; //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless] - bool d_P_4; //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless] - bool d_l3rd_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] - bool d_l5th_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] + double d_m{}; //!< String number within frame [dimensionless] + double d_t_k{}; //!< GLONASS Time (UTC(SU) + 3 h) referenced to the beginning of the frame within the current day [s] + double d_t_b{}; //!< Reference ephemeris relative time in GLONASS Time (UTC(SU) + 3 h). Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [s] + double d_M{}; //!< Type of satellite transmitting navigation signal [dimensionless] + double d_gamma_n{}; //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless] + double d_tau_n{}; //!< Correction to the nth satellite time (tn) relative to GLONASS time (te), + double d_Xn{}; //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km]. + double d_Yn{}; //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km] + double d_Zn{}; //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km] + double d_VXn{}; //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s] + double d_VYn{}; //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s] + double d_VZn{}; //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s] + double d_AXn{}; //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2] + double d_AYn{}; //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2] + double d_AZn{}; //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2] + double d_B_n{}; //!< Health flag [dimensionless] + double d_P{}; //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless] + double d_N_T{}; //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days] + double d_F_T{}; //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless] + double d_n{}; //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation + double d_Delta_tau_n{}; //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless] + double d_E_n{}; //!< Characterises "age" of a current information [days] + double d_P_1{}; //!< Flag of the immediate data updating [minutes] + bool d_P_2{}; //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless] + bool d_P_3{}; //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless] + bool d_P_4{}; //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless] + bool d_l3rd_n{}; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] + bool d_l5th_n{}; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] // Immediate deliverables of ephemeris information // Satellite Identification Information - int32_t i_satellite_freq_channel; //!< SV Frequency Channel Number - uint32_t i_satellite_PRN; //!< SV PRN Number, equivalent to slot number for compatibility with GPS - uint32_t i_satellite_slot_number; //!< SV Slot Number - double d_yr; //!< Current year - double d_satClkDrift; //!< GLONASS clock error - double d_dtr; //!< relativistic clock correction term - double d_iode; //!< Issue of data, ephemeris (Bit 0-6 of tb) - double d_tau_c; //!< GLONASST 2 UTC correction (todo) may be eliminated - double d_TOW; //!< GLONASST IN GPST seconds of week - double d_WN; //!< GLONASST IN GPST week number of the start of frame - double d_tod; //!< Time of Day since ephemeris where decoded + int32_t i_satellite_freq_channel{}; //!< SV Frequency Channel Number + uint32_t i_satellite_PRN{}; //!< SV PRN Number, equivalent to slot number for compatibility with GPS + uint32_t i_satellite_slot_number{}; //!< SV Slot Number + double d_yr = 1972.0; //!< Current year + double d_satClkDrift{}; //!< GLONASS clock error + double d_dtr{}; //!< relativistic clock correction term + double d_iode{}; //!< Issue of data, ephemeris (Bit 0-6 of tb) + double d_tau_c{}; //!< GLONASST 2 UTC correction (todo) may be eliminated + double d_TOW{}; //!< GLONASST IN GPST seconds of week + double d_WN{}; //!< GLONASST IN GPST week number of the start of frame + double d_tod{}; //!< Time of Day since ephemeris where decoded /*! * \brief Sets (\a d_satClkDrift)and returns the clock drift in seconds according to the User Algorithm for SV Clock Correction diff --git a/src/core/system_parameters/glonass_gnav_navigation_message.cc b/src/core/system_parameters/glonass_gnav_navigation_message.cc index 91209110c..0a9fa075e 100644 --- a/src/core/system_parameters/glonass_gnav_navigation_message.cc +++ b/src/core/system_parameters/glonass_gnav_navigation_message.cc @@ -28,61 +28,8 @@ #include // for operator<< -void Glonass_Gnav_Navigation_Message::reset() +Glonass_Gnav_Navigation_Message::Glonass_Gnav_Navigation_Message() { - // Satellite Identification - i_satellite_PRN = 0U; - i_alm_satellite_slot_number = 0; // SV Orbit Slot Number - flag_update_slot_number = false; - - // Ephmeris Flags - flag_all_ephemeris = false; - flag_ephemeris_str_1 = false; - flag_ephemeris_str_2 = false; - flag_ephemeris_str_3 = false; - flag_ephemeris_str_4 = false; - - // Almanac Flags - flag_all_almanac = false; - flag_almanac_str_6 = false; - flag_almanac_str_7 = false; - flag_almanac_str_8 = false; - flag_almanac_str_9 = false; - flag_almanac_str_10 = false; - flag_almanac_str_11 = false; - flag_almanac_str_12 = false; - flag_almanac_str_13 = false; - flag_almanac_str_14 = false; - flag_almanac_str_15 = false; - - // UTC and System Clocks Flags - flag_utc_model_valid = false; // If set, it indicates that the UTC model parameters are filled - flag_utc_model_str_5 = false; // Clock info send in string 5 of navigation data - flag_utc_model_str_15 = false; // Clock info send in string 15 of frame 5 of navigation data - - // broadcast orbit 1 - flag_TOW_set = false; - flag_TOW_new = false; - - flag_CRC_test = false; - d_frame_ID = 0U; - d_string_ID = 0U; - i_channel_ID = 0; - - // Clock terms - d_satClkCorr = 0.0; - d_dtr = 0.0; - d_satClkDrift = 0.0; - - // Data update information - d_previous_tb = 0.0; - for (double& i : d_previous_Na) - { - i = 0.0; - } - - std::map satelliteBlock; // Map that stores to which block the PRN belongs - auto gnss_sat = Gnss_Satellite(); std::string _system("GLONASS"); // TODO SHould number of channels be hardcoded? @@ -93,12 +40,6 @@ void Glonass_Gnav_Navigation_Message::reset() } -Glonass_Gnav_Navigation_Message::Glonass_Gnav_Navigation_Message() -{ - reset(); -} - - bool Glonass_Gnav_Navigation_Message::CRC_test(std::bitset bits) { uint32_t sum_bits = 0; diff --git a/src/core/system_parameters/glonass_gnav_navigation_message.h b/src/core/system_parameters/glonass_gnav_navigation_message.h index 510bddf62..f8cab5685 100644 --- a/src/core/system_parameters/glonass_gnav_navigation_message.h +++ b/src/core/system_parameters/glonass_gnav_navigation_message.h @@ -48,53 +48,55 @@ public: */ Glonass_Gnav_Navigation_Message(); - bool flag_CRC_test; - uint32_t d_frame_ID; - uint32_t d_string_ID; - bool flag_update_slot_number; + bool flag_CRC_test{}; + uint32_t d_frame_ID{}; + uint32_t d_string_ID{}; + bool flag_update_slot_number{}; - int32_t i_channel_ID; - uint32_t i_satellite_PRN; + int32_t i_channel_ID{}; + uint32_t i_satellite_PRN{}; - Glonass_Gnav_Ephemeris gnav_ephemeris; //!< Ephemeris information decoded - Glonass_Gnav_Utc_Model gnav_utc_model; //!< UTC model information - Glonass_Gnav_Almanac gnav_almanac[GLONASS_CA_NBR_SATS]; //!< Almanac information for all 24 satellites + Glonass_Gnav_Ephemeris gnav_ephemeris{}; //!< Ephemeris information decoded + Glonass_Gnav_Utc_Model gnav_utc_model{}; //!< UTC model information + Glonass_Gnav_Almanac gnav_almanac[GLONASS_CA_NBR_SATS]{}; //!< Almanac information for all 24 satellites // Ephemeris Flags and control variables - bool flag_all_ephemeris; //!< Flag indicating that all strings containing ephemeris have been received - bool flag_ephemeris_str_1; //!< Flag indicating that ephemeris 1/4 (string 1) have been received - bool flag_ephemeris_str_2; //!< Flag indicating that ephemeris 2/4 (string 2) have been received - bool flag_ephemeris_str_3; //!< Flag indicating that ephemeris 3/4 (string 3) have been received - bool flag_ephemeris_str_4; //!< Flag indicating that ephemeris 4/4 (string 4) have been received + bool flag_all_ephemeris{}; //!< Flag indicating that all strings containing ephemeris have been received + bool flag_ephemeris_str_1{}; //!< Flag indicating that ephemeris 1/4 (string 1) have been received + bool flag_ephemeris_str_2{}; //!< Flag indicating that ephemeris 2/4 (string 2) have been received + bool flag_ephemeris_str_3{}; //!< Flag indicating that ephemeris 3/4 (string 3) have been received + bool flag_ephemeris_str_4{}; //!< Flag indicating that ephemeris 4/4 (string 4) have been received // Almanac Flags - bool flag_all_almanac; //!< Flag indicating that all almanac have been received - bool flag_almanac_str_6; //!< Flag indicating that almanac of string 6 have been received - bool flag_almanac_str_7; //!< Flag indicating that almanac of string 7 have been received - bool flag_almanac_str_8; //!< Flag indicating that almanac of string 8 have been received - bool flag_almanac_str_9; //!< Flag indicating that almanac of string 9 have been received - bool flag_almanac_str_10; //!< Flag indicating that almanac of string 10 have been received - bool flag_almanac_str_11; //!< Flag indicating that almanac of string 11 have been received - bool flag_almanac_str_12; //!< Flag indicating that almanac of string 12 have been received - bool flag_almanac_str_13; //!< Flag indicating that almanac of string 13 have been received - bool flag_almanac_str_14; //!< Flag indicating that almanac of string 14 have been received - bool flag_almanac_str_15; //!< Flag indicating that almanac of string 15 have been received - uint32_t i_alm_satellite_slot_number; //!< SV Orbit Slot Number + bool flag_all_almanac{}; //!< Flag indicating that all almanac have been received + bool flag_almanac_str_6{}; //!< Flag indicating that almanac of string 6 have been received + bool flag_almanac_str_7{}; //!< Flag indicating that almanac of string 7 have been received + bool flag_almanac_str_8{}; //!< Flag indicating that almanac of string 8 have been received + bool flag_almanac_str_9{}; //!< Flag indicating that almanac of string 9 have been received + bool flag_almanac_str_10{}; //!< Flag indicating that almanac of string 10 have been received + bool flag_almanac_str_11{}; //!< Flag indicating that almanac of string 11 have been received + bool flag_almanac_str_12{}; //!< Flag indicating that almanac of string 12 have been received + bool flag_almanac_str_13{}; //!< Flag indicating that almanac of string 13 have been received + bool flag_almanac_str_14{}; //!< Flag indicating that almanac of string 14 have been received + bool flag_almanac_str_15{}; //!< Flag indicating that almanac of string 15 have been received + uint32_t i_alm_satellite_slot_number{}; //!< SV Orbit Slot Number // UTC and System Clocks Flags - bool flag_utc_model_valid; //!< If set, it indicates that the UTC model parameters are filled - bool flag_utc_model_str_5; //!< Clock info send in string 5 of navigation data - bool flag_utc_model_str_15; //!< Clock info send in string 15 of frame 5 of navigation data + bool flag_utc_model_valid{}; //!< If set, it indicates that the UTC model parameters are filled + bool flag_utc_model_str_5{}; //!< Clock info send in string 5 of navigation data + bool flag_utc_model_str_15{}; //!< Clock info send in string 15 of frame 5 of navigation data - bool flag_TOW_set; //!< Flag indicating when the TOW has been set - bool flag_TOW_new; //!< Flag indicating when a new TOW has been computed + bool flag_TOW_set{}; //!< Flag indicating when the TOW has been set + bool flag_TOW_new{}; //!< Flag indicating when a new TOW has been computed - double d_satClkCorr; //!< Satellite clock error - double d_dtr; //!< Relativistic clock correction term - double d_satClkDrift; //!< Satellite clock drift + double d_satClkCorr{}; //!< Satellite clock error + double d_dtr{}; //!< Relativistic clock correction term + double d_satClkDrift{}; //!< Satellite clock drift - double d_previous_tb; //!< Previous iode for the Glonass_Gnav_Ephemeris object. Used to determine when new data arrives - double d_previous_Na[GLONASS_CA_NBR_SATS]; //!< Previous time for almanac of the Glonass_Gnav_Almanac object + double d_previous_tb{}; //!< Previous iode for the Glonass_Gnav_Ephemeris object. Used to determine when new data arrives + double d_previous_Na[GLONASS_CA_NBR_SATS]{}; //!< Previous time for almanac of the Glonass_Gnav_Almanac object + + std::map satelliteBlock; // Map that stores to which block the PRN belongs /*! * \brief Compute CRC for GLONASS GNAV strings @@ -109,11 +111,6 @@ public: */ uint32_t get_frame_number(uint32_t satellite_slot_number); - /*! - * \brief Reset GLONASS GNAV Navigation Information - */ - void reset(); - /*! * \brief Obtain a GLONASS GNAV SV Ephemeris class filled with current SV data */ diff --git a/src/core/system_parameters/glonass_gnav_utc_model.cc b/src/core/system_parameters/glonass_gnav_utc_model.cc index 352d20671..3d2b3eddb 100644 --- a/src/core/system_parameters/glonass_gnav_utc_model.cc +++ b/src/core/system_parameters/glonass_gnav_utc_model.cc @@ -21,18 +21,6 @@ #include "glonass_gnav_utc_model.h" -Glonass_Gnav_Utc_Model::Glonass_Gnav_Utc_Model() -{ - valid = false; - d_tau_c = 0.0; - d_tau_gps = 0.0; - d_N_4 = 0.0; - d_N_A = 0.0; - d_B1 = 0.0; - d_B2 = 0.0; -} - - double Glonass_Gnav_Utc_Model::utc_time(double glonass_time_corrected) { double t_utc; diff --git a/src/core/system_parameters/glonass_gnav_utc_model.h b/src/core/system_parameters/glonass_gnav_utc_model.h index 26e82bae8..1bec0ce65 100644 --- a/src/core/system_parameters/glonass_gnav_utc_model.h +++ b/src/core/system_parameters/glonass_gnav_utc_model.h @@ -37,16 +37,16 @@ public: /*! * Default constructor */ - Glonass_Gnav_Utc_Model(); + Glonass_Gnav_Utc_Model() = default; - bool valid; + bool valid{}; // Clock Parameters - double d_tau_c; //!< GLONASS time scale correction to UTC(SU) time. [s] - double d_tau_gps; //!< Correction to GPS time to GLONASS time [day] - double d_N_4; //!< Four year interval number starting from 1996 [4 year interval] - double d_N_A; //!< Calendar day number within the four-year period beginning since the leap year for Almanac data [days] - double d_B1; //!< Coefficient to determine DeltaUT1 [s] - double d_B2; //!< Coefficient to determine DeltaUT1 [s/msd] + double d_tau_c{}; //!< GLONASS time scale correction to UTC(SU) time. [s] + double d_tau_gps{}; //!< Correction to GPS time to GLONASS time [day] + double d_N_4{}; //!< Four year interval number starting from 1996 [4 year interval] + double d_N_A{}; //!< Calendar day number within the four-year period beginning since the leap year for Almanac data [days] + double d_B1{}; //!< Coefficient to determine DeltaUT1 [s] + double d_B2{}; //!< Coefficient to determine DeltaUT1 [s/msd] /*! * \brief Computes the Coordinated Universal Time (UTC) and diff --git a/src/core/system_parameters/gnss_satellite.cc b/src/core/system_parameters/gnss_satellite.cc index b7f455368..074e422a5 100644 --- a/src/core/system_parameters/gnss_satellite.cc +++ b/src/core/system_parameters/gnss_satellite.cc @@ -22,12 +22,6 @@ #include -Gnss_Satellite::Gnss_Satellite() -{ - Gnss_Satellite::reset(); -} - - Gnss_Satellite::Gnss_Satellite(const std::string& system_, uint32_t PRN_) { Gnss_Satellite::reset(); diff --git a/src/core/system_parameters/gnss_satellite.h b/src/core/system_parameters/gnss_satellite.h index fd57eb146..ee59ec49a 100644 --- a/src/core/system_parameters/gnss_satellite.h +++ b/src/core/system_parameters/gnss_satellite.h @@ -37,7 +37,7 @@ class Gnss_Satellite { public: - Gnss_Satellite(); //!< Default Constructor. + Gnss_Satellite() = default; //!< Default Constructor. Gnss_Satellite(const std::string& system_, uint32_t PRN_); //!< Concrete GNSS satellite Constructor. ~Gnss_Satellite() = default; //!< Default Destructor. void update_PRN(uint32_t PRN); //!< Updates the PRN Number when information is decoded, only applies to GLONASS GNAV messages diff --git a/src/core/system_parameters/gnss_signal.cc b/src/core/system_parameters/gnss_signal.cc index 5e1f1ee6a..c44cb7ae3 100644 --- a/src/core/system_parameters/gnss_signal.cc +++ b/src/core/system_parameters/gnss_signal.cc @@ -20,11 +20,6 @@ #include "gnss_signal.h" -Gnss_Signal::Gnss_Signal() -{ - this->signal = ""; -} - Gnss_Signal::Gnss_Signal(const std::string& signal_) { diff --git a/src/core/system_parameters/gnss_signal.h b/src/core/system_parameters/gnss_signal.h index 575e40cf0..03d3e3779 100644 --- a/src/core/system_parameters/gnss_signal.h +++ b/src/core/system_parameters/gnss_signal.h @@ -33,7 +33,7 @@ class Gnss_Signal { public: - Gnss_Signal(); + Gnss_Signal() = default; explicit Gnss_Signal(const std::string& signal_); Gnss_Signal(const Gnss_Satellite& satellite_, const std::string& signal_); ~Gnss_Signal() = default; diff --git a/src/core/system_parameters/gps_acq_assist.cc b/src/core/system_parameters/gps_acq_assist.cc deleted file mode 100644 index da4e0df1b..000000000 --- a/src/core/system_parameters/gps_acq_assist.cc +++ /dev/null @@ -1,37 +0,0 @@ -/*! - * \file gps_acq_assist.cc - * \brief Interface of a GPS RRLL ACQUISITION ASSISTACE storage - * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix II - * \author Javier Arribas, 2013. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "gps_acq_assist.h" - -Gps_Acq_Assist::Gps_Acq_Assist() -{ - i_satellite_PRN = 0U; - d_TOW = 0.0; - d_Doppler0 = 0.0; - d_Doppler1 = 0.0; - dopplerUncertainty = 0.0; - Code_Phase = 0.0; - Code_Phase_int = 0.0; - GPS_Bit_Number = 0.0; - Code_Phase_window = 0.0; - Azimuth = 0.0; - Elevation = 0.0; -} diff --git a/src/core/system_parameters/gps_acq_assist.h b/src/core/system_parameters/gps_acq_assist.h index 8b8d714a7..a851b2d52 100644 --- a/src/core/system_parameters/gps_acq_assist.h +++ b/src/core/system_parameters/gps_acq_assist.h @@ -34,22 +34,22 @@ class Gps_Acq_Assist { public: - uint32_t i_satellite_PRN; //!< SV PRN NUMBER - double d_TOW; //!< Time Of Week assigned to the acquisition data - double d_Doppler0; //!< Doppler (0 order term) [Hz] - double d_Doppler1; //!< Doppler (1 order term) [Hz] - double dopplerUncertainty; //!< Doppler Uncertainty [Hz] - double Code_Phase; //!< Code phase [chips] - double Code_Phase_int; //!< Integer Code Phase [1 C/A code period] - double GPS_Bit_Number; //!< GPS Bit Number - double Code_Phase_window; //!< Code Phase search window [chips] - double Azimuth; //!< Satellite Azimuth [deg] - double Elevation; //!< Satellite Elevation [deg] - /*! * Default constructor */ - Gps_Acq_Assist(); + Gps_Acq_Assist() = default; + + uint32_t i_satellite_PRN{}; //!< SV PRN NUMBER + double d_TOW{}; //!< Time Of Week assigned to the acquisition data + double d_Doppler0{}; //!< Doppler (0 order term) [Hz] + double d_Doppler1{}; //!< Doppler (1 order term) [Hz] + double dopplerUncertainty{}; //!< Doppler Uncertainty [Hz] + double Code_Phase{}; //!< Code phase [chips] + double Code_Phase_int{}; //!< Integer Code Phase [1 C/A code period] + double GPS_Bit_Number{}; //!< GPS Bit Number + double Code_Phase_window{}; //!< Code Phase search window [chips] + double Azimuth{}; //!< Satellite Azimuth [deg] + double Elevation{}; //!< Satellite Elevation [deg] }; #endif diff --git a/src/core/system_parameters/gps_almanac.cc b/src/core/system_parameters/gps_almanac.cc deleted file mode 100644 index 77f68eb83..000000000 --- a/src/core/system_parameters/gps_almanac.cc +++ /dev/null @@ -1,40 +0,0 @@ -/*! - * \file gps_almanac.cc - * \brief Interface of a GPS ALMANAC storage - * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix II - * \author Javier Arribas, 2013. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "gps_almanac.h" - -Gps_Almanac::Gps_Almanac() -{ - i_satellite_PRN = 0U; - d_Delta_i = 0.0; - i_Toa = 0; - i_WNa = 0; - d_M_0 = 0.0; - d_e_eccentricity = 0.0; - d_sqrt_A = 0.0; - d_OMEGA0 = 0.0; - d_OMEGA = 0.0; - d_OMEGA_DOT = 0.0; - i_SV_health = 0; - i_AS_status = 0; - d_A_f0 = 0.0; - d_A_f1 = 0.0; -} diff --git a/src/core/system_parameters/gps_almanac.h b/src/core/system_parameters/gps_almanac.h index c06af1465..bdc38a375 100644 --- a/src/core/system_parameters/gps_almanac.h +++ b/src/core/system_parameters/gps_almanac.h @@ -32,25 +32,25 @@ class Gps_Almanac { public: - uint32_t i_satellite_PRN; //!< SV PRN NUMBER - double d_Delta_i; //!< Inclination Angle at Reference Time (relative to i_0 = 0.30 semi-circles) - int32_t i_Toa; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - int32_t i_WNa; //!< Almanac week number - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_e_eccentricity; //!< Eccentricity [dimensionless] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] - int32_t i_SV_health; //!< SV Health - int32_t i_AS_status; //!< Anti-Spoofing Flags and SV Configuration - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - /*! * Default constructor */ - Gps_Almanac(); + Gps_Almanac() = default; + + uint32_t i_satellite_PRN{}; //!< SV PRN NUMBER + double d_Delta_i{}; //!< Inclination Angle at Reference Time (relative to i_0 = 0.30 semi-circles) + int32_t i_Toa{}; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] + int32_t i_WNa{}; //!< Almanac week number + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] + double d_e_eccentricity{}; //!< Eccentricity [dimensionless] + double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s] + int32_t i_SV_health{}; //!< SV Health + int32_t i_AS_status{}; //!< Anti-Spoofing Flags and SV Configuration + double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s] template diff --git a/src/core/system_parameters/gps_cnav_ephemeris.cc b/src/core/system_parameters/gps_cnav_ephemeris.cc index 7faacd23d..7886db9be 100644 --- a/src/core/system_parameters/gps_cnav_ephemeris.cc +++ b/src/core/system_parameters/gps_cnav_ephemeris.cc @@ -24,69 +24,6 @@ #include -Gps_CNAV_Ephemeris::Gps_CNAV_Ephemeris() -{ - i_satellite_PRN = 0U; - - d_Toe1 = -1; - d_Toe2 = -1; - - d_TOW = 0; - d_Crs = 0.0; - d_M_0 = 0.0; - d_Cuc = 0.0; - d_e_eccentricity = 0.0; - d_Cus = 0.0; - - d_Toc = 0; - d_Cic = 0.0; - d_OMEGA0 = 0.0; - d_Cis = 0.0; - d_i_0 = 0.0; - d_Crc = 0.0; - d_OMEGA = 0.0; - d_IDOT = 0.0; - - i_GPS_week = 0; - - d_TGD = 0.0; // Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - - d_A_f0 = 0.0; // Coefficient 0 of code phase offset model [s] - d_A_f1 = 0.0; // Coefficient 1 of code phase offset model [s/s] - d_A_f2 = 0.0; // Coefficient 2 of code phase offset model [s/s^2] - - b_integrity_status_flag = false; - b_alert_flag = false; // If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - b_antispoofing_flag = false; // If true, the AntiSpoofing mode is ON in that SV - - d_satClkDrift = 0.0; - d_dtr = 0.0; - d_satpos_X = 0.0; - d_satpos_Y = 0.0; - d_satpos_Z = 0.0; - d_satvel_X = 0.0; - d_satvel_Y = 0.0; - d_satvel_Z = 0.0; - - i_URA = 0; - i_signal_health = 0; - d_Top = 0; - d_DELTA_A = 0.0; - d_A_DOT = 0.0; - d_Delta_n = 0.0; - d_DELTA_DOT_N = 0.0; - d_DELTA_OMEGA_DOT = 0.0; - d_URA0 = 0.0; - d_URA1 = 0.0; - d_URA2 = 0.0; - d_ISCL1 = 0.0; - d_ISCL2 = 0.0; - d_ISCL5I = 0.0; - d_ISCL5Q = 0.0; - b_l2c_phasing_flag = false; -} - - double Gps_CNAV_Ephemeris::check_t(double time) { double corrTime; diff --git a/src/core/system_parameters/gps_cnav_ephemeris.h b/src/core/system_parameters/gps_cnav_ephemeris.h index d36be3ae7..a68968175 100644 --- a/src/core/system_parameters/gps_cnav_ephemeris.h +++ b/src/core/system_parameters/gps_cnav_ephemeris.h @@ -36,53 +36,53 @@ public: /*! * Default constructor */ - Gps_CNAV_Ephemeris(); + Gps_CNAV_Ephemeris() = default; - uint32_t i_satellite_PRN; // SV PRN NUMBER + uint32_t i_satellite_PRN{}; // SV PRN NUMBER // Message Types 10 and 11 Parameters (1 of 2) - int32_t i_GPS_week; //!< GPS week number, aka WN [week] - int32_t i_URA; //!< ED Accuracy Index - int32_t i_signal_health; //!< Signal health (L1/L2/L5) - int32_t d_Top; //!< Data predict time of week - double d_DELTA_A; //!< Semi-major axis difference at reference time - double d_A_DOT; //!< Change rate in semi-major axis - double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] - double d_DELTA_DOT_N; //!< Rate of mean motion difference from computed value - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_e_eccentricity; //!< Eccentricity - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-cicles] - int32_t d_Toe1; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - int32_t d_Toe2; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - double d_DELTA_OMEGA_DOT; //!< Rate of Right Ascension difference [semi-circles/s] - double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] - double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] - double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] - double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] - double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + int32_t i_GPS_week{}; //!< GPS week number, aka WN [week] + int32_t i_URA{}; //!< ED Accuracy Index + int32_t i_signal_health{}; //!< Signal health (L1/L2/L5) + int32_t d_Top{}; //!< Data predict time of week + double d_DELTA_A{}; //!< Semi-major axis difference at reference time + double d_A_DOT{}; //!< Change rate in semi-major axis + double d_Delta_n{}; //!< Mean Motion Difference From Computed Value [semi-circles/s] + double d_DELTA_DOT_N{}; //!< Rate of mean motion difference from computed value + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] + double d_e_eccentricity{}; //!< Eccentricity + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-cicles] + int32_t d_Toe1{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] + int32_t d_Toe2{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] + double d_DELTA_OMEGA_DOT{}; //!< Rate of Right Ascension difference [semi-circles/s] + double d_i_0{}; //!< Inclination Angle at Reference Time [semi-circles] + double d_IDOT{}; //!< Rate of Inclination Angle [semi-circles/s] + double d_Cis{}; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] + double d_Cic{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] + double d_Crs{}; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + double d_Crc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + double d_Cus{}; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] + double d_Cuc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] // Clock Correction and Accuracy Parameters - int32_t d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] + int32_t d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] + double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s] + double d_A_f2{}; //!< Coefficient 2 of code phase offset model [s/s^2] - double d_URA0; //!< NED Accuracy Index - double d_URA1; //!< NED Accuracy Change Index - double d_URA2; //!< NED Accuracy Change Rate Index + double d_URA0{}; //!< NED Accuracy Index + double d_URA1{}; //!< NED Accuracy Change Index + double d_URA2{}; //!< NED Accuracy Change Rate Index // Group Delay Differential Parameters - double d_TGD; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - double d_ISCL1; - double d_ISCL2; - double d_ISCL5I; - double d_ISCL5Q; + double d_TGD{}; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] + double d_ISCL1{}; + double d_ISCL2{}; + double d_ISCL5I{}; + double d_ISCL5Q{}; - int32_t d_TOW; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] + int32_t d_TOW{}; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] /*! \brief If true, enhanced level of integrity assurance. * @@ -94,24 +94,24 @@ public: * times the upper bound value of the current broadcast URA index, for more than 5.2 seconds, without an * accompanying alert, is less than 1E-8 per hour. */ - bool b_integrity_status_flag; - bool b_l2c_phasing_flag; - bool b_alert_flag; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - bool b_antispoofing_flag; //!< If true, the AntiSpoofing mode is ON in that SV + bool b_integrity_status_flag{}; + bool b_l2c_phasing_flag{}; + bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. + bool b_antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV // clock terms derived from ephemeris data - double d_satClkDrift; //!< GPS clock error - double d_dtr; //!< relativistic clock correction term + double d_satClkDrift{}; //!< GPS clock error + double d_dtr{}; //!< relativistic clock correction term // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] /*! * \brief Compute the ECEF SV coordinates and ECEF velocity diff --git a/src/core/system_parameters/gps_cnav_iono.cc b/src/core/system_parameters/gps_cnav_iono.cc deleted file mode 100644 index 3f90fb93c..000000000 --- a/src/core/system_parameters/gps_cnav_iono.cc +++ /dev/null @@ -1,35 +0,0 @@ -/*! - * \file gps_cnav_iono.cc - * \brief Interface of a GPS CNAV IONOSPHERIC MODEL storage - * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix III - * \author Javier Arribas, 2015. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "gps_cnav_iono.h" - -Gps_CNAV_Iono::Gps_CNAV_Iono() -{ - valid = false; - d_alpha0 = 0.0; - d_alpha1 = 0.0; - d_alpha2 = 0.0; - d_alpha3 = 0.0; - d_beta0 = 0.0; - d_beta1 = 0.0; - d_beta2 = 0.0; - d_beta3 = 0.0; -} diff --git a/src/core/system_parameters/gps_cnav_iono.h b/src/core/system_parameters/gps_cnav_iono.h index 12d240d83..6300c7b74 100644 --- a/src/core/system_parameters/gps_cnav_iono.h +++ b/src/core/system_parameters/gps_cnav_iono.h @@ -33,18 +33,18 @@ class Gps_CNAV_Iono { public: - bool valid; //!< Valid flag - // Ionospheric parameters - double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] - double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] - double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] - double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] - double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] - double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] - double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] - double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] + Gps_CNAV_Iono() = default; //!< Default constructor - Gps_CNAV_Iono(); //!< Default constructor + bool valid{}; //!< Valid flag + // Ionospheric parameters + double d_alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] + double d_alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] + double d_alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] + double d_alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] + double d_beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s] + double d_beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] + double d_beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] + double d_beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] template diff --git a/src/core/system_parameters/gps_cnav_navigation_message.cc b/src/core/system_parameters/gps_cnav_navigation_message.cc index 26ae184cb..d2db7d9f0 100644 --- a/src/core/system_parameters/gps_cnav_navigation_message.cc +++ b/src/core/system_parameters/gps_cnav_navigation_message.cc @@ -24,34 +24,8 @@ #include // for std::numeric_limits -void Gps_CNAV_Navigation_Message::reset() -{ - b_flag_ephemeris_1 = false; - b_flag_ephemeris_2 = false; - b_flag_iono_valid = false; - b_flag_utc_valid = false; - - // satellite positions - d_satpos_X = 0.0; - d_satpos_Y = 0.0; - d_satpos_Z = 0.0; - - // info - i_channel_ID = 0; - i_satellite_PRN = 0U; - - // Satellite velocity - d_satvel_X = 0.0; - d_satvel_Y = 0.0; - d_satvel_Z = 0.0; - - d_TOW = 0; -} - - Gps_CNAV_Navigation_Message::Gps_CNAV_Navigation_Message() { - reset(); Gnss_Satellite gnss_satellite_ = Gnss_Satellite(); for (uint32_t prn_ = 1; prn_ < 33; prn_++) { diff --git a/src/core/system_parameters/gps_cnav_navigation_message.h b/src/core/system_parameters/gps_cnav_navigation_message.h index bec82bb48..cb1a2b118 100644 --- a/src/core/system_parameters/gps_cnav_navigation_message.h +++ b/src/core/system_parameters/gps_cnav_navigation_message.h @@ -47,30 +47,29 @@ public: */ Gps_CNAV_Navigation_Message(); - int32_t d_TOW; - bool b_flag_ephemeris_1; - bool b_flag_ephemeris_2; - bool b_flag_iono_valid; //!< If set, it indicates that the ionospheric parameters are filled and are not yet read by the get_iono - bool b_flag_utc_valid; //!< If set, it indicates that the utc parameters are filled and are not yet read by the get_utc_model + int32_t d_TOW{}; + bool b_flag_ephemeris_1{}; + bool b_flag_ephemeris_2{}; + bool b_flag_iono_valid{}; //!< If set, it indicates that the ionospheric parameters are filled and are not yet read by the get_iono + bool b_flag_utc_valid{}; //!< If set, it indicates that the utc parameters are filled and are not yet read by the get_utc_model std::map satelliteBlock; //!< Map that stores to which block the PRN belongs https://www.navcen.uscg.gov/?Do=constellationStatus // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // satellite identification info - int32_t i_channel_ID; - uint32_t i_satellite_PRN; + int32_t i_channel_ID{}; + uint32_t i_satellite_PRN{}; // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] // public functions - void reset(); void decode_page(std::bitset data_bits); @@ -109,9 +108,9 @@ private: int64_t read_navigation_signed(std::bitset bits, const std::vector>& parameter); bool read_navigation_bool(std::bitset bits, const std::vector>& parameter); - Gps_CNAV_Ephemeris ephemeris_record; - Gps_CNAV_Iono iono_record; - Gps_CNAV_Utc_Model utc_model_record; + Gps_CNAV_Ephemeris ephemeris_record{}; + Gps_CNAV_Iono iono_record{}; + Gps_CNAV_Utc_Model utc_model_record{}; }; #endif diff --git a/src/core/system_parameters/gps_cnav_utc_model.cc b/src/core/system_parameters/gps_cnav_utc_model.cc index d473d371c..9df57c3b2 100644 --- a/src/core/system_parameters/gps_cnav_utc_model.cc +++ b/src/core/system_parameters/gps_cnav_utc_model.cc @@ -20,20 +20,6 @@ #include "gps_cnav_utc_model.h" #include -Gps_CNAV_Utc_Model::Gps_CNAV_Utc_Model() -{ - valid = false; - d_A2 = 0.0; - d_A1 = 0.0; - d_A0 = 0.0; - d_t_OT = 0; - i_WN_T = 0; - d_DeltaT_LS = 0; - i_WN_LSF = 0; - i_DN = 0; - d_DeltaT_LSF = 0; -} - double Gps_CNAV_Utc_Model::utc_time(double gpstime_corrected, int32_t i_GPS_week) { diff --git a/src/core/system_parameters/gps_cnav_utc_model.h b/src/core/system_parameters/gps_cnav_utc_model.h index 8ec9daca1..6bae09dc6 100644 --- a/src/core/system_parameters/gps_cnav_utc_model.h +++ b/src/core/system_parameters/gps_cnav_utc_model.h @@ -32,22 +32,22 @@ class Gps_CNAV_Utc_Model { public: - bool valid; - // UTC parameters - double d_A2; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - double d_A1; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - double d_A0; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s] - int32_t d_t_OT; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200K) [s] - int32_t i_WN_T; //!< UTC reference week number [weeks] - int32_t d_DeltaT_LS; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. - int32_t i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks] - int32_t i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days] - int32_t d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] - /*! * Default constructor */ - Gps_CNAV_Utc_Model(); + Gps_CNAV_Utc_Model() = default; + + bool valid{}; + // UTC parameters + double d_A2{}; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] + double d_A1{}; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] + double d_A0{}; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s] + int32_t d_t_OT{}; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200K) [s] + int32_t i_WN_T{}; //!< UTC reference week number [weeks] + int32_t d_DeltaT_LS{}; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. + int32_t i_WN_LSF{}; //!< Week number at the end of which the leap second becomes effective [weeks] + int32_t i_DN{}; //!< Day number (DN) at the end of which the leap second becomes effective [days] + int32_t d_DeltaT_LSF{}; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] /*! * \brief Computes the Coordinated Universal Time (UTC) and diff --git a/src/core/system_parameters/gps_ephemeris.cc b/src/core/system_parameters/gps_ephemeris.cc index c891559fe..df3ce3463 100644 --- a/src/core/system_parameters/gps_ephemeris.cc +++ b/src/core/system_parameters/gps_ephemeris.cc @@ -24,65 +24,15 @@ #include "gnss_satellite.h" #include + Gps_Ephemeris::Gps_Ephemeris() { - i_satellite_PRN = 0U; - d_TOW = 0; - d_Crs = 0.0; - d_Delta_n = 0.0; - d_M_0 = 0.0; - d_Cuc = 0.0; - d_e_eccentricity = 0.0; - d_Cus = 0.0; - d_sqrt_A = 0.0; - d_Toe = 0; - d_Toc = 0; - d_Cic = 0.0; - d_OMEGA0 = 0.0; - d_Cis = 0.0; - d_i_0 = 0.0; - d_Crc = 0.0; - d_OMEGA = 0.0; - d_OMEGA_DOT = 0.0; - d_IDOT = 0.0; - i_code_on_L2 = 0; - i_GPS_week = 0; - b_L2_P_data_flag = false; - i_SV_accuracy = 0; - i_SV_health = 0; - d_IODE_SF2 = 0; - d_IODE_SF3 = 0; - d_TGD = 0.0; // Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - d_IODC = 0; // Issue of Data, Clock - i_AODO = 0; // Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - - b_fit_interval_flag = false; // indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. - d_spare1 = 0.0; - d_spare2 = 0.0; - - d_A_f0 = 0.0; // Coefficient 0 of code phase offset model [s] - d_A_f1 = 0.0; // Coefficient 1 of code phase offset model [s/s] - d_A_f2 = 0.0; // Coefficient 2 of code phase offset model [s/s^2] - - b_integrity_status_flag = false; - b_alert_flag = false; // If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - b_antispoofing_flag = false; // If true, the AntiSpoofing mode is ON in that SV - auto gnss_sat = Gnss_Satellite(); std::string _system("GPS"); for (uint32_t i = 1; i < 33; i++) { satelliteBlock[i] = gnss_sat.what_block(_system, i); } - - d_satClkDrift = 0.0; - d_dtr = 0.0; - d_satpos_X = 0.0; - d_satpos_Y = 0.0; - d_satpos_Z = 0.0; - d_satvel_X = 0.0; - d_satvel_Y = 0.0; - d_satvel_Z = 0.0; } @@ -115,7 +65,6 @@ double Gps_Ephemeris::sv_clock_drift(double transmitTime) // } // d_satClkDrift = d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt); - double dt; dt = check_t(transmitTime - d_Toc); d_satClkDrift = d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt) + sv_clock_relativistic_term(transmitTime); diff --git a/src/core/system_parameters/gps_ephemeris.h b/src/core/system_parameters/gps_ephemeris.h index 84a158385..3beec4780 100644 --- a/src/core/system_parameters/gps_ephemeris.h +++ b/src/core/system_parameters/gps_ephemeris.h @@ -41,43 +41,43 @@ public: */ Gps_Ephemeris(); - uint32_t i_satellite_PRN; // SV PRN NUMBER - int32_t d_TOW; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] - double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - double d_e_eccentricity; //!< Eccentricity [dimensionless] - double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] - int32_t d_Toe; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - int32_t d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] - double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] - double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] - double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] - double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] - int32_t i_code_on_L2; //!< If 1, P code ON in L2; if 2, C/A code ON in L2; - int32_t i_GPS_week; //!< GPS week number, aka WN [week] - bool b_L2_P_data_flag; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel - int32_t i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) - int32_t i_SV_health; - double d_TGD; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - int32_t d_IODC; //!< Issue of Data, Clock - int32_t d_IODE_SF2; //!< Issue of Data, Ephemeris (IODE), subframe 2 - int32_t d_IODE_SF3; //!< Issue of Data, Ephemeris(IODE), subframe 3 - int32_t i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + uint32_t i_satellite_PRN{}; // SV PRN NUMBER + int32_t d_TOW{}; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] + double d_Crs{}; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + double d_Delta_n{}; //!< Mean Motion Difference From Computed Value [semi-circles/s] + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] + double d_Cuc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + double d_e_eccentricity{}; //!< Eccentricity [dimensionless] + double d_Cus{}; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] + double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] + int32_t d_Toe{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] + int32_t d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] + double d_Cic{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_Cis{}; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] + double d_i_0{}; //!< Inclination Angle at Reference Time [semi-circles] + double d_Crc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s] + double d_IDOT{}; //!< Rate of Inclination Angle [semi-circles/s] + int32_t i_code_on_L2{}; //!< If 1, P code ON in L2; if 2, C/A code ON in L2; + int32_t i_GPS_week{}; //!< GPS week number, aka WN [week] + bool b_L2_P_data_flag{}; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel + int32_t i_SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) + int32_t i_SV_health{}; + double d_TGD{}; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] + int32_t d_IODC{}; //!< Issue of Data, Clock + int32_t d_IODE_SF2{}; //!< Issue of Data, Ephemeris (IODE), subframe 2 + int32_t d_IODE_SF3{}; //!< Issue of Data, Ephemeris(IODE), subframe 3 + int32_t i_AODO{}; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - bool b_fit_interval_flag; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. - double d_spare1; - double d_spare2; + bool b_fit_interval_flag{}; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. + double d_spare1{}; + double d_spare2{}; - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] + double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s] + double d_A_f2{}; //!< Coefficient 2 of code phase offset model [s/s^2] // Flags @@ -91,23 +91,23 @@ public: * times the upper bound value of the current broadcast URA index, for more than 5.2 seconds, without an * accompanying alert, is less than 1E-8 per hour. */ - bool b_integrity_status_flag; - bool b_alert_flag; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - bool b_antispoofing_flag; //!< If true, the AntiSpoofing mode is ON in that SV + bool b_integrity_status_flag{}; + bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. + bool b_antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV // clock terms derived from ephemeris data - double d_satClkDrift; //!< GPS clock error - double d_dtr; //!< relativistic clock correction term + double d_satClkDrift{}; //!< GPS clock error + double d_dtr{}; //!< relativistic clock correction term // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] std::map satelliteBlock; //!< Map that stores to which block the PRN belongs https://www.navcen.uscg.gov/?Do=constellationStatus diff --git a/src/core/system_parameters/gps_iono.cc b/src/core/system_parameters/gps_iono.cc deleted file mode 100644 index fbd5dda1e..000000000 --- a/src/core/system_parameters/gps_iono.cc +++ /dev/null @@ -1,35 +0,0 @@ -/*! - * \file gps_iono.cc - * \brief Interface of a GPS IONOSPHERIC MODEL storage - * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix II - * \author Javier Arribas, 2013. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "gps_iono.h" - -Gps_Iono::Gps_Iono() -{ - valid = false; - d_alpha0 = 0.0; - d_alpha1 = 0.0; - d_alpha2 = 0.0; - d_alpha3 = 0.0; - d_beta0 = 0.0; - d_beta1 = 0.0; - d_beta2 = 0.0; - d_beta3 = 0.0; -} diff --git a/src/core/system_parameters/gps_iono.h b/src/core/system_parameters/gps_iono.h index 7d68df41f..11a7e539c 100644 --- a/src/core/system_parameters/gps_iono.h +++ b/src/core/system_parameters/gps_iono.h @@ -33,18 +33,18 @@ class Gps_Iono { public: - bool valid; //!< Valid flag + bool valid{}; //!< Valid flag // Ionospheric parameters - double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] - double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] - double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] - double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] - double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] - double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] - double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] - double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] + double d_alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] + double d_alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] + double d_alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] + double d_alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] + double d_beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s] + double d_beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] + double d_beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] + double d_beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] - Gps_Iono(); //!< Default constructor + Gps_Iono() = default; //!< Default constructor template diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index 37915f883..f1f208792 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -27,120 +27,18 @@ m * \file gps_navigation_message.cc #include // for std::numeric_limits -void Gps_Navigation_Message::reset() +Gps_Navigation_Message::Gps_Navigation_Message() { - b_valid_ephemeris_set_flag = false; - d_TOW = 0; - d_TOW_SF1 = 0; - d_TOW_SF2 = 0; - d_TOW_SF3 = 0; - d_TOW_SF4 = 0; - d_TOW_SF5 = 0; - d_IODE_SF2 = 0; - d_IODE_SF3 = 0; - d_Crs = 0.0; - d_Delta_n = 0.0; - d_M_0 = 0.0; - d_Cuc = 0.0; - d_e_eccentricity = 0.0; - d_Cus = 0.0; - d_sqrt_A = 0.0; - d_Toe = 0; - d_Toc = 0; - d_Cic = 0.0; - d_OMEGA0 = 0.0; - d_Cis = 0.0; - d_i_0 = 0.0; - d_Crc = 0.0; - d_OMEGA = 0.0; - d_OMEGA_DOT = 0.0; - d_IDOT = 0.0; - i_code_on_L2 = 0; - i_GPS_week = 0; - b_L2_P_data_flag = false; - i_SV_accuracy = 0; - i_SV_health = 0; - d_TGD = 0.0; - d_IODC = -1; - i_AODO = 0; - - b_fit_interval_flag = false; - d_spare1 = 0.0; - d_spare2 = 0.0; - - d_A_f0 = 0.0; - d_A_f1 = 0.0; - d_A_f2 = 0.0; - - // clock terms - // d_master_clock=0; - d_dtr = 0.0; - d_satClkCorr = 0.0; - d_satClkDrift = 0.0; - - // satellite positions - d_satpos_X = 0.0; - d_satpos_Y = 0.0; - d_satpos_Z = 0.0; - - // info - i_channel_ID = 0; - i_satellite_PRN = 0U; - - // time synchro - d_subframe_timestamp_ms = 0.0; - - // flags - b_alert_flag = false; - b_integrity_status_flag = false; - b_antispoofing_flag = false; - - // Ionosphere and UTC - flag_iono_valid = false; - flag_utc_model_valid = false; - d_alpha0 = 0.0; - d_alpha1 = 0.0; - d_alpha2 = 0.0; - d_alpha3 = 0.0; - d_beta0 = 0.0; - d_beta1 = 0.0; - d_beta2 = 0.0; - d_beta3 = 0.0; - d_A2 = 0.0; - d_A1 = 0.0; - d_A0 = 0.0; - d_t_OT = 0; - i_WN_T = 0; - d_DeltaT_LS = 0; - i_WN_LSF = 0; - i_DN = 0; - d_DeltaT_LSF = 0; - - // Almanac - i_Toa = 0; - i_WN_A = 0; - for (int32_t i = 1; i < 32; i++) - { - almanacHealth[i] = 0; - } - - // Satellite velocity - d_satvel_X = 0.0; - d_satvel_Y = 0.0; - d_satvel_Z = 0.0; - auto gnss_sat = Gnss_Satellite(); std::string _system("GPS"); for (uint32_t i = 1; i < 33; i++) { satelliteBlock[i] = gnss_sat.what_block(_system, i); } -} - - -Gps_Navigation_Message::Gps_Navigation_Message() -{ - reset(); + for (int32_t i = 1; i < 33; i++) + { + almanacHealth[i] = 0; + } } diff --git a/src/core/system_parameters/gps_navigation_message.h b/src/core/system_parameters/gps_navigation_message.h index 1ba9aa7cc..0f279f059 100644 --- a/src/core/system_parameters/gps_navigation_message.h +++ b/src/core/system_parameters/gps_navigation_message.h @@ -47,57 +47,57 @@ public: */ Gps_Navigation_Message(); - bool b_valid_ephemeris_set_flag; // flag indicating that this ephemeris set have passed the validation check + bool b_valid_ephemeris_set_flag{}; // flag indicating that this ephemeris set have passed the validation check // broadcast orbit 1 - int32_t d_TOW; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] - int32_t d_TOW_SF1; //!< Time of GPS Week from HOW word of Subframe 1 [s] - int32_t d_TOW_SF2; //!< Time of GPS Week from HOW word of Subframe 2 [s] - int32_t d_TOW_SF3; //!< Time of GPS Week from HOW word of Subframe 3 [s] - int32_t d_TOW_SF4; //!< Time of GPS Week from HOW word of Subframe 4 [s] - int32_t d_TOW_SF5; //!< Time of GPS Week from HOW word of Subframe 5 [s] - int32_t d_IODE_SF2; - int32_t d_IODE_SF3; - double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] + int32_t d_TOW{}; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] + int32_t d_TOW_SF1{}; //!< Time of GPS Week from HOW word of Subframe 1 [s] + int32_t d_TOW_SF2{}; //!< Time of GPS Week from HOW word of Subframe 2 [s] + int32_t d_TOW_SF3{}; //!< Time of GPS Week from HOW word of Subframe 3 [s] + int32_t d_TOW_SF4{}; //!< Time of GPS Week from HOW word of Subframe 4 [s] + int32_t d_TOW_SF5{}; //!< Time of GPS Week from HOW word of Subframe 5 [s] + int32_t d_IODE_SF2{}; + int32_t d_IODE_SF3{}; + double d_Crs{}; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + double d_Delta_n{}; //!< Mean Motion Difference From Computed Value [semi-circles/s] + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] // broadcast orbit 2 - double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - double d_e_eccentricity; //!< Eccentricity [dimensionless] - double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_Cuc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + double d_e_eccentricity{}; //!< Eccentricity [dimensionless] + double d_Cus{}; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] + double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] // broadcast orbit 3 - int32_t d_Toe; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - int32_t d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] - double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] + int32_t d_Toe{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] + int32_t d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] + double d_Cic{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_Cis{}; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] // broadcast orbit 4 - double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] - double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] + double d_i_0{}; //!< Inclination Angle at Reference Time [semi-circles] + double d_Crc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s] // broadcast orbit 5 - double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] - int32_t i_code_on_L2; //!< If 1, P code ON in L2; if 2, C/A code ON in L2; - int32_t i_GPS_week; //!< GPS week number, aka WN [week] - bool b_L2_P_data_flag; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel + double d_IDOT{}; //!< Rate of Inclination Angle [semi-circles/s] + int32_t i_code_on_L2{}; //!< If 1, P code ON in L2; if 2, C/A code ON in L2; + int32_t i_GPS_week{}; //!< GPS week number, aka WN [week] + bool b_L2_P_data_flag{}; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel // broadcast orbit 6 - int32_t i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) - int32_t i_SV_health; - double d_TGD; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - int32_t d_IODC; //!< Issue of Data, Clock + int32_t i_SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) + int32_t i_SV_health{}; + double d_TGD{}; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] + int32_t d_IODC{}; //!< Issue of Data, Clock // broadcast orbit 7 - int32_t i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - bool b_fit_interval_flag; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. - double d_spare1; - double d_spare2; - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] + int32_t i_AODO{}; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + bool b_fit_interval_flag{}; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. + double d_spare1{}; + double d_spare2{}; + double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s] + double d_A_f2{}; //!< Coefficient 2 of code phase offset model [s/s^2] // Almanac - int32_t i_Toa; //!< Almanac reference time [s] - int32_t i_WN_A; //!< Modulo 256 of the GPS week number to which the almanac reference time (i_Toa) is referenced + int32_t i_Toa{}; //!< Almanac reference time [s] + int32_t i_WN_A{}; //!< Modulo 256 of the GPS week number to which the almanac reference time (i_Toa) is referenced std::map almanacHealth; //!< Map that stores the health information stored in the almanac std::map satelliteBlock; //!< Map that stores to which block the PRN belongs https://www.navcen.uscg.gov/?Do=constellationStatus @@ -114,58 +114,57 @@ public: * times the upper bound value of the current broadcast URA index, for more than 5.2 seconds, without an * accompanying alert, is less than 1E-8 per hour. */ - bool b_integrity_status_flag; - bool b_alert_flag; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - bool b_antispoofing_flag; //!< If true, the AntiSpoofing mode is ON in that SV + bool b_integrity_status_flag{}; + bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. + bool b_antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV // clock terms - // double d_master_clock; // GPS transmission time - double d_satClkCorr; // GPS clock error - double d_dtr; // relativistic clock correction term - double d_satClkDrift; + // double d_master_clock{}; // GPS transmission time + double d_satClkCorr{}; // GPS clock error + double d_dtr{}; // relativistic clock correction term + double d_satClkDrift{}; // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // satellite identification info - int32_t i_channel_ID; - uint32_t i_satellite_PRN; + int32_t i_channel_ID{}; + uint32_t i_satellite_PRN{}; // time synchro - double d_subframe_timestamp_ms; // [ms] + double d_subframe_timestamp_ms{}; // [ms] // Ionospheric parameters - bool flag_iono_valid; //!< If set, it indicates that the ionospheric parameters are filled (page 18 has arrived and decoded) - double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] - double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] - double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] - double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] - double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] - double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] - double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] - double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] + bool flag_iono_valid{}; //!< If set, it indicates that the ionospheric parameters are filled (page 18 has arrived and decoded) + double d_alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] + double d_alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] + double d_alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] + double d_alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] + double d_beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s] + double d_beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] + double d_beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] + double d_beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] // UTC parameters - bool flag_utc_model_valid; //!< If set, it indicates that the UTC model parameters are filled - double d_A0; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s] - double d_A1; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - double d_A2; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - int32_t d_t_OT; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200K) [s] - int32_t i_WN_T; //!< UTC reference week number [weeks] - int32_t d_DeltaT_LS; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. - int32_t i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks] - int32_t i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days] - int32_t d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] + bool flag_utc_model_valid{}; //!< If set, it indicates that the UTC model parameters are filled + double d_A0{}; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s] + double d_A1{}; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] + double d_A2{}; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] + int32_t d_t_OT{}; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200K) [s] + int32_t i_WN_T{}; //!< UTC reference week number [weeks] + int32_t d_DeltaT_LS{}; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. + int32_t i_WN_LSF{}; //!< Week number at the end of which the leap second becomes effective [weeks] + int32_t i_DN{}; //!< Day number (DN) at the end of which the leap second becomes effective [days] + int32_t d_DeltaT_LSF{}; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] // public functions - void reset(); /*! * \brief Obtain a GPS SV Ephemeris class filled with current SV data diff --git a/src/core/system_parameters/gps_utc_model.cc b/src/core/system_parameters/gps_utc_model.cc index a88b330ad..06545d5cf 100644 --- a/src/core/system_parameters/gps_utc_model.cc +++ b/src/core/system_parameters/gps_utc_model.cc @@ -21,21 +21,6 @@ #include -Gps_Utc_Model::Gps_Utc_Model() -{ - valid = false; - d_A0 = 0.0; - d_A1 = 0.0; - d_A2 = 0.0; - d_t_OT = 0; - i_WN_T = 0; - d_DeltaT_LS = 0; - i_WN_LSF = 0; - i_DN = 0; - d_DeltaT_LSF = 0; -} - - double Gps_Utc_Model::utc_time(double gpstime_corrected, int32_t i_GPS_week) { double t_utc; diff --git a/src/core/system_parameters/gps_utc_model.h b/src/core/system_parameters/gps_utc_model.h index 1bc3aacbe..788c88755 100644 --- a/src/core/system_parameters/gps_utc_model.h +++ b/src/core/system_parameters/gps_utc_model.h @@ -32,22 +32,22 @@ class Gps_Utc_Model { public: - bool valid; - // UTC parameters - double d_A0; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s] - double d_A1; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - double d_A2; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - int32_t d_t_OT; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200K) [s] - int32_t i_WN_T; //!< UTC reference week number [weeks] - int32_t d_DeltaT_LS; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. - int32_t i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks] - int32_t i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days] - int32_t d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] - /*! * Default constructor */ - Gps_Utc_Model(); + Gps_Utc_Model() = default; + + bool valid{}; + // UTC parameters + double d_A0{}; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s] + double d_A1{}; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] + double d_A2{}; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] + int32_t d_t_OT{}; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200K) [s] + int32_t i_WN_T{}; //!< UTC reference week number [weeks] + int32_t d_DeltaT_LS{}; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. + int32_t i_WN_LSF{}; //!< Week number at the end of which the leap second becomes effective [weeks] + int32_t i_DN{}; //!< Day number (DN) at the end of which the leap second becomes effective [days] + int32_t d_DeltaT_LSF{}; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] template /* diff --git a/src/core/system_parameters/sbas_ephemeris.h b/src/core/system_parameters/sbas_ephemeris.h index 69644c9b4..c397a994b 100644 --- a/src/core/system_parameters/sbas_ephemeris.h +++ b/src/core/system_parameters/sbas_ephemeris.h @@ -30,17 +30,20 @@ class Sbas_Ephemeris { public: + Sbas_Ephemeris() = default; + + int i_prn{}; //!< PRN number + int i_t0{}; //!< Reference epoch time (GPST) + double d_tof{}; //!< Time of message frame (GPST) + int i_sv_ura{}; //!< SV accuracy (URA index), not standardized + bool b_sv_do_not_use{}; //!< Health status (false:do not use / true:usable) + double d_pos[3]{}; //!< Satellite position (m) (ECEF) + double d_vel[3]{}; //!< Satellite velocity (m/s) (ECEF) + double d_acc[3]{}; //!< Satellite acceleration (m/s^2) (ECEF) + double d_af0{}; //!< Satellite clock-offset (s) + double d_af1{}; //!< Satellite drift (s/s) + void print(std::ostream &out); - int i_prn; //!< PRN number - int i_t0; //!< Reference epoch time (GPST) - double d_tof; //!< Time of message frame (GPST) - int i_sv_ura; //!< SV accuracy (URA index), not standardized - bool b_sv_do_not_use; //!< Health status (false:do not use / true:usable) - double d_pos[3]; //!< Satellite position (m) (ECEF) - double d_vel[3]; //!< Satellite velocity (m/s) (ECEF) - double d_acc[3]; //!< Satellite acceleration (m/s^2) (ECEF) - double d_af0; //!< Satellite clock-offset (s) - double d_af1; //!< Satellite drift (s/s) }; diff --git a/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc b/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc index a7bf37c6e..e2eb02b65 100644 --- a/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc +++ b/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc @@ -33,8 +33,7 @@ TEST(GlonassGnavNavigationMessageTest, CRCTestSuccess) // Variables declarations in code bool test_result; std::bitset string_bits(std::string("0010100100001100000000000000000000000000110011110001100000000000000001100100011000000")); - Glonass_Gnav_Navigation_Message gnav_nav_message; - gnav_nav_message.reset(); + auto gnav_nav_message = Glonass_Gnav_Navigation_Message(); // Call function to test test_result = gnav_nav_message.CRC_test(string_bits); @@ -55,8 +54,7 @@ TEST(GlonassGnavNavigationMessageTest, CRCTestFailure) bool test_result; // Constructor of string to bitset will flip the order of the bits. Needed for CRC computation std::bitset string_bits(std::string("0111100100001100000000000000000000000000110011110001100000000000000001100100011000000")); - Glonass_Gnav_Navigation_Message gnav_nav_message; - gnav_nav_message.reset(); + auto gnav_nav_message = Glonass_Gnav_Navigation_Message(); // Call function to test test_result = gnav_nav_message.CRC_test(string_bits);