1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-09-10 23:06:03 +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() << ")";
} }

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;
} }
} }
} }
@@ -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{ }
else
{
return 0; 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;