From 525a8ba602fd20f8736db9b420163ecdab015e48 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 22 Jun 2022 12:48:25 +0200 Subject: [PATCH] Fix units of ephemeris angles in comments Fix angle units in retrieval of reduced CED ephemeris --- docs/protobuf/galileo_ephemeris.proto | 22 ++++++++-------- docs/protobuf/gps_ephemeris.proto | 22 ++++++++-------- .../system_parameters/galileo_fnav_message.cc | 14 +++++------ .../system_parameters/galileo_inav_message.cc | 25 +++++++++---------- .../system_parameters/galileo_inav_message.h | 14 +++++------ .../system_parameters/galileo_reduced_ced.cc | 9 +++---- .../system_parameters/galileo_reduced_ced.h | 6 ++--- src/core/system_parameters/gnss_ephemeris.h | 22 ++++++++-------- 8 files changed, 66 insertions(+), 68 deletions(-) diff --git a/docs/protobuf/galileo_ephemeris.proto b/docs/protobuf/galileo_ephemeris.proto index 73b456106..9b05e8dc0 100644 --- a/docs/protobuf/galileo_ephemeris.proto +++ b/docs/protobuf/galileo_ephemeris.proto @@ -6,21 +6,21 @@ package gnss_sdr; message GalileoEphemeris { int32 PRN = 1; // SV ID - double M_0 = 2; // Mean anomaly at reference time [semi-circles] - double delta_n = 3; // Mean motion difference from computed value [semi-circles/sec] + double M_0 = 2; // Mean anomaly at reference time [rad] + double delta_n = 3; // Mean motion difference from computed value [rad/sec] double ecc = 4; // Eccentricity double sqrtA = 5; // Square root of the semi-major axis [meters^1/2] - double OMEGA_0 = 6; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - double i_0 = 7; // Inclination angle at reference time [semi-circles] - double omega = 8; // Argument of perigee [semi-circles] - double OMEGAdot = 9; // Rate of right ascension [semi-circles/sec] - double idot = 10; // Rate of inclination angle [semi-circles/sec] - double Cuc = 11; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - double Cus = 12; // Amplitude of the sine harmonic correction term to the argument of latitude [radians] + double OMEGA_0 = 6; // Longitude of ascending node of orbital plane at weekly epoch [rad] + double i_0 = 7; // Inclination angle at reference time [rad] + double omega = 8; // Argument of perigee [rad] + double OMEGAdot = 9; // Rate of right ascension [rad/sec] + double idot = 10; // Rate of inclination angle [rad/sec] + double Cuc = 11; // Amplitude of the cosine harmonic correction term to the argument of latitude [rad] + double Cus = 12; // Amplitude of the sine harmonic correction term to the argument of latitude [rad] double Crc = 13; // Amplitude of the cosine harmonic correction term to the orbit radius [meters] double Crs = 14; // Amplitude of the sine harmonic correction term to the orbit radius [meters] - double Cic = 15; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians] - double Cis = 16; // Amplitude of the sine harmonic correction term to the angle of inclination [radians] + double Cic = 15; // Amplitude of the cosine harmonic correction term to the angle of inclination [rad] + double Cis = 16; // Amplitude of the sine harmonic correction term to the angle of inclination [rad] int32 toe = 17; // Ephemeris reference time [s] // Clock correction parameters diff --git a/docs/protobuf/gps_ephemeris.proto b/docs/protobuf/gps_ephemeris.proto index 9aa1d6847..f1c4ae54f 100644 --- a/docs/protobuf/gps_ephemeris.proto +++ b/docs/protobuf/gps_ephemeris.proto @@ -6,21 +6,21 @@ package gnss_sdr; message GpsEphemeris { int32 PRN = 1; // SV ID - double M_0 = 2; // Mean anomaly at reference time [semi-circles] - double delta_n = 3; // Mean motion difference from computed value [semi-circles/sec] + double M_0 = 2; // Mean anomaly at reference time [rad] + double delta_n = 3; // Mean motion difference from computed value [rad/sec] double ecc = 4; // Eccentricity double sqrtA = 5; // Square root of the semi-major axis [meters^1/2] - double OMEGA_0 = 6; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - double i_0 = 7; // Inclination angle at reference time [semi-circles] - double omega = 8; // Argument of perigee [semi-circles] - double OMEGAdot = 9; // Rate of right ascension [semi-circles/sec] - double idot = 10; // Rate of inclination angle [semi-circles/sec] - double Cuc = 11; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - double Cus = 12; // Amplitude of the sine harmonic correction term to the argument of latitude [radians] + double OMEGA_0 = 6; // Longitude of ascending node of orbital plane at weekly epoch [rad] + double i_0 = 7; // Inclination angle at reference time [rad] + double omega = 8; // Argument of perigee [rad] + double OMEGAdot = 9; // Rate of right ascension [rad/sec] + double idot = 10; // Rate of inclination angle [rad/sec] + double Cuc = 11; // Amplitude of the cosine harmonic correction term to the argument of latitude [rad] + double Cus = 12; // Amplitude of the sine harmonic correction term to the argument of latitude [rad] double Crc = 13; // Amplitude of the cosine harmonic correction term to the orbit radius [meters] double Crs = 14; // Amplitude of the sine harmonic correction term to the orbit radius [meters] - double Cic = 15; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians] - double Cis = 16; // Amplitude of the sine harmonic correction term to the angle of inclination [radians] + double Cic = 15; // Amplitude of the cosine harmonic correction term to the angle of inclination [rad] + double Cis = 16; // Amplitude of the sine harmonic correction term to the angle of inclination [rad] int32 toe = 17; // Ephemeris reference time [s] // Clock correction parameters diff --git a/src/core/system_parameters/galileo_fnav_message.cc b/src/core/system_parameters/galileo_fnav_message.cc index 572d6f93c..e4fe4a50a 100644 --- a/src/core/system_parameters/galileo_fnav_message.cc +++ b/src/core/system_parameters/galileo_fnav_message.cc @@ -401,15 +401,15 @@ Galileo_Ephemeris Galileo_Fnav_Message::get_ephemeris() const ephemeris.flag_all_ephemeris = flag_all_ephemeris; ephemeris.IOD_ephemeris = IOD_ephemeris; ephemeris.PRN = FNAV_SV_ID_PRN_1; - ephemeris.M_0 = FNAV_M0_2; // Mean anomaly at reference time [semi-circles] - ephemeris.delta_n = FNAV_deltan_3; // Mean motion difference from computed value [semi-circles/sec] + ephemeris.M_0 = FNAV_M0_2; // Mean anomaly at reference time [rad] + ephemeris.delta_n = FNAV_deltan_3; // Mean motion difference from computed value [rad/sec] ephemeris.ecc = FNAV_e_2; // Eccentricity ephemeris.sqrtA = FNAV_a12_2; // Square root of the semi-major axis [meters^1/2] - ephemeris.OMEGA_0 = FNAV_omega0_2; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - ephemeris.i_0 = FNAV_i0_3; // Inclination angle at reference time [semi-circles] - ephemeris.omega = FNAV_w_3; // Argument of perigee [semi-circles] - ephemeris.OMEGAdot = FNAV_omegadot_2; // Rate of right ascension [semi-circles/sec] - ephemeris.idot = FNAV_idot_2; // Rate of inclination angle [semi-circles/sec] + ephemeris.OMEGA_0 = FNAV_omega0_2; // Longitude of ascending node of orbital plane at weekly epoch [rad] + ephemeris.i_0 = FNAV_i0_3; // Inclination angle at reference time [rad] + ephemeris.omega = FNAV_w_3; // Argument of perigee [rad] + ephemeris.OMEGAdot = FNAV_omegadot_2; // Rate of right ascension [rad/sec] + ephemeris.idot = FNAV_idot_2; // Rate of inclination angle [rad/sec] ephemeris.Cuc = FNAV_Cuc_3; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians] ephemeris.Cus = FNAV_Cus_3; // Amplitude of the sine harmonic correction term to the argument of latitude [radians] ephemeris.Crc = FNAV_Crc_3; // Amplitude of the cosine harmonic correction term to the orbit radius [meters] diff --git a/src/core/system_parameters/galileo_inav_message.cc b/src/core/system_parameters/galileo_inav_message.cc index e940e18e9..3c946b487 100644 --- a/src/core/system_parameters/galileo_inav_message.cc +++ b/src/core/system_parameters/galileo_inav_message.cc @@ -428,21 +428,21 @@ Galileo_Ephemeris Galileo_Inav_Message::get_ephemeris() const ephemeris.IOD_ephemeris = IOD_ephemeris; ephemeris.IOD_nav = IOD_nav_1; ephemeris.PRN = SV_ID_PRN_4; - ephemeris.M_0 = M0_1; // Mean anomaly at reference time [semi-circles] - ephemeris.delta_n = delta_n_3; // Mean motion difference from computed value [semi-circles/sec] + ephemeris.M_0 = M0_1; // Mean anomaly at reference time [rad] + ephemeris.delta_n = delta_n_3; // Mean motion difference from computed value [rad/sec] ephemeris.ecc = e_1; // Eccentricity ephemeris.sqrtA = A_1; // Square root of the semi-major axis [meters^1/2] - ephemeris.OMEGA_0 = OMEGA_0_2; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - ephemeris.i_0 = i_0_2; // Inclination angle at reference time [semi-circles] - ephemeris.omega = omega_2; // Argument of perigee [semi-circles] - ephemeris.OMEGAdot = OMEGA_dot_3; // Rate of right ascension [semi-circles/sec] - ephemeris.idot = iDot_2; // Rate of inclination angle [semi-circles/sec] - ephemeris.Cuc = C_uc_3; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - ephemeris.Cus = C_us_3; // Amplitude of the sine harmonic correction term to the argument of latitude [radians] + ephemeris.OMEGA_0 = OMEGA_0_2; // Longitude of ascending node of orbital plane at weekly epoch [rad] + ephemeris.i_0 = i_0_2; // Inclination angle at reference time [rad] + ephemeris.omega = omega_2; // Argument of perigee [rad] + ephemeris.OMEGAdot = OMEGA_dot_3; // Rate of right ascension [rad/sec] + ephemeris.idot = iDot_2; // Rate of inclination angle [rad/sec] + ephemeris.Cuc = C_uc_3; // Amplitude of the cosine harmonic correction term to the argument of latitude [rad] + ephemeris.Cus = C_us_3; // Amplitude of the sine harmonic correction term to the argument of latitude [rad] ephemeris.Crc = C_rc_3; // Amplitude of the cosine harmonic correction term to the orbit radius [meters] ephemeris.Crs = C_rs_3; // Amplitude of the sine harmonic correction term to the orbit radius [meters] - ephemeris.Cic = C_ic_4; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians] - ephemeris.Cis = C_is_4; // Amplitude of the sine harmonic correction term to the angle of inclination [radians] + ephemeris.Cic = C_ic_4; // Amplitude of the cosine harmonic correction term to the angle of inclination [rad] + ephemeris.Cis = C_is_4; // Amplitude of the sine harmonic correction term to the angle of inclination [rad] ephemeris.toe = t0e_1; // Ephemeris reference time [s] // Clock correction parameters @@ -609,8 +609,7 @@ Galileo_Ephemeris Galileo_Inav_Message::get_reduced_ced() const ced.af1red = ced_af1red; Galileo_Ephemeris eph = ced.compute_eph(); - eph.BGD_E1E5a = BGD_E1E5a_5; - eph.BGD_E1E5b = BGD_E1E5b_5; + return eph; } diff --git a/src/core/system_parameters/galileo_inav_message.h b/src/core/system_parameters/galileo_inav_message.h index dc6063ade..1b37e9083 100644 --- a/src/core/system_parameters/galileo_inav_message.h +++ b/src/core/system_parameters/galileo_inav_message.h @@ -248,22 +248,22 @@ private: // 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 M0_1{}; // Mean anomaly at reference time [rad] 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] + double OMEGA_0_2{}; // Longitude of ascending node of orbital plane at weekly epoch [rad] + double i_0_2{}; // Inclination angle at reference time [rad] + double omega_2{}; // Argument of perigee [rad] + double iDot_2{}; // Rate of inclination angle [rad/sec] // Word type 3: Ephemeris (3/4) and SISA int32_t IOD_nav_3{}; int32_t SISA_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 OMEGA_dot_3{}; // Rate of right ascension [rad/sec] + double delta_n_3{}; // Mean motion difference from computed value [rad/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] diff --git a/src/core/system_parameters/galileo_reduced_ced.cc b/src/core/system_parameters/galileo_reduced_ced.cc index 30f316c9f..69ee40bfb 100644 --- a/src/core/system_parameters/galileo_reduced_ced.cc +++ b/src/core/system_parameters/galileo_reduced_ced.cc @@ -28,12 +28,11 @@ Galileo_Ephemeris Galileo_Reduced_CED::compute_eph() const eph.sqrtA = std::sqrt(Ared); // Square root of the semi-major axis [meters^1/2] const double i_nominal = 56.0; // degrees (Table 1 Galileo ICD 2.0) const double i0red = Deltai0red + i_nominal / 180.0; - eph.i_0 = i0red; // Inclination angle at reference time [semi-circles] + eph.i_0 = i0red * GNSS_PI; // Inclination angle at reference time [rad] eph.ecc = std::sqrt(exred * exred + eyred * eyred); // Eccentricity - const double omega_semicircles = std::atan2(eyred, exred) / GNSS_PI; - eph.omega = omega_semicircles; // Argument of perigee [semi-circles] - eph.M_0 = lambda0red - omega_semicircles; // Mean anomaly at reference time [semi-circles] - eph.OMEGA_0 = Omega0red; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles] + eph.omega = std::atan2(eyred, exred); // Argument of perigee [rad] + eph.M_0 = lambda0red * GNSS_PI - eph.omega; // Mean anomaly at reference time [rad] + eph.OMEGA_0 = Omega0red * GNSS_PI; // Longitude of ascending node of orbital plane at weekly epoch [rad] eph.flag_all_ephemeris = true; eph.IOD_ephemeris = IODnav; diff --git a/src/core/system_parameters/galileo_reduced_ced.h b/src/core/system_parameters/galileo_reduced_ced.h index edd20c9c3..0478f7200 100644 --- a/src/core/system_parameters/galileo_reduced_ced.h +++ b/src/core/system_parameters/galileo_reduced_ced.h @@ -49,9 +49,9 @@ public: double DeltaAred{}; //!< Difference between the Reduced CED semi-major axis and the nominal semi-major axis [meters] double exred{}; //!< Reduced CED eccentricity vector component x double eyred{}; //!< Reduced CED eccentricity vector component y - double Deltai0red{}; //!< Difference between the Reduced CED inclination angle at reference time and the nominal inclination [semi-circles] - double Omega0red{}; //!< Reduced CED longitude of ascending node at weekly epoch [semi-circles] - double lambda0red{}; //!< Reduced CED mean argument of latitude [semi-circles] + double Deltai0red{}; //!< Difference between the Reduced CED inclination angle at reference time and the nominal inclination [rad] + double Omega0red{}; //!< Reduced CED longitude of ascending node at weekly epoch [rad] + double lambda0red{}; //!< Reduced CED mean argument of latitude [rad] double af0red{}; //!< Reduced CED satellite clock bias correction coefficient [seconds] double af1red{}; //!< Reduced CED satellite clock drift correction coefficient [seconds/seconds] }; diff --git a/src/core/system_parameters/gnss_ephemeris.h b/src/core/system_parameters/gnss_ephemeris.h index c3f9a8e78..15fc7faac 100644 --- a/src/core/system_parameters/gnss_ephemeris.h +++ b/src/core/system_parameters/gnss_ephemeris.h @@ -68,21 +68,21 @@ public: void satellitePosition(double transmitTime); //!< Computes the ECEF SV coordinates and ECEF velocity uint32_t PRN{}; //!< SV ID - double M_0{}; //!< Mean anomaly at reference time [semi-circles] - double delta_n{}; //!< Mean motion difference from computed value [semi-circles/sec] + double M_0{}; //!< Mean anomaly at reference time [rad] + double delta_n{}; //!< Mean motion difference from computed value [rad/sec] double ecc{}; //!< Eccentricity double sqrtA{}; //!< Square root of the semi-major axis [meters^1/2] - double OMEGA_0{}; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - double i_0{}; //!< Inclination angle at reference time [semi-circles] - double omega{}; //!< Argument of perigee [semi-circles] - double OMEGAdot{}; //!< Rate of right ascension [semi-circles/sec] - double idot{}; //!< Rate of inclination angle [semi-circles/sec] - double Cuc{}; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - double Cus{}; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians] + double OMEGA_0{}; //!< Longitude of ascending node of orbital plane at weekly epoch [rad] + double i_0{}; //!< Inclination angle at reference time [rad] + double omega{}; //!< Argument of perigee [rad] + double OMEGAdot{}; //!< Rate of right ascension [rad/sec] + double idot{}; //!< Rate of inclination angle [rad/sec] + double Cuc{}; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [rad] + double Cus{}; //!< Amplitude of the sine harmonic correction term to the argument of latitude [rad] double Crc{}; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters] double Crs{}; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters] - double Cic{}; //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians] - double Cis{}; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians] + double Cic{}; //!< Amplitude of the cosine harmonic correction term to the angle of inclination [rad] + double Cis{}; //!< Amplitude of the sine harmonic correction term to the angle of inclination [rad] int32_t toe{}; //!< Ephemeris reference time [s] // Clock correction parameters