1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-16 05:00:35 +00:00

Merge branch 'next' into new_fsm

This commit is contained in:
Antonio Ramos 2018-01-10 16:29:33 +01:00
commit c20bd62313
13 changed files with 85 additions and 20 deletions

View File

@ -66,11 +66,6 @@ hybrid_observables_cc::hybrid_observables_cc(unsigned int nchannels, bool dump,
{ {
d_gnss_synchro_history_queue.push_back(std::deque<Gnss_Synchro>()); d_gnss_synchro_history_queue.push_back(std::deque<Gnss_Synchro>());
} }
// todo: this is a gnuradio scheduler hack.
// Migrate the queues to gnuradio set_history to see if the scheduler can handle
// the multiple output flow
d_max_noutputs = 100;
this->set_min_noutput_items(100);
// ############# ENABLE DATA FILE LOG ################# // ############# ENABLE DATA FILE LOG #################
if (d_dump == true) if (d_dump == true)
@ -328,8 +323,15 @@ bool Hybrid_valueCompare_gnss_synchro_d_TOW(const Gnss_Synchro& a, double b)
return (a.TOW_at_current_symbol_s) < (b); return (a.TOW_at_current_symbol_s) < (b);
} }
void hybrid_observables_cc::forecast (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required)
{
for(unsigned int i = 0; i < d_nchannels; i++)
{
ninput_items_required[i] = 0; //set the required available samples in each call
}
}
int hybrid_observables_cc::general_work (int noutput_items __attribute__((unused)), int hybrid_observables_cc::general_work (int noutput_items ,
gr_vector_int &ninput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items) gr_vector_void_star &output_items)
@ -351,15 +353,27 @@ int hybrid_observables_cc::general_work (int noutput_items __attribute__((unused
* Multi-rate GNURADIO Block. Read how many input items are avaliable in each channel * Multi-rate GNURADIO Block. Read how many input items are avaliable in each channel
* Record all synchronization data into queues * Record all synchronization data into queues
*/ */
bool zero_samples=true;
for (unsigned int i = 0; i < d_nchannels; i++) for (unsigned int i = 0; i < d_nchannels; i++)
{ {
n_consume[i] = ninput_items[i];// full throttle n_consume[i] = ninput_items[i];// full throttle
for (int j = 0; j < n_consume[i]; j++) for (int j = 0; j < n_consume[i]; j++)
{ {
d_gnss_synchro_history_queue[i].push_back(in[i][j]); d_gnss_synchro_history_queue[i].push_back(in[i][j]);
zero_samples=false;
} }
} }
//check if there are new channel data available
//This is required because the combination of several GNSS tracking signals
//leads to a multirrate inputs that can not warantee that every channel will have new data
//and forecast method is set to zero samples for each channel to avoid blockings
if (zero_samples==true)
{
usleep(500); // run this task at up to 2 kHz rate
return 0; // No new samples in this call, thus, return.
}
bool channel_history_ok; bool channel_history_ok;
do do
{ {
@ -561,7 +575,7 @@ int hybrid_observables_cc::general_work (int noutput_items __attribute__((unused
} }
} }
} }
} while(channel_history_ok == true && d_max_noutputs > n_outputs); } while(channel_history_ok == true && noutput_items > n_outputs);
// Multi-rate consume! // Multi-rate consume!
for (unsigned int i = 0; i < d_nchannels; i++) for (unsigned int i = 0; i < d_nchannels; i++)

View File

@ -55,7 +55,7 @@ public:
~hybrid_observables_cc (); ~hybrid_observables_cc ();
int general_work (int noutput_items, gr_vector_int &ninput_items, int general_work (int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
void forecast (int noutput_items, gr_vector_int &ninput_items_required);
private: private:
friend hybrid_observables_cc_sptr friend hybrid_observables_cc_sptr
hybrid_make_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, unsigned int deep_history); hybrid_make_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, unsigned int deep_history);
@ -66,7 +66,6 @@ private:
double T_rx_s; double T_rx_s;
double T_rx_step_s; double T_rx_step_s;
int d_max_noutputs;
bool d_dump; bool d_dump;
unsigned int d_nchannels; unsigned int d_nchannels;
unsigned int history_deep; unsigned int history_deep;

View File

@ -953,7 +953,7 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
if (current_synchro_data.Flag_valid_symbol_output) if (current_synchro_data.Flag_valid_symbol_output)
{ {
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false return 1;
}else{ }else{
return 0; return 0;
} }

View File

@ -513,7 +513,12 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr
consume_each(d_current_prn_length_samples); // this is needed in gr::block derivates consume_each(d_current_prn_length_samples); // this is needed in gr::block derivates
d_sample_counter += d_current_prn_length_samples; //count for the processed samples d_sample_counter += d_current_prn_length_samples; //count for the processed samples
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false if (d_enable_tracking)
{
return 1;
}else{
return 0;
}
} }

View File

@ -733,7 +733,13 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
d_secondary_delay = (d_secondary_delay + 1) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH; d_secondary_delay = (d_secondary_delay + 1) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH;
d_sample_counter += d_current_prn_length_samples; //count for the processed samples d_sample_counter += d_current_prn_length_samples; //count for the processed samples
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
if (current_synchro_data.Flag_valid_symbol_output)
{
return 1;
}else{
return 0;
}
} }

View File

@ -875,7 +875,12 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri
consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates
d_sample_counter += d_correlation_length_samples; //count for the processed samples d_sample_counter += d_correlation_length_samples; //count for the processed samples
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false if (d_enable_tracking)
{
return 1;
}else{
return 0;
}
} }

View File

@ -694,7 +694,12 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work(
//consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates //consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates
d_sample_counter += d_correlation_length_samples; //count for the processed samples d_sample_counter += d_correlation_length_samples; //count for the processed samples
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false if (d_enable_tracking)
{
return 1;
}else{
return 0;
}
} }

View File

@ -879,7 +879,12 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri
consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates
d_sample_counter += d_correlation_length_samples; //count for the processed samples d_sample_counter += d_correlation_length_samples; //count for the processed samples
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false if (d_enable_tracking)
{
return 1;
}else{
return 0;
}
} }

View File

@ -738,7 +738,13 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
d_sample_counter += d_current_prn_length_samples; // count for the processed samples d_sample_counter += d_current_prn_length_samples; // count for the processed samples
return 1; // output tracking result ALWAYS even in the case of d_enable_tracking==false
if (d_enable_tracking)
{
return 1;
}else{
return 0;
}
} }

View File

@ -536,7 +536,12 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu
consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates
d_sample_counter += d_correlation_length_samples; //count for the processed samples d_sample_counter += d_correlation_length_samples; //count for the processed samples
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false if (d_enable_tracking)
{
return 1;
}else{
return 0;
}
} }

View File

@ -549,7 +549,12 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri
d_sample_counter_seconds = d_sample_counter_seconds + ( static_cast<double>(d_current_prn_length_samples) / static_cast<double>(d_fs_in) ); d_sample_counter_seconds = d_sample_counter_seconds + ( static_cast<double>(d_current_prn_length_samples) / static_cast<double>(d_fs_in) );
d_sample_counter += d_current_prn_length_samples; //count for the processed samples d_sample_counter += d_current_prn_length_samples; //count for the processed samples
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false if (d_enable_tracking)
{
return 1;
}else{
return 0;
}
} }

View File

@ -729,7 +729,12 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(
} }
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
d_sample_counter += d_current_prn_length_samples; // count for the processed samples d_sample_counter += d_current_prn_length_samples; // count for the processed samples
return 1; // output tracking result ALWAYS even in the case of d_enable_tracking==false if (d_enable_tracking)
{
return 1;
}else{
return 0;
}
} }

View File

@ -729,7 +729,12 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__((
} }
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
d_sample_counter += d_current_prn_length_samples; // count for the processed samples d_sample_counter += d_current_prn_length_samples; // count for the processed samples
return 1; // output tracking result ALWAYS even in the case of d_enable_tracking==false if (d_enable_tracking)
{
return 1;
}else{
return 0;
}
} }