From 3d315af2866b2c765f318e40d1b07a894891a7d6 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 22 Oct 2016 13:19:17 +0200 Subject: [PATCH] Fix erros in Galileo message decoding Thanks to Patricia Lopez Torres from Fundacion Ayesa for spotting the errors. --- src/core/system_parameters/Galileo_E1.h | 6 +++--- src/core/system_parameters/galileo_navigation_message.cc | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/system_parameters/Galileo_E1.h b/src/core/system_parameters/Galileo_E1.h index 6c415d778..258a9e954 100644 --- a/src/core/system_parameters/Galileo_E1.h +++ b/src/core/system_parameters/Galileo_E1.h @@ -145,7 +145,7 @@ const std::vector> af1_4_bit({{100,21}}); // const double af1_4_LSB = TWO_N46; const std::vector> af2_4_bit({{121,6}}); const double af2_4_LSB = TWO_N59; -const std::vector> spare_4_bit({{121,6}}); +const std::vector> spare_4_bit({{127,2}}); //last two bits are reserved @@ -187,9 +187,9 @@ const std::vector> Delta_tLS_6_bit({{63,8}}); const std::vector> t0t_6_bit({{71,8}}); const double t0t_6_LSB = 3600; const std::vector> WNot_6_bit({{79,8}}); -const std::vector> WN_LSF_6_bit({{86,8}}); +const std::vector> WN_LSF_6_bit({{87,8}}); const std::vector> DN_6_bit({{95,3}}); -const std::vector> Delta_tLSF_6_bit({{97,8}}); +const std::vector> Delta_tLSF_6_bit({{98,8}}); const std::vector> TOW_6_bit({{106,20}}); diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index 1b1fb8255..f2a8b72ee 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -906,7 +906,7 @@ int Galileo_Navigation_Message::page_jk_decoder(const char *data_jk) break; case 8: /*Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)*/ - IOD_a_8 = static_cast(read_navigation_signed(data_jk_bits, IOD_a_8_bit)); + IOD_a_8 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_8_bit)); DLOG(INFO) << "IOD_a_8= " << IOD_a_8; af0_8 = static_cast(read_navigation_signed(data_jk_bits, af0_8_bit)); af0_8 = af0_8 * af0_8_LSB; @@ -959,11 +959,11 @@ int Galileo_Navigation_Message::page_jk_decoder(const char *data_jk) af1_9 = static_cast(read_navigation_signed(data_jk_bits, af1_9_bit)); af1_9 = af1_9 * af1_9_LSB; DLOG(INFO) << "af1_9= " << af1_9; + E5b_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_9_bit)); + DLOG(INFO) << "E5b_HS_9= " << E5b_HS_9; E1B_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_9_bit)); DLOG(INFO) << "E1B_HS_9= " << E1B_HS_9; - E1B_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_9_bit)); - DLOG(INFO) << "E1B_HS_9= " << E1B_HS_9; - SVID3_9 = static_cast(read_navigation_unsigned(data_jk_bits,SVID3_9_bit)); + SVID3_9 = static_cast(read_navigation_unsigned(data_jk_bits, SVID3_9_bit)); DLOG(INFO) << "SVID3_9= " << SVID3_9; DELTA_A_9 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_9_bit)); DELTA_A_9 = DELTA_A_9 * DELTA_A_9_LSB;