1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-25 22:43:14 +00:00

final release of observables and PVT receiver time fix for 1 ms integer granularity

This commit is contained in:
Javier Arribas 2018-06-05 18:20:55 +02:00
parent c087c8b318
commit 9a5b426059
3 changed files with 28 additions and 19 deletions

View File

@ -592,7 +592,6 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
double current_RX_time = gnss_observables_map.begin()->second.RX_time;
unsigned int current_RX_time_ms = static_cast<unsigned int>(current_RX_time * 1000.0);
//if (std::fabs(current_RX_time - d_rx_time) * 1000.0 >= static_cast<double>(d_output_rate_ms))
if (current_RX_time_ms % d_output_rate_ms == 0)
{
flag_compute_pvt_output = true;
@ -604,14 +603,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
// compute on the fly PVT solution
if (flag_compute_pvt_output == true)
{
// correct the observable to account for the receiver clock offset
// receiver clock correction is disabled to be coherent with the RINEX and RTCM standard
//std::cout << TEXT_RED << "(internal) accumulated RX clock offset: " << d_ls_pvt->get_time_offset_s() << "[s]" << TEXT_RESET << std::endl;
for (std::map<int, Gnss_Synchro>::iterator it = gnss_observables_map.begin(); it != gnss_observables_map.end(); ++it)
{
//todo: check if it has effect to correct the receiver time for the internal pvt solution
// take into account that the RINEX obs with the RX time (integer ms) CAN NOT be corrected to keep the coherence in obs time
it->second.Pseudorange_m = it->second.Pseudorange_m; // - d_ls_pvt->get_time_offset_s() * GPS_C_m_s;
}
//for (std::map<int, Gnss_Synchro>::iterator it = gnss_observables_map.begin(); it != gnss_observables_map.end(); ++it)
// {
//todo: check if it has effect to correct the receiver time for the internal pvt solution
// take into account that the RINEX obs with the RX time (integer ms) CAN NOT be corrected to keep the coherence in obs time
// it->second.Pseudorange_m = it->second.Pseudorange_m - d_ls_pvt->get_time_offset_s() * GPS_C_m_s;
// }
if (d_ls_pvt->get_PVT(gnss_observables_map, false))
{
@ -631,7 +630,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
flag_write_RTCM_1045_output = true;
}
// TODO: RTCM 1077, 1087 and 1097 are not used, so, disable the output rates
// if (current_RX_time_ms % d_rtcm_MT1077_rate_ms==0 and d_rtcm_MT1077_rate_ms != 0)
// {
// last_RTCM_1077_output_time = current_RX_time;
@ -2061,17 +2060,26 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
// DEBUG MESSAGE: Display position in console output
if (d_ls_pvt->is_valid_position() and flag_display_pvt)
{
std::cout << TEXT_BOLD_GREEN << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time())
<< " UTC using " << d_ls_pvt->get_num_valid_observations() << " observations is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude()
std::streamsize ss = std::cout.precision(); //save current precision
std::cout << TEXT_BOLD_GREEN
<< std::fixed
<< "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time())
<< std::setprecision(ss)
<< " UTC using " << d_ls_pvt->get_num_valid_observations()
<< std::setprecision(10)
<< " observations is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude()
<< std::setprecision(3)
<< " [deg], Height= " << d_ls_pvt->get_height() << " [m]" << TEXT_RESET << std::endl;
std::cout << TEXT_RED << "accumulated RX clock offset: " << d_ls_pvt->get_time_offset_s() << "[s]" << TEXT_RESET << std::endl;
boost::posix_time::ptime p_time;
gtime_t rtklib_utc_time = gpst2time(adjgpsweek(d_ls_pvt->gps_ephemeris_map.cbegin()->second.i_GPS_week), d_rx_time);
p_time = boost::posix_time::from_time_t(rtklib_utc_time.time);
p_time += boost::posix_time::microseconds(round(rtklib_utc_time.sec * 1e6));
std::cout << TEXT_MAGENTA << "Observable RX time (GPST) " << boost::posix_time::to_simple_string(p_time) << TEXT_RESET << std::endl;
std::cout << TEXT_RED
<< std::setprecision(10)
<< "RX clock offset: " << d_ls_pvt->get_time_offset_s() << "[s]" << TEXT_RESET << std::endl;
std::cout << std::setprecision(ss);
//boost::posix_time::ptime p_time;
//gtime_t rtklib_utc_time = gpst2time(adjgpsweek(d_ls_pvt->gps_ephemeris_map.cbegin()->second.i_GPS_week), d_rx_time);
//p_time = boost::posix_time::from_time_t(rtklib_utc_time.time);
//p_time += boost::posix_time::microseconds(round(rtklib_utc_time.sec * 1e6));
//std::cout << TEXT_MAGENTA << "Observable RX time (GPST) " << boost::posix_time::to_simple_string(p_time) << TEXT_RESET << std::endl;
LOG(INFO) << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time())

View File

@ -460,7 +460,7 @@ void hybrid_observables_cc::correct_TOW_and_compute_prange(std::vector<Gnss_Sync
else
{
T_rx_TOW_ms += T_rx_step_ms;
//todo: check what happen during the week rollover
//todo: check what happens during the week rollover
if (T_rx_TOW_ms >= 604800000)
{
T_rx_TOW_ms = T_rx_TOW_ms % 604800000;

View File

@ -82,6 +82,7 @@ const int GPS_L1_CA_HISTORY_DEEP = 100;
const int GPS_CA_PREAMBLE_LENGTH_BITS = 8;
const int GPS_CA_PREAMBLE_LENGTH_SYMBOLS = 160;
const double GPS_CA_PREAMBLE_DURATION_S = 0.160;
const int GPS_CA_PREAMBLE_DURATION_MS = 160;
const int GPS_CA_TELEMETRY_RATE_BITS_SECOND = 50; //!< NAV message bit rate [bits/s]
const int GPS_CA_TELEMETRY_SYMBOLS_PER_BIT = 20;
const int GPS_CA_TELEMETRY_RATE_SYMBOLS_SECOND = GPS_CA_TELEMETRY_RATE_BITS_SECOND * GPS_CA_TELEMETRY_SYMBOLS_PER_BIT; //!< NAV message bit rate [symbols/s]