1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-09-05 04:17:58 +00:00

fixing IONO and UTC reading

This commit is contained in:
Carles Fernandez
2015-03-01 14:49:55 +01:00
parent 9dd69c0ac9
commit 1176361e79
3 changed files with 36 additions and 31 deletions

View File

@@ -77,7 +77,7 @@ GpsL1CaTelemetryDecoder::GpsL1CaTelemetryDecoder(ConfigurationInterface* configu
telemetry_decoder_->set_utc_model_queue(&global_gps_utc_model_queue); telemetry_decoder_->set_utc_model_queue(&global_gps_utc_model_queue);
//decimation factor //decimation factor
int decimation_factor=configuration->property(role + ".decimation_factor", 1); int decimation_factor = configuration->property(role + ".decimation_factor", 1);
telemetry_decoder_->set_decimation(decimation_factor); telemetry_decoder_->set_decimation(decimation_factor);
DLOG(INFO) << "global navigation message queue assigned to telemetry_decoder ("<< telemetry_decoder_->unique_id() << ")"; DLOG(INFO) << "global navigation message queue assigned to telemetry_decoder ("<< telemetry_decoder_->unique_id() << ")";
} }
@@ -97,16 +97,16 @@ void GpsL1CaTelemetryDecoder::set_satellite(Gnss_Satellite satellite)
void GpsL1CaTelemetryDecoder::connect(gr::top_block_sptr top_block) void GpsL1CaTelemetryDecoder::connect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
// Nothing to connect internally // Nothing to connect internally
DLOG(INFO) << "nothing to connect internally"; DLOG(INFO) << "nothing to connect internally";
} }
void GpsL1CaTelemetryDecoder::disconnect(gr::top_block_sptr top_block) void GpsL1CaTelemetryDecoder::disconnect(gr::top_block_sptr top_block)
{ {
if(top_block) { /* top_block is not null */}; if(top_block) { /* top_block is not null */};
// Nothing to disconnect // Nothing to disconnect
} }

View File

@@ -130,7 +130,7 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc(
d_TOW_at_Preamble = 0; d_TOW_at_Preamble = 0;
d_TOW_at_current_symbol = 0; d_TOW_at_current_symbol = 0;
flag_TOW_set = false; flag_TOW_set = false;
d_average_count=0; d_average_count = 0;
//set_history(d_samples_per_bit*8); // At least a history of 8 bits are needed to correlate with the preamble //set_history(d_samples_per_bit*8); // At least a history of 8 bits are needed to correlate with the preamble
} }
@@ -235,7 +235,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
LOG(INFO) << "Lost of frame sync SAT " << this->d_satellite << " preamble_diff= " << preamble_diff; LOG(INFO) << "Lost of frame sync SAT " << this->d_satellite << " preamble_diff= " << preamble_diff;
d_stat = 0; //lost of frame sync d_stat = 0; //lost of frame sync
d_flag_frame_sync = false; d_flag_frame_sync = false;
flag_TOW_set=false; flag_TOW_set = false;
} }
} }
} }
@@ -302,11 +302,11 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
current_synchro_data = in[0][0]; current_synchro_data = in[0][0];
//2. Add the telemetry decoder information //2. Add the telemetry decoder information
if (this->d_flag_preamble == true and d_GPS_FSM.d_nav.d_TOW > 0) if (this->d_flag_preamble == true and d_GPS_FSM.d_nav.d_TOW > 0)
//update TOW at the preamble instant (todo: check for valid d_TOW) //update TOW at the preamble instant (todo: check for valid d_TOW)
// JAVI: 30/06/2014 // JAVI: 30/06/2014
// TOW, in GPS, is referred to the START of the SUBFRAME, that is, THE FIRST SYMBOL OF THAT SUBFRAME, NOT THE PREAMBLE. // TOW, in GPS, is referred to the START of the SUBFRAME, that is, THE FIRST SYMBOL OF THAT SUBFRAME, NOT THE PREAMBLE.
// thus, no correction should be done. d_TOW_at_Preamble should be renamed to d_TOW_at_subframe_start. // thus, no correction should be done. d_TOW_at_Preamble should be renamed to d_TOW_at_subframe_start.
// Sice we detected the preable, then, we are in the last symbol of that preamble, or just at the start of the first subframe symbol. // Sice we detected the preable, then, we are in the last symbol of that preamble, or just at the start of the first subframe symbol.
{ {
d_TOW_at_Preamble = d_GPS_FSM.d_nav.d_TOW + GPS_SUBFRAME_SECONDS; //we decoded the current TOW when the last word of the subframe arrive, so, we have a lag of ONE SUBFRAME d_TOW_at_Preamble = d_GPS_FSM.d_nav.d_TOW + GPS_SUBFRAME_SECONDS; //we decoded the current TOW when the last word of the subframe arrive, so, we have a lag of ONE SUBFRAME
d_TOW_at_current_symbol = d_TOW_at_Preamble;//GPS_L1_CA_CODE_PERIOD;// + (double)GPS_CA_PREAMBLE_LENGTH_BITS/(double)GPS_CA_TELEMETRY_RATE_BITS_SECOND; d_TOW_at_current_symbol = d_TOW_at_Preamble;//GPS_L1_CA_CODE_PERIOD;// + (double)GPS_CA_PREAMBLE_LENGTH_BITS/(double)GPS_CA_TELEMETRY_RATE_BITS_SECOND;
@@ -324,8 +324,8 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
current_synchro_data.d_TOW = d_TOW_at_Preamble; current_synchro_data.d_TOW = d_TOW_at_Preamble;
current_synchro_data.d_TOW_at_current_symbol = d_TOW_at_current_symbol; current_synchro_data.d_TOW_at_current_symbol = d_TOW_at_current_symbol;
current_synchro_data.d_TOW_hybrid_at_current_symbol= current_synchro_data.d_TOW_at_current_symbol; // to be used in the hybrid configuration current_synchro_data.d_TOW_hybrid_at_current_symbol = current_synchro_data.d_TOW_at_current_symbol; // to be used in the hybrid configuration
current_synchro_data.Flag_valid_word = (d_flag_frame_sync == true and d_flag_parity == true and flag_TOW_set==true); current_synchro_data.Flag_valid_word = (d_flag_frame_sync == true and d_flag_parity == true and flag_TOW_set == true);
current_synchro_data.Flag_preamble = d_flag_preamble; current_synchro_data.Flag_preamble = d_flag_preamble;
current_synchro_data.Prn_timestamp_ms = in[0][0].Tracking_timestamp_secs * 1000.0; current_synchro_data.Prn_timestamp_ms = in[0][0].Tracking_timestamp_secs * 1000.0;
current_synchro_data.Prn_timestamp_at_preamble_ms = Prn_timestamp_at_preamble_ms; current_synchro_data.Prn_timestamp_at_preamble_ms = Prn_timestamp_at_preamble_ms;
@@ -352,23 +352,24 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
//todo: implement averaging //todo: implement averaging
d_average_count++; d_average_count++;
if (d_average_count==d_decimation_output_factor) if (d_average_count == d_decimation_output_factor)
{ {
d_average_count=0; d_average_count = 0;
//3. Make the output (copy the object contents to the GNURadio reserved memory) //3. Make the output (copy the object contents to the GNURadio reserved memory)
*out[0] = current_synchro_data; *out[0] = current_synchro_data;
//std::cout<<"GPS TLM output on CH="<<this->d_channel << " SAMPLE STAMP="<<d_sample_counter/d_decimation_output_factor<<std::endl; //std::cout<<"GPS TLM output on CH="<<this->d_channel << " SAMPLE STAMP="<<d_sample_counter/d_decimation_output_factor<<std::endl;
return 1; return 1;
}else{ }
return 0; else
} {
return 0;
}
} }
void gps_l1_ca_telemetry_decoder_cc::set_decimation(int decimation) void gps_l1_ca_telemetry_decoder_cc::set_decimation(int decimation)
{ {
d_decimation_output_factor=decimation; d_decimation_output_factor = decimation;
} }
void gps_l1_ca_telemetry_decoder_cc::set_satellite(Gnss_Satellite satellite) void gps_l1_ca_telemetry_decoder_cc::set_satellite(Gnss_Satellite satellite)

View File

@@ -102,8 +102,8 @@ void Gps_Navigation_Message::reset()
b_antispoofing_flag = false; b_antispoofing_flag = false;
// Ionosphere and UTC // Ionosphere and UTC
flag_iono_valid = false; flag_iono_valid = true;
flag_utc_model_valid = false; flag_utc_model_valid = true;
d_alpha0 = 0; d_alpha0 = 0;
d_alpha1 = 0; d_alpha1 = 0;
d_alpha2 = 0; d_alpha2 = 0;
@@ -558,6 +558,7 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
if (SV_page > 24 && SV_page < 33) // Page 4 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) if (SV_page > 24 && SV_page < 33) // Page 4 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
{ {
//! \TODO read almanac //! \TODO read almanac
if(SV_data_ID){}
} }
if (SV_page == 52) // Page 13 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) if (SV_page == 52) // Page 13 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
@@ -633,6 +634,7 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
if (SV_page_5 < 25) if (SV_page_5 < 25)
{ {
//! \TODO read almanac //! \TODO read almanac
if(SV_data_ID){}
} }
if (SV_page_5 == 51) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) if (SV_page_5 == 51) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
{ {
@@ -788,6 +790,7 @@ Gps_Ephemeris Gps_Navigation_Message::get_ephemeris()
return ephemeris; return ephemeris;
} }
Gps_Iono Gps_Navigation_Message::get_iono() Gps_Iono Gps_Navigation_Message::get_iono()
{ {
Gps_Iono iono; Gps_Iono iono;
@@ -801,14 +804,14 @@ Gps_Iono Gps_Navigation_Message::get_iono()
iono.d_beta3 = d_beta3; iono.d_beta3 = d_beta3;
iono.valid = flag_iono_valid; iono.valid = flag_iono_valid;
//WARNING: We clear flag_utc_model_valid in order to not re-send the same information to the ionospheric parameters queue //WARNING: We clear flag_utc_model_valid in order to not re-send the same information to the ionospheric parameters queue
flag_iono_valid = false; // flag_iono_valid = false;
return iono; return iono;
} }
Gps_Utc_Model Gps_Navigation_Message::get_utc_model() Gps_Utc_Model Gps_Navigation_Message::get_utc_model()
{ {
Gps_Utc_Model utc_model; Gps_Utc_Model utc_model;
utc_model.valid = flag_utc_model_valid; utc_model.valid = flag_utc_model_valid;
// UTC parameters // UTC parameters
utc_model.d_A1 = d_A1; utc_model.d_A1 = d_A1;
@@ -820,10 +823,11 @@ Gps_Utc_Model Gps_Navigation_Message::get_utc_model()
utc_model.i_DN = i_DN; utc_model.i_DN = i_DN;
utc_model.d_DeltaT_LSF = d_DeltaT_LSF; utc_model.d_DeltaT_LSF = d_DeltaT_LSF;
// warning: We clear flag_utc_model_valid in order to not re-send the same information to the ionospheric parameters queue // warning: We clear flag_utc_model_valid in order to not re-send the same information to the ionospheric parameters queue
flag_utc_model_valid = false; // flag_utc_model_valid = false;
return utc_model; return utc_model;
} }
bool Gps_Navigation_Message::satellite_validation() bool Gps_Navigation_Message::satellite_validation()
{ {
bool flag_data_valid = false; bool flag_data_valid = false;