mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-06-08 17:44:09 +00:00
Pretty-printing of satellites is back again
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@150 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
parent
cdccdac4c6
commit
9625070ea9
@ -93,11 +93,11 @@ void Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::forecast (int noutput_items, gr_vector_i
|
|||||||
|
|
||||||
|
|
||||||
Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc(
|
Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc(
|
||||||
long if_freq,
|
long if_freq,
|
||||||
long fs_in,
|
long fs_in,
|
||||||
unsigned int vector_length,
|
unsigned int vector_length,
|
||||||
gr_msg_queue_sptr queue,
|
gr_msg_queue_sptr queue,
|
||||||
bool dump,
|
bool dump,
|
||||||
std::string dump_filename,
|
std::string dump_filename,
|
||||||
int order,
|
int order,
|
||||||
float fll_bw_hz,
|
float fll_bw_hz,
|
||||||
@ -159,6 +159,12 @@ Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc(
|
|||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = 5;
|
d_carrier_lock_threshold = 5;
|
||||||
|
|
||||||
|
systemName["G"] = std::string("GPS");
|
||||||
|
systemName["R"] = std::string("GLONASS");
|
||||||
|
systemName["S"] = std::string("SBAS");
|
||||||
|
systemName["E"] = std::string("Galileo");
|
||||||
|
systemName["C"] = std::string("Compass");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -170,9 +176,9 @@ void Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::start_tracking()
|
|||||||
* correct the code phase according to the delay between acq and trk
|
* correct the code phase according to the delay between acq and trk
|
||||||
*/
|
*/
|
||||||
|
|
||||||
d_acq_code_phase_samples = d_acquisition_gnss_synchro->Acq_delay_samples;
|
d_acq_code_phase_samples = d_acquisition_gnss_synchro->Acq_delay_samples;
|
||||||
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
|
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
|
||||||
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
|
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
|
||||||
|
|
||||||
unsigned long int acq_trk_diff_samples;
|
unsigned long int acq_trk_diff_samples;
|
||||||
float acq_trk_diff_seconds;
|
float acq_trk_diff_seconds;
|
||||||
@ -230,17 +236,25 @@ void Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::start_tracking()
|
|||||||
|
|
||||||
d_code_phase_samples = d_acq_code_phase_samples;
|
d_code_phase_samples = d_acq_code_phase_samples;
|
||||||
|
|
||||||
|
std::string sys_ = &d_acquisition_gnss_synchro->System;
|
||||||
|
sys = sys_.substr(0,1);
|
||||||
|
|
||||||
// DEBUG OUTPUT
|
// DEBUG OUTPUT
|
||||||
std::cout << "Tracking start on channel " << d_channel << " for satellite " << d_acquisition_gnss_synchro->System << " "<< d_acquisition_gnss_synchro->PRN << std::endl;
|
std::cout << "Tracking start on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl;
|
||||||
DLOG(INFO) << "Start tracking for satellite " << d_acquisition_gnss_synchro->System << " "<< d_acquisition_gnss_synchro->PRN << " received ";
|
DLOG(INFO) << "Start tracking for satellite " << d_acquisition_gnss_synchro->System << " "<< d_acquisition_gnss_synchro->PRN << " received ";
|
||||||
|
|
||||||
// enable tracking
|
// enable tracking Gnss_Satellite(systemName[&d_acquisition_gnss_synchro->System], d_acquisition_gnss_synchro->PRN)
|
||||||
d_pull_in = true;
|
d_pull_in = true;
|
||||||
d_enable_tracking = true;
|
d_enable_tracking = true;
|
||||||
|
|
||||||
std::cout << "PULL-IN Doppler [Hz]= " << d_carrier_doppler_hz
|
std::cout << "PULL-IN Doppler [Hz]= " << d_carrier_doppler_hz
|
||||||
<< " Code Phase correction [samples]=" << delay_correction_samples
|
<< " Code Phase correction [samples]=" << delay_correction_samples
|
||||||
<< " PULL-IN Code Phase [samples]= " << d_acq_code_phase_samples << std::endl;
|
<< " PULL-IN Code Phase [samples]= " << d_acq_code_phase_samples << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -346,10 +360,10 @@ int Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::general_work (int noutput_items, gr_vecto
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
|
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
|
||||||
Gnss_Synchro current_synchro_data;
|
Gnss_Synchro current_synchro_data;
|
||||||
// Fill the acquisition data
|
// Fill the acquisition data
|
||||||
current_synchro_data=*d_acquisition_gnss_synchro;
|
current_synchro_data=*d_acquisition_gnss_synchro;
|
||||||
|
|
||||||
// get the sample in and out pointers
|
// get the sample in and out pointers
|
||||||
const gr_complex* in = (gr_complex*) input_items[0]; //block input samples pointer
|
const gr_complex* in = (gr_complex*) input_items[0]; //block input samples pointer
|
||||||
@ -377,14 +391,14 @@ int Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::general_work (int noutput_items, gr_vecto
|
|||||||
|
|
||||||
// perform Early, Prompt and Late correlation
|
// perform Early, Prompt and Late correlation
|
||||||
d_correlator.Carrier_wipeoff_and_EPL_volk(d_current_prn_length_samples,
|
d_correlator.Carrier_wipeoff_and_EPL_volk(d_current_prn_length_samples,
|
||||||
in,
|
in,
|
||||||
d_carr_sign,
|
d_carr_sign,
|
||||||
d_early_code,
|
d_early_code,
|
||||||
d_prompt_code,
|
d_prompt_code,
|
||||||
d_late_code,
|
d_late_code,
|
||||||
d_Early,
|
d_Early,
|
||||||
d_Prompt,
|
d_Prompt,
|
||||||
d_Late);
|
d_Late);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DLL, FLL, and PLL discriminators
|
* DLL, FLL, and PLL discriminators
|
||||||
@ -479,7 +493,9 @@ int Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::general_work (int noutput_items, gr_vecto
|
|||||||
{
|
{
|
||||||
d_last_seg = floor(d_sample_counter/d_fs_in);
|
d_last_seg = floor(d_sample_counter/d_fs_in);
|
||||||
std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl;
|
std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl;
|
||||||
std::cout << "Tracking CH " << d_channel << ": Satellite " << d_acquisition_gnss_synchro->System << " "<< d_acquisition_gnss_synchro->PRN << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
//std::string sys = &d_acquisition_gnss_synchro->System;
|
||||||
|
//std::cout << sys << ", " << sys.substr(0,1) << std::endl;
|
||||||
|
std::cout << "Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
||||||
//std::cout<<"TRK CH "<<d_channel<<" Carrier_lock_test="<<d_carrier_lock_test<< std::endl;
|
//std::cout<<"TRK CH "<<d_channel<<" Carrier_lock_test="<<d_carrier_lock_test<< std::endl;
|
||||||
//if (d_last_seg==5) d_carrier_lock_fail_counter=500; //DEBUG: force unlock!
|
//if (d_last_seg==5) d_carrier_lock_fail_counter=500; //DEBUG: force unlock!
|
||||||
}
|
}
|
||||||
@ -489,7 +505,9 @@ int Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::general_work (int noutput_items, gr_vecto
|
|||||||
if (floor(d_sample_counter/d_fs_in) != d_last_seg)
|
if (floor(d_sample_counter/d_fs_in) != d_last_seg)
|
||||||
{
|
{
|
||||||
d_last_seg = floor(d_sample_counter/d_fs_in);
|
d_last_seg = floor(d_sample_counter/d_fs_in);
|
||||||
std::cout << "Tracking CH " << d_channel << ": Satellite " << d_acquisition_gnss_synchro->System << " "<< d_acquisition_gnss_synchro->PRN << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
//std::string sys2 = &d_acquisition_gnss_synchro->System;
|
||||||
|
//std::cout << sys2 << ", " << sys2.substr(0,1) << std::endl;
|
||||||
|
std::cout << "Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
||||||
//std::cout<<"TRK CH "<<d_channel<<" Carrier_lock_test="<<d_carrier_lock_test<< std::endl;
|
//std::cout<<"TRK CH "<<d_channel<<" Carrier_lock_test="<<d_carrier_lock_test<< std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -519,11 +537,11 @@ int Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::general_work (int noutput_items, gr_vecto
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*d_Early = gr_complex(0,0);
|
*d_Early = gr_complex(0,0);
|
||||||
*d_Prompt = gr_complex(0,0);
|
*d_Prompt = gr_complex(0,0);
|
||||||
*d_Late = gr_complex(0,0);
|
*d_Late = gr_complex(0,0);
|
||||||
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; //block output streams pointer
|
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; //block output streams pointer
|
||||||
*out[0]=*d_acquisition_gnss_synchro;
|
*out[0]=*d_acquisition_gnss_synchro;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -621,5 +639,5 @@ void Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::set_channel_queue(concurrent_queue<int>
|
|||||||
|
|
||||||
void Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
|
void Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
|
||||||
{
|
{
|
||||||
d_acquisition_gnss_synchro=p_gnss_synchro;
|
d_acquisition_gnss_synchro=p_gnss_synchro;
|
||||||
}
|
}
|
||||||
|
@ -46,11 +46,8 @@
|
|||||||
//#include <gnuradio/gr_sync_decimator.h>
|
//#include <gnuradio/gr_sync_decimator.h>
|
||||||
#include "concurrent_queue.h"
|
#include "concurrent_queue.h"
|
||||||
#include "gps_sdr_signal_processing.h"
|
#include "gps_sdr_signal_processing.h"
|
||||||
|
|
||||||
#include "tracking_FLL_PLL_filter.h"
|
#include "tracking_FLL_PLL_filter.h"
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
|
|
||||||
|
|
||||||
//#include "GPS_L1_CA.h"
|
//#include "GPS_L1_CA.h"
|
||||||
#include "correlator.h"
|
#include "correlator.h"
|
||||||
|
|
||||||
@ -207,6 +204,9 @@ private:
|
|||||||
|
|
||||||
std::string d_dump_filename;
|
std::string d_dump_filename;
|
||||||
std::ofstream d_dump_file;
|
std::ofstream d_dump_file;
|
||||||
|
|
||||||
|
std::map<std::string, std::string> systemName;
|
||||||
|
std::string sys;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //GNSS_SDR_GPS_L1_CA_DLL_FLL_PLL_TRACKING_CC_H
|
#endif //GNSS_SDR_GPS_L1_CA_DLL_FLL_PLL_TRACKING_CC_H
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
#include "CN_estimators.h"
|
#include "CN_estimators.h"
|
||||||
#include "GPS_L1_CA.h"
|
#include "GPS_L1_CA.h"
|
||||||
#ifdef GNSS_SDR_USE_BOOST_ROUND
|
#ifdef GNSS_SDR_USE_BOOST_ROUND
|
||||||
#include <boost/math/special_functions/round.hpp>
|
#include <boost/math/special_functions/round.hpp>
|
||||||
#endif
|
#endif
|
||||||
#include "control_message_factory.h"
|
#include "control_message_factory.h"
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
@ -65,24 +65,24 @@ using google::LogMessage;
|
|||||||
|
|
||||||
gps_l1_ca_dll_pll_tracking_cc_sptr
|
gps_l1_ca_dll_pll_tracking_cc_sptr
|
||||||
gps_l1_ca_dll_pll_make_tracking_cc(
|
gps_l1_ca_dll_pll_make_tracking_cc(
|
||||||
long if_freq,
|
long if_freq,
|
||||||
long fs_in,
|
long fs_in,
|
||||||
unsigned int vector_length,
|
unsigned int vector_length,
|
||||||
gr_msg_queue_sptr queue,
|
gr_msg_queue_sptr queue,
|
||||||
bool dump,
|
bool dump,
|
||||||
std::string dump_filename,
|
std::string dump_filename,
|
||||||
float pll_bw_hz,
|
float pll_bw_hz,
|
||||||
float dll_bw_hz,
|
float dll_bw_hz,
|
||||||
float early_late_space_chips)
|
float early_late_space_chips)
|
||||||
{
|
{
|
||||||
return gps_l1_ca_dll_pll_tracking_cc_sptr(new Gps_L1_Ca_Dll_Pll_Tracking_cc(if_freq,
|
return gps_l1_ca_dll_pll_tracking_cc_sptr(new Gps_L1_Ca_Dll_Pll_Tracking_cc(if_freq,
|
||||||
fs_in, vector_length, queue, dump, dump_filename, pll_bw_hz, dll_bw_hz, early_late_space_chips));
|
fs_in, vector_length, queue, dump, dump_filename, pll_bw_hz, dll_bw_hz, early_late_space_chips));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Gps_L1_Ca_Dll_Pll_Tracking_cc::forecast (int noutput_items,
|
void Gps_L1_Ca_Dll_Pll_Tracking_cc::forecast (int noutput_items,
|
||||||
gr_vector_int &ninput_items_required)
|
gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
ninput_items_required[0] = (int)d_vector_length*2; //set the required available samples in each call
|
ninput_items_required[0] = (int)d_vector_length*2; //set the required available samples in each call
|
||||||
}
|
}
|
||||||
@ -90,15 +90,15 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::forecast (int noutput_items,
|
|||||||
|
|
||||||
|
|
||||||
Gps_L1_Ca_Dll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Pll_Tracking_cc(
|
Gps_L1_Ca_Dll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Pll_Tracking_cc(
|
||||||
long if_freq,
|
long if_freq,
|
||||||
long fs_in,
|
long fs_in,
|
||||||
unsigned int vector_length,
|
unsigned int vector_length,
|
||||||
gr_msg_queue_sptr queue,
|
gr_msg_queue_sptr queue,
|
||||||
bool dump,
|
bool dump,
|
||||||
std::string dump_filename,
|
std::string dump_filename,
|
||||||
float pll_bw_hz,
|
float pll_bw_hz,
|
||||||
float dll_bw_hz,
|
float dll_bw_hz,
|
||||||
float early_late_space_chips) :
|
float early_late_space_chips) :
|
||||||
gr_block ("Gps_L1_Ca_Dll_Pll_Tracking_cc", gr_make_io_signature (1, 1, sizeof(gr_complex)),
|
gr_block ("Gps_L1_Ca_Dll_Pll_Tracking_cc", gr_make_io_signature (1, 1, sizeof(gr_complex)),
|
||||||
gr_make_io_signature(1, 1, sizeof(Gnss_Synchro)))
|
gr_make_io_signature(1, 1, sizeof(Gnss_Synchro)))
|
||||||
{
|
{
|
||||||
@ -173,6 +173,12 @@ Gps_L1_Ca_Dll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Pll_Tracking_cc(
|
|||||||
d_CN0_SNV_dB_Hz = 0;
|
d_CN0_SNV_dB_Hz = 0;
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_carrier_lock_threshold = 5;
|
d_carrier_lock_threshold = 5;
|
||||||
|
|
||||||
|
systemName["G"] = std::string("GPS");
|
||||||
|
systemName["R"] = std::string("GLONASS");
|
||||||
|
systemName["S"] = std::string("SBAS");
|
||||||
|
systemName["E"] = std::string("Galileo");
|
||||||
|
systemName["C"] = std::string("Compass");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
|
void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
|
||||||
@ -181,9 +187,9 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
|
|||||||
* correct the code phase according to the delay between acq and trk
|
* correct the code phase according to the delay between acq and trk
|
||||||
*/
|
*/
|
||||||
|
|
||||||
d_acq_code_phase_samples = d_acquisition_gnss_synchro->Acq_delay_samples;
|
d_acq_code_phase_samples = d_acquisition_gnss_synchro->Acq_delay_samples;
|
||||||
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
|
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
|
||||||
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
|
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
|
||||||
|
|
||||||
unsigned long int acq_trk_diff_samples;
|
unsigned long int acq_trk_diff_samples;
|
||||||
float acq_trk_diff_seconds;
|
float acq_trk_diff_seconds;
|
||||||
@ -244,15 +250,20 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
|
|||||||
|
|
||||||
d_code_phase_samples = d_acq_code_phase_samples;
|
d_code_phase_samples = d_acq_code_phase_samples;
|
||||||
|
|
||||||
|
std::string sys_ = &d_acquisition_gnss_synchro->System;
|
||||||
|
sys = sys_.substr(0,1);
|
||||||
|
|
||||||
// DEBUG OUTPUT
|
// DEBUG OUTPUT
|
||||||
std::cout << "Tracking start on channel " << d_channel << " for satellite " << d_acquisition_gnss_synchro->System << " "<< d_acquisition_gnss_synchro->PRN << std::endl;
|
std::cout << "Tracking start on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl;
|
||||||
DLOG(INFO) << "Start tracking for satellite " << d_acquisition_gnss_synchro->System << " "<< d_acquisition_gnss_synchro->PRN << " received" << std::endl;
|
DLOG(INFO) << "Start tracking for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " received" << std::endl;
|
||||||
|
|
||||||
// enable tracking
|
// enable tracking
|
||||||
d_pull_in = true;
|
d_pull_in = true;
|
||||||
d_enable_tracking = true;
|
d_enable_tracking = true;
|
||||||
|
|
||||||
std::cout << "PULL-IN Doppler [Hz]=" << d_carrier_doppler_hz << " Code Phase correction [samples]=" << delay_correction_samples << " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples << std::endl;
|
std::cout << "PULL-IN Doppler [Hz]=" << d_carrier_doppler_hz
|
||||||
|
<< " Code Phase correction [samples]=" << delay_correction_samples
|
||||||
|
<< " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -361,11 +372,11 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
|
|||||||
acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
|
acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
|
||||||
acq_trk_shif_correction_samples = d_next_prn_length_samples - fmod((float)acq_to_trk_delay_samples, (float)d_next_prn_length_samples);
|
acq_trk_shif_correction_samples = d_next_prn_length_samples - fmod((float)acq_to_trk_delay_samples, (float)d_next_prn_length_samples);
|
||||||
//std::cout<<"acq_trk_shif_correction="<<acq_trk_shif_correction_samples<<"\r\n";
|
//std::cout<<"acq_trk_shif_correction="<<acq_trk_shif_correction_samples<<"\r\n";
|
||||||
#ifdef GNSS_SDR_USE_BOOST_ROUND
|
#ifdef GNSS_SDR_USE_BOOST_ROUND
|
||||||
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);
|
||||||
#else
|
#else
|
||||||
samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples);
|
samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples);
|
||||||
#endif
|
#endif
|
||||||
// /todo: Check if the sample counter sent to the next block as a time reference should be incremented AFTER sended or BEFORE
|
// /todo: Check if the sample counter sent to the next block as a time reference should be incremented AFTER sended or BEFORE
|
||||||
d_sample_counter_seconds = d_sample_counter_seconds + (((double)samples_offset) / (double)d_fs_in);
|
d_sample_counter_seconds = d_sample_counter_seconds + (((double)samples_offset) / (double)d_fs_in);
|
||||||
d_sample_counter = d_sample_counter + samples_offset; //count for the processed samples
|
d_sample_counter = d_sample_counter + samples_offset; //count for the processed samples
|
||||||
@ -375,10 +386,10 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
|
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
|
||||||
Gnss_Synchro current_synchro_data;
|
Gnss_Synchro current_synchro_data;
|
||||||
// Fill the acquisition data
|
// Fill the acquisition data
|
||||||
current_synchro_data=*d_acquisition_gnss_synchro;
|
current_synchro_data = *d_acquisition_gnss_synchro;
|
||||||
|
|
||||||
const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignement
|
const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignement
|
||||||
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
|
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
|
||||||
@ -405,14 +416,14 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
|
|||||||
|
|
||||||
// perform Early, Prompt and Late correlation
|
// perform Early, Prompt and Late correlation
|
||||||
d_correlator.Carrier_wipeoff_and_EPL_volk(d_current_prn_length_samples,
|
d_correlator.Carrier_wipeoff_and_EPL_volk(d_current_prn_length_samples,
|
||||||
in,
|
in,
|
||||||
d_carr_sign,
|
d_carr_sign,
|
||||||
d_early_code,
|
d_early_code,
|
||||||
d_prompt_code,
|
d_prompt_code,
|
||||||
d_late_code,
|
d_late_code,
|
||||||
d_Early,
|
d_Early,
|
||||||
d_Prompt,
|
d_Prompt,
|
||||||
d_Late);
|
d_Late);
|
||||||
|
|
||||||
// Compute PLL error and update carrier NCO -
|
// Compute PLL error and update carrier NCO -
|
||||||
carr_error = pll_cloop_two_quadrant_atan(*d_Prompt) / (float)TWO_PI;
|
carr_error = pll_cloop_two_quadrant_atan(*d_Prompt) / (float)TWO_PI;
|
||||||
@ -498,13 +509,13 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
|
|||||||
|
|
||||||
// ########### Output the tracking data to navigation and PVT ##########
|
// ########### Output the tracking data to navigation and PVT ##########
|
||||||
|
|
||||||
current_synchro_data.Prompt_I=(double)(*d_Prompt).real();
|
current_synchro_data.Prompt_I = (double)(*d_Prompt).real();
|
||||||
current_synchro_data.Prompt_Q=(double)(*d_Prompt).imag();
|
current_synchro_data.Prompt_Q = (double)(*d_Prompt).imag();
|
||||||
current_synchro_data.Tracking_timestamp_secs=d_sample_counter_seconds;
|
current_synchro_data.Tracking_timestamp_secs = d_sample_counter_seconds;
|
||||||
current_synchro_data.Carrier_phase_rads=(double)d_acc_carrier_phase_rad;
|
current_synchro_data.Carrier_phase_rads = (double)d_acc_carrier_phase_rad;
|
||||||
current_synchro_data.Code_phase_secs=(double)d_code_phase_samples * (1/(float)d_fs_in);
|
current_synchro_data.Code_phase_secs = (double)d_code_phase_samples * (1/(float)d_fs_in);
|
||||||
current_synchro_data.CN0_dB_hz=(double)d_CN0_SNV_dB_Hz;
|
current_synchro_data.CN0_dB_hz = (double)d_CN0_SNV_dB_Hz;
|
||||||
*out[0]=current_synchro_data;
|
*out[0] = current_synchro_data;
|
||||||
|
|
||||||
// ########## DEBUG OUTPUT
|
// ########## DEBUG OUTPUT
|
||||||
/*!
|
/*!
|
||||||
@ -517,7 +528,8 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
|
|||||||
{
|
{
|
||||||
d_last_seg = floor(d_sample_counter / d_fs_in);
|
d_last_seg = floor(d_sample_counter / d_fs_in);
|
||||||
std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl;
|
std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl;
|
||||||
std::cout << "Tracking CH " << d_channel << ": Satellite " << d_acquisition_gnss_synchro->System << " "<< d_acquisition_gnss_synchro->PRN << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
std::cout << "Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
|
||||||
|
<< ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
||||||
//std::cout<<"TRK CH "<<d_channel<<" Carrier_lock_test="<<d_carrier_lock_test<< std::endl;
|
//std::cout<<"TRK CH "<<d_channel<<" Carrier_lock_test="<<d_carrier_lock_test<< std::endl;
|
||||||
//if (d_last_seg==5) d_carrier_lock_fail_counter=500; //DEBUG: force unlock!
|
//if (d_last_seg==5) d_carrier_lock_fail_counter=500; //DEBUG: force unlock!
|
||||||
}
|
}
|
||||||
@ -527,21 +539,22 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
|
|||||||
if (floor(d_sample_counter / d_fs_in) != d_last_seg)
|
if (floor(d_sample_counter / d_fs_in) != d_last_seg)
|
||||||
{
|
{
|
||||||
d_last_seg = floor(d_sample_counter / d_fs_in);
|
d_last_seg = floor(d_sample_counter / d_fs_in);
|
||||||
std::cout << "Tracking CH " << d_channel << ": Satellite " << d_acquisition_gnss_synchro->System << " "<< d_acquisition_gnss_synchro->PRN << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
std::cout << "Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
|
||||||
|
<< ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
||||||
//std::cout<<"TRK CH "<<d_channel<<" Carrier_lock_test="<<d_carrier_lock_test<< std::endl;
|
//std::cout<<"TRK CH "<<d_channel<<" Carrier_lock_test="<<d_carrier_lock_test<< std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*d_Early = gr_complex(0,0);
|
*d_Early = gr_complex(0,0);
|
||||||
*d_Prompt = gr_complex(0,0);
|
*d_Prompt = gr_complex(0,0);
|
||||||
*d_Late = gr_complex(0,0);
|
*d_Late = gr_complex(0,0);
|
||||||
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; //block output streams pointer
|
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; //block output streams pointer
|
||||||
//std::cout<<output_items.size()<<std::endl;
|
//std::cout<<output_items.size()<<std::endl;
|
||||||
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
|
// GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder
|
||||||
Gnss_Synchro current_synchro_data;
|
Gnss_Synchro current_synchro_data;
|
||||||
*out[0]=current_synchro_data;
|
*out[0] = current_synchro_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(d_dump)
|
if(d_dump)
|
||||||
@ -640,7 +653,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::set_channel_queue(concurrent_queue<int> *cha
|
|||||||
|
|
||||||
void Gps_L1_Ca_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
|
void Gps_L1_Ca_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
|
||||||
{
|
{
|
||||||
d_acquisition_gnss_synchro=p_gnss_synchro;
|
d_acquisition_gnss_synchro = p_gnss_synchro;
|
||||||
|
|
||||||
// Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
// Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||||
//DLOG(INFO) << "Tracking code phase set to " << d_acq_code_phase_samples;
|
//DLOG(INFO) << "Tracking code phase set to " << d_acq_code_phase_samples;
|
||||||
|
@ -193,6 +193,9 @@ private:
|
|||||||
// file dump
|
// file dump
|
||||||
std::string d_dump_filename;
|
std::string d_dump_filename;
|
||||||
std::ofstream d_dump_file;
|
std::ofstream d_dump_file;
|
||||||
|
|
||||||
|
std::map<std::string, std::string> systemName;
|
||||||
|
std::string sys;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_CC_H
|
#endif //GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_CC_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user