From 4b2e5661cfcc3c4485f2bbca0c7cb5b54c21e320 Mon Sep 17 00:00:00 2001 From: joebre Date: Tue, 21 Jan 2025 15:50:01 +0100 Subject: [PATCH] clang-formt Signed-off-by: joebre --- src/core/system_parameters/GPS_L1_CA.h | 2 +- .../gps_navigation_message.cc | 61 +++++++++---------- .../gps_navigation_message.h | 6 +- 3 files changed, 34 insertions(+), 35 deletions(-) diff --git a/src/core/system_parameters/GPS_L1_CA.h b/src/core/system_parameters/GPS_L1_CA.h index 8d4415d51..1f9866d48 100644 --- a/src/core/system_parameters/GPS_L1_CA.h +++ b/src/core/system_parameters/GPS_L1_CA.h @@ -226,7 +226,7 @@ const std::vector> HEALTH_SV23({{253, 6}}); const std::vector> HEALTH_SV24({{259, 6}}); -// Almanac +// Almanac const std::vector> ALM_ECC({{69, 16}}); constexpr double ALM_ECC_LSB = TWO_N21; const std::vector> ALM_TOA({{91, 8}}); diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index 622b14c26..bdae760dd 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -203,29 +203,29 @@ int32_t Gps_Navigation_Message::subframe_decoder(const char* subframe) { if (SV_data_ID != 0) { - a_M_0 = static_cast(read_navigation_signed(subframe_bits, ALM_MZERO)); - a_M_0 = a_M_0 * ALM_MZERO_LSB; - a_ecc = static_cast(read_navigation_unsigned(subframe_bits, ALM_ECC)); - a_ecc = a_ecc *ALM_ECC_LSB; + a_M_0 = static_cast(read_navigation_signed(subframe_bits, ALM_MZERO)); + a_M_0 = a_M_0 * ALM_MZERO_LSB; + a_ecc = static_cast(read_navigation_unsigned(subframe_bits, ALM_ECC)); + a_ecc = a_ecc * ALM_ECC_LSB; a_sqrtA = static_cast(read_navigation_unsigned(subframe_bits, ALM_SQUAREA)); - a_sqrtA = a_sqrtA *ALM_SQUAREA_LSB; + a_sqrtA = a_sqrtA * ALM_SQUAREA_LSB; a_OMEGA_0 = static_cast(read_navigation_signed(subframe_bits, ALM_OMEGAZERO)); a_OMEGA_0 = a_OMEGA_0 * ALM_OMEGAZERO_LSB; a_omega = static_cast(read_navigation_signed(subframe_bits, ALM_OMEGA)); a_omega = a_omega * ALM_OMEGA_LSB; a_OMEGAdot = static_cast(read_navigation_signed(subframe_bits, ALM_OMEGADOT)); - a_OMEGAdot = a_OMEGAdot *ALM_OMEGADOT_LSB; + a_OMEGAdot = a_OMEGAdot * ALM_OMEGADOT_LSB; a_delta_i = static_cast(read_navigation_signed(subframe_bits, ALM_DELTAI)); a_delta_i = a_delta_i * ALM_DELTAI_LSB; a_af0 = static_cast(read_navigation_signed(subframe_bits, ALM_AF0)); - a_af0 = a_af0 * ALM_AF0_LSB; + a_af0 = a_af0 * ALM_AF0_LSB; a_af1 = static_cast(read_navigation_signed(subframe_bits, ALM_AF1)); - a_af1 = a_af1* ALM_AF1_LSB; + a_af1 = a_af1 * ALM_AF1_LSB; a_PRN = SV_page; i_Toa = static_cast(read_navigation_unsigned(subframe_bits, ALM_TOA)); i_Toa = i_Toa * ALM_TOA_LSB; - - flag_almanac_valid = true ; + + flag_almanac_valid = true; } } @@ -302,30 +302,29 @@ int32_t Gps_Navigation_Message::subframe_decoder(const char* subframe) { if (SV_data_ID_5 != 0) { - a_M_0 = static_cast(read_navigation_signed(subframe_bits, ALM_MZERO)); - a_M_0 = a_M_0 * ALM_MZERO_LSB; - a_ecc = static_cast(read_navigation_unsigned(subframe_bits, ALM_ECC)); - a_ecc = a_ecc *ALM_ECC_LSB; + a_M_0 = static_cast(read_navigation_signed(subframe_bits, ALM_MZERO)); + a_M_0 = a_M_0 * ALM_MZERO_LSB; + a_ecc = static_cast(read_navigation_unsigned(subframe_bits, ALM_ECC)); + a_ecc = a_ecc * ALM_ECC_LSB; a_sqrtA = static_cast(read_navigation_unsigned(subframe_bits, ALM_SQUAREA)); - a_sqrtA = a_sqrtA *ALM_SQUAREA_LSB; + a_sqrtA = a_sqrtA * ALM_SQUAREA_LSB; a_OMEGA_0 = static_cast(read_navigation_signed(subframe_bits, ALM_OMEGAZERO)); a_OMEGA_0 = a_OMEGA_0 * ALM_OMEGAZERO_LSB; a_omega = static_cast(read_navigation_signed(subframe_bits, ALM_OMEGA)); a_omega = a_omega * ALM_OMEGA_LSB; a_OMEGAdot = static_cast(read_navigation_signed(subframe_bits, ALM_OMEGADOT)); - a_OMEGAdot = a_OMEGAdot *ALM_OMEGADOT_LSB; + a_OMEGAdot = a_OMEGAdot * ALM_OMEGADOT_LSB; a_delta_i = static_cast(read_navigation_signed(subframe_bits, ALM_DELTAI)); a_delta_i = a_delta_i * ALM_DELTAI_LSB; a_af0 = static_cast(read_navigation_signed(subframe_bits, ALM_AF0)); - a_af0 = a_af0 * ALM_AF0_LSB; + a_af0 = a_af0 * ALM_AF0_LSB; a_af1 = static_cast(read_navigation_signed(subframe_bits, ALM_AF1)); - a_af1 = a_af1* ALM_AF1_LSB; + a_af1 = a_af1 * ALM_AF1_LSB; a_PRN = SV_page_5; i_Toa = static_cast(read_navigation_unsigned(subframe_bits, ALM_TOA)); i_Toa = i_Toa * ALM_TOA_LSB; SV_Health = static_cast(read_navigation_unsigned(subframe_bits, ALM_SVHEALTH)); flag_almanac_valid = true; - } } if (SV_page_5 == 51) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200M) @@ -482,21 +481,21 @@ Gps_Ephemeris Gps_Navigation_Message::get_ephemeris() const Gps_Almanac Gps_Navigation_Message::get_almanac() -{ +{ Gps_Almanac almanac; almanac.SV_health = SV_Health; almanac.PRN = a_PRN; - almanac.delta_i = a_delta_i; + almanac.delta_i = a_delta_i; almanac.toa = i_Toa; - almanac.WNa = i_WN_A; - almanac.M_0 = a_M_0; - almanac.ecc = a_ecc; - almanac.sqrtA = a_sqrtA; - almanac.OMEGA_0 = a_OMEGA_0; - almanac.omega = a_omega; - almanac.OMEGAdot = a_OMEGAdot; - almanac.af0 = a_af0; - almanac.af1 = a_af1; + almanac.WNa = i_WN_A; + almanac.M_0 = a_M_0; + almanac.ecc = a_ecc; + almanac.sqrtA = a_sqrtA; + almanac.OMEGA_0 = a_OMEGA_0; + almanac.omega = a_omega; + almanac.OMEGAdot = a_OMEGAdot; + almanac.af0 = a_af0; + almanac.af1 = a_af1; flag_almanac_valid = false; return almanac; } @@ -561,5 +560,5 @@ bool Gps_Navigation_Message::satellite_validation() bool Gps_Navigation_Message::almanac_validation() { - return flag_almanac_valid && (i_WN_A > 0); + return flag_almanac_valid && (i_WN_A > 0); } diff --git a/src/core/system_parameters/gps_navigation_message.h b/src/core/system_parameters/gps_navigation_message.h index 22f09c7e5..9860778fb 100644 --- a/src/core/system_parameters/gps_navigation_message.h +++ b/src/core/system_parameters/gps_navigation_message.h @@ -21,8 +21,8 @@ #include "GPS_L1_CA.h" -#include "gps_ephemeris.h" #include "gps_almanac.h" +#include "gps_ephemeris.h" #include "gps_iono.h" #include "gps_utc_model.h" #include @@ -199,8 +199,8 @@ private: 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 int32_t SV_Health{}; // Almanac SV healt uint32_t a_PRN; // Almanac PRN double a_delta_i{}; // Inclination Angle at Reference Time (relative to i_0 = 0.30 semi-circles)