From 40be1e3ad4903d4d8e268d0b1e3c2a67ea495690 Mon Sep 17 00:00:00 2001 From: Antonio Ramos Date: Mon, 5 Mar 2018 18:45:18 +0100 Subject: [PATCH] debug7 --- src/core/system_parameters/GPS_CNAV.h | 4 ++-- .../gps_cnav_navigation_message.cc | 24 ++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/core/system_parameters/GPS_CNAV.h b/src/core/system_parameters/GPS_CNAV.h index fc2239ab6..e703ea4cd 100644 --- a/src/core/system_parameters/GPS_CNAV.h +++ b/src/core/system_parameters/GPS_CNAV.h @@ -120,11 +120,11 @@ const std::vector > CNAV_URA_NED2({{58,3}}); const std::vector > CNAV_TOC({{61,11}}); const double CNAV_TOC_LSB = 300.0; const std::vector > CNAV_AF0({{72,26}}); -const double CNAV_AF0_LSB = TWO_N60; +const double CNAV_AF0_LSB = TWO_N35; const std::vector > CNAV_AF1({{98,20}}); const double CNAV_AF1_LSB = TWO_N48; const std::vector > CNAV_AF2({{118,10}}); -const double CNAV_AF2_LSB = TWO_N35; +const double CNAV_AF2_LSB = TWO_N60; const std::vector > CNAV_TGD({{128,13}}); const double CNAV_TGD_LSB = TWO_N35; const std::vector > CNAV_ISCL1({{141,13}}); diff --git a/src/core/system_parameters/gps_cnav_navigation_message.cc b/src/core/system_parameters/gps_cnav_navigation_message.cc index bc8507c89..7a1479ed0 100644 --- a/src/core/system_parameters/gps_cnav_navigation_message.cc +++ b/src/core/system_parameters/gps_cnav_navigation_message.cc @@ -32,7 +32,6 @@ #include "gps_cnav_navigation_message.h" #include "gnss_satellite.h" -#include void Gps_CNAV_Navigation_Message::reset() @@ -258,20 +257,27 @@ void Gps_CNAV_Navigation_Message::decode_page(std::bitset(read_navigation_signed(data_bits, CNAV_AF2)); ephemeris_record.d_A_f2 = ephemeris_record.d_A_f2 * CNAV_AF2_LSB; //group delays - ephemeris_record.d_TGD = static_cast(read_navigation_signed(data_bits, CNAV_TGD)); - //Check if the grup delay value is not available. See IS-GPS-200, Table 30-IV. + //Check if the grup delay values are not available. See IS-GPS-200, Table 30-IV. //Bit string "1000000000000" is -4096 in 2 complement + ephemeris_record.d_TGD = static_cast(read_navigation_signed(data_bits, CNAV_TGD)); if(ephemeris_record.d_TGD < -4095.9) { ephemeris_record.d_TGD = 0.0; } - ephemeris_record.d_TGD = ephemeris_record.d_TGD * CNAV_TGD_LSB; + ephemeris_record.d_TGD *= CNAV_TGD_LSB; + ephemeris_record.d_ISCL1 = static_cast(read_navigation_signed(data_bits, CNAV_ISCL1)); - ephemeris_record.d_ISCL1 = ephemeris_record.d_ISCL1 * CNAV_ISCL1_LSB; + if(ephemeris_record.d_ISCL1 < -4095.9) { ephemeris_record.d_ISCL1 = 0.0; } + ephemeris_record.d_ISCL1 *= CNAV_ISCL1_LSB; + ephemeris_record.d_ISCL2 = static_cast(read_navigation_signed(data_bits, CNAV_ISCL2)); - ephemeris_record.d_ISCL2 = ephemeris_record.d_ISCL2 * CNAV_ISCL2_LSB; - std::cout << "ISCL2 * c = " << ephemeris_record.d_ISCL2 * 3e8 << " [m]" << std::endl; + if(ephemeris_record.d_ISCL2 < -4095.9) { ephemeris_record.d_ISCL2 = 0.0; } + ephemeris_record.d_ISCL2 *= CNAV_ISCL2_LSB; + ephemeris_record.d_ISCL5I = static_cast(read_navigation_signed(data_bits, CNAV_ISCL5I)); - ephemeris_record.d_ISCL5I = ephemeris_record.d_ISCL5I * CNAV_ISCL5I_LSB; + if(ephemeris_record.d_ISCL5I < -4095.9) { ephemeris_record.d_ISCL5I = 0.0; } + ephemeris_record.d_ISCL5I *= CNAV_ISCL5I_LSB; + ephemeris_record.d_ISCL5Q = static_cast(read_navigation_signed(data_bits, CNAV_ISCL5Q)); - ephemeris_record.d_ISCL5Q = ephemeris_record.d_ISCL5Q * CNAV_ISCL5Q_LSB; + if(ephemeris_record.d_ISCL5Q < -4095.9) { ephemeris_record.d_ISCL5Q = 0.0; } + ephemeris_record.d_ISCL5Q *= CNAV_ISCL5Q_LSB; //iono iono_record.d_alpha0 = static_cast(read_navigation_signed(data_bits, CNAV_ALPHA0)); iono_record.d_alpha0 = iono_record.d_alpha0 * CNAV_ALPHA0_LSB;