mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-14 20:20:35 +00:00
Implementation of new receiver telecommands standby and coldstart
This commit is contained in:
parent
19dca87427
commit
5b3eb12998
@ -40,6 +40,9 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GalileoE1Pcps8msAmbiguousAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -122,6 +122,12 @@ public:
|
||||
* \brief Restart acquisition algorithm
|
||||
*/
|
||||
void reset() override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
void set_state(int state __attribute__((unused))) override{};
|
||||
|
||||
private:
|
||||
|
@ -42,6 +42,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -131,6 +131,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_acquisition_sptr acquisition_;
|
||||
|
@ -39,9 +39,12 @@
|
||||
#include <glog/logging.h>
|
||||
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisitionFpga::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
@ -54,7 +57,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
|
||||
|
||||
DLOG(INFO) << "role " << role;
|
||||
|
||||
// item_type_ = configuration_->property(role + ".item_type", default_item_type);
|
||||
// item_type_ = configuration_->property(role + ".item_type", default_item_type);
|
||||
|
||||
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
|
||||
long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
@ -62,10 +65,10 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
|
||||
//if_ = configuration_->property(role + ".if", 0);
|
||||
//acq_parameters.freq = if_;
|
||||
|
||||
// dump_ = configuration_->property(role + ".dump", false);
|
||||
// acq_parameters.dump = dump_;
|
||||
// blocking_ = configuration_->property(role + ".blocking", true);
|
||||
// acq_parameters.blocking = blocking_;
|
||||
// dump_ = configuration_->property(role + ".dump", false);
|
||||
// acq_parameters.dump = dump_;
|
||||
// blocking_ = configuration_->property(role + ".blocking", true);
|
||||
// acq_parameters.blocking = blocking_;
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
acq_parameters.doppler_max = doppler_max_;
|
||||
@ -74,16 +77,16 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
|
||||
unsigned int sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 4);
|
||||
acq_parameters.sampled_ms = sampled_ms;
|
||||
|
||||
// bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
|
||||
// acq_parameters.bit_transition_flag = bit_transition_flag_;
|
||||
// use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions
|
||||
// acq_parameters.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_;
|
||||
// bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
|
||||
// acq_parameters.bit_transition_flag = bit_transition_flag_;
|
||||
// use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions
|
||||
// acq_parameters.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_;
|
||||
acquire_pilot_ = configuration_->property(role + ".acquire_pilot", false); //will be true in future versions
|
||||
|
||||
// max_dwells_ = configuration_->property(role + ".max_dwells", 1);
|
||||
// acq_parameters.max_dwells = max_dwells_;
|
||||
// dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
|
||||
// acq_parameters.dump_filename = dump_filename_;
|
||||
// max_dwells_ = configuration_->property(role + ".max_dwells", 1);
|
||||
// acq_parameters.max_dwells = max_dwells_;
|
||||
// dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
|
||||
// acq_parameters.dump_filename = dump_filename_;
|
||||
//--- Find number of samples per spreading code (4 ms) -----------------
|
||||
unsigned int code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
|
||||
//acq_parameters.samples_per_code = code_length_;
|
||||
@ -91,10 +94,10 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
|
||||
//acq_parameters.samples_per_ms = samples_per_ms;
|
||||
//unsigned int vector_length = sampled_ms * samples_per_ms;
|
||||
|
||||
// if (bit_transition_flag_)
|
||||
// {
|
||||
// vector_length_ *= 2;
|
||||
// }
|
||||
// if (bit_transition_flag_)
|
||||
// {
|
||||
// vector_length_ *= 2;
|
||||
// }
|
||||
|
||||
//printf("fs_in = %d\n", fs_in);
|
||||
//printf("Galileo_E1_B_CODE_LENGTH_CHIPS = %f\n", Galileo_E1_B_CODE_LENGTH_CHIPS);
|
||||
@ -111,166 +114,163 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
|
||||
std::string default_device_name = "/dev/uio0";
|
||||
std::string device_name = configuration_->property(role + ".devicename", default_device_name);
|
||||
acq_parameters.device_name = device_name;
|
||||
acq_parameters.samples_per_ms = nsamples_total/sampled_ms;
|
||||
acq_parameters.samples_per_ms = nsamples_total / sampled_ms;
|
||||
acq_parameters.samples_per_code = nsamples_total;
|
||||
|
||||
// compute all the GALILEO E1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time
|
||||
// a channel is assigned)
|
||||
gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT
|
||||
std::complex<float>* code = new std::complex<float>[nsamples_total]; // buffer for the local code
|
||||
std::complex<float>* code = new std::complex<float>[nsamples_total]; // buffer for the local code
|
||||
gr_complex* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E1_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32
|
||||
float max; // temporary maxima search
|
||||
float max; // temporary maxima search
|
||||
|
||||
//int tmp_re, tmp_im;
|
||||
|
||||
for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++)
|
||||
{
|
||||
//code_ = new gr_complex[vector_length_];
|
||||
|
||||
//code_ = new gr_complex[vector_length_];
|
||||
bool cboc = false; // cboc is set to 0 when using the FPGA
|
||||
|
||||
bool cboc = false; // cboc is set to 0 when using the FPGA
|
||||
//std::complex<float>* code = new std::complex<float>[code_length_];
|
||||
|
||||
//std::complex<float>* code = new std::complex<float>[code_length_];
|
||||
if (acquire_pilot_ == true)
|
||||
{
|
||||
//printf("yes acquiring pilot!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1\n");
|
||||
//set local signal generator to Galileo E1 pilot component (1C)
|
||||
char pilot_signal[3] = "1C";
|
||||
galileo_e1_code_gen_complex_sampled(code, pilot_signal,
|
||||
cboc, PRN, fs_in, 0, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
char data_signal[3] = "1B";
|
||||
galileo_e1_code_gen_complex_sampled(code, data_signal,
|
||||
cboc, PRN, fs_in, 0, false);
|
||||
}
|
||||
|
||||
if (acquire_pilot_ == true)
|
||||
{
|
||||
//printf("yes acquiring pilot!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1\n");
|
||||
//set local signal generator to Galileo E1 pilot component (1C)
|
||||
char pilot_signal[3] = "1C";
|
||||
galileo_e1_code_gen_complex_sampled(code, pilot_signal,
|
||||
cboc, PRN, fs_in, 0, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
char data_signal[3] = "1B";
|
||||
galileo_e1_code_gen_complex_sampled(code, data_signal,
|
||||
cboc, PRN, fs_in, 0, false);
|
||||
}
|
||||
|
||||
// for (unsigned int i = 0; i < sampled_ms / 4; i++)
|
||||
// {
|
||||
// //memcpy(&(code_[i * code_length_]), code, sizeof(gr_complex) * code_length_);
|
||||
// memcpy(&(d_all_fft_codes_[i * code_length_]), code, sizeof(gr_complex) * code_length_);
|
||||
// }
|
||||
// for (unsigned int i = 0; i < sampled_ms / 4; i++)
|
||||
// {
|
||||
// //memcpy(&(code_[i * code_length_]), code, sizeof(gr_complex) * code_length_);
|
||||
// memcpy(&(d_all_fft_codes_[i * code_length_]), code, sizeof(gr_complex) * code_length_);
|
||||
// }
|
||||
|
||||
|
||||
// // debug
|
||||
// char filename[25];
|
||||
// FILE *fid;
|
||||
// sprintf(filename,"gal_prn%d.txt", PRN);
|
||||
// fid = fopen(filename, "w");
|
||||
// for (unsigned int kk=0;kk< nsamples_total; kk++)
|
||||
// {
|
||||
// fprintf(fid, "%f\n", code[kk].real());
|
||||
// fprintf(fid, "%f\n", code[kk].imag());
|
||||
// }
|
||||
// fclose(fid);
|
||||
// // debug
|
||||
// char filename[25];
|
||||
// FILE *fid;
|
||||
// sprintf(filename,"gal_prn%d.txt", PRN);
|
||||
// fid = fopen(filename, "w");
|
||||
// for (unsigned int kk=0;kk< nsamples_total; kk++)
|
||||
// {
|
||||
// fprintf(fid, "%f\n", code[kk].real());
|
||||
// fprintf(fid, "%f\n", code[kk].imag());
|
||||
// }
|
||||
// fclose(fid);
|
||||
|
||||
|
||||
// // fill in zero padding
|
||||
for (int s = code_length; s < nsamples_total; s++)
|
||||
{
|
||||
code[s] = std::complex<float>(static_cast<float>(0,0));
|
||||
//code[s] = 0;
|
||||
}
|
||||
// // fill in zero padding
|
||||
for (int s = code_length; s < nsamples_total; s++)
|
||||
{
|
||||
code[s] = std::complex<float>(static_cast<float>(0, 0));
|
||||
//code[s] = 0;
|
||||
}
|
||||
|
||||
memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer
|
||||
fft_if->execute(); // Run the FFT of local code
|
||||
volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values
|
||||
memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer
|
||||
fft_if->execute(); // Run the FFT of local code
|
||||
volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values
|
||||
|
||||
// // debug
|
||||
// char filename[25];
|
||||
// FILE *fid;
|
||||
// sprintf(filename,"fft_gal_prn%d.txt", PRN);
|
||||
// fid = fopen(filename, "w");
|
||||
// for (unsigned int kk=0;kk< nsamples_total; kk++)
|
||||
// {
|
||||
// fprintf(fid, "%f\n", fft_codes_padded[kk].real());
|
||||
// fprintf(fid, "%f\n", fft_codes_padded[kk].imag());
|
||||
// }
|
||||
// fclose(fid);
|
||||
// // debug
|
||||
// char filename[25];
|
||||
// FILE *fid;
|
||||
// sprintf(filename,"fft_gal_prn%d.txt", PRN);
|
||||
// fid = fopen(filename, "w");
|
||||
// for (unsigned int kk=0;kk< nsamples_total; kk++)
|
||||
// {
|
||||
// fprintf(fid, "%f\n", fft_codes_padded[kk].real());
|
||||
// fprintf(fid, "%f\n", fft_codes_padded[kk].imag());
|
||||
// }
|
||||
// fclose(fid);
|
||||
|
||||
|
||||
// normalize the code
|
||||
max = 0; // initialize maximum value
|
||||
for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima
|
||||
{
|
||||
if (std::abs(fft_codes_padded[i].real()) > max)
|
||||
{
|
||||
max = std::abs(fft_codes_padded[i].real());
|
||||
}
|
||||
if (std::abs(fft_codes_padded[i].imag()) > max)
|
||||
{
|
||||
max = std::abs(fft_codes_padded[i].imag());
|
||||
}
|
||||
}
|
||||
for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs
|
||||
{
|
||||
//d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(4096*fft_codes_padded[i].real() * (pow(2, 3) - 1) / max)),
|
||||
// static_cast<int>(floor(4096*fft_codes_padded[i].imag() * (pow(2, 3) - 1) / max)));
|
||||
// d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(1024*fft_codes_padded[i].real() * (pow(2, 5) - 1) / max)),
|
||||
// static_cast<int>(floor(1024*fft_codes_padded[i].imag() * (pow(2, 5) - 1) / max)));
|
||||
// d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(256*fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)),
|
||||
// static_cast<int>(floor(256*fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max)));
|
||||
// d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(16*fft_codes_padded[i].real() * (pow(2, 11) - 1) / max)),
|
||||
// static_cast<int>(floor(16*fft_codes_padded[i].imag() * (pow(2, 11) - 1) / max)));
|
||||
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)),
|
||||
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max)));
|
||||
// normalize the code
|
||||
max = 0; // initialize maximum value
|
||||
for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima
|
||||
{
|
||||
if (std::abs(fft_codes_padded[i].real()) > max)
|
||||
{
|
||||
max = std::abs(fft_codes_padded[i].real());
|
||||
}
|
||||
if (std::abs(fft_codes_padded[i].imag()) > max)
|
||||
{
|
||||
max = std::abs(fft_codes_padded[i].imag());
|
||||
}
|
||||
}
|
||||
for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs
|
||||
{
|
||||
//d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(4096*fft_codes_padded[i].real() * (pow(2, 3) - 1) / max)),
|
||||
// static_cast<int>(floor(4096*fft_codes_padded[i].imag() * (pow(2, 3) - 1) / max)));
|
||||
// d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(1024*fft_codes_padded[i].real() * (pow(2, 5) - 1) / max)),
|
||||
// static_cast<int>(floor(1024*fft_codes_padded[i].imag() * (pow(2, 5) - 1) / max)));
|
||||
// d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(256*fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)),
|
||||
// static_cast<int>(floor(256*fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max)));
|
||||
// d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(16*fft_codes_padded[i].real() * (pow(2, 11) - 1) / max)),
|
||||
// static_cast<int>(floor(16*fft_codes_padded[i].imag() * (pow(2, 11) - 1) / max)));
|
||||
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)),
|
||||
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max)));
|
||||
|
||||
// tmp_re = static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max));
|
||||
// tmp_im = static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max));
|
||||
|
||||
// if (tmp_re > 127)
|
||||
// {
|
||||
// tmp_re = 127;
|
||||
// }
|
||||
// if (tmp_re < -128)
|
||||
// {
|
||||
// tmp_re = -128;
|
||||
// }
|
||||
// if (tmp_im > 127)
|
||||
// {
|
||||
// tmp_im = 127;
|
||||
// }
|
||||
// if (tmp_im < -128)
|
||||
// {
|
||||
// tmp_im = -128;
|
||||
// }
|
||||
// d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(tmp_re), static_cast<int>(tmp_im));
|
||||
//
|
||||
}
|
||||
|
||||
// // debug
|
||||
// char filename2[25];
|
||||
// FILE *fid2;
|
||||
// sprintf(filename2,"fft_gal_prn%d_norm.txt", PRN);
|
||||
// fid2 = fopen(filename2, "w");
|
||||
// for (unsigned int kk=0;kk< nsamples_total; kk++)
|
||||
// {
|
||||
// fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].real());
|
||||
// fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].imag());
|
||||
// }
|
||||
// fclose(fid2);
|
||||
// tmp_re = static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max));
|
||||
// tmp_im = static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max));
|
||||
|
||||
// if (tmp_re > 127)
|
||||
// {
|
||||
// tmp_re = 127;
|
||||
// }
|
||||
// if (tmp_re < -128)
|
||||
// {
|
||||
// tmp_re = -128;
|
||||
// }
|
||||
// if (tmp_im > 127)
|
||||
// {
|
||||
// tmp_im = 127;
|
||||
// }
|
||||
// if (tmp_im < -128)
|
||||
// {
|
||||
// tmp_im = -128;
|
||||
// }
|
||||
// d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(tmp_re), static_cast<int>(tmp_im));
|
||||
//
|
||||
}
|
||||
|
||||
// // debug
|
||||
// char filename2[25];
|
||||
// FILE *fid2;
|
||||
// sprintf(filename2,"fft_gal_prn%d_norm.txt", PRN);
|
||||
// fid2 = fopen(filename2, "w");
|
||||
// for (unsigned int kk=0;kk< nsamples_total; kk++)
|
||||
// {
|
||||
// fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].real());
|
||||
// fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].imag());
|
||||
// }
|
||||
// fclose(fid2);
|
||||
}
|
||||
|
||||
|
||||
// for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++)
|
||||
// {
|
||||
// // debug
|
||||
// char filename2[25];
|
||||
// FILE *fid2;
|
||||
// sprintf(filename2,"fft_gal_prn%d_norm_last.txt", PRN);
|
||||
// fid2 = fopen(filename2, "w");
|
||||
// for (unsigned int kk=0;kk< nsamples_total; kk++)
|
||||
// {
|
||||
// fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].real());
|
||||
// fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].imag());
|
||||
// }
|
||||
// fclose(fid2);
|
||||
// }
|
||||
// for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++)
|
||||
// {
|
||||
// // debug
|
||||
// char filename2[25];
|
||||
// FILE *fid2;
|
||||
// sprintf(filename2,"fft_gal_prn%d_norm_last.txt", PRN);
|
||||
// fid2 = fopen(filename2, "w");
|
||||
// for (unsigned int kk=0;kk< nsamples_total; kk++)
|
||||
// {
|
||||
// fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].real());
|
||||
// fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].imag());
|
||||
// }
|
||||
// fclose(fid2);
|
||||
// }
|
||||
|
||||
//acq_parameters
|
||||
|
||||
@ -284,14 +284,14 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
|
||||
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";
|
||||
|
||||
// stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||
// DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||
// stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||
// DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||
|
||||
// if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// cbyte_to_float_x2_ = make_complex_byte_to_float_x2();
|
||||
// float_to_complex_ = gr::blocks::float_to_complex::make();
|
||||
// }
|
||||
// if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// cbyte_to_float_x2_ = make_complex_byte_to_float_x2();
|
||||
// float_to_complex_ = gr::blocks::float_to_complex::make();
|
||||
// }
|
||||
|
||||
channel_ = 0;
|
||||
//threshold_ = 0.0;
|
||||
@ -325,22 +325,22 @@ void GalileoE1PcpsAmbiguousAcquisitionFpga::set_threshold(float threshold)
|
||||
// the .pfa parameter and the threshold calculation is only used for the CFAR algorithm.
|
||||
// We don't use the CFAR algorithm in the FPGA. Therefore the threshold is set as such.
|
||||
|
||||
// float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
//
|
||||
// if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
//
|
||||
// if (pfa == 0.0)
|
||||
// {
|
||||
// threshold_ = threshold;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// threshold_ = calculate_threshold(pfa);
|
||||
// }
|
||||
// float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
//
|
||||
// if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
//
|
||||
// if (pfa == 0.0)
|
||||
// {
|
||||
// threshold_ = threshold;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// threshold_ = calculate_threshold(pfa);
|
||||
// }
|
||||
|
||||
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold;
|
||||
acquisition_fpga_->set_threshold(threshold);
|
||||
// acquisition_fpga_->set_threshold(threshold_);
|
||||
// acquisition_fpga_->set_threshold(threshold_);
|
||||
//printf("top acq set threshold end\n");
|
||||
}
|
||||
|
||||
@ -377,7 +377,7 @@ void GalileoE1PcpsAmbiguousAcquisitionFpga::set_gnss_synchro(Gnss_Synchro* gnss_
|
||||
|
||||
signed int GalileoE1PcpsAmbiguousAcquisitionFpga::mag()
|
||||
{
|
||||
// printf("top acq mag start\n");
|
||||
// printf("top acq mag start\n");
|
||||
return acquisition_fpga_->mag();
|
||||
//printf("top acq mag end\n");
|
||||
}
|
||||
@ -385,60 +385,60 @@ signed int GalileoE1PcpsAmbiguousAcquisitionFpga::mag()
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisitionFpga::init()
|
||||
{
|
||||
// printf("top acq init start\n");
|
||||
// printf("top acq init start\n");
|
||||
acquisition_fpga_->init();
|
||||
// printf("top acq init end\n");
|
||||
// printf("top acq init end\n");
|
||||
//set_local_code();
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisitionFpga::set_local_code()
|
||||
{
|
||||
// printf("top acq set local code start\n");
|
||||
// bool cboc = configuration_->property(
|
||||
// "Acquisition" + boost::lexical_cast<std::string>(channel_) + ".cboc", false);
|
||||
//
|
||||
// std::complex<float>* code = new std::complex<float>[code_length_];
|
||||
//
|
||||
// if (acquire_pilot_ == true)
|
||||
// {
|
||||
// //set local signal generator to Galileo E1 pilot component (1C)
|
||||
// char pilot_signal[3] = "1C";
|
||||
// galileo_e1_code_gen_complex_sampled(code, pilot_signal,
|
||||
// cboc, gnss_synchro_->PRN, fs_in_, 0, false);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal,
|
||||
// cboc, gnss_synchro_->PRN, fs_in_, 0, false);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// for (unsigned int i = 0; i < sampled_ms_ / 4; i++)
|
||||
// {
|
||||
// memcpy(&(code_[i * code_length_]), code, sizeof(gr_complex) * code_length_);
|
||||
// }
|
||||
// printf("top acq set local code start\n");
|
||||
// bool cboc = configuration_->property(
|
||||
// "Acquisition" + boost::lexical_cast<std::string>(channel_) + ".cboc", false);
|
||||
//
|
||||
// std::complex<float>* code = new std::complex<float>[code_length_];
|
||||
//
|
||||
// if (acquire_pilot_ == true)
|
||||
// {
|
||||
// //set local signal generator to Galileo E1 pilot component (1C)
|
||||
// char pilot_signal[3] = "1C";
|
||||
// galileo_e1_code_gen_complex_sampled(code, pilot_signal,
|
||||
// cboc, gnss_synchro_->PRN, fs_in_, 0, false);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal,
|
||||
// cboc, gnss_synchro_->PRN, fs_in_, 0, false);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// for (unsigned int i = 0; i < sampled_ms_ / 4; i++)
|
||||
// {
|
||||
// memcpy(&(code_[i * code_length_]), code, sizeof(gr_complex) * code_length_);
|
||||
// }
|
||||
|
||||
//acquisition_fpga_->set_local_code(code_);
|
||||
acquisition_fpga_->set_local_code();
|
||||
// delete[] code;
|
||||
// printf("top acq set local code end\n");
|
||||
// delete[] code;
|
||||
// printf("top acq set local code end\n");
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisitionFpga::reset()
|
||||
{
|
||||
// printf("top acq reset start\n");
|
||||
// printf("top acq reset start\n");
|
||||
acquisition_fpga_->set_active(true);
|
||||
// printf("top acq reset end\n");
|
||||
// printf("top acq reset end\n");
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisitionFpga::set_state(int state)
|
||||
{
|
||||
// printf("top acq set state start\n");
|
||||
// printf("top acq set state start\n");
|
||||
acquisition_fpga_->set_state(state);
|
||||
// printf("top acq set state end\n");
|
||||
// printf("top acq set state end\n");
|
||||
}
|
||||
|
||||
|
||||
@ -465,26 +465,26 @@ void GalileoE1PcpsAmbiguousAcquisitionFpga::set_state(int state)
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisitionFpga::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
// printf("top acq connect\n");
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
||||
// top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
||||
// top_block->connect(float_to_complex_, 0, stream_to_vector_, 0);
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
// printf("top acq connect\n");
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
||||
// top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
||||
// top_block->connect(float_to_complex_, 0, stream_to_vector_, 0);
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
|
||||
// nothing to connect
|
||||
}
|
||||
@ -492,61 +492,60 @@ void GalileoE1PcpsAmbiguousAcquisitionFpga::connect(gr::top_block_sptr top_block
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisitionFpga::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// // Since a byte-based acq implementation is not available,
|
||||
// // we just convert cshorts to gr_complex
|
||||
// top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
||||
// top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
||||
// top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0);
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// // Since a byte-based acq implementation is not available,
|
||||
// // we just convert cshorts to gr_complex
|
||||
// top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
||||
// top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
||||
// top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0);
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
|
||||
// nothing to disconnect
|
||||
// printf("top acq disconnect\n");
|
||||
// printf("top acq disconnect\n");
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisitionFpga::get_left_block()
|
||||
{
|
||||
// printf("top acq get left block start\n");
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// return stream_to_vector_;
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// return stream_to_vector_;
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// return cbyte_to_float_x2_;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
return nullptr;
|
||||
// }
|
||||
// printf("top acq get left block end\n");
|
||||
// printf("top acq get left block start\n");
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// return stream_to_vector_;
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// return stream_to_vector_;
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// return cbyte_to_float_x2_;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
return nullptr;
|
||||
// }
|
||||
// printf("top acq get left block end\n");
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisitionFpga::get_right_block()
|
||||
{
|
||||
// printf("top acq get right block start\n");
|
||||
// printf("top acq get right block start\n");
|
||||
return acquisition_fpga_;
|
||||
// printf("top acq get right block end\n");
|
||||
// printf("top acq get right block end\n");
|
||||
}
|
||||
|
||||
|
@ -136,6 +136,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
//pcps_acquisition_sptr acquisition_;
|
||||
|
@ -40,6 +40,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GalileoE1PcpsCccwsrAmbiguousAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -125,6 +125,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_cccwsr_acquisition_cc_sptr acquisition_cc_;
|
||||
|
@ -40,6 +40,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GalileoE1PcpsQuickSyncAmbiguousAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -129,6 +129,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_quicksync_acquisition_cc_sptr acquisition_cc_;
|
||||
|
@ -40,6 +40,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GalileoE1PcpsTongAmbiguousAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -128,6 +128,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_tong_acquisition_cc_sptr acquisition_cc_;
|
||||
|
@ -46,6 +46,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GalileoE5aNoncoherentIQAcquisitionCaf::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -131,6 +131,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr acquisition_cc_;
|
||||
|
@ -42,6 +42,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GalileoE5aPcpsAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
|
@ -122,6 +122,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
float calculate_threshold(float pfa);
|
||||
|
||||
|
@ -39,15 +39,16 @@
|
||||
#include <volk_gnsssdr/volk_gnsssdr_complex.h>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GalileoE5aPcpsAcquisitionFpga::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
//printf("creating the E5A acquisition");
|
||||
//printf("creating the E5A acquisition");
|
||||
pcpsconf_fpga_t acq_parameters;
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -100,7 +101,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
|
||||
std::string default_device_name = "/dev/uio0";
|
||||
std::string device_name = configuration_->property(role + ".devicename", default_device_name);
|
||||
acq_parameters.device_name = device_name;
|
||||
acq_parameters.samples_per_ms = nsamples_total/sampled_ms;
|
||||
acq_parameters.samples_per_ms = nsamples_total / sampled_ms;
|
||||
acq_parameters.samples_per_code = nsamples_total;
|
||||
|
||||
//vector_length_ = code_length_ * sampled_ms_;
|
||||
@ -108,10 +109,10 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
|
||||
// compute all the GALILEO E5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time
|
||||
// a channel is assigned)
|
||||
gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT
|
||||
std::complex<float>* code = new std::complex<float>[nsamples_total]; // buffer for the local code
|
||||
std::complex<float>* code = new std::complex<float>[nsamples_total]; // buffer for the local code
|
||||
gr_complex* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E5a_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32
|
||||
float max; // temporary maxima search
|
||||
float max; // temporary maxima search
|
||||
|
||||
//printf("creating the E5A acquisition CONT");
|
||||
//printf("nsamples_total = %d\n", nsamples_total);
|
||||
@ -140,16 +141,16 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
|
||||
// fill in zero padding
|
||||
for (int s = code_length; s < nsamples_total; s++)
|
||||
{
|
||||
code[s] = std::complex<float>(static_cast<float>(0,0));
|
||||
code[s] = std::complex<float>(static_cast<float>(0, 0));
|
||||
//code[s] = 0;
|
||||
}
|
||||
|
||||
memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer
|
||||
memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer
|
||||
fft_if->execute(); // Run the FFT of local code
|
||||
volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values
|
||||
|
||||
max = 0; // initialize maximum value
|
||||
for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima
|
||||
max = 0; // initialize maximum value
|
||||
for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima
|
||||
{
|
||||
if (std::abs(fft_codes_padded[i].real()) > max)
|
||||
{
|
||||
@ -165,7 +166,6 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
|
||||
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)),
|
||||
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -178,19 +178,19 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
|
||||
|
||||
//code_ = new gr_complex[vector_length_];
|
||||
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// item_size_ = sizeof(lv_16sc_t);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// item_size_ = sizeof(lv_16sc_t);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
//acq_parameters.it_size = item_size_;
|
||||
//acq_parameters.samples_per_code = code_length_;
|
||||
//acq_parameters.samples_per_ms = code_length_;
|
||||
@ -231,22 +231,22 @@ void GalileoE5aPcpsAcquisitionFpga::set_channel(unsigned int channel)
|
||||
|
||||
void GalileoE5aPcpsAcquisitionFpga::set_threshold(float threshold)
|
||||
{
|
||||
// float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
//
|
||||
// if (pfa == 0.0)
|
||||
// {
|
||||
// pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
// }
|
||||
//
|
||||
// if (pfa == 0.0)
|
||||
// {
|
||||
// threshold_ = threshold;
|
||||
// }
|
||||
//
|
||||
// else
|
||||
// {
|
||||
// threshold_ = calculate_threshold(pfa);
|
||||
// }
|
||||
// float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
//
|
||||
// if (pfa == 0.0)
|
||||
// {
|
||||
// pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
// }
|
||||
//
|
||||
// if (pfa == 0.0)
|
||||
// {
|
||||
// threshold_ = threshold;
|
||||
// }
|
||||
//
|
||||
// else
|
||||
// {
|
||||
// threshold_ = calculate_threshold(pfa);
|
||||
// }
|
||||
|
||||
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold;
|
||||
|
||||
@ -295,32 +295,32 @@ void GalileoE5aPcpsAcquisitionFpga::init()
|
||||
|
||||
void GalileoE5aPcpsAcquisitionFpga::set_local_code()
|
||||
{
|
||||
// gr_complex* code = new gr_complex[code_length_];
|
||||
// char signal_[3];
|
||||
//
|
||||
// if (acq_iq_)
|
||||
// {
|
||||
// strcpy(signal_, "5X");
|
||||
// }
|
||||
// else if (acq_pilot_)
|
||||
// {
|
||||
// strcpy(signal_, "5Q");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// strcpy(signal_, "5I");
|
||||
// }
|
||||
//
|
||||
// galileo_e5_a_code_gen_complex_sampled(code, signal_, gnss_synchro_->PRN, fs_in_, 0);
|
||||
//
|
||||
// for (unsigned int i = 0; i < sampled_ms_; i++)
|
||||
// {
|
||||
// memcpy(code_ + (i * code_length_), code, sizeof(gr_complex) * code_length_);
|
||||
// }
|
||||
// gr_complex* code = new gr_complex[code_length_];
|
||||
// char signal_[3];
|
||||
//
|
||||
// if (acq_iq_)
|
||||
// {
|
||||
// strcpy(signal_, "5X");
|
||||
// }
|
||||
// else if (acq_pilot_)
|
||||
// {
|
||||
// strcpy(signal_, "5Q");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// strcpy(signal_, "5I");
|
||||
// }
|
||||
//
|
||||
// galileo_e5_a_code_gen_complex_sampled(code, signal_, gnss_synchro_->PRN, fs_in_, 0);
|
||||
//
|
||||
// for (unsigned int i = 0; i < sampled_ms_; i++)
|
||||
// {
|
||||
// memcpy(code_ + (i * code_length_), code, sizeof(gr_complex) * code_length_);
|
||||
// }
|
||||
|
||||
//acquisition_->set_local_code(code_);
|
||||
acquisition_fpga_->set_local_code();
|
||||
// delete[] code;
|
||||
// delete[] code;
|
||||
}
|
||||
|
||||
|
||||
@ -359,35 +359,35 @@ void GalileoE5aPcpsAcquisitionFpga::set_state(int state)
|
||||
|
||||
void GalileoE5aPcpsAcquisitionFpga::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
void GalileoE5aPcpsAcquisitionFpga::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
@ -124,6 +124,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
//float calculate_threshold(float pfa);
|
||||
|
||||
|
@ -43,6 +43,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GlonassL1CaPcpsAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -131,6 +131,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_acquisition_sptr acquisition_;
|
||||
|
@ -42,6 +42,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GlonassL2CaPcpsAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -130,6 +130,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_acquisition_sptr acquisition_;
|
||||
|
@ -45,6 +45,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL1CaPcpsAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -135,6 +135,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_acquisition_sptr acquisition_;
|
||||
|
@ -42,6 +42,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL1CaPcpsAcquisitionFineDoppler::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -126,6 +126,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
pcps_acquisition_fine_doppler_cc_sptr acquisition_cc_;
|
||||
size_t item_size_;
|
||||
|
@ -48,6 +48,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL1CaPcpsAcquisitionFpga::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -134,6 +134,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_acquisition_fpga_sptr acquisition_fpga_;
|
||||
|
@ -42,6 +42,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL1CaPcpsAssistedAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -122,6 +122,11 @@ public:
|
||||
void reset() override;
|
||||
void set_state(int state __attribute__((unused))) override{};
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
pcps_assisted_acquisition_cc_sptr acquisition_cc_;
|
||||
size_t item_size_;
|
||||
|
@ -40,6 +40,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL1CaPcpsOpenClAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -124,6 +124,11 @@ public:
|
||||
void reset() override;
|
||||
void set_state(int state __attribute__((unused))) override{};
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_opencl_acquisition_cc_sptr acquisition_cc_;
|
||||
|
@ -41,6 +41,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL1CaPcpsQuickSyncAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -130,6 +130,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_quicksync_acquisition_cc_sptr acquisition_cc_;
|
||||
|
@ -40,6 +40,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL1CaPcpsTongAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -129,6 +129,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_tong_acquisition_cc_sptr acquisition_cc_;
|
||||
|
@ -43,6 +43,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL2MPcpsAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -133,6 +133,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_acquisition_sptr acquisition_;
|
||||
|
@ -43,6 +43,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL2MPcpsAcquisitionFpga::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
@ -93,7 +97,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
|
||||
std::string default_device_name = "/dev/uio0";
|
||||
std::string device_name = configuration_->property(role + ".devicename", default_device_name);
|
||||
acq_parameters.device_name = device_name;
|
||||
acq_parameters.samples_per_ms = nsamples_total/acq_parameters.sampled_ms;
|
||||
acq_parameters.samples_per_ms = nsamples_total / acq_parameters.sampled_ms;
|
||||
//acq_parameters.samples_per_ms = static_cast<int>(std::round(static_cast<double>(fs_in_) * 0.001));
|
||||
acq_parameters.samples_per_code = nsamples_total;
|
||||
|
||||
@ -111,10 +115,10 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
|
||||
// fill in zero padding
|
||||
for (int s = code_length; s < nsamples_total; s++)
|
||||
{
|
||||
code[s] = std::complex<float>(static_cast<float>(0,0));
|
||||
code[s] = std::complex<float>(static_cast<float>(0, 0));
|
||||
//code[s] = 0;
|
||||
}
|
||||
memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer
|
||||
memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer
|
||||
fft_if->execute(); // Run the FFT of local code
|
||||
volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values
|
||||
max = 0; // initialize maximum value
|
||||
@ -134,7 +138,6 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
|
||||
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)),
|
||||
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//acq_parameters
|
||||
@ -153,26 +156,23 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
|
||||
gnss_synchro_ = 0;
|
||||
|
||||
|
||||
// vector_length_ = code_length_;
|
||||
//
|
||||
// if (bit_transition_flag_)
|
||||
// {
|
||||
// vector_length_ *= 2;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// vector_length_ = code_length_;
|
||||
//
|
||||
// if (bit_transition_flag_)
|
||||
// {
|
||||
// vector_length_ *= 2;
|
||||
// }
|
||||
|
||||
// code_ = new gr_complex[vector_length_];
|
||||
//
|
||||
// if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// item_size_ = sizeof(lv_16sc_t);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// }
|
||||
// code_ = new gr_complex[vector_length_];
|
||||
//
|
||||
// if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// item_size_ = sizeof(lv_16sc_t);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// }
|
||||
//acq_parameters.samples_per_ms = static_cast<int>(std::round(static_cast<double>(fs_in_) * 0.001));
|
||||
//acq_parameters.samples_per_code = code_length_;
|
||||
//acq_parameters.it_size = item_size_;
|
||||
@ -183,19 +183,19 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
|
||||
//acquisition_ = pcps_make_acquisition(acq_parameters);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";
|
||||
|
||||
// stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||
// DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||
//
|
||||
// if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// cbyte_to_float_x2_ = make_complex_byte_to_float_x2();
|
||||
// float_to_complex_ = gr::blocks::float_to_complex::make();
|
||||
// }
|
||||
// stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||
// DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||
//
|
||||
// if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// cbyte_to_float_x2_ = make_complex_byte_to_float_x2();
|
||||
// float_to_complex_ = gr::blocks::float_to_complex::make();
|
||||
// }
|
||||
|
||||
// channel_ = 0;
|
||||
// channel_ = 0;
|
||||
threshold_ = 0.0;
|
||||
// doppler_step_ = 0;
|
||||
// gnss_synchro_ = 0;
|
||||
// doppler_step_ = 0;
|
||||
// gnss_synchro_ = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -215,20 +215,20 @@ void GpsL2MPcpsAcquisitionFpga::set_channel(unsigned int channel)
|
||||
|
||||
void GpsL2MPcpsAcquisitionFpga::set_threshold(float threshold)
|
||||
{
|
||||
// float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
//
|
||||
// if (pfa == 0.0)
|
||||
// {
|
||||
// pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
// }
|
||||
// if (pfa == 0.0)
|
||||
// {
|
||||
// threshold_ = threshold;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// threshold_ = calculate_threshold(pfa);
|
||||
// }
|
||||
// float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
//
|
||||
// if (pfa == 0.0)
|
||||
// {
|
||||
// pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
// }
|
||||
// if (pfa == 0.0)
|
||||
// {
|
||||
// threshold_ = threshold;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// threshold_ = calculate_threshold(pfa);
|
||||
// }
|
||||
|
||||
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
|
||||
|
||||
@ -317,25 +317,25 @@ void GpsL2MPcpsAcquisitionFpga::set_state(int state)
|
||||
|
||||
void GpsL2MPcpsAcquisitionFpga::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
||||
// top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
||||
// top_block->connect(float_to_complex_, 0, stream_to_vector_, 0);
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
||||
// top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
||||
// top_block->connect(float_to_complex_, 0, stream_to_vector_, 0);
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
|
||||
// nothing to connect
|
||||
}
|
||||
@ -343,27 +343,27 @@ void GpsL2MPcpsAcquisitionFpga::connect(gr::top_block_sptr top_block)
|
||||
|
||||
void GpsL2MPcpsAcquisitionFpga::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// // Since a byte-based acq implementation is not available,
|
||||
// // we just convert cshorts to gr_complex
|
||||
// top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
||||
// top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
||||
// top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0);
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// // Since a byte-based acq implementation is not available,
|
||||
// // we just convert cshorts to gr_complex
|
||||
// top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
||||
// top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
||||
// top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0);
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
|
||||
// nothing to disconnect
|
||||
}
|
||||
@ -371,23 +371,23 @@ void GpsL2MPcpsAcquisitionFpga::disconnect(gr::top_block_sptr top_block)
|
||||
|
||||
gr::basic_block_sptr GpsL2MPcpsAcquisitionFpga::get_left_block()
|
||||
{
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// return stream_to_vector_;
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// return stream_to_vector_;
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// return cbyte_to_float_x2_;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// return nullptr;
|
||||
// }
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// return stream_to_vector_;
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// return stream_to_vector_;
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// return cbyte_to_float_x2_;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// return nullptr;
|
||||
// }
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -134,6 +134,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
//pcps_acquisition_sptr acquisition_;
|
||||
|
@ -43,6 +43,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL5iPcpsAcquisition::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -133,6 +133,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_acquisition_sptr acquisition_;
|
||||
|
@ -43,12 +43,16 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL5iPcpsAcquisitionFpga::stop_acquisition()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
//printf("L5 ACQ CLASS CREATED\n");
|
||||
pcpsconf_fpga_t acq_parameters;
|
||||
//printf("L5 ACQ CLASS CREATED\n");
|
||||
pcpsconf_fpga_t acq_parameters;
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
std::string default_dump_filename = "./data/acquisition.dat";
|
||||
@ -110,48 +114,46 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
|
||||
|
||||
//printf("L5 ACQ CLASS MID 1 vector_length = %d\n", vector_length);
|
||||
|
||||
float max; // temporary maxima search
|
||||
float max; // temporary maxima search
|
||||
for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++)
|
||||
{
|
||||
//printf("L5 ACQ CLASS processing PRN = %d\n", PRN);
|
||||
gps_l5i_code_gen_complex_sampled(code, PRN, fs_in);
|
||||
//printf("L5 ACQ CLASS processing PRN = %d (cont) \n", PRN);
|
||||
// fill in zero padding
|
||||
for (int s = code_length; s < nsamples_total; s++)
|
||||
{
|
||||
code[s] = std::complex<float>(static_cast<float>(0,0));
|
||||
//code[s] = 0;
|
||||
}
|
||||
memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer
|
||||
fft_if->execute(); // Run the FFT of local code
|
||||
volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values
|
||||
{
|
||||
//printf("L5 ACQ CLASS processing PRN = %d\n", PRN);
|
||||
gps_l5i_code_gen_complex_sampled(code, PRN, fs_in);
|
||||
//printf("L5 ACQ CLASS processing PRN = %d (cont) \n", PRN);
|
||||
// fill in zero padding
|
||||
for (int s = code_length; s < nsamples_total; s++)
|
||||
{
|
||||
code[s] = std::complex<float>(static_cast<float>(0, 0));
|
||||
//code[s] = 0;
|
||||
}
|
||||
memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer
|
||||
fft_if->execute(); // Run the FFT of local code
|
||||
volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values
|
||||
|
||||
max = 0; // initialize maximum value
|
||||
for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima
|
||||
{
|
||||
if (std::abs(fft_codes_padded[i].real()) > max)
|
||||
{
|
||||
max = std::abs(fft_codes_padded[i].real());
|
||||
}
|
||||
if (std::abs(fft_codes_padded[i].imag()) > max)
|
||||
{
|
||||
max = std::abs(fft_codes_padded[i].imag());
|
||||
}
|
||||
}
|
||||
for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs
|
||||
{
|
||||
//d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(256*fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)),
|
||||
// static_cast<int>(floor(256*fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max)));
|
||||
//d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(16*floor(fft_codes_padded[i].real() * (pow(2, 11) - 1) / max)),
|
||||
// static_cast<int>(16*floor(fft_codes_padded[i].imag() * (pow(2, 11) - 1) / max)));
|
||||
//d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)),
|
||||
// static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max)));
|
||||
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)),
|
||||
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
max = 0; // initialize maximum value
|
||||
for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima
|
||||
{
|
||||
if (std::abs(fft_codes_padded[i].real()) > max)
|
||||
{
|
||||
max = std::abs(fft_codes_padded[i].real());
|
||||
}
|
||||
if (std::abs(fft_codes_padded[i].imag()) > max)
|
||||
{
|
||||
max = std::abs(fft_codes_padded[i].imag());
|
||||
}
|
||||
}
|
||||
for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs
|
||||
{
|
||||
//d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(256*fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)),
|
||||
// static_cast<int>(floor(256*fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max)));
|
||||
//d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(16*floor(fft_codes_padded[i].real() * (pow(2, 11) - 1) / max)),
|
||||
// static_cast<int>(16*floor(fft_codes_padded[i].imag() * (pow(2, 11) - 1) / max)));
|
||||
//d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)),
|
||||
// static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max)));
|
||||
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)),
|
||||
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//printf("L5 ACQ CLASS MID 2\n");
|
||||
@ -163,47 +165,47 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
|
||||
delete[] code;
|
||||
delete fft_if;
|
||||
delete[] fft_codes_padded;
|
||||
// vector_length_ = code_length_;
|
||||
//
|
||||
// if (bit_transition_flag_)
|
||||
// {
|
||||
// vector_length_ *= 2;
|
||||
// }
|
||||
//
|
||||
// code_ = new gr_complex[vector_length_];
|
||||
//
|
||||
// if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// item_size_ = sizeof(lv_16sc_t);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// }
|
||||
// acq_parameters.samples_per_code = code_length_;
|
||||
// acq_parameters.samples_per_ms = code_length_;
|
||||
// acq_parameters.it_size = item_size_;
|
||||
// vector_length_ = code_length_;
|
||||
//
|
||||
// if (bit_transition_flag_)
|
||||
// {
|
||||
// vector_length_ *= 2;
|
||||
// }
|
||||
//
|
||||
// code_ = new gr_complex[vector_length_];
|
||||
//
|
||||
// if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// item_size_ = sizeof(lv_16sc_t);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// }
|
||||
// acq_parameters.samples_per_code = code_length_;
|
||||
// acq_parameters.samples_per_ms = code_length_;
|
||||
// acq_parameters.it_size = item_size_;
|
||||
//acq_parameters.sampled_ms = 1;
|
||||
// acq_parameters.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4);
|
||||
// acq_parameters.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0);
|
||||
// acq_parameters.make_2_steps = configuration_->property(role + ".make_two_steps", false);
|
||||
// acquisition_fpga_ = pcps_make_acquisition(acq_parameters);
|
||||
// DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";
|
||||
// acq_parameters.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4);
|
||||
// acq_parameters.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0);
|
||||
// acq_parameters.make_2_steps = configuration_->property(role + ".make_two_steps", false);
|
||||
// acquisition_fpga_ = pcps_make_acquisition(acq_parameters);
|
||||
// DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";
|
||||
|
||||
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")";
|
||||
|
||||
// stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||
// DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||
//
|
||||
// if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// cbyte_to_float_x2_ = make_complex_byte_to_float_x2();
|
||||
// float_to_complex_ = gr::blocks::float_to_complex::make();
|
||||
// }
|
||||
// stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||
// DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||
//
|
||||
// if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// cbyte_to_float_x2_ = make_complex_byte_to_float_x2();
|
||||
// float_to_complex_ = gr::blocks::float_to_complex::make();
|
||||
// }
|
||||
|
||||
channel_ = 0;
|
||||
// threshold_ = 0.0;
|
||||
// threshold_ = 0.0;
|
||||
doppler_step_ = 0;
|
||||
gnss_synchro_ = 0;
|
||||
//printf("L5 ACQ CLASS FINISHED\n");
|
||||
@ -221,34 +223,32 @@ void GpsL5iPcpsAcquisitionFpga::set_channel(unsigned int channel)
|
||||
{
|
||||
channel_ = channel;
|
||||
acquisition_fpga_->set_channel(channel_);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void GpsL5iPcpsAcquisitionFpga::set_threshold(float threshold)
|
||||
{
|
||||
// float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
//
|
||||
// if (pfa == 0.0)
|
||||
// {
|
||||
// pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
// }
|
||||
// if (pfa == 0.0)
|
||||
// {
|
||||
// threshold_ = threshold;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// threshold_ = calculate_threshold(pfa);
|
||||
// }
|
||||
// float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
//
|
||||
// if (pfa == 0.0)
|
||||
// {
|
||||
// pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
// }
|
||||
// if (pfa == 0.0)
|
||||
// {
|
||||
// threshold_ = threshold;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// threshold_ = calculate_threshold(pfa);
|
||||
// }
|
||||
|
||||
// DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
|
||||
// DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
|
||||
|
||||
// the .pfa parameter and the threshold calculation is only used for the CFAR algorithm.
|
||||
// We don't use the CFAR algorithm in the FPGA. Therefore the threshold is set as such.
|
||||
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold;
|
||||
acquisition_fpga_->set_threshold(threshold);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -277,18 +277,18 @@ void GpsL5iPcpsAcquisitionFpga::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
|
||||
|
||||
signed int GpsL5iPcpsAcquisitionFpga::mag()
|
||||
{
|
||||
return acquisition_fpga_->mag();
|
||||
return acquisition_fpga_->mag();
|
||||
}
|
||||
|
||||
|
||||
void GpsL5iPcpsAcquisitionFpga::init()
|
||||
{
|
||||
acquisition_fpga_->init();
|
||||
acquisition_fpga_->init();
|
||||
}
|
||||
|
||||
void GpsL5iPcpsAcquisitionFpga::set_local_code()
|
||||
{
|
||||
acquisition_fpga_->set_local_code();
|
||||
acquisition_fpga_->set_local_code();
|
||||
}
|
||||
|
||||
|
||||
@ -325,75 +325,75 @@ void GpsL5iPcpsAcquisitionFpga::set_state(int state)
|
||||
|
||||
void GpsL5iPcpsAcquisitionFpga::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
||||
// top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
||||
// top_block->connect(float_to_complex_, 0, stream_to_vector_, 0);
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
||||
// top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
||||
// top_block->connect(float_to_complex_, 0, stream_to_vector_, 0);
|
||||
// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
// nothing to connect
|
||||
}
|
||||
|
||||
|
||||
void GpsL5iPcpsAcquisitionFpga::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// // Since a byte-based acq implementation is not available,
|
||||
// // we just convert cshorts to gr_complex
|
||||
// top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
||||
// top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
||||
// top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0);
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// // Since a byte-based acq implementation is not available,
|
||||
// // we just convert cshorts to gr_complex
|
||||
// top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
||||
// top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
||||
// top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0);
|
||||
// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// }
|
||||
// nothing to disconnect
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GpsL5iPcpsAcquisitionFpga::get_left_block()
|
||||
{
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// return stream_to_vector_;
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// return stream_to_vector_;
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// return cbyte_to_float_x2_;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// return nullptr;
|
||||
// }
|
||||
// if (item_type_.compare("gr_complex") == 0)
|
||||
// {
|
||||
// return stream_to_vector_;
|
||||
// }
|
||||
// else if (item_type_.compare("cshort") == 0)
|
||||
// {
|
||||
// return stream_to_vector_;
|
||||
// }
|
||||
// else if (item_type_.compare("cbyte") == 0)
|
||||
// {
|
||||
// return cbyte_to_float_x2_;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
// return nullptr;
|
||||
// }
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -134,6 +134,11 @@ public:
|
||||
*/
|
||||
void set_state(int state) override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running acquisition
|
||||
*/
|
||||
void stop_acquisition() override;
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
//pcps_acquisition_sptr acquisition_;
|
||||
|
@ -196,6 +196,19 @@ void Channel::set_signal(const Gnss_Signal& gnss_signal)
|
||||
}
|
||||
|
||||
|
||||
void Channel::stop_channel()
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
bool result = channel_fsm_->Event_stop_channel();
|
||||
if (!result)
|
||||
{
|
||||
LOG(WARNING) << "Invalid channel event";
|
||||
return;
|
||||
}
|
||||
DLOG(INFO)
|
||||
<< "Channel stop_channel()";
|
||||
}
|
||||
|
||||
void Channel::start_acquisition()
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
|
@ -73,21 +73,17 @@ public:
|
||||
gr::basic_block_sptr get_right_block() override;
|
||||
|
||||
inline std::string role() override { return role_; }
|
||||
|
||||
//! Returns "Channel"
|
||||
inline std::string implementation() override { return implementation_; }
|
||||
|
||||
inline size_t item_size() override { return 0; }
|
||||
|
||||
inline Gnss_Signal get_signal() const override { return gnss_signal_; }
|
||||
|
||||
void start_acquisition() override; //!< Start the State Machine
|
||||
void stop_channel() override; //!< Stop the State Machine
|
||||
void set_signal(const Gnss_Signal& gnss_signal_) override; //!< Sets the channel GNSS signal
|
||||
|
||||
inline std::shared_ptr<AcquisitionInterface> acquisition() { return acq_; }
|
||||
inline std::shared_ptr<TrackingInterface> tracking() { return trk_; }
|
||||
inline std::shared_ptr<TelemetryDecoderInterface> telemetry() { return nav_; }
|
||||
|
||||
void msg_handler_events(pmt::pmt_t msg);
|
||||
|
||||
private:
|
||||
|
@ -52,6 +52,28 @@ ChannelFsm::ChannelFsm(std::shared_ptr<AcquisitionInterface> acquisition) : acq_
|
||||
}
|
||||
|
||||
|
||||
bool ChannelFsm::Event_stop_channel()
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
DLOG(INFO) << "CH = " << channel_ << ". Ev stop channel";
|
||||
switch (d_state)
|
||||
{
|
||||
case 0: //already in stanby
|
||||
return true;
|
||||
break;
|
||||
case 1: //acquisition
|
||||
d_state = 0;
|
||||
stop_acquisition();
|
||||
break;
|
||||
case 2: //tracking
|
||||
d_state = 0;
|
||||
stop_tracking();
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool ChannelFsm::Event_start_acquisition()
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
@ -165,6 +187,17 @@ void ChannelFsm::set_channel(uint32_t channel)
|
||||
}
|
||||
|
||||
|
||||
void ChannelFsm::stop_acquisition()
|
||||
{
|
||||
acq_->stop_acquisition();
|
||||
}
|
||||
|
||||
void ChannelFsm::stop_tracking()
|
||||
{
|
||||
trk_->stop_tracking();
|
||||
}
|
||||
|
||||
|
||||
void ChannelFsm::start_acquisition()
|
||||
{
|
||||
acq_->reset();
|
||||
|
@ -58,6 +58,7 @@ public:
|
||||
//FSM EVENTS
|
||||
bool Event_start_acquisition();
|
||||
bool Event_valid_acquisition();
|
||||
bool Event_stop_channel();
|
||||
bool Event_failed_acquisition_repeat();
|
||||
bool Event_failed_acquisition_no_repeat();
|
||||
bool Event_failed_tracking_standby();
|
||||
@ -65,6 +66,8 @@ public:
|
||||
private:
|
||||
void start_acquisition();
|
||||
void start_tracking();
|
||||
void stop_acquisition();
|
||||
void stop_tracking();
|
||||
void request_satellite();
|
||||
void notify_stop_tracking();
|
||||
|
||||
|
@ -45,6 +45,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GalileoE1DllPllVemlTracking::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -92,6 +92,10 @@ public:
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
dll_pll_veml_tracking_sptr tracking_;
|
||||
|
@ -46,12 +46,16 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GalileoE1DllPllVemlTrackingFpga::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
//dllpllconf_t trk_param;
|
||||
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
|
||||
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
|
||||
DLOG(INFO) << "role " << role;
|
||||
//################# CONFIGURATION PARAMETERS ########################
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -126,23 +130,23 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
|
||||
unsigned int device_base = configuration->property(role + ".device_base", 1);
|
||||
trk_param_fpga.device_base = device_base;
|
||||
//unsigned int multicorr_type = configuration->property(role + ".multicorr_type", 1);
|
||||
trk_param_fpga.multicorr_type = 1; // 0 -> 3 correlators, 1 -> 5 correlators
|
||||
trk_param_fpga.multicorr_type = 1; // 0 -> 3 correlators, 1 -> 5 correlators
|
||||
|
||||
//################# PRE-COMPUTE ALL THE CODES #################
|
||||
unsigned int code_samples_per_chip = 2;
|
||||
d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* code_samples_per_chip * Galileo_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
float * ca_codes_f;
|
||||
float * data_codes_f;
|
||||
d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * Galileo_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
float* ca_codes_f;
|
||||
float* data_codes_f;
|
||||
|
||||
if (trk_param_fpga.track_pilot)
|
||||
{
|
||||
d_data_codes = static_cast<int *>(volk_gnsssdr_malloc((static_cast<unsigned int>(Galileo_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * Galileo_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
d_data_codes = static_cast<int*>(volk_gnsssdr_malloc((static_cast<unsigned int>(Galileo_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * Galileo_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
}
|
||||
ca_codes_f = static_cast<float*>(volk_gnsssdr_malloc(static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
ca_codes_f = static_cast<float*>(volk_gnsssdr_malloc(static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
|
||||
if (trk_param_fpga.track_pilot)
|
||||
{
|
||||
data_codes_f = static_cast<float *>(volk_gnsssdr_malloc((static_cast<unsigned int>(Galileo_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
data_codes_f = static_cast<float*>(volk_gnsssdr_malloc((static_cast<unsigned int>(Galileo_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
}
|
||||
|
||||
//printf("pppppppp trk_param_fpga.track_pilot = %d\n", trk_param_fpga.track_pilot);
|
||||
@ -159,12 +163,11 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
|
||||
galileo_e1_code_gen_sinboc11_float(ca_codes_f, pilot_signal, PRN);
|
||||
galileo_e1_code_gen_sinboc11_float(data_codes_f, data_signal, PRN);
|
||||
|
||||
for (unsigned int s = 0; s < 2*Galileo_E1_B_CODE_LENGTH_CHIPS; s++)
|
||||
for (unsigned int s = 0; s < 2 * Galileo_E1_B_CODE_LENGTH_CHIPS; s++)
|
||||
{
|
||||
d_ca_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s] = static_cast<int>(ca_codes_f[s]);
|
||||
d_data_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s] = static_cast<int>(data_codes_f[s]);
|
||||
d_ca_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int>(ca_codes_f[s]);
|
||||
d_data_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int>(data_codes_f[s]);
|
||||
//printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
|
||||
|
||||
}
|
||||
//printf("\n next \n");
|
||||
//scanf ("%d",&kk);
|
||||
@ -174,15 +177,14 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
|
||||
//printf("no tracking pilot\n");
|
||||
galileo_e1_code_gen_sinboc11_float(ca_codes_f, data_signal, PRN);
|
||||
|
||||
for (unsigned int s = 0; s < 2*Galileo_E1_B_CODE_LENGTH_CHIPS; s++)
|
||||
for (unsigned int s = 0; s < 2 * Galileo_E1_B_CODE_LENGTH_CHIPS; s++)
|
||||
{
|
||||
d_ca_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s] = static_cast<int>(ca_codes_f[s]);
|
||||
d_ca_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int>(ca_codes_f[s]);
|
||||
//printf("%f %d | ", ca_codes_f[s], d_ca_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
|
||||
}
|
||||
//printf("\n next \n");
|
||||
//scanf ("%d",&kk);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
delete[] ca_codes_f;
|
||||
@ -193,7 +195,7 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
|
||||
trk_param_fpga.ca_codes = d_ca_codes;
|
||||
trk_param_fpga.data_codes = d_data_codes;
|
||||
trk_param_fpga.code_length_chips = Galileo_E1_B_CODE_LENGTH_CHIPS;
|
||||
trk_param_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip
|
||||
trk_param_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip
|
||||
//################# MAKE TRACKING GNURadio object ###################
|
||||
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
|
||||
channel_ = 0;
|
||||
@ -207,7 +209,6 @@ GalileoE1DllPllVemlTrackingFpga::~GalileoE1DllPllVemlTrackingFpga()
|
||||
if (d_track_pilot)
|
||||
{
|
||||
delete[] d_data_codes;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,6 +93,12 @@ public:
|
||||
|
||||
void start_tracking() override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
|
||||
private:
|
||||
//dll_pll_veml_tracking_sptr tracking_;
|
||||
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
|
||||
@ -104,7 +110,6 @@ private:
|
||||
int* d_ca_codes;
|
||||
int* d_data_codes;
|
||||
bool d_track_pilot;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -44,6 +44,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GalileoE1TcpConnectorTracking::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -93,6 +93,10 @@ public:
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
galileo_e1_tcp_connector_tracking_cc_sptr tracking_;
|
||||
|
@ -45,6 +45,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GalileoE5aDllPllTracking::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -91,6 +91,10 @@ public:
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
dll_pll_veml_tracking_sptr tracking_;
|
||||
|
@ -46,14 +46,18 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GalileoE5aDllPllTrackingFpga::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
ConfigurationInterface *configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
//printf("creating the E5A tracking");
|
||||
//printf("creating the E5A tracking");
|
||||
|
||||
|
||||
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
|
||||
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
|
||||
DLOG(INFO) << "role " << role;
|
||||
//################# CONFIGURATION PARAMETERS ########################
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -126,7 +130,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
|
||||
unsigned int device_base = configuration->property(role + ".device_base", 1);
|
||||
trk_param_fpga.device_base = device_base;
|
||||
//unsigned int multicorr_type = configuration->property(role + ".multicorr_type", 1);
|
||||
trk_param_fpga.multicorr_type = 1; // 0 -> 3 correlators, 1 -> up to 5+1 correlators
|
||||
trk_param_fpga.multicorr_type = 1; // 0 -> 3 correlators, 1 -> up to 5+1 correlators
|
||||
|
||||
//################# PRE-COMPUTE ALL THE CODES #################
|
||||
unsigned int code_samples_per_chip = 1;
|
||||
@ -143,7 +147,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
|
||||
}
|
||||
tracking_code = static_cast<float *>(volk_gnsssdr_malloc(code_samples_per_chip * code_length_chips * sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
|
||||
d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<int>(code_length_chips)* code_samples_per_chip * Galileo_E5a_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
d_ca_codes = static_cast<int *>(volk_gnsssdr_malloc(static_cast<int>(code_length_chips) * code_samples_per_chip * Galileo_E5a_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
|
||||
if (trk_param_fpga.track_pilot)
|
||||
{
|
||||
@ -153,44 +157,36 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
|
||||
|
||||
for (unsigned int PRN = 1; PRN <= Galileo_E5a_NUMBER_OF_CODES; PRN++)
|
||||
{
|
||||
//galileo_e5_a_code_gen_complex_primary(aux_code, PRN, const_cast<char *>(trk_param_fpga.signal.c_str()));
|
||||
galileo_e5_a_code_gen_complex_primary(aux_code, PRN, const_cast<char *>(sig_));
|
||||
if (trk_param_fpga.track_pilot)
|
||||
{
|
||||
//d_secondary_code_string = const_cast<std::string *>(&Galileo_E5a_Q_SECONDARY_CODE[PRN - 1]);
|
||||
for (unsigned int i = 0; i < code_length_chips; i++)
|
||||
{
|
||||
tracking_code[i] = aux_code[i].imag();
|
||||
data_code[i] = aux_code[i].real();
|
||||
}
|
||||
for (unsigned int s = 0; s < code_length_chips; s++)
|
||||
{
|
||||
d_ca_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(tracking_code[s]);
|
||||
d_data_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(data_code[s]);
|
||||
//printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (unsigned int i = 0; i < code_length_chips; i++)
|
||||
{
|
||||
tracking_code[i] = aux_code[i].real();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//galileo_e5_a_code_gen_complex_primary(aux_code, PRN, const_cast<char *>(trk_param_fpga.signal.c_str()));
|
||||
galileo_e5_a_code_gen_complex_primary(aux_code, PRN, const_cast<char *>(sig_));
|
||||
if (trk_param_fpga.track_pilot)
|
||||
{
|
||||
//d_secondary_code_string = const_cast<std::string *>(&Galileo_E5a_Q_SECONDARY_CODE[PRN - 1]);
|
||||
for (unsigned int i = 0; i < code_length_chips; i++)
|
||||
{
|
||||
tracking_code[i] = aux_code[i].imag();
|
||||
data_code[i] = aux_code[i].real();
|
||||
}
|
||||
for (unsigned int s = 0; s < code_length_chips; s++)
|
||||
{
|
||||
d_ca_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(tracking_code[s]);
|
||||
d_data_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(data_code[s]);
|
||||
//printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
for (unsigned int i = 0; i < code_length_chips; i++)
|
||||
{
|
||||
tracking_code[i] = aux_code[i].real();
|
||||
}
|
||||
|
||||
for (unsigned int s = 0; s < code_length_chips; s++)
|
||||
{
|
||||
d_ca_codes[static_cast<int>(code_length_chips)* (PRN - 1) + s] = static_cast<int>(tracking_code[s]);
|
||||
//printf("%f %d | ", ca_codes_f[s], d_ca_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
for (unsigned int s = 0; s < code_length_chips; s++)
|
||||
{
|
||||
d_ca_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(tracking_code[s]);
|
||||
//printf("%f %d | ", ca_codes_f[s], d_ca_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
volk_gnsssdr_free(aux_code);
|
||||
@ -202,25 +198,23 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
|
||||
trk_param_fpga.ca_codes = d_ca_codes;
|
||||
trk_param_fpga.data_codes = d_data_codes;
|
||||
trk_param_fpga.code_length_chips = code_length_chips;
|
||||
trk_param_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip
|
||||
trk_param_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip
|
||||
//################# MAKE TRACKING GNURadio object ###################
|
||||
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
|
||||
// if (item_type.compare("gr_complex") == 0)
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// tracking_ = dll_pll_veml_make_tracking(trk_param_fpga);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// LOG(WARNING) << item_type << " unknown tracking item type.";
|
||||
// }
|
||||
// if (item_type.compare("gr_complex") == 0)
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// tracking_ = dll_pll_veml_make_tracking(trk_param_fpga);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// LOG(WARNING) << item_type << " unknown tracking item type.";
|
||||
// }
|
||||
channel_ = 0;
|
||||
|
||||
//DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
|
||||
DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -230,7 +224,6 @@ GalileoE5aDllPllTrackingFpga::~GalileoE5aDllPllTrackingFpga()
|
||||
if (d_track_pilot)
|
||||
{
|
||||
delete[] d_data_codes;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -247,14 +240,14 @@ void GalileoE5aDllPllTrackingFpga::start_tracking()
|
||||
*/
|
||||
void GalileoE5aDllPllTrackingFpga::set_channel(unsigned int channel)
|
||||
{
|
||||
//printf("blabla channel = %d\n", channel);
|
||||
//printf("blabla channel = %d\n", channel);
|
||||
channel_ = channel;
|
||||
//tracking_->set_channel(channel);
|
||||
tracking_fpga_sc->set_channel(channel);
|
||||
}
|
||||
|
||||
|
||||
void GalileoE5aDllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
|
||||
void GalileoE5aDllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro)
|
||||
{
|
||||
//tracking_->set_gnss_synchro(p_gnss_synchro);
|
||||
tracking_fpga_sc->set_gnss_synchro(p_gnss_synchro);
|
||||
|
@ -91,6 +91,10 @@ public:
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
|
||||
@ -104,7 +108,6 @@ private:
|
||||
int* d_ca_codes;
|
||||
int* d_data_codes;
|
||||
bool d_track_pilot;
|
||||
|
||||
};
|
||||
|
||||
#endif /* GNSS_SDR_GALILEO_E5A_DLL_PLL_TRACKING_FPGA_H_ */
|
||||
|
@ -46,6 +46,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GlonassL1CaDllPllCAidTracking::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -93,6 +93,10 @@ public:
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc;
|
||||
|
@ -45,6 +45,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GlonassL1CaDllPllTracking::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -91,6 +91,10 @@ public:
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
glonass_l1_ca_dll_pll_tracking_cc_sptr tracking_;
|
||||
|
@ -44,6 +44,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GlonassL2CaDllPllCAidTracking::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -91,6 +91,10 @@ public:
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc;
|
||||
|
@ -43,6 +43,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GlonassL2CaDllPllTracking::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -90,6 +90,10 @@ public:
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
glonass_l2_ca_dll_pll_tracking_cc_sptr tracking_;
|
||||
|
@ -45,6 +45,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL1CaDllPllCAidTracking::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -92,6 +92,10 @@ public:
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc;
|
||||
|
@ -45,6 +45,11 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL1CaDllPllTracking::stop_tracking()
|
||||
{
|
||||
tracking_->stop_tracking();
|
||||
}
|
||||
|
||||
GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -91,6 +91,11 @@ public:
|
||||
|
||||
void start_tracking() override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
dll_pll_veml_tracking_sptr tracking_;
|
||||
size_t item_size_;
|
||||
|
@ -48,14 +48,17 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
void GpsL1CaDllPllTrackingFpga::stop_tracking()
|
||||
{
|
||||
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
|
||||
}
|
||||
|
||||
GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
|
||||
DLOG(INFO) << "role " << role;
|
||||
|
||||
|
||||
//################# CONFIGURATION PARAMETERS ########################
|
||||
//std::string default_item_type = "gr_complex";
|
||||
//std::string item_type = configuration->property(role + ".item_type", default_item_type);
|
||||
@ -130,23 +133,22 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
|
||||
unsigned int device_base = configuration->property(role + ".device_base", 1);
|
||||
trk_param_fpga.device_base = device_base;
|
||||
//unsigned int multicorr_type = configuration->property(role + ".multicorr_type", 0);
|
||||
trk_param_fpga.multicorr_type = 0; //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators
|
||||
trk_param_fpga.multicorr_type = 0; //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators
|
||||
|
||||
//################# PRE-COMPUTE ALL THE CODES #################
|
||||
d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS*NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++)
|
||||
{
|
||||
gps_l1_ca_code_gen_int(&d_ca_codes[(int(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)], PRN, 0);
|
||||
}
|
||||
{
|
||||
gps_l1_ca_code_gen_int(&d_ca_codes[(int(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)], PRN, 0);
|
||||
}
|
||||
trk_param_fpga.ca_codes = d_ca_codes;
|
||||
trk_param_fpga.code_length_chips = GPS_L1_CA_CODE_LENGTH_CHIPS;
|
||||
trk_param_fpga.code_samples_per_chip = 1; // 1 sample per chip
|
||||
trk_param_fpga.code_samples_per_chip = 1; // 1 sample per chip
|
||||
|
||||
//################# MAKE TRACKING GNURadio object ###################
|
||||
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
|
||||
channel_ = 0;
|
||||
DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")";
|
||||
|
||||
}
|
||||
|
||||
GpsL1CaDllPllTrackingFpga::~GpsL1CaDllPllTrackingFpga()
|
||||
@ -175,14 +177,18 @@ void GpsL1CaDllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
|
||||
|
||||
void GpsL1CaDllPllTrackingFpga::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
//nothing to connect
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaDllPllTrackingFpga::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
//nothing to disconnect
|
||||
}
|
||||
|
||||
@ -197,5 +203,3 @@ gr::basic_block_sptr GpsL1CaDllPllTrackingFpga::get_right_block()
|
||||
{
|
||||
return tracking_fpga_sc;
|
||||
}
|
||||
|
||||
|
||||
|
@ -53,9 +53,9 @@ class GpsL1CaDllPllTrackingFpga : public TrackingInterface
|
||||
{
|
||||
public:
|
||||
GpsL1CaDllPllTrackingFpga(ConfigurationInterface* configuration,
|
||||
std::string role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
std::string role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
virtual ~GpsL1CaDllPllTrackingFpga();
|
||||
|
||||
@ -93,10 +93,13 @@ public:
|
||||
|
||||
void start_tracking() override;
|
||||
|
||||
//void reset(void);
|
||||
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
|
||||
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
|
||||
size_t item_size_;
|
||||
unsigned int channel_;
|
||||
std::string role_;
|
||||
@ -105,4 +108,4 @@ private:
|
||||
int* d_ca_codes;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_H_
|
||||
#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_H_
|
||||
|
@ -44,6 +44,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL1CaDllPllTrackingGPU::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL1CaDllPllTrackingGPU::GpsL1CaDllPllTrackingGPU(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -91,6 +91,11 @@ public:
|
||||
|
||||
void start_tracking() override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
gps_l1_ca_dll_pll_tracking_gpu_cc_sptr tracking_;
|
||||
size_t item_size_;
|
||||
|
@ -47,6 +47,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL1CaKfTracking::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL1CaKfTracking::GpsL1CaKfTracking(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -93,6 +93,11 @@ public:
|
||||
|
||||
void start_tracking() override;
|
||||
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
gps_l1_ca_kf_tracking_cc_sptr tracking_;
|
||||
size_t item_size_;
|
||||
|
@ -43,6 +43,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL1CaTcpConnectorTracking::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -91,6 +91,10 @@ public:
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
gps_l1_ca_tcp_connector_tracking_cc_sptr tracking_;
|
||||
|
@ -45,6 +45,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL2MDllPllTracking::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL2MDllPllTracking::GpsL2MDllPllTracking(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -90,6 +90,10 @@ public:
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
dll_pll_veml_tracking_sptr tracking_;
|
||||
|
@ -47,12 +47,16 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL2MDllPllTrackingFpga::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
//dllpllconf_t trk_param;
|
||||
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
|
||||
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
|
||||
DLOG(INFO) << "role " << role;
|
||||
//################# CONFIGURATION PARAMETERS ########################
|
||||
//std::string default_item_type = "gr_complex";
|
||||
@ -115,43 +119,43 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga(
|
||||
unsigned int device_base = configuration->property(role + ".device_base", 1);
|
||||
trk_param_fpga.device_base = device_base;
|
||||
//unsigned int multicorr_type = configuration->property(role + ".multicorr_type", 0);
|
||||
trk_param_fpga.multicorr_type = 0; //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators
|
||||
trk_param_fpga.multicorr_type = 0; //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators
|
||||
|
||||
//d_tracking_code = static_cast<float *>(volk_gnsssdr_malloc(2 * static_cast<unsigned int>(GPS_L2_M_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<unsigned int>(GPS_L2_M_CODE_LENGTH_CHIPS)* NUM_PRNs * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
float* ca_codes_f = static_cast<float*>(volk_gnsssdr_malloc(static_cast<unsigned int>(GPS_L2_M_CODE_LENGTH_CHIPS)* sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<unsigned int>(GPS_L2_M_CODE_LENGTH_CHIPS) * NUM_PRNs * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
float* ca_codes_f = static_cast<float*>(volk_gnsssdr_malloc(static_cast<unsigned int>(GPS_L2_M_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
|
||||
//################# PRE-COMPUTE ALL THE CODES #################
|
||||
d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<int>(GPS_L2_M_CODE_LENGTH_CHIPS*NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<int>(GPS_L2_M_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++)
|
||||
{
|
||||
//gps_l1_ca_code_gen_int(&d_ca_codes[(int(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)], PRN, 0);
|
||||
gps_l2c_m_code_gen_float(ca_codes_f, PRN);
|
||||
for (unsigned int s = 0; s < 2*static_cast<unsigned int>(GPS_L2_M_CODE_LENGTH_CHIPS); s++)
|
||||
{
|
||||
d_ca_codes[static_cast<int>(GPS_L2_M_CODE_LENGTH_CHIPS)* (PRN - 1) + s] = static_cast<int>(ca_codes_f[s]);
|
||||
}
|
||||
}
|
||||
{
|
||||
//gps_l1_ca_code_gen_int(&d_ca_codes[(int(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)], PRN, 0);
|
||||
gps_l2c_m_code_gen_float(ca_codes_f, PRN);
|
||||
for (unsigned int s = 0; s < 2 * static_cast<unsigned int>(GPS_L2_M_CODE_LENGTH_CHIPS); s++)
|
||||
{
|
||||
d_ca_codes[static_cast<int>(GPS_L2_M_CODE_LENGTH_CHIPS) * (PRN - 1) + s] = static_cast<int>(ca_codes_f[s]);
|
||||
}
|
||||
}
|
||||
|
||||
delete[] ca_codes_f;
|
||||
|
||||
trk_param_fpga.ca_codes = d_ca_codes;
|
||||
trk_param_fpga.code_length_chips = GPS_L2_M_CODE_LENGTH_CHIPS;
|
||||
trk_param_fpga.code_samples_per_chip = 1; // 1 sample per chip
|
||||
trk_param_fpga.code_samples_per_chip = 1; // 1 sample per chip
|
||||
|
||||
//################# MAKE TRACKING GNURadio object ###################
|
||||
|
||||
// //################# MAKE TRACKING GNURadio object ###################
|
||||
// if (item_type.compare("gr_complex") == 0)
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// tracking_ = dll_pll_veml_make_tracking(trk_param);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// LOG(WARNING) << item_type << " unknown tracking item type.";
|
||||
// }
|
||||
// //################# MAKE TRACKING GNURadio object ###################
|
||||
// if (item_type.compare("gr_complex") == 0)
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// tracking_ = dll_pll_veml_make_tracking(trk_param);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// LOG(WARNING) << item_type << " unknown tracking item type.";
|
||||
// }
|
||||
|
||||
//################# MAKE TRACKING GNURadio object ###################
|
||||
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
|
||||
|
@ -91,6 +91,10 @@ public:
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
//dll_pll_veml_tracking_sptr tracking_;
|
||||
|
@ -45,6 +45,10 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL5DllPllTracking::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL5DllPllTracking::GpsL5DllPllTracking(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
|
@ -89,6 +89,10 @@ public:
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
dll_pll_veml_tracking_sptr tracking_;
|
||||
|
@ -47,13 +47,17 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
void GpsL5DllPllTrackingFpga::stop_tracking()
|
||||
{
|
||||
}
|
||||
|
||||
GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
ConfigurationInterface *configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
//printf("L5 TRK CLASS CREATED\n");
|
||||
//printf("L5 TRK CLASS CREATED\n");
|
||||
//dllpllconf_t trk_param;
|
||||
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
|
||||
Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga();
|
||||
DLOG(INFO) << "role " << role;
|
||||
//################# CONFIGURATION PARAMETERS ########################
|
||||
//std::string default_item_type = "gr_complex";
|
||||
@ -126,7 +130,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
|
||||
unsigned int device_base = configuration->property(role + ".device_base", 1);
|
||||
trk_param_fpga.device_base = device_base;
|
||||
//unsigned int multicorr_type = configuration->property(role + ".multicorr_type", 0);
|
||||
trk_param_fpga.multicorr_type = 0; //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators
|
||||
trk_param_fpga.multicorr_type = 0; //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators
|
||||
|
||||
//################# PRE-COMPUTE ALL THE CODES #################
|
||||
unsigned int code_samples_per_chip = 1;
|
||||
@ -139,11 +143,11 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
|
||||
tracking_code = static_cast<float *>(volk_gnsssdr_malloc(code_length_chips * sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
|
||||
if (trk_param_fpga.track_pilot)
|
||||
{
|
||||
data_code = static_cast<float *>(volk_gnsssdr_malloc(code_length_chips * sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
}
|
||||
{
|
||||
data_code = static_cast<float *>(volk_gnsssdr_malloc(code_length_chips * sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
}
|
||||
|
||||
d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<int>(code_length_chips*NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
d_ca_codes = static_cast<int *>(volk_gnsssdr_malloc(static_cast<int>(code_length_chips * NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
|
||||
if (trk_param_fpga.track_pilot)
|
||||
{
|
||||
@ -152,35 +156,31 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
|
||||
|
||||
//printf("start \n");
|
||||
for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++)
|
||||
{
|
||||
|
||||
if (track_pilot)
|
||||
{
|
||||
|
||||
gps_l5q_code_gen_float(tracking_code, PRN);
|
||||
gps_l5i_code_gen_float(data_code, PRN);
|
||||
{
|
||||
if (track_pilot)
|
||||
{
|
||||
gps_l5q_code_gen_float(tracking_code, PRN);
|
||||
gps_l5i_code_gen_float(data_code, PRN);
|
||||
|
||||
|
||||
for (unsigned int s = 0; s < code_length_chips; s++)
|
||||
{
|
||||
d_ca_codes[static_cast<int>(code_length_chips)* (PRN - 1) + s] = static_cast<int>(tracking_code[s]);
|
||||
d_data_codes[static_cast<int>(code_length_chips)* (PRN - 1) + s] = static_cast<int>(data_code[s]);
|
||||
//printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
|
||||
for (unsigned int s = 0; s < code_length_chips; s++)
|
||||
{
|
||||
d_ca_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(tracking_code[s]);
|
||||
d_data_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(data_code[s]);
|
||||
//printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
gps_l5i_code_gen_float(tracking_code, PRN);
|
||||
for (unsigned int s = 0; s < code_length_chips; s++)
|
||||
{
|
||||
d_ca_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(data_code[s]);
|
||||
//printf("%f %d | ", ca_codes_f[s], d_ca_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gps_l5i_code_gen_float(tracking_code, PRN);
|
||||
for (unsigned int s = 0; s < code_length_chips; s++)
|
||||
{
|
||||
d_ca_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(data_code[s]);
|
||||
//printf("%f %d | ", ca_codes_f[s], d_ca_codes[static_cast<int>(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]);
|
||||
}
|
||||
}
|
||||
}
|
||||
//printf("end \n");
|
||||
|
||||
|
||||
@ -192,18 +192,18 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
|
||||
trk_param_fpga.ca_codes = d_ca_codes;
|
||||
trk_param_fpga.data_codes = d_data_codes;
|
||||
trk_param_fpga.code_length_chips = code_length_chips;
|
||||
trk_param_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip
|
||||
trk_param_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip
|
||||
//################# MAKE TRACKING GNURadio object ###################
|
||||
// if (item_type.compare("gr_complex") == 0)
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// tracking_ = dll_pll_veml_make_tracking(trk_param_fpga);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// LOG(WARNING) << item_type << " unknown tracking item type.";
|
||||
// }
|
||||
// if (item_type.compare("gr_complex") == 0)
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// tracking_ = dll_pll_veml_make_tracking(trk_param_fpga);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item_size_ = sizeof(gr_complex);
|
||||
// LOG(WARNING) << item_type << " unknown tracking item type.";
|
||||
// }
|
||||
//printf("call \n");
|
||||
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga);
|
||||
//printf("end2 \n");
|
||||
@ -214,19 +214,17 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
|
||||
|
||||
GpsL5DllPllTrackingFpga::~GpsL5DllPllTrackingFpga()
|
||||
{
|
||||
|
||||
delete[] d_ca_codes;
|
||||
if (d_track_pilot)
|
||||
{
|
||||
delete[] d_data_codes;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL5DllPllTrackingFpga::start_tracking()
|
||||
{
|
||||
tracking_fpga_sc->start_tracking();
|
||||
tracking_fpga_sc->start_tracking();
|
||||
}
|
||||
|
||||
|
||||
@ -240,9 +238,9 @@ void GpsL5DllPllTrackingFpga::set_channel(unsigned int channel)
|
||||
}
|
||||
|
||||
|
||||
void GpsL5DllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
|
||||
void GpsL5DllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro)
|
||||
{
|
||||
tracking_fpga_sc->set_gnss_synchro(p_gnss_synchro);
|
||||
tracking_fpga_sc->set_gnss_synchro(p_gnss_synchro);
|
||||
}
|
||||
|
||||
|
||||
|
@ -89,6 +89,10 @@ public:
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
/*!
|
||||
* \brief Stop running tracking
|
||||
*/
|
||||
void stop_tracking() override;
|
||||
|
||||
private:
|
||||
//dll_pll_veml_tracking_sptr tracking_;
|
||||
|
@ -1324,6 +1324,12 @@ void dll_pll_veml_tracking::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro)
|
||||
}
|
||||
|
||||
|
||||
void dll_pll_veml_tracking::stop_tracking()
|
||||
{
|
||||
gr::thread::scoped_lock l(d_setlock);
|
||||
d_state = 0;
|
||||
}
|
||||
|
||||
int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
||||
{
|
||||
|
@ -61,6 +61,7 @@ public:
|
||||
void set_channel(uint32_t channel);
|
||||
void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro);
|
||||
void start_tracking();
|
||||
void stop_tracking();
|
||||
|
||||
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
|
||||
|
@ -1214,10 +1214,16 @@ void dll_pll_veml_tracking_fpga::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro)
|
||||
d_acquisition_gnss_synchro = p_gnss_synchro;
|
||||
}
|
||||
|
||||
void dll_pll_veml_tracking_fpga::stop_tracking()
|
||||
{
|
||||
gr::thread::scoped_lock l(d_setlock);
|
||||
d_state = 0;
|
||||
}
|
||||
|
||||
int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
||||
{
|
||||
gr::thread::scoped_lock l(d_setlock);
|
||||
// Block input data and block output stream pointers
|
||||
Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]);
|
||||
|
||||
|
@ -52,44 +52,11 @@
|
||||
#include <boost/circular_buffer.hpp>
|
||||
#include "fpga_multicorrelator.h"
|
||||
|
||||
//typedef struct
|
||||
//{
|
||||
// /* DLL/PLL tracking configuration */
|
||||
// double fs_in;
|
||||
// uint32_t vector_length;
|
||||
// bool dump;
|
||||
// std::string dump_filename;
|
||||
// float pll_bw_hz;
|
||||
// float dll_bw_hz;
|
||||
// float pll_bw_narrow_hz;
|
||||
// float dll_bw_narrow_hz;
|
||||
// float early_late_space_chips;
|
||||
// float very_early_late_space_chips;
|
||||
// float early_late_space_narrow_chips;
|
||||
// float very_early_late_space_narrow_chips;
|
||||
// int32_t extend_correlation_symbols;
|
||||
// int32_t cn0_samples;
|
||||
// int32_t cn0_min;
|
||||
// int32_t max_lock_fail;
|
||||
// double carrier_lock_th;
|
||||
// bool track_pilot;
|
||||
// char system;
|
||||
// char signal[3];
|
||||
// std::string device_name;
|
||||
// uint32_t device_base;
|
||||
// uint32_t multicorr_type;
|
||||
// uint32_t code_length_chips;
|
||||
// uint32_t code_samples_per_chip;
|
||||
// int* ca_codes;
|
||||
// int* data_codes;
|
||||
//} dllpllconf_fpga_t;
|
||||
|
||||
class dll_pll_veml_tracking_fpga;
|
||||
|
||||
typedef boost::shared_ptr<dll_pll_veml_tracking_fpga>
|
||||
dll_pll_veml_tracking_fpga_sptr;
|
||||
|
||||
//dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(const dllpllconf_fpga_t &conf_);
|
||||
dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(const Dll_Pll_Conf_Fpga &conf_);
|
||||
|
||||
|
||||
@ -104,7 +71,7 @@ public:
|
||||
void set_channel(uint32_t channel);
|
||||
void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro);
|
||||
void start_tracking();
|
||||
|
||||
void stop_tracking();
|
||||
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
|
||||
|
||||
|
@ -64,6 +64,7 @@ public:
|
||||
virtual void set_state(int state) = 0;
|
||||
virtual signed int mag() = 0;
|
||||
virtual void reset() = 0;
|
||||
virtual void stop_acquisition() = 0;
|
||||
};
|
||||
|
||||
#endif /* GNSS_SDR_ACQUISITION_INTERFACE */
|
||||
|
@ -53,6 +53,7 @@ class ChannelInterface : public GNSSBlockInterface
|
||||
public:
|
||||
virtual Gnss_Signal get_signal() const = 0;
|
||||
virtual void start_acquisition() = 0;
|
||||
virtual void stop_channel() = 0;
|
||||
virtual void set_signal(const Gnss_Signal&) = 0;
|
||||
};
|
||||
|
||||
|
@ -56,6 +56,7 @@ class TrackingInterface : public GNSSBlockInterface
|
||||
{
|
||||
public:
|
||||
virtual void start_tracking() = 0;
|
||||
virtual void stop_tracking() = 0;
|
||||
virtual void set_gnss_synchro(Gnss_Synchro* gnss_synchro) = 0;
|
||||
virtual void set_channel(unsigned int channel) = 0;
|
||||
};
|
||||
|
@ -5,6 +5,7 @@
|
||||
* Luis Esteve, 2012. luis(at)epsilon-formacion.com
|
||||
* Carles Fernandez-Prades, 2014. cfernandez(at)cttc.es
|
||||
* Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com
|
||||
* Javier Arribas, 2018. javiarribas(at)gmail.com
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
@ -811,21 +812,40 @@ bool GNSSFlowgraph::send_telemetry_msg(pmt::pmt_t msg)
|
||||
/*
|
||||
* Applies an action to the flow graph
|
||||
*
|
||||
* \param[in] who Who generated the action
|
||||
* \param[in] what What is the action 0: acquisition failed
|
||||
* \param[in] who Who generated the action:
|
||||
* -> 0-199 are the channels IDs
|
||||
* -> 200 is the control_thread dispatched by the control_thread apply_action
|
||||
* -> 300 is the telecommand system (TC) for receiver control
|
||||
* -> 400 - 599 is the TC channel control for channels 0-199
|
||||
* \param[in] what What is the action:
|
||||
* --- actions from channels ---
|
||||
* -> 0 acquisition failed
|
||||
* -> 1 acquisition succesfull
|
||||
* -> 2 tracking lost
|
||||
* --- actions from TC receiver control ---
|
||||
* -> 10 TC request standby mode
|
||||
* -> 11 TC request coldstart
|
||||
* -> 12 TC request hotstart
|
||||
* -> 13 TC request warmstart
|
||||
* --- actions from TC channel control ---
|
||||
* -> 20 stop channel
|
||||
* -> 21 start channel
|
||||
*/
|
||||
void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(signal_list_mutex);
|
||||
DLOG(INFO) << "Received " << what << " from " << who << ". Number of applied actions = " << applied_actions_;
|
||||
unsigned int sat = 0;
|
||||
try
|
||||
if (who < 200)
|
||||
{
|
||||
sat = configuration_->property("Channel" + std::to_string(who) + ".satellite", 0);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
LOG(WARNING) << e.what();
|
||||
try
|
||||
{
|
||||
sat = configuration_->property("Channel" + std::to_string(who) + ".satellite", 0);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
LOG(WARNING) << e.what();
|
||||
}
|
||||
}
|
||||
switch (what)
|
||||
{
|
||||
@ -1026,7 +1046,162 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10: //request stanby mode
|
||||
LOG(INFO) << "TC request stanby mode";
|
||||
for (size_t n = 0; n < channels_.size(); n++)
|
||||
{
|
||||
if (channels_state_[n] == 1 or channels_state_[n] == 2) //channel in acquisition or in tracking
|
||||
{
|
||||
//recover the satellite assigned
|
||||
|
||||
Gnss_Signal gs = channels_[n]->get_signal();
|
||||
switch (mapStringValues_[gs.get_signal_str()])
|
||||
{
|
||||
case evGPS_1C:
|
||||
available_GPS_1C_signals_.remove(gs);
|
||||
available_GPS_1C_signals_.push_back(gs);
|
||||
break;
|
||||
|
||||
case evGPS_2S:
|
||||
available_GPS_2S_signals_.remove(gs);
|
||||
available_GPS_2S_signals_.push_back(gs);
|
||||
break;
|
||||
|
||||
case evGPS_L5:
|
||||
available_GPS_L5_signals_.remove(gs);
|
||||
available_GPS_L5_signals_.push_back(gs);
|
||||
break;
|
||||
|
||||
case evGAL_1B:
|
||||
available_GAL_1B_signals_.remove(gs);
|
||||
available_GAL_1B_signals_.push_back(gs);
|
||||
break;
|
||||
|
||||
case evGAL_5X:
|
||||
available_GAL_5X_signals_.remove(gs);
|
||||
available_GAL_5X_signals_.push_back(gs);
|
||||
break;
|
||||
|
||||
case evGLO_1G:
|
||||
available_GLO_1G_signals_.remove(gs);
|
||||
available_GLO_1G_signals_.push_back(gs);
|
||||
break;
|
||||
|
||||
case evGLO_2G:
|
||||
available_GLO_2G_signals_.remove(gs);
|
||||
available_GLO_2G_signals_.push_back(gs);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG(ERROR) << "This should not happen :-(";
|
||||
break;
|
||||
}
|
||||
channels_[n]->stop_channel(); //stop the acquisition or tracking operation
|
||||
channels_state_[n] = 0;
|
||||
}
|
||||
}
|
||||
acq_channels_count_ = 0; //all channels are in stanby now
|
||||
break;
|
||||
case 11: //request coldstart mode
|
||||
LOG(INFO) << "TC request coldstart";
|
||||
//todo: delete all ephemeris and almanac information from maps (also the PVT map queue)
|
||||
//todo: reorder the satellite queues to the receiver default startup order.
|
||||
//This is required to allow repeatability. Otherwise the satellite search order will depend on the last tracked satellites
|
||||
|
||||
//start again the satellite acquisitions
|
||||
for (unsigned int i = 0; i < channels_count_; i++)
|
||||
{
|
||||
unsigned int ch_index = (who + i + 1) % channels_count_;
|
||||
unsigned int sat_ = 0;
|
||||
try
|
||||
{
|
||||
sat_ = configuration_->property("Channel" + std::to_string(ch_index) + ".satellite", 0);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
LOG(WARNING) << e.what();
|
||||
}
|
||||
if ((acq_channels_count_ < max_acq_channels_) && (channels_state_[ch_index] == 0))
|
||||
{
|
||||
channels_state_[ch_index] = 1;
|
||||
if (sat_ == 0)
|
||||
{
|
||||
channels_[ch_index]->set_signal(search_next_signal(channels_[ch_index]->get_signal().get_signal_str(), true));
|
||||
}
|
||||
acq_channels_count_++;
|
||||
DLOG(INFO) << "Channel " << ch_index << " Starting acquisition " << channels_[ch_index]->get_signal().get_satellite() << ", Signal " << channels_[ch_index]->get_signal().get_signal_str();
|
||||
channels_[ch_index]->start_acquisition();
|
||||
}
|
||||
DLOG(INFO) << "Channel " << ch_index << " in state " << channels_state_[ch_index];
|
||||
}
|
||||
break;
|
||||
case 12: //request hotstart mode
|
||||
LOG(INFO) << "TC request hotstart";
|
||||
//todo: call here the function that computes the set of visible satellites and its elevation
|
||||
//for the date and time specified by the hotstart command and the last available PVT
|
||||
//todo: reorder the satellite queue to acquire first those visible satellites
|
||||
//start again the satellite acquisitions
|
||||
for (unsigned int i = 0; i < channels_count_; i++)
|
||||
{
|
||||
unsigned int ch_index = (who + i + 1) % channels_count_;
|
||||
unsigned int sat_ = 0;
|
||||
try
|
||||
{
|
||||
sat_ = configuration_->property("Channel" + std::to_string(ch_index) + ".satellite", 0);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
LOG(WARNING) << e.what();
|
||||
}
|
||||
if ((acq_channels_count_ < max_acq_channels_) && (channels_state_[ch_index] == 0))
|
||||
{
|
||||
channels_state_[ch_index] = 1;
|
||||
if (sat_ == 0)
|
||||
{
|
||||
channels_[ch_index]->set_signal(search_next_signal(channels_[ch_index]->get_signal().get_signal_str(), true));
|
||||
}
|
||||
acq_channels_count_++;
|
||||
DLOG(INFO) << "Channel " << ch_index << " Starting acquisition " << channels_[ch_index]->get_signal().get_satellite() << ", Signal " << channels_[ch_index]->get_signal().get_signal_str();
|
||||
channels_[ch_index]->start_acquisition();
|
||||
}
|
||||
DLOG(INFO) << "Channel " << ch_index << " in state " << channels_state_[ch_index];
|
||||
}
|
||||
break;
|
||||
case 13: //request warmstart mode
|
||||
LOG(INFO) << "TC request warmstart";
|
||||
//todo: delete all ephemeris and almanac information from maps (also the PVT map queue)
|
||||
//todo: load the ephemeris and the almanac from XML files (receiver assistance)
|
||||
//todo: call here the function that computes the set of visible satellites and its elevation
|
||||
//for the date and time specified by the warmstart command and the assisted position
|
||||
//todo: reorder the satellite queue to acquire first those visible satellites
|
||||
|
||||
//start again the satellite acquisitions
|
||||
for (unsigned int i = 0; i < channels_count_; i++)
|
||||
{
|
||||
unsigned int ch_index = (who + i + 1) % channels_count_;
|
||||
unsigned int sat_ = 0;
|
||||
try
|
||||
{
|
||||
sat_ = configuration_->property("Channel" + std::to_string(ch_index) + ".satellite", 0);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
LOG(WARNING) << e.what();
|
||||
}
|
||||
if ((acq_channels_count_ < max_acq_channels_) && (channels_state_[ch_index] == 0))
|
||||
{
|
||||
channels_state_[ch_index] = 1;
|
||||
if (sat_ == 0)
|
||||
{
|
||||
channels_[ch_index]->set_signal(search_next_signal(channels_[ch_index]->get_signal().get_signal_str(), true));
|
||||
}
|
||||
acq_channels_count_++;
|
||||
DLOG(INFO) << "Channel " << ch_index << " Starting acquisition " << channels_[ch_index]->get_signal().get_satellite() << ", Signal " << channels_[ch_index]->get_signal().get_signal_str();
|
||||
channels_[ch_index]->start_acquisition();
|
||||
}
|
||||
DLOG(INFO) << "Channel " << ch_index << " in state " << channels_state_[ch_index];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -51,31 +51,63 @@ std::string TcpCmdInterface::reset(const std::vector<std::string> &commandLine)
|
||||
return response;
|
||||
}
|
||||
|
||||
std::string TcpCmdInterface::stop(const std::vector<std::string> &commandLine)
|
||||
std::string TcpCmdInterface::standby(const std::vector<std::string> &commandLine)
|
||||
{
|
||||
std::string response;
|
||||
response = "Not implemented\n";
|
||||
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
||||
if (control_queue_ != nullptr)
|
||||
{
|
||||
control_queue_->handle(cmf->GetQueueMessage(300, 10)); //send the standby message (who=300,what=10)
|
||||
response = "OK\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
response = "ERROR\n";
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
std::string TcpCmdInterface::status(const std::vector<std::string> &commandLine)
|
||||
{
|
||||
std::string response;
|
||||
//todo: implement the receiver status report
|
||||
response = "Not implemented\n";
|
||||
return response;
|
||||
}
|
||||
|
||||
std::string TcpCmdInterface::assistedstart(const std::vector<std::string> &commandLine)
|
||||
std::string TcpCmdInterface::hotstart(const std::vector<std::string> &commandLine)
|
||||
{
|
||||
std::string response;
|
||||
response = "Not implemented\n";
|
||||
//todo: read and parse the command line parameter: dd/mm/yyyy HH:MM:SS
|
||||
//todo: store it in a member variable
|
||||
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
||||
if (control_queue_ != nullptr)
|
||||
{
|
||||
control_queue_->handle(cmf->GetQueueMessage(300, 12)); //send the standby message (who=300,what=12)
|
||||
response = "OK\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
response = "ERROR\n";
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
std::string TcpCmdInterface::warmstart(const std::vector<std::string> &commandLine)
|
||||
{
|
||||
std::string response;
|
||||
response = "Not implemented\n";
|
||||
//todo: read and parse the command line parameter: dd/mm/yyyy HH:MM:SS
|
||||
//todo: store it in a member variable
|
||||
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
||||
if (control_queue_ != nullptr)
|
||||
{
|
||||
control_queue_->handle(cmf->GetQueueMessage(300, 13)); //send the standby message (who=300,what=13)
|
||||
response = "OK\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
response = "ERROR\n";
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
@ -83,13 +115,23 @@ std::string TcpCmdInterface::warmstart(const std::vector<std::string> &commandLi
|
||||
std::string TcpCmdInterface::coldstart(const std::vector<std::string> &commandLine)
|
||||
{
|
||||
std::string response;
|
||||
response = "Not implemented\n";
|
||||
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
||||
if (control_queue_ != nullptr)
|
||||
{
|
||||
control_queue_->handle(cmf->GetQueueMessage(300, 11)); //send the standby message (who=300,what=11)
|
||||
response = "OK\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
response = "ERROR\n";
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
std::string TcpCmdInterface::set_ch_satellite(const std::vector<std::string> &commandLine)
|
||||
{
|
||||
std::string response;
|
||||
//todo: implement the set satellite command
|
||||
response = "Not implemented\n";
|
||||
return response;
|
||||
}
|
||||
@ -98,9 +140,9 @@ std::string TcpCmdInterface::set_ch_satellite(const std::vector<std::string> &co
|
||||
void TcpCmdInterface::register_functions()
|
||||
{
|
||||
functions["status"] = std::bind(&TcpCmdInterface::status, this, std::placeholders::_1);
|
||||
functions["stop"] = std::bind(&TcpCmdInterface::stop, this, std::placeholders::_1);
|
||||
functions["standby"] = std::bind(&TcpCmdInterface::standby, this, std::placeholders::_1);
|
||||
functions["reset"] = std::bind(&TcpCmdInterface::reset, this, std::placeholders::_1);
|
||||
functions["assistedstart"] = std::bind(&TcpCmdInterface::assistedstart, this, std::placeholders::_1);
|
||||
functions["hotstart"] = std::bind(&TcpCmdInterface::hotstart, this, std::placeholders::_1);
|
||||
functions["warmstart"] = std::bind(&TcpCmdInterface::warmstart, this, std::placeholders::_1);
|
||||
functions["coldstart"] = std::bind(&TcpCmdInterface::coldstart, this, std::placeholders::_1);
|
||||
functions["set_ch_satellite"] = std::bind(&TcpCmdInterface::set_ch_satellite, this, std::placeholders::_1);
|
||||
@ -168,6 +210,8 @@ void TcpCmdInterface::run_cmd_server(int tcp_port)
|
||||
if (cmd_vector.at(0).compare("exit") == 0)
|
||||
{
|
||||
error = boost::asio::error::eof;
|
||||
//send cmd response
|
||||
socket.write_some(boost::asio::buffer("OK\n"), not_throw);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -58,8 +58,8 @@ private:
|
||||
functions;
|
||||
std::string status(const std::vector<std::string> &commandLine);
|
||||
std::string reset(const std::vector<std::string> &commandLine);
|
||||
std::string stop(const std::vector<std::string> &commandLine);
|
||||
std::string assistedstart(const std::vector<std::string> &commandLine);
|
||||
std::string standby(const std::vector<std::string> &commandLine);
|
||||
std::string hotstart(const std::vector<std::string> &commandLine);
|
||||
std::string warmstart(const std::vector<std::string> &commandLine);
|
||||
std::string coldstart(const std::vector<std::string> &commandLine);
|
||||
std::string set_ch_satellite(const std::vector<std::string> &commandLine);
|
||||
|
Loading…
Reference in New Issue
Block a user