1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-12-23 16:36:02 +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:
Carles Fernandez
2012-01-30 23:14:57 +00:00
parent cdccdac4c6
commit 9625070ea9
4 changed files with 126 additions and 92 deletions

View File

@@ -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");
} }
@@ -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;
} }
@@ -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;
} }
} }

View File

@@ -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

View File

@@ -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>
@@ -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()
@@ -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
@@ -378,7 +389,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
// 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];
@@ -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,7 +539,8 @@ 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;
} }
} }
@@ -541,7 +554,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
//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;

View File

@@ -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