From fa03077ca19f0207c1d584a84d2f334ba2c7d48e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 14 Dec 2018 00:42:05 +0100 Subject: [PATCH] Improve data types for Galileo navigation data --- src/core/system_parameters/Galileo_E1.h | 8 +-- src/core/system_parameters/Galileo_E5a.h | 8 +-- .../system_parameters/galileo_ephemeris.cc | 20 +++--- .../system_parameters/galileo_ephemeris.h | 28 ++++---- .../system_parameters/galileo_fnav_message.cc | 70 +++++++++---------- .../system_parameters/galileo_fnav_message.h | 36 +++++----- src/core/system_parameters/galileo_iono.cc | 4 +- src/core/system_parameters/galileo_iono.h | 4 +- .../galileo_navigation_message.cc | 64 ++++++++--------- .../galileo_navigation_message.h | 48 ++++++------- .../system_parameters/galileo_utc_model.cc | 16 ++--- .../system_parameters/galileo_utc_model.h | 14 ++-- 12 files changed, 160 insertions(+), 160 deletions(-) diff --git a/src/core/system_parameters/Galileo_E1.h b/src/core/system_parameters/Galileo_E1.h index d6f08a19e..93a814805 100644 --- a/src/core/system_parameters/Galileo_E1.h +++ b/src/core/system_parameters/Galileo_E1.h @@ -103,7 +103,7 @@ const std::vector> PAGE_TYPE_bit({{1, 6}}); /*Page 1 - Word type 1: Ephemeris (1/4)*/ const std::vector> IOD_nav_1_bit({{7, 10}}); const std::vector> T0E_1_bit({{17, 14}}); -const double t0e_1_LSB = 60; +const int32_t t0e_1_LSB = 60; const std::vector> M0_1_bit({{31, 32}}); const double M0_1_LSB = PI_TWO_N31; const std::vector> e_1_bit({{63, 32}}); @@ -151,7 +151,7 @@ const double C_ic_4_LSB = TWO_N29; const std::vector> C_is_4_bit({{39, 16}}); const double C_is_4_LSB = TWO_N29; const std::vector> t0c_4_bit({{55, 14}}); // -const double t0c_4_LSB = 60; +const int32_t t0c_4_LSB = 60; const std::vector> af0_4_bit({{69, 31}}); // const double af0_4_LSB = TWO_N34; const std::vector> af1_4_bit({{100, 21}}); // @@ -198,7 +198,7 @@ const std::vector> A1_6_bit({{39, 24}}); const double A1_6_LSB = TWO_N50; const std::vector> Delta_tLS_6_bit({{63, 8}}); const std::vector> t0t_6_bit({{71, 8}}); -const double t0t_6_LSB = 3600; +const int32_t t0t_6_LSB = 3600; const std::vector> WNot_6_bit({{79, 8}}); const std::vector> WN_LSF_6_bit({{87, 8}}); const std::vector> DN_6_bit({{95, 3}}); @@ -294,7 +294,7 @@ const double A_0G_10_LSB = TWO_N35; const std::vector> A_1G_10_bit({{103, 12}}); const double A_1G_10_LSB = TWO_N51; const std::vector> t_0G_10_bit({{115, 8}}); -const double t_0G_10_LSB = 3600; +const int32_t t_0G_10_LSB = 3600; const std::vector> WN_0G_10_bit({{123, 6}}); diff --git a/src/core/system_parameters/Galileo_E5a.h b/src/core/system_parameters/Galileo_E5a.h index c1cf20350..cf7e56ce1 100644 --- a/src/core/system_parameters/Galileo_E5a.h +++ b/src/core/system_parameters/Galileo_E5a.h @@ -83,7 +83,7 @@ const std::vector> FNAV_PAGE_TYPE_bit({{1, 6}}); const std::vector> FNAV_SV_ID_PRN_1_bit({{7, 6}}); const std::vector> FNAV_IODnav_1_bit({{13, 10}}); const std::vector> FNAV_t0c_1_bit({{23, 14}}); -const double FNAV_t0c_1_LSB = 60; +const int32_t FNAV_t0c_1_LSB = 60; const std::vector> FNAV_af0_1_bit({{37, 31}}); const double FNAV_af0_1_LSB = TWO_N34; const std::vector> FNAV_af1_1_bit({{68, 21}}); @@ -143,7 +143,7 @@ const double FNAV_Crc_3_LSB = TWO_N5; const std::vector> FNAV_Crs_3_bit({{145, 16}}); const double FNAV_Crs_3_LSB = TWO_N5; const std::vector> FNAV_t0e_3_bit({{161, 14}}); -const double FNAV_t0e_3_LSB = 60; +const int32_t FNAV_t0e_3_LSB = 60; const std::vector> FNAV_WN_3_bit({{175, 12}}); const std::vector> FNAV_TOW_3_bit({{187, 20}}); @@ -159,13 +159,13 @@ const std::vector> FNAV_A1_4_bit({{81, 24}}); const double FNAV_A1_4_LSB = TWO_N50; const std::vector> FNAV_deltatls_4_bit({{105, 8}}); const std::vector> FNAV_t0t_4_bit({{113, 8}}); -const double FNAV_t0t_4_LSB = 3600; +const int32_t FNAV_t0t_4_LSB = 3600; const std::vector> FNAV_WNot_4_bit({{121, 8}}); const std::vector> FNAV_WNlsf_4_bit({{129, 8}}); const std::vector> FNAV_DN_4_bit({{137, 3}}); const std::vector> FNAV_deltatlsf_4_bit({{140, 8}}); const std::vector> FNAV_t0g_4_bit({{148, 8}}); -const double FNAV_t0g_4_LSB = 3600; +const int32_t FNAV_t0g_4_LSB = 3600; const std::vector> FNAV_A0g_4_bit({{156, 16}}); const double FNAV_A0g_4_LSB = TWO_N35; const std::vector> FNAV_A1g_4_bit({{172, 12}}); diff --git a/src/core/system_parameters/galileo_ephemeris.cc b/src/core/system_parameters/galileo_ephemeris.cc index 0c1021048..a606b2d20 100644 --- a/src/core/system_parameters/galileo_ephemeris.cc +++ b/src/core/system_parameters/galileo_ephemeris.cc @@ -54,26 +54,26 @@ Galileo_Ephemeris::Galileo_Ephemeris() 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.0; // Ephemeris reference time [s] + t0e_1 = 0; // Ephemeris reference time [s] // Clock correction parameters - t0c_4 = 0.0; // Clock correction data reference Time of Week [sec] + 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.0; - TOW_5 = 0.0; + WN_5 = 0; + TOW_5 = 0; // SV status - SISA_3 = 0.0; - E5a_HS = 0U; - E5b_HS_5 = 0.0; - E1B_HS_5 = 0.0; + SISA_3 = 0; + E5a_HS = 0; + E5b_HS_5 = 0; + E1B_HS_5 = 0; E5a_DVS = false; - E5b_DVS_5 = 0.0; - E1B_DVS_5 = 0.0; + 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] diff --git a/src/core/system_parameters/galileo_ephemeris.h b/src/core/system_parameters/galileo_ephemeris.h index fd844adf2..75d2bdbd9 100644 --- a/src/core/system_parameters/galileo_ephemeris.h +++ b/src/core/system_parameters/galileo_ephemeris.h @@ -67,29 +67,29 @@ public: 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] - double t0e_1; //!< Ephemeris reference time [s] + int32_t t0e_1; //!< Ephemeris reference time [s] /*Clock correction parameters*/ - double 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] + 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*/ - //Not belong to ephemeris set (page 1 to 4) - double WN_5; //!< Week number - double TOW_5; //!< Time of Week + // 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 // SV status - double SISA_3; - uint32_t E5a_HS; //!< E5a Signal Health Status - double E5b_HS_5; //!< E5b Signal Health Status - double E1B_HS_5; //!< E1B Signal Health 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 - double E5b_DVS_5; //!< E5b Data Validity Status - double E1B_DVS_5; //!< E1B 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] diff --git a/src/core/system_parameters/galileo_fnav_message.cc b/src/core/system_parameters/galileo_fnav_message.cc index 660f7c413..c6026c7b7 100644 --- a/src/core/system_parameters/galileo_fnav_message.cc +++ b/src/core/system_parameters/galileo_fnav_message.cc @@ -70,11 +70,11 @@ void Galileo_Fnav_Message::reset() // health and Data validity status FNAV_SV_ID_PRN_1 = 0; FNAV_IODnav_1 = -1; - FNAV_t0c_1 = 0.0; + FNAV_t0c_1 = 0; FNAV_af0_1 = 0.0; FNAV_af1_1 = 0.0; FNAV_af2_1 = 0.0; - FNAV_SISA_1 = 0.0; + FNAV_SISA_1 = 0; FNAV_ai0_1 = 0.0; FNAV_ai1_1 = 0.0; FNAV_ai2_1 = 0.0; @@ -85,8 +85,8 @@ void Galileo_Fnav_Message::reset() FNAV_region5_1 = false; FNAV_BGD_1 = 0.0; FNAV_E5ahs_1 = 0; - FNAV_WN_1 = 0.0; - FNAV_TOW_1 = 0.0; + FNAV_WN_1 = 0; + FNAV_TOW_1 = 0; FNAV_E5advs_1 = false; // WORD 2 Ephemeris (1/3) and GST @@ -97,8 +97,8 @@ void Galileo_Fnav_Message::reset() FNAV_a12_2 = 0.0; FNAV_omega0_2 = 0.0; FNAV_idot_2 = 0.0; - FNAV_WN_2 = 0.0; - FNAV_TOW_2 = 0.0; + FNAV_WN_2 = 0; + FNAV_TOW_2 = 0; // WORD 3 Ephemeris (2/3) and GST FNAV_IODnav_3 = -3; @@ -109,9 +109,9 @@ void Galileo_Fnav_Message::reset() FNAV_Cus_3 = 0.0; FNAV_Crc_3 = 0.0; FNAV_Crs_3 = 0.0; - FNAV_t0e_3 = 0.0; - FNAV_WN_3 = 0.0; - FNAV_TOW_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 @@ -120,17 +120,17 @@ void Galileo_Fnav_Message::reset() FNAV_Cis_4 = 0.0; FNAV_A0_4 = 0.0; FNAV_A1_4 = 0.0; - FNAV_deltatls_4 = 0.0; - FNAV_t0t_4 = 0.0; - FNAV_WNot_4 = 0.0; - FNAV_WNlsf_4 = 0.0; - FNAV_DN_4 = 0.0; - FNAV_deltatlsf_4 = 0.0; - FNAV_t0g_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.0; - FNAV_TOW_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; @@ -238,7 +238,7 @@ void Galileo_Fnav_Message::decode_page(const std::string& data) case 1: // SVID, Clock correction, SISA, Ionospheric correction, BGD, GST, Signal health and Data validity status FNAV_SV_ID_PRN_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_SV_ID_PRN_1_bit)); FNAV_IODnav_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODnav_1_bit)); - FNAV_t0c_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0c_1_bit)); + FNAV_t0c_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0c_1_bit)); FNAV_t0c_1 *= FNAV_t0c_1_LSB; FNAV_af0_1 = static_cast(read_navigation_signed(data_bits, FNAV_af0_1_bit)); FNAV_af0_1 *= FNAV_af0_1_LSB; @@ -246,7 +246,7 @@ void Galileo_Fnav_Message::decode_page(const std::string& data) FNAV_af1_1 *= FNAV_af1_1_LSB; FNAV_af2_1 = static_cast(read_navigation_signed(data_bits, FNAV_af2_1_bit)); FNAV_af2_1 *= FNAV_af2_1_LSB; - FNAV_SISA_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_SISA_1_bit)); + FNAV_SISA_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_SISA_1_bit)); FNAV_ai0_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_ai0_1_bit)); FNAV_ai0_1 *= FNAV_ai0_1_LSB; FNAV_ai1_1 = static_cast(read_navigation_signed(data_bits, FNAV_ai1_1_bit)); @@ -261,8 +261,8 @@ void Galileo_Fnav_Message::decode_page(const std::string& data) FNAV_BGD_1 = static_cast(read_navigation_signed(data_bits, FNAV_BGD_1_bit)); FNAV_BGD_1 *= FNAV_BGD_1_LSB; FNAV_E5ahs_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_1_bit)); - FNAV_WN_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_1_bit)); - FNAV_TOW_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_1_bit)); + FNAV_WN_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_1_bit)); + FNAV_TOW_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_1_bit)); FNAV_E5advs_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5advs_1_bit)); flag_TOW_1 = true; flag_TOW_set = true; @@ -282,8 +282,8 @@ void Galileo_Fnav_Message::decode_page(const std::string& data) FNAV_omega0_2 *= FNAV_omega0_2_LSB; FNAV_idot_2 = static_cast(read_navigation_signed(data_bits, FNAV_idot_2_bit)); FNAV_idot_2 *= FNAV_idot_2_LSB; - FNAV_WN_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_2_bit)); - FNAV_TOW_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_2_bit)); + FNAV_WN_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_2_bit)); + FNAV_TOW_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_2_bit)); flag_TOW_2 = true; flag_TOW_set = true; flag_ephemeris_1 = true; @@ -304,10 +304,10 @@ void Galileo_Fnav_Message::decode_page(const std::string& data) FNAV_Crc_3 *= FNAV_Crc_3_LSB; FNAV_Crs_3 = static_cast(read_navigation_signed(data_bits, FNAV_Crs_3_bit)); FNAV_Crs_3 *= FNAV_Crs_3_LSB; - FNAV_t0e_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0e_3_bit)); + FNAV_t0e_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0e_3_bit)); FNAV_t0e_3 *= FNAV_t0e_3_LSB; - FNAV_WN_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_3_bit)); - FNAV_TOW_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_3_bit)); + FNAV_WN_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_3_bit)); + FNAV_TOW_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_3_bit)); flag_TOW_3 = true; flag_TOW_set = true; flag_ephemeris_2 = true; @@ -323,20 +323,20 @@ void Galileo_Fnav_Message::decode_page(const std::string& data) FNAV_A1_4 = static_cast(read_navigation_signed(data_bits, FNAV_A1_4_bit)); FNAV_A1_4 *= FNAV_A1_4_LSB; FNAV_deltatls_4 = static_cast(read_navigation_signed(data_bits, FNAV_deltatls_4_bit)); - FNAV_t0t_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0t_4_bit)); + FNAV_t0t_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0t_4_bit)); FNAV_t0t_4 *= FNAV_t0t_4_LSB; - FNAV_WNot_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNot_4_bit)); - FNAV_WNlsf_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNlsf_4_bit)); - FNAV_DN_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_DN_4_bit)); - FNAV_deltatlsf_4 = static_cast(read_navigation_signed(data_bits, FNAV_deltatlsf_4_bit)); - FNAV_t0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0g_4_bit)); + FNAV_WNot_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNot_4_bit)); + FNAV_WNlsf_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNlsf_4_bit)); + FNAV_DN_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_DN_4_bit)); + FNAV_deltatlsf_4 = static_cast(read_navigation_signed(data_bits, FNAV_deltatlsf_4_bit)); + FNAV_t0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0g_4_bit)); FNAV_t0g_4 *= FNAV_t0g_4_LSB; FNAV_A0g_4 = static_cast(read_navigation_signed(data_bits, FNAV_A0g_4_bit)); FNAV_A0g_4 *= FNAV_A0g_4_LSB; FNAV_A1g_4 = static_cast(read_navigation_signed(data_bits, FNAV_A1g_4_bit)); FNAV_A1g_4 *= FNAV_A1g_4_LSB; - FNAV_WN0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN0g_4_bit)); - FNAV_TOW_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_4_bit)); + FNAV_WN0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN0g_4_bit)); + FNAV_TOW_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_4_bit)); flag_TOW_4 = true; flag_TOW_set = true; flag_ephemeris_3 = true; diff --git a/src/core/system_parameters/galileo_fnav_message.h b/src/core/system_parameters/galileo_fnav_message.h index ff69df958..1bb0ae31d 100644 --- a/src/core/system_parameters/galileo_fnav_message.h +++ b/src/core/system_parameters/galileo_fnav_message.h @@ -95,11 +95,11 @@ public: // health and Data validity status int32_t FNAV_SV_ID_PRN_1; int32_t FNAV_IODnav_1; - double FNAV_t0c_1; + int32_t FNAV_t0c_1; double FNAV_af0_1; double FNAV_af1_1; double FNAV_af2_1; - double FNAV_SISA_1; + int32_t FNAV_SISA_1; double FNAV_ai0_1; double FNAV_ai1_1; double FNAV_ai2_1; @@ -110,8 +110,8 @@ public: bool FNAV_region5_1; double FNAV_BGD_1; int32_t FNAV_E5ahs_1; - double FNAV_WN_1; - double FNAV_TOW_1; + int32_t FNAV_WN_1; + int32_t FNAV_TOW_1; bool FNAV_E5advs_1; // WORD 2 Ephemeris (1/3) and GST @@ -122,8 +122,8 @@ public: double FNAV_a12_2; double FNAV_omega0_2; double FNAV_idot_2; - double FNAV_WN_2; - double FNAV_TOW_2; + int32_t FNAV_WN_2; + int32_t FNAV_TOW_2; // WORD 3 Ephemeris (2/3) and GST int32_t FNAV_IODnav_3; @@ -134,9 +134,9 @@ public: double FNAV_Cus_3; double FNAV_Crc_3; double FNAV_Crs_3; - double FNAV_t0e_3; - double FNAV_WN_3; - double FNAV_TOW_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 @@ -145,17 +145,17 @@ public: double FNAV_Cis_4; double FNAV_A0_4; double FNAV_A1_4; - double FNAV_deltatls_4; - double FNAV_t0t_4; - double FNAV_WNot_4; - double FNAV_WNlsf_4; - double FNAV_DN_4; - double FNAV_deltatlsf_4; - double FNAV_t0g_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; - double FNAV_WN0g_4; - double FNAV_TOW_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; diff --git a/src/core/system_parameters/galileo_iono.cc b/src/core/system_parameters/galileo_iono.cc index d79b2a319..440abbc44 100644 --- a/src/core/system_parameters/galileo_iono.cc +++ b/src/core/system_parameters/galileo_iono.cc @@ -45,6 +45,6 @@ Galileo_Iono::Galileo_Iono() Region4_flag_5 = false; // Ionospheric Disturbance Flag for region 4 Region5_flag_5 = false; // Ionospheric Disturbance Flag for region 5 - TOW_5 = 0.0; - WN_5 = 0.0; + 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 90c861c12..ab36199c0 100644 --- a/src/core/system_parameters/galileo_iono.h +++ b/src/core/system_parameters/galileo_iono.h @@ -55,8 +55,8 @@ public: bool Region5_flag_5; //!< Ionospheric Disturbance Flag for region 5 // from page 5 (UTC) to have a timestamp - double TOW_5; //!< UTC data reference Time of Week [s] - double WN_5; //!< UTC data reference Week number [week] + int32_t TOW_5; //!< UTC data reference Time of Week [s] + int32_t WN_5; //!< UTC data reference Week number [week] /*! * Default constructor diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index 51c28068d..650ed88bd 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -74,7 +74,7 @@ void Galileo_Navigation_Message::reset() // Word type 1: Ephemeris (1/4) IOD_nav_1 = 0; - t0e_1 = 0.0; + t0e_1 = 0; M0_1 = 0.0; e_1 = 0.0; A_1 = 0.0; @@ -94,7 +94,7 @@ void Galileo_Navigation_Message::reset() 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.0; // + SISA_3 = 0; // // Word type 4: Ephemeris (4/4) and Clock correction parameter/ IOD_nav_4 = 0; @@ -103,7 +103,7 @@ void Galileo_Navigation_Message::reset() C_is_4 = 0.0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians] // Clock correction parameters - t0c_4 = 0.0; + t0c_4 = 0; af0_4 = 0.0; af1_4 = 0.0; af2_4 = 0.0; @@ -129,20 +129,20 @@ void Galileo_Navigation_Message::reset() E1B_DVS_5 = 0; // GST - WN_5 = 0.0; - TOW_5 = 0.0; + 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.0; - t0t_6 = 0.0; - WNot_6 = 0.0; + Delta_tLS_6 = 0; + t0t_6 = 0; + WNot_6 = 0; WN_LSF_6 = 0; DN_6 = 0; - Delta_tLSF_6 = 0.0; - TOW_6 = 0.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; @@ -199,13 +199,13 @@ void Galileo_Navigation_Message::reset() // GST-GPS A_0G_10 = 0.0; A_1G_10 = 0.0; - t_0G_10 = 0.0; - WN_0G_10 = 0.0; + t_0G_10 = 0; + WN_0G_10 = 0; // Word type 0: I/NAV Spare Word - Time_0 = 0.0; - WN_0 = 0.0; - TOW_0 = 0.0; + Time_0 = 0; + WN_0 = 0; + TOW_0 = 0; flag_TOW_6 = false; @@ -653,7 +653,7 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) case 1: // Word type 1: Ephemeris (1/4) IOD_nav_1 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_nav_1_bit)); DLOG(INFO) << "IOD_nav_1= " << IOD_nav_1; - t0e_1 = static_cast(read_navigation_unsigned(data_jk_bits, T0E_1_bit)); + t0e_1 = static_cast(read_navigation_unsigned(data_jk_bits, T0E_1_bit)); t0e_1 = t0e_1 * t0e_1_LSB; DLOG(INFO) << "t0e_1= " << t0e_1; M0_1 = static_cast(read_navigation_signed(data_jk_bits, M0_1_bit)); @@ -709,7 +709,7 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) C_rs_3 = static_cast(read_navigation_signed(data_jk_bits, C_rs_3_bit)); C_rs_3 = C_rs_3 * C_rs_3_LSB; DLOG(INFO) << "C_rs_3= " << C_rs_3; - SISA_3 = static_cast(read_navigation_unsigned(data_jk_bits, SISA_3_bit)); + SISA_3 = static_cast(read_navigation_unsigned(data_jk_bits, SISA_3_bit)); DLOG(INFO) << "SISA_3= " << SISA_3; flag_ephemeris_3 = true; DLOG(INFO) << "flag_tow_set" << flag_TOW_set; @@ -727,7 +727,7 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) C_is_4 = C_is_4 * C_is_4_LSB; DLOG(INFO) << "C_is_4= " << C_is_4; // Clock correction parameters - t0c_4 = static_cast(read_navigation_unsigned(data_jk_bits, t0c_4_bit)); + t0c_4 = static_cast(read_navigation_unsigned(data_jk_bits, t0c_4_bit)); t0c_4 = t0c_4 * t0c_4_LSB; DLOG(INFO) << "t0c_4= " << t0c_4; af0_4 = static_cast(read_navigation_signed(data_jk_bits, af0_4_bit)); @@ -777,14 +777,14 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) DLOG(INFO) << "E5b_HS_5= " << E5b_HS_5; E1B_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_5_bit)); DLOG(INFO) << "E1B_HS_5= " << E1B_HS_5; - E5b_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_DVS_5_bit)); + E5b_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_DVS_5_bit)); DLOG(INFO) << "E5b_DVS_5= " << E5b_DVS_5; - E1B_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_DVS_5_bit)); + E1B_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_DVS_5_bit)); DLOG(INFO) << "E1B_DVS_5= " << E1B_DVS_5; // GST - WN_5 = static_cast(read_navigation_unsigned(data_jk_bits, WN_5_bit)); + WN_5 = static_cast(read_navigation_unsigned(data_jk_bits, WN_5_bit)); DLOG(INFO) << "WN_5= " << WN_5; - TOW_5 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_5_bit)); + TOW_5 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_5_bit)); DLOG(INFO) << "TOW_5= " << TOW_5; flag_TOW_5 = true; // set to false externally spare_5 = static_cast(read_navigation_unsigned(data_jk_bits, spare_5_bit)); @@ -801,20 +801,20 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) A1_6 = static_cast(read_navigation_signed(data_jk_bits, A1_6_bit)); A1_6 = A1_6 * A1_6_LSB; DLOG(INFO) << "A1_6= " << A1_6; - Delta_tLS_6 = static_cast(read_navigation_signed(data_jk_bits, Delta_tLS_6_bit)); + Delta_tLS_6 = static_cast(read_navigation_signed(data_jk_bits, Delta_tLS_6_bit)); DLOG(INFO) << "Delta_tLS_6= " << Delta_tLS_6; - t0t_6 = static_cast(read_navigation_unsigned(data_jk_bits, t0t_6_bit)); + t0t_6 = static_cast(read_navigation_unsigned(data_jk_bits, t0t_6_bit)); t0t_6 = t0t_6 * t0t_6_LSB; DLOG(INFO) << "t0t_6= " << t0t_6; - WNot_6 = static_cast(read_navigation_unsigned(data_jk_bits, WNot_6_bit)); + WNot_6 = static_cast(read_navigation_unsigned(data_jk_bits, WNot_6_bit)); DLOG(INFO) << "WNot_6= " << WNot_6; WN_LSF_6 = static_cast(read_navigation_unsigned(data_jk_bits, WN_LSF_6_bit)); DLOG(INFO) << "WN_LSF_6= " << WN_LSF_6; DN_6 = static_cast(read_navigation_unsigned(data_jk_bits, DN_6_bit)); DLOG(INFO) << "DN_6= " << DN_6; - Delta_tLSF_6 = static_cast(read_navigation_signed(data_jk_bits, Delta_tLSF_6_bit)); + Delta_tLSF_6 = static_cast(read_navigation_signed(data_jk_bits, Delta_tLSF_6_bit)); DLOG(INFO) << "Delta_tLSF_6= " << Delta_tLSF_6; - TOW_6 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_6_bit)); + TOW_6 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_6_bit)); DLOG(INFO) << "TOW_6= " << TOW_6; flag_TOW_6 = true; // set to false externally flag_utc_model = true; // set to false externally @@ -963,11 +963,11 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) A_1G_10 = A_1G_10 * A_1G_10_LSB; flag_GGTO_2 = true; DLOG(INFO) << "A_1G_10= " << A_1G_10; - t_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, t_0G_10_bit)); + t_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, t_0G_10_bit)); t_0G_10 = t_0G_10 * t_0G_10_LSB; flag_GGTO_3 = true; DLOG(INFO) << "t_0G_10= " << t_0G_10; - WN_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0G_10_bit)); + WN_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0G_10_bit)); flag_GGTO_4 = true; DLOG(INFO) << "WN_0G_10= " << WN_0G_10; flag_almanac_4 = true; @@ -975,11 +975,11 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) break; case 0: // Word type 0: I/NAV Spare Word - Time_0 = static_cast(read_navigation_unsigned(data_jk_bits, Time_0_bit)); + Time_0 = static_cast(read_navigation_unsigned(data_jk_bits, Time_0_bit)); DLOG(INFO) << "Time_0= " << Time_0; - WN_0 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0_bit)); + WN_0 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0_bit)); DLOG(INFO) << "WN_0= " << WN_0; - TOW_0 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_0_bit)); + TOW_0 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_0_bit)); DLOG(INFO) << "TOW_0= " << TOW_0; DLOG(INFO) << "flag_tow_set" << flag_TOW_set; break; diff --git a/src/core/system_parameters/galileo_navigation_message.h b/src/core/system_parameters/galileo_navigation_message.h index 302c38424..cf1eb0a0f 100644 --- a/src/core/system_parameters/galileo_navigation_message.h +++ b/src/core/system_parameters/galileo_navigation_message.h @@ -93,7 +93,7 @@ public: // Word type 1: Ephemeris (1/4) int32_t IOD_nav_1; //!< IOD_nav page 1 - double t0e_1; //!< Ephemeris reference time [s] + 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] @@ -113,7 +113,7 @@ public: 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 SISA_3; + int32_t SISA_3; // Word type 4: Ephemeris (4/4) and Clock correction parameters*/ int32_t IOD_nav_4; // @@ -122,10 +122,10 @@ public: double C_is_4; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians] // Clock correction parameters - double 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] + 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*/ @@ -143,26 +143,26 @@ public: 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 - int32_t E5b_DVS_5; //!< E5b Data Validity Status - int32_t 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 - double WN_5; - double TOW_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; - double Delta_tLS_6; - double t0t_6; - double WNot_6; + int32_t Delta_tLS_6; + int32_t t0t_6; + int32_t WNot_6; int32_t WN_LSF_6; int32_t DN_6; - double Delta_tLSF_6; - double TOW_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; @@ -217,15 +217,15 @@ public: 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 - double t_0G_10; //!< Reference time for Galileo/GPS Time Offset (GGTO) data - double 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 - double Time_0; - double WN_0; - double TOW_0; + int32_t Time_0; + int32_t WN_0; + int32_t TOW_0; double Galileo_satClkDrift; double Galileo_dtr; //!< Relativistic clock correction term diff --git a/src/core/system_parameters/galileo_utc_model.cc b/src/core/system_parameters/galileo_utc_model.cc index e51c7c2f2..96ca127e7 100644 --- a/src/core/system_parameters/galileo_utc_model.cc +++ b/src/core/system_parameters/galileo_utc_model.cc @@ -36,28 +36,28 @@ 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.0; - t0t_6 = 0.0; - WNot_6 = 0.0; + Delta_tLS_6 = 0; + t0t_6 = 0; + WNot_6 = 0; WN_LSF_6 = 0; DN_6 = 0; - Delta_tLSF_6 = 0.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.0; - WN_0G_10 = 0.0; + t_0G_10 = 0; + WN_0G_10 = 0; } -double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int WN) +double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int32_t WN) { double t_Utc; double t_Utc_daytime; double Delta_t_Utc = 0; // Determine if the effectivity time of the leap second event is in the past - int weeksToLeapSecondEvent = WN_LSF_6 - (WN % 256); + int32_t weeksToLeapSecondEvent = WN_LSF_6 - (WN % 256); if ((weeksToLeapSecondEvent) >= 0) // is not in the past { diff --git a/src/core/system_parameters/galileo_utc_model.h b/src/core/system_parameters/galileo_utc_model.h index f91b3ded1..7e9e328b0 100644 --- a/src/core/system_parameters/galileo_utc_model.h +++ b/src/core/system_parameters/galileo_utc_model.h @@ -47,22 +47,22 @@ public: // Word type 6: GST-UTC conversion parameters double A0_6; double A1_6; - double Delta_tLS_6; - double t0t_6; //!< UTC data reference Time of Week [s] - double WNot_6; //!< UTC data reference Week number [week] + 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; - double Delta_tLSF_6; + int32_t Delta_tLSF_6; bool flag_utc_model; // GPS to Galileo GST conversion parameters double A_0G_10; double A_1G_10; - double t_0G_10; - double WN_0G_10; + int32_t t_0G_10; + int32_t WN_0G_10; //double TOW_6; - double GST_to_UTC_time(double t_e, int WN); //!< GST-UTC Conversion Algorithm and Parameters + double GST_to_UTC_time(double t_e, int32_t WN); //!< GST-UTC Conversion Algorithm and Parameters /*! * Default constructor */