1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-09-29 07:20:51 +00:00

Adding proper TOW computation for GLONASS processing

This commit is contained in:
Damian Miralles 2017-08-30 22:44:03 -06:00 committed by Damian Miralles
parent 0caa7fff15
commit e5ffc2b46c
3 changed files with 40 additions and 6 deletions

View File

@ -88,6 +88,31 @@ const double GLONASS_L1_CA_CODE_PERIOD = 0.001; //!< GLONASS L1 C/
const double GLONASS_L1_CA_CHIP_PERIOD = 1.9569e-06; //!< GLONASS L1 C/A chip period [seconds]
const double GLONASS_L1_CA_SYMBOL_RATE_BPS = 1000;
//FIXME Probably should use leap seconds definitions of rtklib
const double GLONASS_LEAP_SECONDS[21][7] = { /* leap seconds (y,m,d,h,m,s,utc-gpst) */
{2019, 1, 1, 0, 0, 0, -20},
{2018, 1, 1, 0, 0, 0, -19},
{2017, 1, 1, 0, 0, 0, -18},
{2015, 7, 1, 0, 0, 0, -17},
{2012, 7, 1, 0, 0, 0, -16},
{2009, 1, 1, 0, 0, 0, -15},
{2006, 1, 1, 0, 0, 0, -14},
{1999, 1, 1, 0, 0, 0, -13},
{1997, 7, 1, 0, 0, 0, -12},
{1996, 1, 1, 0, 0, 0, -11},
{1994, 7, 1, 0, 0, 0, -10},
{1993, 7, 1, 0, 0, 0, -9},
{1992, 7, 1, 0, 0, 0, -8},
{1991, 1, 1, 0, 0, 0, -7},
{1990, 1, 1, 0, 0, 0, -6},
{1988, 1, 1, 0, 0, 0, -5},
{1985, 7, 1, 0, 0, 0, -4},
{1983, 7, 1, 0, 0, 0, -3},
{1982, 7, 1, 0, 0, 0, -2},
{1981, 7, 1, 0, 0, 0, -1},
{}
};
// GLONASS SV's orbital slots PRN = (orbital_slot - 1)
const std::map<unsigned int, int> GLONASS_PRN =
{{ 0, 8,}, //For test

View File

@ -319,11 +319,12 @@ double Glonass_Gnav_Navigation_Message::get_TOW()
TOW = gnav_ephemeris.d_t_k + glot2utcsu + utcsu2utc + gnav_utc_model.d_tau_c + gnav_utc_model.d_tau_gps;
for (i = 0; leaps[i][0]>0; i++)
for (i = 0; GLONASS_LEAP_SECONDS[i][0]>0; i++)
{
if (leaps[i][0] == gnav_ephemeris.d_yr)
if (GLONASS_LEAP_SECONDS[i][0] == gnav_ephemeris.d_yr)
{
TOW -= leaps[i][6];
TOW -= GLONASS_LEAP_SECONDS[i][6];
}
}
return TOW;
}
@ -354,8 +355,6 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
gnav_ephemeris.d_Xn = static_cast<double>(read_navigation_signed(string_bits, X_N)) * TWO_N11;
flag_ephemeris_str_1 = true;
d_TOW = get_TOW();
flag_TOW_set = true;
break;
@ -441,6 +440,14 @@ int Glonass_Gnav_Navigation_Message::string_decoder(std::string frame_string)
// 2). Current year in common form is calculated by the following formula:
gnav_ephemeris.d_yr = 1996 + 4.0*(gnav_utc_model.d_N_4 - 1.0) + (J - 1.0);
gnav_ephemeris.d_tau_c = gnav_utc_model.d_tau_c;
// 3). Set TOW once the year has been defined, it helps with leap second determination
if(flag_ephemeris_str_1 == true)
{
d_TOW = get_TOW();
flag_TOW_set = true;
}
}
break;

View File

@ -156,9 +156,11 @@ public:
/*
* \brief Gets the time of week in GPS Time
* \details This converts from GLONASS Time to GPS Time of Week based on the
* start of frame
*/
double get_TOW();
/*!
* \brief Computes the Coordinated Universal Time (UTC) and returns it in [s]
*/