mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	Bug fixes for duplicated observable time
This commit is contained in:
		| @@ -188,6 +188,7 @@ int hybrid_observables_cc::general_work (int noutput_items, | |||||||
|                         gnss_synchro_map.end(), |                         gnss_synchro_map.end(), | ||||||
|                         Hybrid_pairCompare_gnss_synchro_sample_counter); |                         Hybrid_pairCompare_gnss_synchro_sample_counter); | ||||||
|                 T_rx_s = (double)gnss_synchro_map_iter->second.Tracking_sample_counter/(double)gnss_synchro_map_iter->second.fs; |                 T_rx_s = (double)gnss_synchro_map_iter->second.Tracking_sample_counter/(double)gnss_synchro_map_iter->second.fs; | ||||||
|  |                 T_rx_s = floor(T_rx_s*1000.0)/1000.0;// truncate to ms | ||||||
|                 T_rx_s +=past_history_s; //increase T_rx to have a minimum past history to interpolate |                 T_rx_s +=past_history_s; //increase T_rx to have a minimum past history to interpolate | ||||||
|             } |             } | ||||||
|  |  | ||||||
| @@ -216,25 +217,25 @@ int hybrid_observables_cc::general_work (int noutput_items, | |||||||
|                             int distance=std::distance(d_gnss_synchro_history_queue[i].begin(), gnss_synchro_deque_iter); |                             int distance=std::distance(d_gnss_synchro_history_queue[i].begin(), gnss_synchro_deque_iter); | ||||||
|                             if (distance>0) |                             if (distance>0) | ||||||
|                             { |                             { | ||||||
|                                 double T_rx_channel_prev=(double)d_gnss_synchro_history_queue[i].at(distance-1).Tracking_sample_counter/(double)gnss_synchro_deque_iter->fs; | //                                double T_rx_channel_prev=(double)d_gnss_synchro_history_queue[i].at(distance-1).Tracking_sample_counter/(double)gnss_synchro_deque_iter->fs; | ||||||
|                                 double delta_T_rx_s_prev=T_rx_channel_prev-T_rx_s; | //                                double delta_T_rx_s_prev=T_rx_channel_prev-T_rx_s; | ||||||
|                                 if (fabs(delta_T_rx_s_prev)<fabs(delta_T_rx_s)) | //                                if (fabs(delta_T_rx_s_prev)<fabs(delta_T_rx_s)) | ||||||
|                                 { | //                                { | ||||||
|                                     realigned_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>( |  //                                   realigned_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>( | ||||||
|                                         d_gnss_synchro_history_queue[i].at(distance-1).Channel_ID, | //                                        d_gnss_synchro_history_queue[i].at(distance-1).Channel_ID, | ||||||
|                                         d_gnss_synchro_history_queue[i].at(distance-1))); | //                                        d_gnss_synchro_history_queue[i].at(distance-1))); | ||||||
|                                     adjacent_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(gnss_synchro_deque_iter->Channel_ID, | //                                    adjacent_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(gnss_synchro_deque_iter->Channel_ID, | ||||||
|                                             *gnss_synchro_deque_iter)); | //                                            *gnss_synchro_deque_iter)); | ||||||
|                                 }else{ | //                                }else{ | ||||||
|                                     realigned_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(gnss_synchro_deque_iter->Channel_ID, |                                     realigned_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(gnss_synchro_deque_iter->Channel_ID, | ||||||
|                                             *gnss_synchro_deque_iter)); |                                             *gnss_synchro_deque_iter)); | ||||||
|                                     adjacent_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>( |                                     adjacent_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>( | ||||||
|                                         d_gnss_synchro_history_queue[i].at(distance-1).Channel_ID, |                                         d_gnss_synchro_history_queue[i].at(distance-1).Channel_ID, | ||||||
|                                         d_gnss_synchro_history_queue[i].at(distance-1))); |                                         d_gnss_synchro_history_queue[i].at(distance-1))); | ||||||
|                                 } | //                                } | ||||||
|                             }else{ | //                            }else{ | ||||||
|                                 realigned_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(gnss_synchro_deque_iter->Channel_ID, | //                                realigned_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(gnss_synchro_deque_iter->Channel_ID, | ||||||
|                                         *gnss_synchro_deque_iter)); | //                                        *gnss_synchro_deque_iter)); | ||||||
|                             } |                             } | ||||||
|  |  | ||||||
|                         }else{ |                         }else{ | ||||||
| @@ -254,6 +255,9 @@ int hybrid_observables_cc::general_work (int noutput_items, | |||||||
|                         realigned_gnss_synchro_map.end(), |                         realigned_gnss_synchro_map.end(), | ||||||
|                         Hybrid_pairCompare_gnss_synchro_d_TOW); |                         Hybrid_pairCompare_gnss_synchro_d_TOW); | ||||||
|                 double d_TOW_reference = gnss_synchro_map_iter->second.TOW_at_current_symbol_s; |                 double d_TOW_reference = gnss_synchro_map_iter->second.TOW_at_current_symbol_s; | ||||||
|  | //                std::cout << std::fixed; | ||||||
|  | //                std::cout << std::setprecision(2); | ||||||
|  | //                std::cout<<"d_TOW_reference:"<<d_TOW_reference*1000.0<<std::endl; | ||||||
|                 double d_ref_PRN_phase_samples = gnss_synchro_map_iter->second.Code_phase_samples; |                 double d_ref_PRN_phase_samples = gnss_synchro_map_iter->second.Code_phase_samples; | ||||||
|                 //std::cout<<"OBS SV REF SAT: "<<gnss_synchro_map_iter->second.PRN<<std::endl; |                 //std::cout<<"OBS SV REF SAT: "<<gnss_synchro_map_iter->second.PRN<<std::endl; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -455,8 +455,7 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items __attribut | |||||||
|             current_synchro_data.Flag_valid_word = false; |             current_synchro_data.Flag_valid_word = false; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     current_synchro_data.TOW_at_current_symbol_s = d_TOW_at_current_symbol; |     current_synchro_data.TOW_at_current_symbol_s = floor(d_TOW_at_current_symbol*1000.0)/1000.0; | ||||||
|     //todo: move to observables: current_synchro_data.d_TOW_hybrid_at_current_symbol = current_synchro_data.d_TOW_at_current_symbol - delta_t; //delta_t = t_gal - t_gps  ---->  t_gps = t_gal -delta_t |  | ||||||
|  |  | ||||||
|     if(d_dump == true) |     if(d_dump == true) | ||||||
|         { |         { | ||||||
|   | |||||||
| @@ -533,7 +533,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut | |||||||
|             current_synchro_data.Flag_valid_word = false; |             current_synchro_data.Flag_valid_word = false; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     current_synchro_data.TOW_at_current_symbol_s = d_TOW_at_current_symbol; |     current_synchro_data.TOW_at_current_symbol_s = floor(d_TOW_at_current_symbol*1000.0)/1000.0; | ||||||
|  |  | ||||||
|     if(d_dump == true) |     if(d_dump == true) | ||||||
|         { |         { | ||||||
|   | |||||||
| @@ -340,7 +340,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_ | |||||||
|             // update TOW at the preamble instant |             // update TOW at the preamble instant | ||||||
|             d_TOW_at_Preamble = d_GPS_FSM.d_nav.d_TOW + GPS_L1_CA_CODE_PERIOD; |             d_TOW_at_Preamble = d_GPS_FSM.d_nav.d_TOW + GPS_L1_CA_CODE_PERIOD; | ||||||
|  |  | ||||||
|             d_TOW_at_current_symbol = d_TOW_at_Preamble; |             d_TOW_at_current_symbol = floor(d_TOW_at_Preamble*1000.0)/1000.0; | ||||||
|             flag_TOW_set = true; |             flag_TOW_set = true; | ||||||
|             d_flag_new_tow_available=false; |             d_flag_new_tow_available=false; | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -155,6 +155,7 @@ int gps_l2c_telemetry_decoder_cc::general_work (int noutput_items __attribute__( | |||||||
|         //* \code |         //* \code | ||||||
|         //* symbolTime_ms = msg->tow * 6000 + *pdelay * 20 |         //* symbolTime_ms = msg->tow * 6000 + *pdelay * 20 | ||||||
|         d_TOW_at_current_symbol=((double)msg.tow) * 6.0 + ((double)delay) * GPS_L2_M_PERIOD +12*GPS_L2_M_PERIOD; |         d_TOW_at_current_symbol=((double)msg.tow) * 6.0 + ((double)delay) * GPS_L2_M_PERIOD +12*GPS_L2_M_PERIOD; | ||||||
|  |         d_TOW_at_current_symbol=floor(d_TOW_at_current_symbol*1000.0)/1000.0; | ||||||
|         d_flag_valid_word=true; |         d_flag_valid_word=true; | ||||||
|     } |     } | ||||||
|     else |     else | ||||||
|   | |||||||
| @@ -70,7 +70,7 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( | |||||||
|     std::string default_dump_filename = "./track_ch"; |     std::string default_dump_filename = "./track_ch"; | ||||||
|     dump_filename = configuration->property(role + ".dump_filename", |     dump_filename = configuration->property(role + ".dump_filename", | ||||||
|             default_dump_filename); //unused! |             default_dump_filename); //unused! | ||||||
|     vector_length = std::round(fs_in / (GPS_L2_M_CODE_RATE_HZ / GPS_L2_M_CODE_LENGTH_CHIPS)); |     vector_length = std::round((double)fs_in / ((double)GPS_L2_M_CODE_RATE_HZ / (double)GPS_L2_M_CODE_LENGTH_CHIPS)); | ||||||
|  |  | ||||||
|     //################# MAKE TRACKING GNURadio object ################### |     //################# MAKE TRACKING GNURadio object ################### | ||||||
|     if (item_type.compare("gr_complex") == 0) |     if (item_type.compare("gr_complex") == 0) | ||||||
|   | |||||||
| @@ -316,6 +316,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ | |||||||
|             current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; |             current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; | ||||||
|             current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; |             current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; | ||||||
|             current_synchro_data.fs=d_fs_in; |             current_synchro_data.fs=d_fs_in; | ||||||
|  |             current_synchro_data.correlation_length_ms = 1; | ||||||
|             *out[0] = current_synchro_data; |             *out[0] = current_synchro_data; | ||||||
|             consume_each(samples_offset); // shift input to perform alignment with local replica |             consume_each(samples_offset); // shift input to perform alignment with local replica | ||||||
|             return 1; |             return 1; | ||||||
| @@ -428,6 +429,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ | |||||||
|  |  | ||||||
|         current_synchro_data.Tracking_sample_counter =d_sample_counter + d_current_prn_length_samples; |         current_synchro_data.Tracking_sample_counter =d_sample_counter + d_current_prn_length_samples; | ||||||
|         current_synchro_data.System = {'G'}; |         current_synchro_data.System = {'G'}; | ||||||
|  |         current_synchro_data.correlation_length_ms = 1; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     //assign the GNURadio block output data |     //assign the GNURadio block output data | ||||||
|   | |||||||
| @@ -319,6 +319,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu | |||||||
|                     samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); |                     samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); | ||||||
|                     current_synchro_data.Tracking_sample_counter = d_sample_counter + samples_offset; |                     current_synchro_data.Tracking_sample_counter = d_sample_counter + samples_offset; | ||||||
|                     current_synchro_data.fs=d_fs_in; |                     current_synchro_data.fs=d_fs_in; | ||||||
|  |                     current_synchro_data.correlation_length_ms = 1; | ||||||
|                     *out[0] = current_synchro_data; |                     *out[0] = current_synchro_data; | ||||||
|                     d_sample_counter += samples_offset; //count for the processed samples |                     d_sample_counter += samples_offset; //count for the processed samples | ||||||
|                     d_pull_in = false; |                     d_pull_in = false; | ||||||
| @@ -453,6 +454,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu | |||||||
|                 } |                 } | ||||||
|  |  | ||||||
|             current_synchro_data.System = {'G'}; |             current_synchro_data.System = {'G'}; | ||||||
|  |             current_synchro_data.correlation_length_ms = 1; | ||||||
|             current_synchro_data.Tracking_sample_counter = d_sample_counter + d_correlation_length_samples; |             current_synchro_data.Tracking_sample_counter = d_sample_counter + d_correlation_length_samples; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -320,6 +320,7 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__( | |||||||
|             current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; |             current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; | ||||||
|             current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; |             current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; | ||||||
|             current_synchro_data.fs=d_fs_in; |             current_synchro_data.fs=d_fs_in; | ||||||
|  |             current_synchro_data.correlation_length_ms = 20; | ||||||
|             *out[0] = current_synchro_data; |             *out[0] = current_synchro_data; | ||||||
|             consume_each(samples_offset); // shift input to perform alignment with local replica |             consume_each(samples_offset); // shift input to perform alignment with local replica | ||||||
|             return 1; |             return 1; | ||||||
| @@ -429,6 +430,7 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__( | |||||||
|             d_correlator_outs[n] = gr_complex(0,0); |             d_correlator_outs[n] = gr_complex(0,0); | ||||||
|         } |         } | ||||||
|         current_synchro_data.Tracking_sample_counter =d_sample_counter + d_current_prn_length_samples; |         current_synchro_data.Tracking_sample_counter =d_sample_counter + d_current_prn_length_samples; | ||||||
|  |         current_synchro_data.correlation_length_ms = 20; | ||||||
|     } |     } | ||||||
|     //assign the GNURadio block output data |     //assign the GNURadio block output data | ||||||
|     current_synchro_data.fs=d_fs_in; |     current_synchro_data.fs=d_fs_in; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Javier Arribas
					Javier Arribas