1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-23 13:33:15 +00:00

bugfix: changing flooring operation for tow update

This commit is contained in:
Damian Miralles 2017-10-26 20:46:16 -06:00
parent 791dfbd6d3
commit 6e223c4277
3 changed files with 31 additions and 12 deletions

View File

@ -355,8 +355,7 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib
if (this->d_flag_preamble == true and d_nav.flag_TOW_new == true)
//update TOW at the preamble instant
{
double dummy_dtow = d_nav.get_TOW() - GLONASS_GNAV_PREAMBLE_DURATION_S;
d_TOW_at_current_symbol = d_nav.gnav_ephemeris.d_TOW - GLONASS_GNAV_PREAMBLE_DURATION_S;
d_TOW_at_current_symbol = floor((d_nav.gnav_ephemeris.d_TOW - GLONASS_GNAV_PREAMBLE_DURATION_S)*1000)/1000;
d_nav.flag_TOW_new = false;
}
@ -382,7 +381,7 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib
}
current_symbol.PRN = this->d_satellite.get_PRN();
current_symbol.TOW_at_current_symbol_s = floor(d_TOW_at_current_symbol*1000.0)/1000.0;
current_symbol.TOW_at_current_symbol_s = d_TOW_at_current_symbol;
current_symbol.TOW_at_current_symbol_s -=delta_t; //Galileo to GPS TOW
if(d_dump == true)

View File

@ -99,10 +99,10 @@ public:
double d_satClkDrift; //!< GLONASS clock error
double d_dtr; //!< relativistic clock correction term
double d_iode; //!< Issue of data, ephemeris (Bit 0-6 of tb)
double d_tau_c;
double d_TOW; // tow of the start of frame
double d_WN; // week number of the start of frame
double d_tod;
double d_tau_c; //!< GLONASST 2 UTC correction (todo) may be eliminated
double d_TOW; //!< GLONASST IN GPST seconds of week
double d_WN; //!< GLONASST IN GPST week number of the start of frame
double d_tod; //!< Time of Day since ephemeris where decoded
template<class Archive>
@ -161,13 +161,22 @@ public:
/*!
* \brief Converts from GLONASST to UTC
* \ param [I]
* \ param offset_time Is the start of day offset to compute the time
* \ returns UTC time as a boost::posix_time::ptime object
* \details The function simply adjust for the 6 hrs offset between GLONASST and UTC
* \param[in] offset_time Is the start of day offset
* \param[in] glot2utc_corr Correction from GLONASST to UTC
* \returns UTC time as a boost::posix_time::ptime object
*/
boost::posix_time::ptime glot_to_utc(const double offset_time, const double glot2utc_corr) const;
/*!
* \brief Converts from GLONASST to GPST
* \details Converts from GLONASST to GPST in time of week (TOW) and week number (WN) format
* \param[in] tod_offset Is the start of day offset
* \param[in] glot2utc_corr Correction from GLONASST to UTC
* \param[in] glot2gpst_corr Correction from GLONASST to GPST
* \param[out] WN Week Number, not in mod(1024) format
* \param[out] TOW Time of Week in seconds of week
*/
void glot_to_gpst(double tod_offset, double glot2utc_corr, double glot2gpst_corr, double * WN, double * TOW) const;
/*!

View File

@ -64,7 +64,10 @@ TEST(GlonassGnavEphemerisTest, ComputeGlonassTime)
ASSERT_TRUE(expected_gtime.seconds() - t.seconds() < FLT_EPSILON );
}
// testing case where calendar
/*!
* \brief Testing conversion from GLONASST to GPST
* \test Tests scenario for N_T when greater than 365 days. Possible values here from 1 to 365*4
*/
TEST(GlonassGnavEphemerisTest, ConvertGlonassT2GpsT1)
{
Glonass_Gnav_Ephemeris gnav_eph;
@ -85,6 +88,10 @@ TEST(GlonassGnavEphemerisTest, ConvertGlonassT2GpsT1)
ASSERT_TRUE(tow - true_week < FLT_EPSILON );
}
/*!
* \brief Testing conversion from GLONASST to GPST
* \test This version tests the conversion for offsets greater than 30 in a leap year
*/
TEST(GlonassGnavEphemerisTest, ConvertGlonassT2GpsT2)
{
Glonass_Gnav_Ephemeris gnav_eph;
@ -105,6 +112,10 @@ TEST(GlonassGnavEphemerisTest, ConvertGlonassT2GpsT2)
ASSERT_TRUE(tow - true_week < FLT_EPSILON );
}
/*!
* \brief Testing conversion from GLONASST to GPST
* \test This version tests the conversion around the vicinity of February 29 days when in leap year
*/
TEST(GlonassGnavEphemerisTest, ConvertGlonassT2GpsT3)
{
Glonass_Gnav_Ephemeris gnav_eph;