1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-22 21:13:15 +00:00

Improve tracking adapters constructors: prefer member initializers of the constructor instead of in the constructor body. Improve consistency of private members name

This commit is contained in:
Carles Fernandez 2022-12-08 17:39:16 +01:00
parent 3d3d76362b
commit 8bd0292b1a
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
44 changed files with 696 additions and 562 deletions

View File

@ -32,12 +32,17 @@
BeidouB1iDllPllTracking::BeidouB1iDllPllTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams, unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
Dll_Pll_Conf trk_params = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
trk_params.SetFromConfiguration(configuration, role);
trk_params.SetFromConfiguration(configuration, role_);
const auto vector_length = static_cast<int>(std::round(trk_params.fs_in / (BEIDOU_B1I_CODE_RATE_CPS / BEIDOU_B1I_CODE_LENGTH_CHIPS)));
trk_params.vector_length = vector_length;
@ -51,33 +56,34 @@ BeidouB1iDllPllTracking::BeidouB1iDllPllTracking(
trk_params.extend_correlation_symbols = 20;
std::cout << TEXT_RED << "WARNING: BEIDOU B1I. extend_correlation_symbols must be lower than 21. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << '\n';
}
trk_params.track_pilot = configuration->property(role + ".track_pilot", false);
trk_params.track_pilot = configuration->property(role_ + ".track_pilot", false);
if (trk_params.track_pilot)
{
std::cout << TEXT_RED << "WARNING: BEIDOU B1I does not have pilot signal. Data tracking has been enabled" << TEXT_RESET << '\n';
trk_params.track_pilot = false;
}
if ((trk_params.extend_correlation_symbols > 1) and (trk_params.pll_bw_narrow_hz > trk_params.pll_bw_hz or trk_params.dll_bw_narrow_hz > trk_params.dll_bw_hz))
if ((trk_params.extend_correlation_symbols > 1) && (trk_params.pll_bw_narrow_hz > trk_params.pll_bw_hz or trk_params.dll_bw_narrow_hz > trk_params.dll_bw_hz))
{
std::cout << TEXT_RED << "WARNING: BEIDOU B1I. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n';
}
trk_params.system = 'C';
const std::array<char, 3> sig_{'B', '1', '\0'};
std::copy_n(sig_.data(), 3, trk_params.signal);
const std::array<char, 3> sig{'B', '1', '\0'};
std::copy_n(sig.data(), 3, trk_params.signal);
// ################# Make a GNU Radio Tracking block object ################
DLOG(INFO) << "role " << role_;
if (trk_params.item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_ = dll_pll_veml_make_tracking(trk_params);
tracking_sptr_ = dll_pll_veml_make_tracking(trk_params);
DLOG(INFO) << "tracking(" << tracking_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sptr_ = nullptr;
LOG(WARNING) << trk_params.item_type << " unknown tracking item type.";
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -91,13 +97,13 @@ BeidouB1iDllPllTracking::BeidouB1iDllPllTracking(
void BeidouB1iDllPllTracking::start_tracking()
{
tracking_->start_tracking();
tracking_sptr_->start_tracking();
}
void BeidouB1iDllPllTracking::stop_tracking()
{
tracking_->stop_tracking();
tracking_sptr_->stop_tracking();
}
@ -107,13 +113,13 @@ void BeidouB1iDllPllTracking::stop_tracking()
void BeidouB1iDllPllTracking::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_->set_channel(channel);
tracking_sptr_->set_channel(channel);
}
void BeidouB1iDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);
tracking_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -137,11 +143,11 @@ void BeidouB1iDllPllTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr BeidouB1iDllPllTracking::get_left_block()
{
return tracking_;
return tracking_sptr_;
}
gr::basic_block_sptr BeidouB1iDllPllTracking::get_right_block()
{
return tracking_;
return tracking_sptr_;
}

View File

@ -88,10 +88,10 @@ public:
void stop_tracking() override;
private:
dll_pll_veml_tracking_sptr tracking_;
dll_pll_veml_tracking_sptr tracking_sptr_;
std::string role_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -31,16 +31,22 @@
#include <array>
BeidouB3iDllPllTracking::BeidouB3iDllPllTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
Dll_Pll_Conf trk_params = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
trk_params.SetFromConfiguration(configuration, role);
trk_params.SetFromConfiguration(configuration, role_);
const auto vector_length = static_cast<int>(std::round(static_cast<double>(trk_params.fs_in) / (BEIDOU_B3I_CODE_RATE_CPS / BEIDOU_B3I_CODE_LENGTH_CHIPS)));
trk_params.vector_length = vector_length;
trk_params.track_pilot = configuration->property(role + ".track_pilot", false);
trk_params.track_pilot = configuration->property(role_ + ".track_pilot", false);
if (trk_params.extend_correlation_symbols < 1)
{
trk_params.extend_correlation_symbols = 1;
@ -52,22 +58,23 @@ BeidouB3iDllPllTracking::BeidouB3iDllPllTracking(
std::cout << TEXT_RED << "WARNING: BEIDOU B3I. extend_correlation_symbols must be lower than 21. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << '\n';
}
trk_params.system = 'C';
const std::array<char, 3> sig_{'B', '3', '\0'};
std::copy_n(sig_.data(), 3, trk_params.signal);
const std::array<char, 3> sig{'B', '3', '\0'};
std::copy_n(sig.data(), 3, trk_params.signal);
// ################# Make a GNU Radio Tracking block object ################
DLOG(INFO) << "role " << role_;
if (trk_params.item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_ = dll_pll_veml_make_tracking(trk_params);
tracking_sptr_ = dll_pll_veml_make_tracking(trk_params);
DLOG(INFO) << "tracking(" << tracking_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sptr_ = nullptr;
LOG(WARNING) << trk_params.item_type << " unknown tracking item type.";
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -81,13 +88,13 @@ BeidouB3iDllPllTracking::BeidouB3iDllPllTracking(
void BeidouB3iDllPllTracking::start_tracking()
{
tracking_->start_tracking();
tracking_sptr_->start_tracking();
}
void BeidouB3iDllPllTracking::stop_tracking()
{
tracking_->stop_tracking();
tracking_sptr_->stop_tracking();
}
@ -97,13 +104,13 @@ void BeidouB3iDllPllTracking::stop_tracking()
void BeidouB3iDllPllTracking::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_->set_channel(channel);
tracking_sptr_->set_channel(channel);
}
void BeidouB3iDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);
tracking_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -127,11 +134,11 @@ void BeidouB3iDllPllTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr BeidouB3iDllPllTracking::get_left_block()
{
return tracking_;
return tracking_sptr_;
}
gr::basic_block_sptr BeidouB3iDllPllTracking::get_right_block()
{
return tracking_;
return tracking_sptr_;
}

View File

@ -88,10 +88,10 @@ public:
void stop_tracking() override;
private:
dll_pll_veml_tracking_sptr tracking_;
dll_pll_veml_tracking_sptr tracking_sptr_;
std::string role_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -31,12 +31,18 @@
#include <array>
GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
Dll_Pll_Conf trk_params = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
trk_params.SetFromConfiguration(configuration, role);
trk_params.SetFromConfiguration(configuration, role_);
if (trk_params.extend_correlation_symbols < 1)
{
@ -55,23 +61,23 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
const auto vector_length = static_cast<int>(std::round(trk_params.fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
trk_params.vector_length = vector_length;
trk_params.system = 'E';
const std::array<char, 3> sig_{'1', 'B', '\0'};
std::copy_n(sig_.data(), 3, trk_params.signal);
const std::array<char, 3> sig{'1', 'B', '\0'};
std::copy_n(sig.data(), 3, trk_params.signal);
// ################# Make a GNU Radio Tracking block object ################
DLOG(INFO) << "role " << role_;
if (trk_params.item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_ = dll_pll_veml_make_tracking(trk_params);
tracking_sptr_ = dll_pll_veml_make_tracking(trk_params);
DLOG(INFO) << "tracking(" << tracking_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sptr_ = nullptr;
LOG(WARNING) << trk_params.item_type << " unknown tracking item type.";
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -85,13 +91,13 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
void GalileoE1DllPllVemlTracking::stop_tracking()
{
tracking_->stop_tracking();
tracking_sptr_->stop_tracking();
}
void GalileoE1DllPllVemlTracking::start_tracking()
{
tracking_->start_tracking();
tracking_sptr_->start_tracking();
}
@ -101,13 +107,13 @@ void GalileoE1DllPllVemlTracking::start_tracking()
void GalileoE1DllPllVemlTracking::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_->set_channel(channel);
tracking_sptr_->set_channel(channel);
}
void GalileoE1DllPllVemlTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);
tracking_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -131,11 +137,11 @@ void GalileoE1DllPllVemlTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GalileoE1DllPllVemlTracking::get_left_block()
{
return tracking_;
return tracking_sptr_;
}
gr::basic_block_sptr GalileoE1DllPllVemlTracking::get_right_block()
{
return tracking_;
return tracking_sptr_;
}

View File

@ -91,10 +91,10 @@ public:
void stop_tracking() override;
private:
dll_pll_veml_tracking_sptr tracking_;
dll_pll_veml_tracking_sptr tracking_sptr_;
std::string role_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -34,12 +34,18 @@
#include <array>
GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
data_codes_ptr_(nullptr),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
Dll_Pll_Conf_Fpga trk_params_fpga = Dll_Pll_Conf_Fpga();
DLOG(INFO) << "role " << role;
trk_params_fpga.SetFromConfiguration(configuration, role);
trk_params_fpga.SetFromConfiguration(configuration, role_);
if (trk_params_fpga.extend_correlation_symbols < 1)
{
@ -55,15 +61,15 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
{
std::cout << TEXT_RED << "WARNING: Galileo E1. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n';
}
d_track_pilot = trk_params_fpga.track_pilot;
track_pilot_ = trk_params_fpga.track_pilot;
const auto vector_length = static_cast<int32_t>(std::round(trk_params_fpga.fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
trk_params_fpga.vector_length = vector_length;
trk_params_fpga.system = 'E';
const std::array<char, 3> sig_{'1', 'B', '\0'};
std::copy_n(sig_.data(), 3, trk_params_fpga.signal);
const std::array<char, 3> sig{'1', 'B', '\0'};
std::copy_n(sig.data(), 3, trk_params_fpga.signal);
// UIO device file
device_name = configuration->property(role + ".devicename", default_device_name_Galileo_E1);
device_name_ = configuration->property(role_ + ".devicename", default_device_name_Galileo_E1);
// compute the number of tracking channels that have already been instantiated. The order in which
// GNSS-SDR instantiates the tracking channels i L1, L2, L5, E1, E5a
@ -83,7 +89,7 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
}
else
{
if (configuration->property("Tracking_1C.devicename", std::string("")) != device_name)
if (configuration->property("Tracking_1C.devicename", std::string("")) != device_name_)
{
num_prev_assigned_ch_1C = configuration->property("Channels_1C.count", 0);
}
@ -91,25 +97,24 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
uint32_t num_prev_assigned_ch_2S = configuration->property("Channels_2S.count", 0);
uint32_t num_prev_assigned_ch_L5 = configuration->property("Channels_L5.count", 0);
num_prev_assigned_ch = num_prev_assigned_ch_1C + num_prev_assigned_ch_2S + num_prev_assigned_ch_L5;
num_prev_assigned_ch_ = num_prev_assigned_ch_1C + num_prev_assigned_ch_2S + num_prev_assigned_ch_L5;
// ################# PRE-COMPUTE ALL THE CODES #################
uint32_t code_samples_per_chip = 2;
d_ca_codes = static_cast<int32_t*>(volk_gnsssdr_malloc(static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * GALILEO_E1_NUMBER_OF_CODES * sizeof(int32_t), volk_gnsssdr_get_alignment()));
prn_codes_ptr_ = static_cast<int32_t*>(volk_gnsssdr_malloc(static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * GALILEO_E1_NUMBER_OF_CODES * sizeof(int32_t), volk_gnsssdr_get_alignment()));
volk_gnsssdr::vector<float> ca_codes_f(static_cast<uint32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip);
volk_gnsssdr::vector<float> data_codes_f;
d_data_codes = nullptr;
if (d_track_pilot)
if (track_pilot_)
{
d_data_codes = static_cast<int32_t*>(volk_gnsssdr_malloc((static_cast<uint32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * GALILEO_E1_NUMBER_OF_CODES * sizeof(int32_t), volk_gnsssdr_get_alignment()));
data_codes_ptr_ = static_cast<int32_t*>(volk_gnsssdr_malloc((static_cast<uint32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * GALILEO_E1_NUMBER_OF_CODES * sizeof(int32_t), volk_gnsssdr_get_alignment()));
data_codes_f.resize(static_cast<uint32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip, 0.0);
}
for (uint32_t PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++)
{
std::array<char, 3> data_signal = {'1', 'B', '\0'};
if (d_track_pilot)
if (track_pilot_)
{
std::array<char, 3> pilot_signal = {'1', 'C', '\0'};
galileo_e1_code_gen_sinboc11_float(ca_codes_f, pilot_signal, PRN);
@ -124,14 +129,14 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
tmp_value = 0;
}
tmp_value = tmp_value | LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY;
d_ca_codes[static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = tmp_value;
prn_codes_ptr_[static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = tmp_value;
tmp_value = static_cast<int32_t>(data_codes_f[s]);
if (tmp_value < 0)
{
tmp_value = 0;
}
tmp_value = tmp_value | LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY | LOCAL_CODE_FPGA_CORRELATOR_SELECT_COUNT;
d_data_codes[static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = tmp_value;
data_codes_ptr_[static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = tmp_value;
}
}
else
@ -147,13 +152,13 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
tmp_value = 0;
}
tmp_value = tmp_value | LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY;
d_ca_codes[static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = tmp_value;
prn_codes_ptr_[static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = tmp_value;
}
}
}
trk_params_fpga.ca_codes = d_ca_codes;
trk_params_fpga.data_codes = d_data_codes;
trk_params_fpga.ca_codes = prn_codes_ptr_;
trk_params_fpga.data_codes = data_codes_ptr_;
trk_params_fpga.code_length_chips = GALILEO_E1_B_CODE_LENGTH_CHIPS;
trk_params_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip
trk_params_fpga.extended_correlation_in_fpga = false;
@ -161,9 +166,9 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
trk_params_fpga.fpga_integration_period = 1; // (number of symbols that are effectively integrated in the FPGA)
// ################# MAKE TRACKING GNU Radio object ###################
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_params_fpga);
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")";
DLOG(INFO) << "role " << role_;
tracking_fpga_sc_sptr_ = dll_pll_veml_make_tracking_fpga(trk_params_fpga);
DLOG(INFO) << "tracking(" << tracking_fpga_sc_sptr_->unique_id() << ")";
if (in_streams_ > 1)
{
@ -178,23 +183,23 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
GalileoE1DllPllVemlTrackingFpga::~GalileoE1DllPllVemlTrackingFpga()
{
volk_gnsssdr_free(d_ca_codes);
if (d_track_pilot)
volk_gnsssdr_free(prn_codes_ptr_);
if (track_pilot_)
{
volk_gnsssdr_free(d_data_codes);
volk_gnsssdr_free(data_codes_ptr_);
}
}
void GalileoE1DllPllVemlTrackingFpga::stop_tracking()
{
tracking_fpga_sc->stop_tracking();
tracking_fpga_sc_sptr_->stop_tracking();
}
void GalileoE1DllPllVemlTrackingFpga::start_tracking()
{
tracking_fpga_sc->start_tracking();
tracking_fpga_sc_sptr_->start_tracking();
}
@ -208,18 +213,18 @@ void GalileoE1DllPllVemlTrackingFpga::set_channel(unsigned int channel)
// UIO device file
std::string device_io_name;
// find the uio device file corresponding to the tracking multicorrelator
if (find_uio_dev_file_name(device_io_name, device_name, channel - num_prev_assigned_ch) < 0)
if (find_uio_dev_file_name(device_io_name, device_name_, channel_ - num_prev_assigned_ch_) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name_ << std::endl;
throw std::exception();
}
tracking_fpga_sc->set_channel(channel, device_io_name);
tracking_fpga_sc_sptr_->set_channel(channel_, device_io_name);
}
void GalileoE1DllPllVemlTrackingFpga::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_fpga_sc->set_gnss_synchro(p_gnss_synchro);
tracking_fpga_sc_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -243,11 +248,11 @@ void GalileoE1DllPllVemlTrackingFpga::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GalileoE1DllPllVemlTrackingFpga::get_left_block()
{
return tracking_fpga_sc;
return tracking_fpga_sc_sptr_;
}
gr::basic_block_sptr GalileoE1DllPllVemlTrackingFpga::get_right_block()
{
return tracking_fpga_sc;
return tracking_fpga_sc_sptr_;
}

View File

@ -131,17 +131,16 @@ private:
static const int32_t LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY = 0x0C000000; // flag that enables WE (Write Enable) of the local code FPGA
static const int32_t LOCAL_CODE_FPGA_CORRELATOR_SELECT_COUNT = 0x20000000; // flag that selects the writing of the pilot code in the FPGA (as opposed to the data code)
std::string device_name;
uint32_t num_prev_assigned_ch;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
uint32_t channel_;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc_sptr_;
std::string role_;
std::string device_name_;
int32_t* prn_codes_ptr_;
int32_t* data_codes_ptr_;
uint32_t num_prev_assigned_ch_;
uint32_t channel_;
uint32_t in_streams_;
uint32_t out_streams_;
int32_t* d_ca_codes;
int32_t* d_data_codes;
bool d_track_pilot;
bool track_pilot_;
};

View File

@ -30,38 +30,44 @@
GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
DLOG(INFO) << "role " << role;
// ################# CONFIGURATION PARAMETERS ########################
const std::string default_item_type("gr_complex");
std::string item_type = configuration->property(role + ".item_type", default_item_type);
std::string item_type = configuration->property(role_ + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
bool dump = configuration->property(role + ".dump", false);
float pll_bw_hz = configuration->property(role + ".pll_bw_hz", static_cast<float>(50.0));
bool dump = configuration->property(role_ + ".dump", false);
float pll_bw_hz = configuration->property(role_ + ".pll_bw_hz", static_cast<float>(50.0));
if (FLAGS_pll_bw_hz != 0.0)
{
pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
}
float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast<float>(2.0));
float dll_bw_hz = configuration->property(role_ + ".dll_bw_hz", static_cast<float>(2.0));
if (FLAGS_dll_bw_hz != 0.0)
{
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
}
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast<float>(0.15));
float very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", static_cast<float>(0.5));
size_t port_ch0 = configuration->property(role + ".port_ch0", 2060);
float early_late_space_chips = configuration->property(role_ + ".early_late_space_chips", static_cast<float>(0.15));
float very_early_late_space_chips = configuration->property(role_ + ".very_early_late_space_chips", static_cast<float>(0.5));
size_t port_ch0 = configuration->property(role_ + ".port_ch0", 2060);
const std::string default_dump_filename("./track_ch");
std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
std::string dump_filename = configuration->property(role_ + ".dump_filename", default_dump_filename);
const auto vector_length = static_cast<int>(std::round(fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
// ################# MAKE TRACKING GNURadio object ###################
DLOG(INFO) << "role " << role_;
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_ = galileo_e1_tcp_connector_make_tracking_cc(
tracking_sptr_ = galileo_e1_tcp_connector_make_tracking_cc(
fs_in,
vector_length,
dump,
@ -71,14 +77,15 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking(
early_late_space_chips,
very_early_late_space_chips,
port_ch0);
DLOG(INFO) << "tracking(" << tracking_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sptr_ = nullptr;
LOG(WARNING) << item_type << " unknown tracking item type.";
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -97,7 +104,7 @@ void GalileoE1TcpConnectorTracking::stop_tracking()
void GalileoE1TcpConnectorTracking::start_tracking()
{
tracking_->start_tracking();
tracking_sptr_->start_tracking();
}
/*
@ -106,13 +113,13 @@ void GalileoE1TcpConnectorTracking::start_tracking()
void GalileoE1TcpConnectorTracking::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_->set_channel(channel);
tracking_sptr_->set_channel(channel);
}
void GalileoE1TcpConnectorTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);
tracking_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -136,11 +143,11 @@ void GalileoE1TcpConnectorTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GalileoE1TcpConnectorTracking::get_left_block()
{
return tracking_;
return tracking_sptr_;
}
gr::basic_block_sptr GalileoE1TcpConnectorTracking::get_right_block()
{
return tracking_;
return tracking_sptr_;
}

View File

@ -91,10 +91,10 @@ public:
void stop_tracking() override;
private:
galileo_e1_tcp_connector_tracking_cc_sptr tracking_;
galileo_e1_tcp_connector_tracking_cc_sptr tracking_sptr_;
std::string role_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -31,12 +31,18 @@
#include <array>
GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
Dll_Pll_Conf trk_params = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
trk_params.SetFromConfiguration(configuration, role);
trk_params.SetFromConfiguration(configuration, role_);
const auto vector_length = static_cast<int>(std::round(trk_params.fs_in / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS)));
trk_params.vector_length = vector_length;
@ -55,22 +61,23 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
std::cout << TEXT_RED << "WARNING: Galileo E5a. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n';
}
trk_params.system = 'E';
const std::array<char, 3> sig_{'5', 'X', '\0'};
std::copy_n(sig_.data(), 3, trk_params.signal);
const std::array<char, 3> sig{'5', 'X', '\0'};
std::copy_n(sig.data(), 3, trk_params.signal);
// ################# Make a GNU Radio Tracking block object ################
DLOG(INFO) << "role " << role;
if (trk_params.item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_ = dll_pll_veml_make_tracking(trk_params);
tracking_sptr_ = dll_pll_veml_make_tracking(trk_params);
DLOG(INFO) << "tracking(" << tracking_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sptr_ = nullptr;
LOG(WARNING) << trk_params.item_type << " unknown tracking item type.";
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -84,13 +91,13 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
void GalileoE5aDllPllTracking::stop_tracking()
{
tracking_->stop_tracking();
tracking_sptr_->stop_tracking();
}
void GalileoE5aDllPllTracking::start_tracking()
{
tracking_->start_tracking();
tracking_sptr_->start_tracking();
}
@ -100,13 +107,13 @@ void GalileoE5aDllPllTracking::start_tracking()
void GalileoE5aDllPllTracking::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_->set_channel(channel);
tracking_sptr_->set_channel(channel);
}
void GalileoE5aDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);
tracking_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -130,11 +137,11 @@ void GalileoE5aDllPllTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GalileoE5aDllPllTracking::get_left_block()
{
return tracking_;
return tracking_sptr_;
}
gr::basic_block_sptr GalileoE5aDllPllTracking::get_right_block()
{
return tracking_;
return tracking_sptr_;
}

View File

@ -89,10 +89,10 @@ public:
void stop_tracking() override;
private:
dll_pll_veml_tracking_sptr tracking_;
dll_pll_veml_tracking_sptr tracking_sptr_;
std::string role_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -29,16 +29,22 @@
#include <array>
GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
const ConfigurationInterface *configuration, const std::string &role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface *configuration,
const std::string &role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
data_codes_ptr_(nullptr),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
Dll_Pll_Conf_Fpga trk_params_fpga = Dll_Pll_Conf_Fpga();
DLOG(INFO) << "role " << role;
trk_params_fpga.SetFromConfiguration(configuration, role);
trk_params_fpga.SetFromConfiguration(configuration, role_);
const auto vector_length = static_cast<int32_t>(std::round(trk_params_fpga.fs_in / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS)));
trk_params_fpga.vector_length = vector_length;
d_track_pilot = trk_params_fpga.track_pilot;
track_pilot_ = trk_params_fpga.track_pilot;
if (trk_params_fpga.extend_correlation_symbols < 1)
{
trk_params_fpga.extend_correlation_symbols = 1;
@ -54,13 +60,11 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
std::cout << TEXT_RED << "WARNING: Galileo E5a. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n';
}
trk_params_fpga.system = 'E';
const std::array<char, 3> sig_{'5', 'X', '\0'};
std::copy_n(sig_.data(), 3, trk_params_fpga.signal);
d_data_codes = nullptr;
const std::array<char, 3> sig{'5', 'X', '\0'};
std::copy_n(sig.data(), 3, trk_params_fpga.signal);
// UIO device file
device_name = configuration->property(role + ".devicename", default_device_name_Galileo_E5a);
device_name_ = configuration->property(role_ + ".devicename", default_device_name_Galileo_E5a);
// compute the number of tracking channels that have already been instantiated. The order in which
// GNSS-SDR instantiates the tracking channels i L1, L2, L5, E1, E5a
@ -71,12 +75,12 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
uint32_t num_prev_assigned_ch_1C = configuration->property("Channels_1C.count", 0);
uint32_t num_prev_assigned_ch_2S = 0;
if (configuration->property("Tracking_2S.devicename", std::string("")) != device_name)
if (configuration->property("Tracking_2S.devicename", std::string("")) != device_name_)
{
num_prev_assigned_ch_2S = configuration->property("Channels_2S.count", 0);
}
uint32_t num_prev_assigned_ch_1B = configuration->property("Channels_1B.count", 0);
num_prev_assigned_ch = num_prev_assigned_ch_1C + num_prev_assigned_ch_2S + num_prev_assigned_ch_1B;
num_prev_assigned_ch_ = num_prev_assigned_ch_1C + num_prev_assigned_ch_2S + num_prev_assigned_ch_1B;
// ################# PRE-COMPUTE ALL THE CODES #################
uint32_t code_samples_per_chip = 1;
@ -84,11 +88,11 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
volk_gnsssdr::vector<gr_complex> aux_code(code_length_chips * code_samples_per_chip, gr_complex(0.0, 0.0));
d_ca_codes = static_cast<int32_t *>(volk_gnsssdr_malloc(static_cast<int32_t>(code_length_chips) * code_samples_per_chip * GALILEO_E5A_NUMBER_OF_CODES * sizeof(int32_t), volk_gnsssdr_get_alignment()));
prn_codes_ptr_ = static_cast<int32_t *>(volk_gnsssdr_malloc(static_cast<int32_t>(code_length_chips) * code_samples_per_chip * GALILEO_E5A_NUMBER_OF_CODES * sizeof(int32_t), volk_gnsssdr_get_alignment()));
if (trk_params_fpga.track_pilot)
{
d_data_codes = static_cast<int32_t *>(volk_gnsssdr_malloc((static_cast<uint32_t>(code_length_chips)) * code_samples_per_chip * GALILEO_E5A_NUMBER_OF_CODES * sizeof(int32_t), volk_gnsssdr_get_alignment()));
data_codes_ptr_ = static_cast<int32_t *>(volk_gnsssdr_malloc((static_cast<uint32_t>(code_length_chips)) * code_samples_per_chip * GALILEO_E5A_NUMBER_OF_CODES * sizeof(int32_t), volk_gnsssdr_get_alignment()));
}
for (uint32_t PRN = 1; PRN <= GALILEO_E5A_NUMBER_OF_CODES; PRN++)
@ -107,7 +111,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
tmp_value = 0;
}
tmp_value = tmp_value | LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY;
d_ca_codes[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = tmp_value;
prn_codes_ptr_[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = tmp_value;
tmp_value = static_cast<int32_t>(aux_code[s].real());
if (tmp_value < 0)
@ -115,7 +119,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
tmp_value = 0;
}
tmp_value = tmp_value | LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY | LOCAL_CODE_FPGA_CORRELATOR_SELECT_COUNT;
d_data_codes[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = tmp_value;
data_codes_ptr_[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = tmp_value;
}
}
else
@ -129,20 +133,20 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
tmp_value = 0;
}
tmp_value = tmp_value | LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY;
d_ca_codes[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = tmp_value;
prn_codes_ptr_[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = tmp_value;
}
}
}
trk_params_fpga.ca_codes = d_ca_codes;
trk_params_fpga.data_codes = d_data_codes;
trk_params_fpga.ca_codes = prn_codes_ptr_;
trk_params_fpga.data_codes = data_codes_ptr_;
trk_params_fpga.code_length_chips = code_length_chips;
trk_params_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip
trk_params_fpga.extended_correlation_in_fpga = false; // by default
trk_params_fpga.extend_fpga_integration_periods = 1; // (number of FPGA integrations that are combined in the SW)
trk_params_fpga.fpga_integration_period = 1; // (number of symbols that are effectively integrated in the FPGA)
if (d_track_pilot)
if (track_pilot_)
{
if (trk_params_fpga.extend_correlation_symbols > 1)
{
@ -167,10 +171,9 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
}
// ################# MAKE TRACKING GNURadio object ###################
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_params_fpga);
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")";
DLOG(INFO) << "role " << role_;
tracking_fpga_sc_sptr_ = dll_pll_veml_make_tracking_fpga(trk_params_fpga);
DLOG(INFO) << "tracking(" << tracking_fpga_sc_sptr_->unique_id() << ")";
if (in_streams_ > 1)
{
@ -185,23 +188,23 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
GalileoE5aDllPllTrackingFpga::~GalileoE5aDllPllTrackingFpga()
{
volk_gnsssdr_free(d_ca_codes);
if (d_track_pilot)
volk_gnsssdr_free(prn_codes_ptr_);
if (track_pilot_)
{
volk_gnsssdr_free(d_data_codes);
volk_gnsssdr_free(data_codes_ptr_);
}
}
void GalileoE5aDllPllTrackingFpga::start_tracking()
{
tracking_fpga_sc->start_tracking();
tracking_fpga_sc_sptr_->start_tracking();
}
void GalileoE5aDllPllTrackingFpga::stop_tracking()
{
tracking_fpga_sc->stop_tracking();
tracking_fpga_sc_sptr_->stop_tracking();
}
@ -215,18 +218,18 @@ void GalileoE5aDllPllTrackingFpga::set_channel(unsigned int channel)
// UIO device file
std::string device_io_name;
// find the uio device file corresponding to the tracking multicorrelator
if (find_uio_dev_file_name(device_io_name, device_name, channel - num_prev_assigned_ch) < 0)
if (find_uio_dev_file_name(device_io_name, device_name_, channel_ - num_prev_assigned_ch_) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name_ << std::endl;
throw std::exception();
}
tracking_fpga_sc->set_channel(channel, device_io_name);
tracking_fpga_sc_sptr_->set_channel(channel_, device_io_name);
}
void GalileoE5aDllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro)
{
tracking_fpga_sc->set_gnss_synchro(p_gnss_synchro);
tracking_fpga_sc_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -250,11 +253,11 @@ void GalileoE5aDllPllTrackingFpga::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GalileoE5aDllPllTrackingFpga::get_left_block()
{
return tracking_fpga_sc;
return tracking_fpga_sc_sptr_;
}
gr::basic_block_sptr GalileoE5aDllPllTrackingFpga::get_right_block()
{
return tracking_fpga_sc;
return tracking_fpga_sc_sptr_;
}

View File

@ -123,17 +123,16 @@ private:
static const int32_t LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY = 0x0C000000; // flag that enables WE (Write Enable) of the local code FPGA
static const int32_t LOCAL_CODE_FPGA_CORRELATOR_SELECT_COUNT = 0x20000000; // flag that selects the writing of the pilot code in the FPGA (as opposed to the data code)
std::string device_name;
uint32_t num_prev_assigned_ch;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
uint32_t channel_;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc_sptr_;
std::string role_;
std::string device_name_;
int32_t* prn_codes_ptr_;
int32_t* data_codes_ptr_;
uint32_t num_prev_assigned_ch_;
uint32_t channel_;
uint32_t in_streams_;
uint32_t out_streams_;
int32_t* d_ca_codes;
int32_t* d_data_codes;
bool d_track_pilot;
bool track_pilot_;
};

View File

@ -32,12 +32,18 @@
#include <array>
GalileoE5bDllPllTracking::GalileoE5bDllPllTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
Dll_Pll_Conf trk_params = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
trk_params.SetFromConfiguration(configuration, role);
trk_params.SetFromConfiguration(configuration, role_);
const auto vector_length = static_cast<int>(std::round(trk_params.fs_in / (GALILEO_E5B_CODE_CHIP_RATE_CPS / GALILEO_E5B_CODE_LENGTH_CHIPS)));
trk_params.vector_length = vector_length;
@ -56,22 +62,23 @@ GalileoE5bDllPllTracking::GalileoE5bDllPllTracking(
std::cout << TEXT_RED << "WARNING: Galileo E5b. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n';
}
trk_params.system = 'E';
const std::array<char, 3> sig_{'7', 'X', '\0'};
std::copy_n(sig_.data(), 3, trk_params.signal);
const std::array<char, 3> sig{'7', 'X', '\0'};
std::copy_n(sig.data(), 3, trk_params.signal);
// ################# Make a GNU Radio Tracking block object ################
DLOG(INFO) << "role " << role_;
if (trk_params.item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_ = dll_pll_veml_make_tracking(trk_params);
tracking_sptr_ = dll_pll_veml_make_tracking(trk_params);
DLOG(INFO) << "tracking(" << tracking_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sptr_ = nullptr;
LOG(WARNING) << trk_params.item_type << " unknown tracking item type.";
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -85,13 +92,13 @@ GalileoE5bDllPllTracking::GalileoE5bDllPllTracking(
void GalileoE5bDllPllTracking::stop_tracking()
{
tracking_->stop_tracking();
tracking_sptr_->stop_tracking();
}
void GalileoE5bDllPllTracking::start_tracking()
{
tracking_->start_tracking();
tracking_sptr_->start_tracking();
}
@ -101,13 +108,13 @@ void GalileoE5bDllPllTracking::start_tracking()
void GalileoE5bDllPllTracking::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_->set_channel(channel);
tracking_sptr_->set_channel(channel);
}
void GalileoE5bDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);
tracking_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -133,11 +140,11 @@ void GalileoE5bDllPllTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GalileoE5bDllPllTracking::get_left_block()
{
return tracking_;
return tracking_sptr_;
}
gr::basic_block_sptr GalileoE5bDllPllTracking::get_right_block()
{
return tracking_;
return tracking_sptr_;
}

View File

@ -105,10 +105,10 @@ public:
void stop_tracking() override;
private:
dll_pll_veml_tracking_sptr tracking_;
dll_pll_veml_tracking_sptr tracking_sptr_;
std::string role_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -27,12 +27,18 @@
#include <array>
GalileoE6DllPllTracking::GalileoE6DllPllTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
Dll_Pll_Conf trk_params = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
trk_params.SetFromConfiguration(configuration, role);
trk_params.SetFromConfiguration(configuration, role_);
const auto vector_length = static_cast<int>(std::round(trk_params.fs_in / (GALILEO_E6_B_CODE_CHIP_RATE_CPS / GALILEO_E6_B_CODE_LENGTH_CHIPS)));
trk_params.vector_length = vector_length;
@ -51,22 +57,23 @@ GalileoE6DllPllTracking::GalileoE6DllPllTracking(
std::cout << TEXT_RED << "WARNING: Galileo E5b. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n';
}
trk_params.system = 'E';
const std::array<char, 3> sig_{'E', '6', '\0'};
std::copy_n(sig_.data(), 3, trk_params.signal);
const std::array<char, 3> sig{'E', '6', '\0'};
std::copy_n(sig.data(), 3, trk_params.signal);
// ################# Make a GNU Radio Tracking block object ################
DLOG(INFO) << "role " << role_;
if (trk_params.item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_ = dll_pll_veml_make_tracking(trk_params);
tracking_sptr_ = dll_pll_veml_make_tracking(trk_params);
DLOG(INFO) << "tracking(" << tracking_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sptr_ = nullptr;
LOG(WARNING) << trk_params.item_type << " unknown tracking item type.";
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -80,13 +87,13 @@ GalileoE6DllPllTracking::GalileoE6DllPllTracking(
void GalileoE6DllPllTracking::stop_tracking()
{
tracking_->stop_tracking();
tracking_sptr_->stop_tracking();
}
void GalileoE6DllPllTracking::start_tracking()
{
tracking_->start_tracking();
tracking_sptr_->start_tracking();
}
@ -96,13 +103,13 @@ void GalileoE6DllPllTracking::start_tracking()
void GalileoE6DllPllTracking::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_->set_channel(channel);
tracking_sptr_->set_channel(channel);
}
void GalileoE6DllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);
tracking_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -128,11 +135,11 @@ void GalileoE6DllPllTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GalileoE6DllPllTracking::get_left_block()
{
return tracking_;
return tracking_sptr_;
}
gr::basic_block_sptr GalileoE6DllPllTracking::get_right_block()
{
return tracking_;
return tracking_sptr_;
}

View File

@ -100,10 +100,10 @@ public:
void stop_tracking() override;
private:
dll_pll_veml_tracking_sptr tracking_;
dll_pll_veml_tracking_sptr tracking_sptr_;
std::string role_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -31,40 +31,46 @@
GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
DLOG(INFO) << "role " << role;
// ################# CONFIGURATION PARAMETERS ########################
const std::string default_item_type("gr_complex");
item_type_ = configuration->property(role + ".item_type", default_item_type);
item_type_ = configuration->property(role_ + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
bool dump = configuration->property(role + ".dump", false);
float pll_bw_hz = configuration->property(role + ".pll_bw_hz", static_cast<float>(50.0));
bool dump = configuration->property(role_ + ".dump", false);
float pll_bw_hz = configuration->property(role_ + ".pll_bw_hz", static_cast<float>(50.0));
if (FLAGS_pll_bw_hz != 0.0)
{
pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
}
float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast<float>(2.0));
float dll_bw_hz = configuration->property(role_ + ".dll_bw_hz", static_cast<float>(2.0));
if (FLAGS_dll_bw_hz != 0.0)
{
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
}
float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", static_cast<float>(20.0));
float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", static_cast<float>(2.0));
int extend_correlation_ms = configuration->property(role + ".extend_correlation_ms", 1);
float pll_bw_narrow_hz = configuration->property(role_ + ".pll_bw_narrow_hz", static_cast<float>(20.0));
float dll_bw_narrow_hz = configuration->property(role_ + ".dll_bw_narrow_hz", static_cast<float>(2.0));
int extend_correlation_ms = configuration->property(role_ + ".extend_correlation_ms", 1);
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast<float>(0.5));
float early_late_space_chips = configuration->property(role_ + ".early_late_space_chips", static_cast<float>(0.5));
const std::string default_dump_filename("./track_ch");
std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
std::string dump_filename = configuration->property(role_ + ".dump_filename", default_dump_filename);
const auto vector_length = static_cast<int>(std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_CPS / GLONASS_L1_CA_CODE_LENGTH_CHIPS)));
// ################# MAKE TRACKING GNURadio object ###################
DLOG(INFO) << "role " << role_;
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_cc = glonass_l1_ca_dll_pll_c_aid_make_tracking_cc(
tracking_cc_sptr_ = glonass_l1_ca_dll_pll_c_aid_make_tracking_cc(
fs_in,
vector_length,
dump,
@ -75,12 +81,13 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking(
dll_bw_narrow_hz,
extend_correlation_ms,
early_late_space_chips);
DLOG(INFO) << "tracking(" << tracking_cc->unique_id() << ")";
tracking_sc_sptr_ = nullptr;
DLOG(INFO) << "tracking(" << tracking_cc_sptr_->unique_id() << ")";
}
else if (item_type_ == "cshort")
{
item_size_ = sizeof(lv_16sc_t);
tracking_sc = glonass_l1_ca_dll_pll_c_aid_make_tracking_sc(
tracking_sc_sptr_ = glonass_l1_ca_dll_pll_c_aid_make_tracking_sc(
fs_in,
vector_length,
dump,
@ -91,14 +98,17 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking(
dll_bw_narrow_hz,
extend_correlation_ms,
early_late_space_chips);
DLOG(INFO) << "tracking(" << tracking_sc->unique_id() << ")";
tracking_cc_sptr_ = nullptr;
DLOG(INFO) << "tracking(" << tracking_sc_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sc_sptr_ = nullptr;
tracking_cc_sptr_ = nullptr;
LOG(WARNING) << item_type_ << " unknown tracking item type.";
}
channel_ = 0;
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -119,11 +129,11 @@ void GlonassL1CaDllPllCAidTracking::start_tracking()
{
if (item_type_ == "gr_complex")
{
tracking_cc->start_tracking();
tracking_cc_sptr_->start_tracking();
}
else if (item_type_ == "cshort")
{
tracking_sc->start_tracking();
tracking_sc_sptr_->start_tracking();
}
else
{
@ -141,11 +151,11 @@ void GlonassL1CaDllPllCAidTracking::set_channel(unsigned int channel)
if (item_type_ == "gr_complex")
{
tracking_cc->set_channel(channel);
tracking_cc_sptr_->set_channel(channel);
}
else if (item_type_ == "cshort")
{
tracking_sc->set_channel(channel);
tracking_sc_sptr_->set_channel(channel);
}
else
{
@ -158,11 +168,11 @@ void GlonassL1CaDllPllCAidTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchr
{
if (item_type_ == "gr_complex")
{
tracking_cc->set_gnss_synchro(p_gnss_synchro);
tracking_cc_sptr_->set_gnss_synchro(p_gnss_synchro);
}
else if (item_type_ == "cshort")
{
tracking_sc->set_gnss_synchro(p_gnss_synchro);
tracking_sc_sptr_->set_gnss_synchro(p_gnss_synchro);
}
else
{
@ -193,11 +203,11 @@ gr::basic_block_sptr GlonassL1CaDllPllCAidTracking::get_left_block()
{
if (item_type_ == "gr_complex")
{
return tracking_cc;
return tracking_cc_sptr_;
}
if (item_type_ == "cshort")
{
return tracking_sc;
return tracking_sc_sptr_;
}
LOG(WARNING) << item_type_ << " unknown tracking item type";
return nullptr;
@ -208,11 +218,11 @@ gr::basic_block_sptr GlonassL1CaDllPllCAidTracking::get_right_block()
{
if (item_type_ == "gr_complex")
{
return tracking_cc;
return tracking_cc_sptr_;
}
if (item_type_ == "cshort")
{
return tracking_sc;
return tracking_sc_sptr_;
}

View File

@ -92,12 +92,12 @@ public:
void stop_tracking() override;
private:
glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc;
glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr tracking_sc;
size_t item_size_;
std::string item_type_;
unsigned int channel_;
glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc_sptr_;
glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr tracking_sc_sptr_;
std::string role_;
std::string item_type_;
size_t item_size_;
unsigned int channel_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -30,36 +30,42 @@
GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
DLOG(INFO) << "role " << role;
// ################# CONFIGURATION PARAMETERS ########################
const std::string default_item_type("gr_complex");
std::string item_type = configuration->property(role + ".item_type", default_item_type);
std::string item_type = configuration->property(role_ + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
bool dump = configuration->property(role + ".dump", false);
float pll_bw_hz = configuration->property(role + ".pll_bw_hz", static_cast<float>(50.0));
bool dump = configuration->property(role_ + ".dump", false);
float pll_bw_hz = configuration->property(role_ + ".pll_bw_hz", static_cast<float>(50.0));
if (FLAGS_pll_bw_hz != 0.0)
{
pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
}
float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast<float>(2.0));
float dll_bw_hz = configuration->property(role_ + ".dll_bw_hz", static_cast<float>(2.0));
if (FLAGS_dll_bw_hz != 0.0)
{
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
}
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast<float>(0.5));
float early_late_space_chips = configuration->property(role_ + ".early_late_space_chips", static_cast<float>(0.5));
const std::string default_dump_filename("./track_ch");
std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
std::string dump_filename = configuration->property(role_ + ".dump_filename", default_dump_filename);
const auto vector_length = static_cast<int>(std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_CPS / GLONASS_L1_CA_CODE_LENGTH_CHIPS)));
// ################# MAKE TRACKING GNURadio object ###################
DLOG(INFO) << "role " << role_;
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_ = glonass_l1_ca_dll_pll_make_tracking_cc(
tracking_sptr_ = glonass_l1_ca_dll_pll_make_tracking_cc(
fs_in,
vector_length,
dump,
@ -67,14 +73,15 @@ GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking(
pll_bw_hz,
dll_bw_hz,
early_late_space_chips);
DLOG(INFO) << "tracking(" << tracking_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sptr_ = nullptr;
LOG(WARNING) << item_type << " unknown tracking item type.";
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -93,7 +100,7 @@ void GlonassL1CaDllPllTracking::stop_tracking()
void GlonassL1CaDllPllTracking::start_tracking()
{
tracking_->start_tracking();
tracking_sptr_->start_tracking();
}
@ -103,13 +110,13 @@ void GlonassL1CaDllPllTracking::start_tracking()
void GlonassL1CaDllPllTracking::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_->set_channel(channel);
tracking_sptr_->set_channel(channel);
}
void GlonassL1CaDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);
tracking_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -133,11 +140,11 @@ void GlonassL1CaDllPllTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GlonassL1CaDllPllTracking::get_left_block()
{
return tracking_;
return tracking_sptr_;
}
gr::basic_block_sptr GlonassL1CaDllPllTracking::get_right_block()
{
return tracking_;
return tracking_sptr_;
}

View File

@ -91,10 +91,10 @@ public:
void stop_tracking() override;
private:
glonass_l1_ca_dll_pll_tracking_cc_sptr tracking_;
glonass_l1_ca_dll_pll_tracking_cc_sptr tracking_sptr_;
std::string role_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -29,40 +29,46 @@
GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
DLOG(INFO) << "role " << role;
// ################# CONFIGURATION PARAMETERS ########################
const std::string default_item_type("gr_complex");
item_type_ = configuration->property(role + ".item_type", default_item_type);
item_type_ = configuration->property(role_ + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
bool dump = configuration->property(role + ".dump", false);
float pll_bw_hz = configuration->property(role + ".pll_bw_hz", static_cast<float>(50.0));
bool dump = configuration->property(role_ + ".dump", false);
float pll_bw_hz = configuration->property(role_ + ".pll_bw_hz", static_cast<float>(50.0));
if (FLAGS_pll_bw_hz != 0.0)
{
pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
}
float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast<float>(2.0));
float dll_bw_hz = configuration->property(role_ + ".dll_bw_hz", static_cast<float>(2.0));
if (FLAGS_dll_bw_hz != 0.0)
{
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
}
float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", static_cast<float>(20.0));
float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", static_cast<float>(2.0));
int extend_correlation_ms = configuration->property(role + ".extend_correlation_ms", 1);
float pll_bw_narrow_hz = configuration->property(role_ + ".pll_bw_narrow_hz", static_cast<float>(20.0));
float dll_bw_narrow_hz = configuration->property(role_ + ".dll_bw_narrow_hz", static_cast<float>(2.0));
int extend_correlation_ms = configuration->property(role_ + ".extend_correlation_ms", 1);
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast<float>(0.5));
float early_late_space_chips = configuration->property(role_ + ".early_late_space_chips", static_cast<float>(0.5));
const std::string default_dump_filename("./track_ch");
std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
std::string dump_filename = configuration->property(role_ + ".dump_filename", default_dump_filename);
const auto vector_length = static_cast<int>(std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_CPS / GLONASS_L2_CA_CODE_LENGTH_CHIPS)));
// ################# MAKE TRACKING GNURadio object ###################
DLOG(INFO) << "role " << role_;
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_cc = glonass_l2_ca_dll_pll_c_aid_make_tracking_cc(
tracking_cc_sptr_ = glonass_l2_ca_dll_pll_c_aid_make_tracking_cc(
fs_in,
vector_length,
dump,
@ -73,12 +79,13 @@ GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking(
dll_bw_narrow_hz,
extend_correlation_ms,
early_late_space_chips);
DLOG(INFO) << "tracking(" << tracking_cc->unique_id() << ")";
tracking_sc_sptr_ = nullptr;
DLOG(INFO) << "tracking(" << tracking_cc_sptr_->unique_id() << ")";
}
else if (item_type_ == "cshort")
{
item_size_ = sizeof(lv_16sc_t);
tracking_sc = glonass_l2_ca_dll_pll_c_aid_make_tracking_sc(
tracking_sc_sptr_ = glonass_l2_ca_dll_pll_c_aid_make_tracking_sc(
fs_in,
vector_length,
dump,
@ -89,14 +96,17 @@ GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking(
dll_bw_narrow_hz,
extend_correlation_ms,
early_late_space_chips);
DLOG(INFO) << "tracking(" << tracking_sc->unique_id() << ")";
tracking_cc_sptr_ = nullptr;
DLOG(INFO) << "tracking(" << tracking_sc_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sc_sptr_ = nullptr;
tracking_cc_sptr_ = nullptr;
LOG(WARNING) << item_type_ << " unknown tracking item type.";
}
channel_ = 0;
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -117,11 +127,11 @@ void GlonassL2CaDllPllCAidTracking::start_tracking()
{
if (item_type_ == "gr_complex")
{
tracking_cc->start_tracking();
tracking_cc_sptr_->start_tracking();
}
else if (item_type_ == "cshort")
{
tracking_sc->start_tracking();
tracking_sc_sptr_->start_tracking();
}
else
{
@ -139,11 +149,11 @@ void GlonassL2CaDllPllCAidTracking::set_channel(unsigned int channel)
if (item_type_ == "gr_complex")
{
tracking_cc->set_channel(channel);
tracking_cc_sptr_->set_channel(channel);
}
else if (item_type_ == "cshort")
{
tracking_sc->set_channel(channel);
tracking_sc_sptr_->set_channel(channel);
}
else
{
@ -156,11 +166,11 @@ void GlonassL2CaDllPllCAidTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchr
{
if (item_type_ == "gr_complex")
{
tracking_cc->set_gnss_synchro(p_gnss_synchro);
tracking_cc_sptr_->set_gnss_synchro(p_gnss_synchro);
}
else if (item_type_ == "cshort")
{
tracking_sc->set_gnss_synchro(p_gnss_synchro);
tracking_sc_sptr_->set_gnss_synchro(p_gnss_synchro);
}
else
{
@ -191,11 +201,11 @@ gr::basic_block_sptr GlonassL2CaDllPllCAidTracking::get_left_block()
{
if (item_type_ == "gr_complex")
{
return tracking_cc;
return tracking_cc_sptr_;
}
if (item_type_ == "cshort")
{
return tracking_sc;
return tracking_sc_sptr_;
}
LOG(WARNING) << item_type_ << " unknown tracking item type";
return nullptr;
@ -206,11 +216,11 @@ gr::basic_block_sptr GlonassL2CaDllPllCAidTracking::get_right_block()
{
if (item_type_ == "gr_complex")
{
return tracking_cc;
return tracking_cc_sptr_;
}
if (item_type_ == "cshort")
{
return tracking_sc;
return tracking_sc_sptr_;
}
LOG(WARNING) << item_type_ << " unknown tracking item type";
return nullptr;

View File

@ -91,12 +91,12 @@ public:
void stop_tracking() override;
private:
glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc;
glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr tracking_sc;
size_t item_size_;
std::string item_type_;
unsigned int channel_;
glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc_sptr_;
glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr tracking_sc_sptr_;
std::string role_;
std::string item_type_;
size_t item_size_;
unsigned int channel_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -28,36 +28,42 @@
GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
DLOG(INFO) << "role " << role;
// ################# CONFIGURATION PARAMETERS ########################
const std::string default_item_type("gr_complex");
std::string item_type = configuration->property(role + ".item_type", default_item_type);
std::string item_type = configuration->property(role_ + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
bool dump = configuration->property(role + ".dump", false);
float pll_bw_hz = configuration->property(role + ".pll_bw_hz", static_cast<float>(50.0));
bool dump = configuration->property(role_ + ".dump", false);
float pll_bw_hz = configuration->property(role_ + ".pll_bw_hz", static_cast<float>(50.0));
if (FLAGS_pll_bw_hz != 0.0)
{
pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
}
float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast<float>(2.0));
float dll_bw_hz = configuration->property(role_ + ".dll_bw_hz", static_cast<float>(2.0));
if (FLAGS_dll_bw_hz != 0.0)
{
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
}
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast<float>(0.5));
float early_late_space_chips = configuration->property(role_ + ".early_late_space_chips", static_cast<float>(0.5));
const std::string default_dump_filename("./track_ch");
std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
std::string dump_filename = configuration->property(role_ + ".dump_filename", default_dump_filename);
const auto vector_length = static_cast<int>(std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_CPS / GLONASS_L2_CA_CODE_LENGTH_CHIPS)));
// ################# MAKE TRACKING GNURadio object ###################
DLOG(INFO) << "role " << role_;
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_ = glonass_l2_ca_dll_pll_make_tracking_cc(
tracking_sptr_ = glonass_l2_ca_dll_pll_make_tracking_cc(
fs_in,
vector_length,
dump,
@ -65,14 +71,15 @@ GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking(
pll_bw_hz,
dll_bw_hz,
early_late_space_chips);
DLOG(INFO) << "tracking(" << tracking_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sptr_ = nullptr;
LOG(WARNING) << item_type << " unknown tracking item type.";
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -91,7 +98,7 @@ void GlonassL2CaDllPllTracking::stop_tracking()
void GlonassL2CaDllPllTracking::start_tracking()
{
tracking_->start_tracking();
tracking_sptr_->start_tracking();
}
@ -101,13 +108,13 @@ void GlonassL2CaDllPllTracking::start_tracking()
void GlonassL2CaDllPllTracking::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_->set_channel(channel);
tracking_sptr_->set_channel(channel);
}
void GlonassL2CaDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);
tracking_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -131,11 +138,11 @@ void GlonassL2CaDllPllTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GlonassL2CaDllPllTracking::get_left_block()
{
return tracking_;
return tracking_sptr_;
}
gr::basic_block_sptr GlonassL2CaDllPllTracking::get_right_block()
{
return tracking_;
return tracking_sptr_;
}

View File

@ -90,10 +90,10 @@ public:
void stop_tracking() override;
private:
glonass_l2_ca_dll_pll_tracking_cc_sptr tracking_;
glonass_l2_ca_dll_pll_tracking_cc_sptr tracking_sptr_;
std::string role_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -32,12 +32,17 @@
#include <array>
GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams, unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
Dll_Pll_Conf trk_params = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
trk_params.SetFromConfiguration(configuration, role);
trk_params.SetFromConfiguration(configuration, role_);
const auto vector_length = static_cast<int>(std::round(trk_params.fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
trk_params.vector_length = vector_length;
@ -51,7 +56,7 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
trk_params.extend_correlation_symbols = 20;
std::cout << TEXT_RED << "WARNING: GPS L1 C/A. extend_correlation_symbols must be lower than 21. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << '\n';
}
trk_params.track_pilot = configuration->property(role + ".track_pilot", false);
trk_params.track_pilot = configuration->property(role_ + ".track_pilot", false);
if (trk_params.track_pilot)
{
trk_params.track_pilot = false;
@ -63,22 +68,23 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
}
trk_params.system = 'G';
const std::array<char, 3> sig_{'1', 'C', '\0'};
std::copy_n(sig_.data(), 3, trk_params.signal);
const std::array<char, 3> sig{'1', 'C', '\0'};
std::copy_n(sig.data(), 3, trk_params.signal);
// ################# Make a GNU Radio Tracking block object ################
DLOG(INFO) << "role " << role_;
if (trk_params.item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_ = dll_pll_veml_make_tracking(trk_params);
tracking_sptr_ = dll_pll_veml_make_tracking(trk_params);
DLOG(INFO) << "tracking(" << tracking_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sptr_ = nullptr;
LOG(WARNING) << trk_params.item_type << " unknown tracking item type.";
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -92,13 +98,13 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
void GpsL1CaDllPllTracking::stop_tracking()
{
tracking_->stop_tracking();
tracking_sptr_->stop_tracking();
}
void GpsL1CaDllPllTracking::start_tracking()
{
tracking_->start_tracking();
tracking_sptr_->start_tracking();
}
@ -108,13 +114,13 @@ void GpsL1CaDllPllTracking::start_tracking()
void GpsL1CaDllPllTracking::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_->set_channel(channel);
tracking_sptr_->set_channel(channel);
}
void GpsL1CaDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);
tracking_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -138,11 +144,11 @@ void GpsL1CaDllPllTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GpsL1CaDllPllTracking::get_left_block()
{
return tracking_;
return tracking_sptr_;
}
gr::basic_block_sptr GpsL1CaDllPllTracking::get_right_block()
{
return tracking_;
return tracking_sptr_;
}

View File

@ -92,10 +92,10 @@ public:
void stop_tracking() override;
private:
dll_pll_veml_tracking_sptr tracking_;
dll_pll_veml_tracking_sptr tracking_sptr_;
std::string role_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -34,12 +34,18 @@
#include <array>
GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
num_prev_assigned_ch_(0),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
Dll_Pll_Conf_Fpga trk_params_fpga = Dll_Pll_Conf_Fpga();
DLOG(INFO) << "role " << role;
trk_params_fpga.SetFromConfiguration(configuration, role);
trk_params_fpga.SetFromConfiguration(configuration, role_);
const auto vector_length = static_cast<int32_t>(std::round(trk_params_fpga.fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
trk_params_fpga.vector_length = vector_length;
@ -53,7 +59,7 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
trk_params_fpga.extend_correlation_symbols = GPS_CA_BIT_DURATION_MS;
std::cout << TEXT_RED << "WARNING: GPS L1 C/A. extend_correlation_symbols must be lower than 21. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << '\n';
}
trk_params_fpga.track_pilot = configuration->property(role + ".track_pilot", false);
trk_params_fpga.track_pilot = configuration->property(role_ + ".track_pilot", false);
if (trk_params_fpga.track_pilot)
{
trk_params_fpga.track_pilot = false;
@ -64,35 +70,31 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
std::cout << TEXT_RED << "WARNING: GPS L1 C/A. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n';
}
trk_params_fpga.system = 'G';
const std::array<char, 3> sig_{'1', 'C', '\0'};
std::copy_n(sig_.data(), 3, trk_params_fpga.signal);
const std::array<char, 3> sig{'1', 'C', '\0'};
std::copy_n(sig.data(), 3, trk_params_fpga.signal);
// UIO device file
device_name = configuration->property(role + ".devicename", default_device_name_GPS_L1);
// compute the number of tracking channels that have already been instantiated. The order in which
// GNSS-SDR instantiates the tracking channels i L1, l2, L5, E1, E5a
num_prev_assigned_ch = 0;
device_name_ = configuration->property(role_ + ".devicename", default_device_name_GPS_L1);
// ################# PRE-COMPUTE ALL THE CODES #################
d_ca_codes = static_cast<int32_t*>(volk_gnsssdr_malloc(static_cast<int32_t>(GPS_L1_CA_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int32_t), volk_gnsssdr_get_alignment()));
ca_codes_ptr_ = static_cast<int32_t*>(volk_gnsssdr_malloc(static_cast<int32_t>(GPS_L1_CA_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int32_t), volk_gnsssdr_get_alignment()));
for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++)
{
gps_l1_ca_code_gen_int(own::span<int32_t>(&d_ca_codes[static_cast<int32_t>(GPS_L1_CA_CODE_LENGTH_CHIPS) * (PRN - 1)], &d_ca_codes[static_cast<int32_t>(GPS_L1_CA_CODE_LENGTH_CHIPS) * (PRN)]), PRN, 0);
gps_l1_ca_code_gen_int(own::span<int32_t>(&ca_codes_ptr_[static_cast<int32_t>(GPS_L1_CA_CODE_LENGTH_CHIPS) * (PRN - 1)], &ca_codes_ptr_[static_cast<int32_t>(GPS_L1_CA_CODE_LENGTH_CHIPS) * (PRN)]), PRN, 0);
// The code is generated as a series of 1s and -1s. In order to store the values using only one bit, a -1 is stored as a 0 in the FPGA
for (uint32_t k = 0; k < GPS_L1_CA_CODE_LENGTH_CHIPS; k++)
{
int32_t tmp_value = d_ca_codes[(int32_t(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1) + k];
int32_t tmp_value = ca_codes_ptr_[(int32_t(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1) + k];
if (tmp_value < 0)
{
tmp_value = 0;
}
tmp_value = tmp_value | LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY;
d_ca_codes[(int32_t(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1) + k] = tmp_value;
ca_codes_ptr_[(int32_t(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1) + k] = tmp_value;
}
}
trk_params_fpga.ca_codes = d_ca_codes;
trk_params_fpga.ca_codes = ca_codes_ptr_;
trk_params_fpga.code_length_chips = GPS_L1_CA_CODE_LENGTH_CHIPS;
trk_params_fpga.code_samples_per_chip = 1; // 1 sample per chip
@ -112,9 +114,9 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
}
// ################# MAKE TRACKING GNU Radio object ###################
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_params_fpga);
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")";
DLOG(INFO) << "role " << role_;
tracking_fpga_sc_sptr_ = dll_pll_veml_make_tracking_fpga(trk_params_fpga);
DLOG(INFO) << "tracking(" << tracking_fpga_sc_sptr_->unique_id() << ")";
if (in_streams_ > 1)
{
@ -129,19 +131,19 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
GpsL1CaDllPllTrackingFpga::~GpsL1CaDllPllTrackingFpga()
{
volk_gnsssdr_free(d_ca_codes);
volk_gnsssdr_free(ca_codes_ptr_);
}
void GpsL1CaDllPllTrackingFpga::start_tracking()
{
tracking_fpga_sc->start_tracking();
tracking_fpga_sc_sptr_->start_tracking();
}
void GpsL1CaDllPllTrackingFpga::stop_tracking()
{
tracking_fpga_sc->stop_tracking();
tracking_fpga_sc_sptr_->stop_tracking();
}
@ -156,16 +158,16 @@ void GpsL1CaDllPllTrackingFpga::set_channel(unsigned int channel)
std::string device_io_name;
// find the uio device file corresponding to the tracking multicorrelator
if (find_uio_dev_file_name(device_io_name, device_name, channel - num_prev_assigned_ch) < 0)
if (find_uio_dev_file_name(device_io_name, device_name_, channel_ - num_prev_assigned_ch_) < 0)
{
bool alt_device_found = false; // alternative compatible HW accelerator device not found by default
// If the HW accelerator is the default one in the L1 band then look for an alternative hardware accelerator
if (device_name == default_device_name_GPS_L1)
if (device_name_ == default_device_name_GPS_L1)
{
if (find_uio_dev_file_name(device_io_name, default_device_name_Galileo_E1, channel - num_prev_assigned_ch) < 0)
if (find_uio_dev_file_name(device_io_name, default_device_name_Galileo_E1, channel_ - num_prev_assigned_ch_) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device names " << device_name << " or " << default_device_name_Galileo_E1 << std::endl;
std::cout << "Cannot find the FPGA uio device file corresponding to device names " << device_name_ << " or " << default_device_name_Galileo_E1 << std::endl;
throw std::exception();
}
else
@ -176,18 +178,18 @@ void GpsL1CaDllPllTrackingFpga::set_channel(unsigned int channel)
if (!alt_device_found)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name_ << std::endl;
throw std::exception();
}
}
tracking_fpga_sc->set_channel(channel, device_io_name);
tracking_fpga_sc_sptr_->set_channel(channel_, device_io_name);
}
void GpsL1CaDllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_fpga_sc->set_gnss_synchro(p_gnss_synchro);
tracking_fpga_sc_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -211,11 +213,11 @@ void GpsL1CaDllPllTrackingFpga::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GpsL1CaDllPllTrackingFpga::get_left_block()
{
return tracking_fpga_sc;
return tracking_fpga_sc_sptr_;
}
gr::basic_block_sptr GpsL1CaDllPllTrackingFpga::get_right_block()
{
return tracking_fpga_sc;
return tracking_fpga_sc_sptr_;
}

View File

@ -130,15 +130,14 @@ private:
// expects. This arrangement is done in the initialisation to avoid consuming unnecessary clock cycles during tracking.
static const int32_t LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY = 0x0C000000; // flag that enables WE (Write Enable) of the local code FPGA
std::string device_name;
uint32_t num_prev_assigned_ch;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
uint32_t channel_;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc_sptr_;
std::string role_;
std::string device_name_;
int32_t* ca_codes_ptr_;
uint32_t num_prev_assigned_ch_;
uint32_t channel_;
uint32_t in_streams_;
uint32_t out_streams_;
int32_t* d_ca_codes;
};

View File

@ -32,38 +32,44 @@
GpsL1CaGaussianTracking::GpsL1CaGaussianTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
DLOG(INFO) << "role " << role;
// ################# CONFIGURATION PARAMETERS ########################
const std::string default_item_type("gr_complex");
std::string item_type = configuration->property(role + ".item_type", default_item_type);
int order = configuration->property(role + ".order", 2);
std::string item_type = configuration->property(role_ + ".item_type", default_item_type);
int order = configuration->property(role_ + ".order", 2);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
bool dump = configuration->property(role + ".dump", false);
float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast<float>(2.0));
bool dump = configuration->property(role_ + ".dump", false);
float dll_bw_hz = configuration->property(role_ + ".dll_bw_hz", static_cast<float>(2.0));
if (FLAGS_dll_bw_hz != 0.0)
{
dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
}
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast<float>(0.5));
float early_late_space_chips = configuration->property(role_ + ".early_late_space_chips", static_cast<float>(0.5));
const std::string default_dump_filename("./track_ch");
std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
std::string dump_filename = configuration->property(role_ + ".dump_filename", default_dump_filename);
const auto vector_length = static_cast<int>(std::round(fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
bool bce_run = configuration->property(role + ".bce_run", false);
unsigned int bce_ptrans = configuration->property(role + ".p_transient", 0);
unsigned int bce_strans = configuration->property(role + ".s_transient", 0);
int bce_nu = configuration->property(role + ".bce_nu", 0);
int bce_kappa = configuration->property(role + ".bce_kappa", 0);
bool bce_run = configuration->property(role_ + ".bce_run", false);
unsigned int bce_ptrans = configuration->property(role_ + ".p_transient", 0);
unsigned int bce_strans = configuration->property(role_ + ".s_transient", 0);
int bce_nu = configuration->property(role_ + ".bce_nu", 0);
int bce_kappa = configuration->property(role_ + ".bce_kappa", 0);
// ################# MAKE TRACKING GNURadio object ###################
DLOG(INFO) << "role " << role_;
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_ = gps_l1_ca_gaussian_make_tracking_cc(
tracking_sptr_ = gps_l1_ca_gaussian_make_tracking_cc(
order,
fs_in,
vector_length,
@ -76,14 +82,15 @@ GpsL1CaGaussianTracking::GpsL1CaGaussianTracking(
bce_strans,
bce_nu,
bce_kappa);
DLOG(INFO) << "tracking(" << tracking_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sptr_ = nullptr;
LOG(WARNING) << item_type << " unknown tracking item type.";
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ == 0)
{
in_streams_ = 1;
@ -104,7 +111,7 @@ void GpsL1CaGaussianTracking::stop_tracking()
void GpsL1CaGaussianTracking::start_tracking()
{
tracking_->start_tracking();
tracking_sptr_->start_tracking();
}
@ -114,13 +121,13 @@ void GpsL1CaGaussianTracking::start_tracking()
void GpsL1CaGaussianTracking::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_->set_channel(channel);
tracking_sptr_->set_channel(channel);
}
void GpsL1CaGaussianTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);
tracking_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -144,11 +151,11 @@ void GpsL1CaGaussianTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GpsL1CaGaussianTracking::get_left_block()
{
return tracking_;
return tracking_sptr_;
}
gr::basic_block_sptr GpsL1CaGaussianTracking::get_right_block()
{
return tracking_;
return tracking_sptr_;
}

View File

@ -92,10 +92,10 @@ public:
void stop_tracking() override;
private:
gps_l1_ca_gaussian_tracking_cc_sptr tracking_;
gps_l1_ca_gaussian_tracking_cc_sptr tracking_sptr_;
std::string role_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -32,12 +32,18 @@
#include <array>
GpsL1CaKfTracking::GpsL1CaKfTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
Kf_Conf trk_params = Kf_Conf();
DLOG(INFO) << "role " << role;
trk_params.SetFromConfiguration(configuration, role);
trk_params.SetFromConfiguration(configuration, role_);
const auto vector_length = static_cast<int>(std::round(trk_params.fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
trk_params.vector_length = vector_length;
@ -51,7 +57,7 @@ GpsL1CaKfTracking::GpsL1CaKfTracking(
trk_params.extend_correlation_symbols = 20;
std::cout << TEXT_RED << "WARNING: GPS L1 C/A. extend_correlation_symbols must be lower than 21. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << '\n';
}
trk_params.track_pilot = configuration->property(role + ".track_pilot", false);
trk_params.track_pilot = configuration->property(role_ + ".track_pilot", false);
if (trk_params.track_pilot)
{
trk_params.track_pilot = false;
@ -59,22 +65,23 @@ GpsL1CaKfTracking::GpsL1CaKfTracking(
}
trk_params.system = 'G';
const std::array<char, 3> sig_{'1', 'C', '\0'};
std::copy_n(sig_.data(), 3, trk_params.signal);
const std::array<char, 3> sig{'1', 'C', '\0'};
std::copy_n(sig.data(), 3, trk_params.signal);
// ################# Make a GNU Radio Tracking block object ################
DLOG(INFO) << "role " << role_;
if (trk_params.item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_ = kf_make_tracking(trk_params);
tracking_sptr_ = kf_make_tracking(trk_params);
DLOG(INFO) << "tracking(" << tracking_sptr_->unique_id() << ")";
}
else
{
item_size_ = sizeof(gr_complex);
item_size_ = 0;
tracking_sptr_ = nullptr;
LOG(WARNING) << trk_params.item_type << " unknown tracking item type.";
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -88,13 +95,13 @@ GpsL1CaKfTracking::GpsL1CaKfTracking(
void GpsL1CaKfTracking::stop_tracking()
{
tracking_->stop_tracking();
tracking_sptr_->stop_tracking();
}
void GpsL1CaKfTracking::start_tracking()
{
tracking_->start_tracking();
tracking_sptr_->start_tracking();
}
@ -104,13 +111,13 @@ void GpsL1CaKfTracking::start_tracking()
void GpsL1CaKfTracking::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_->set_channel(channel);
tracking_sptr_->set_channel(channel);
}
void GpsL1CaKfTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);
tracking_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -134,11 +141,11 @@ void GpsL1CaKfTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GpsL1CaKfTracking::get_left_block()
{
return tracking_;
return tracking_sptr_;
}
gr::basic_block_sptr GpsL1CaKfTracking::get_right_block()
{
return tracking_;
return tracking_sptr_;
}

View File

@ -85,10 +85,10 @@ public:
void stop_tracking() override;
private:
kf_tracking_sptr tracking_;
kf_tracking_sptr tracking_sptr_;
std::string role_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -29,43 +29,48 @@
GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
DLOG(INFO) << "role " << role;
// ################# CONFIGURATION PARAMETERS ########################
const std::string default_item_type("gr_complex");
std::string item_type = configuration->property(role + ".item_type", default_item_type);
// vector_length = configuration->property(role + ".vector_length", 2048);
std::string item_type = configuration->property(role_ + ".item_type", default_item_type);
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
bool dump = configuration->property(role + ".dump", false);
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast<float>(0.5));
size_t port_ch0 = configuration->property(role + ".port_ch0", 2060);
bool dump = configuration->property(role_ + ".dump", false);
float early_late_space_chips = configuration->property(role_ + ".early_late_space_chips", static_cast<float>(0.5));
size_t port_ch0 = configuration->property(role_ + ".port_ch0", 2060);
const std::string default_dump_filename("./track_ch");
std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
std::string dump_filename = configuration->property(role_ + ".dump_filename", default_dump_filename);
const auto vector_length = static_cast<int>(std::round(fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
// ################# MAKE TRACKING GNURadio object ###################
DLOG(INFO) << "role " << role_;
if (item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_ = gps_l1_ca_tcp_connector_make_tracking_cc(
tracking_sptr_ = gps_l1_ca_tcp_connector_make_tracking_cc(
fs_in,
vector_length,
dump,
dump_filename,
early_late_space_chips,
port_ch0);
DLOG(INFO) << "tracking(" << tracking_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sptr_ = nullptr;
LOG(WARNING) << item_type << " unknown tracking item type.";
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -84,7 +89,7 @@ void GpsL1CaTcpConnectorTracking::stop_tracking()
void GpsL1CaTcpConnectorTracking::start_tracking()
{
tracking_->start_tracking();
tracking_sptr_->start_tracking();
}
/*
@ -93,13 +98,13 @@ void GpsL1CaTcpConnectorTracking::start_tracking()
void GpsL1CaTcpConnectorTracking::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_->set_channel(channel);
tracking_sptr_->set_channel(channel);
}
void GpsL1CaTcpConnectorTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);
tracking_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -123,11 +128,11 @@ void GpsL1CaTcpConnectorTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GpsL1CaTcpConnectorTracking::get_left_block()
{
return tracking_;
return tracking_sptr_;
}
gr::basic_block_sptr GpsL1CaTcpConnectorTracking::get_right_block()
{
return tracking_;
return tracking_sptr_;
}

View File

@ -90,10 +90,10 @@ public:
void stop_tracking() override;
private:
gps_l1_ca_tcp_connector_tracking_cc_sptr tracking_;
gps_l1_ca_tcp_connector_tracking_cc_sptr tracking_sptr_;
std::string role_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -31,12 +31,18 @@
#include <array>
GpsL2MDllPllTracking::GpsL2MDllPllTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
Dll_Pll_Conf trk_params = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
trk_params.SetFromConfiguration(configuration, role);
trk_params.SetFromConfiguration(configuration, role_);
const auto vector_length = static_cast<int>(std::round(static_cast<double>(trk_params.fs_in) / (static_cast<double>(GPS_L2_M_CODE_RATE_CPS) / static_cast<double>(GPS_L2_M_CODE_LENGTH_CHIPS))));
trk_params.vector_length = vector_length;
@ -45,29 +51,30 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking(
trk_params.extend_correlation_symbols = 1;
std::cout << TEXT_RED << "WARNING: Extended coherent integration is not allowed in GPS L2. Coherent integration has been set to 20 ms (1 symbol)" << TEXT_RESET << '\n';
}
trk_params.track_pilot = configuration->property(role + ".track_pilot", false);
trk_params.track_pilot = configuration->property(role_ + ".track_pilot", false);
if (trk_params.track_pilot)
{
trk_params.track_pilot = false;
std::cout << TEXT_RED << "WARNING: GPS L2 does not have pilot signal. Data tracking has been enabled" << TEXT_RESET << '\n';
}
trk_params.system = 'G';
const std::array<char, 3> sig_{'2', 'S', '\0'};
std::copy_n(sig_.data(), 3, trk_params.signal);
const std::array<char, 3> sig{'2', 'S', '\0'};
std::copy_n(sig.data(), 3, trk_params.signal);
// ################# Make a GNU Radio Tracking block object ################
DLOG(INFO) << "role " << role_;
if (trk_params.item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_ = dll_pll_veml_make_tracking(trk_params);
tracking_sptr_ = dll_pll_veml_make_tracking(trk_params);
DLOG(INFO) << "tracking(" << tracking_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sptr_ = nullptr;
LOG(WARNING) << trk_params.item_type << " unknown tracking item type.";
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -81,13 +88,13 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking(
void GpsL2MDllPllTracking::stop_tracking()
{
tracking_->stop_tracking();
tracking_sptr_->stop_tracking();
}
void GpsL2MDllPllTracking::start_tracking()
{
tracking_->start_tracking();
tracking_sptr_->start_tracking();
}
@ -97,13 +104,13 @@ void GpsL2MDllPllTracking::start_tracking()
void GpsL2MDllPllTracking::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_->set_channel(channel);
tracking_sptr_->set_channel(channel);
}
void GpsL2MDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);
tracking_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -127,11 +134,11 @@ void GpsL2MDllPllTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GpsL2MDllPllTracking::get_left_block()
{
return tracking_;
return tracking_sptr_;
}
gr::basic_block_sptr GpsL2MDllPllTracking::get_right_block()
{
return tracking_;
return tracking_sptr_;
}

View File

@ -90,10 +90,10 @@ public:
void stop_tracking() override;
private:
dll_pll_veml_tracking_sptr tracking_;
dll_pll_veml_tracking_sptr tracking_sptr_;
std::string role_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -38,60 +38,64 @@
#include <iostream>
GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
Dll_Pll_Conf_Fpga trk_params_fpga = Dll_Pll_Conf_Fpga();
DLOG(INFO) << "role " << role;
trk_params_fpga.SetFromConfiguration(configuration, role);
trk_params_fpga.SetFromConfiguration(configuration, role_);
const auto vector_length = static_cast<int>(std::round(static_cast<double>(trk_params_fpga.fs_in) / (static_cast<double>(GPS_L2_M_CODE_RATE_CPS) / static_cast<double>(GPS_L2_M_CODE_LENGTH_CHIPS))));
trk_params_fpga.vector_length = vector_length;
trk_params_fpga.extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1);
trk_params_fpga.extend_correlation_symbols = configuration->property(role_ + ".extend_correlation_symbols", 1);
if (trk_params_fpga.extend_correlation_symbols != 1)
{
trk_params_fpga.extend_correlation_symbols = 1;
std::cout << TEXT_RED << "WARNING: Extended coherent integration is not allowed in GPS L2. Coherent integration has been set to 20 ms (1 symbol)" << TEXT_RESET << '\n';
}
trk_params_fpga.track_pilot = configuration->property(role + ".track_pilot", false);
trk_params_fpga.track_pilot = configuration->property(role_ + ".track_pilot", false);
if (trk_params_fpga.track_pilot)
{
trk_params_fpga.track_pilot = false;
std::cout << TEXT_RED << "WARNING: GPS L2 does not have pilot signal. Data tracking has been enabled" << TEXT_RESET << '\n';
}
trk_params_fpga.system = 'G';
const std::array<char, 3> sig_{'2', 'S', '\0'};
std::copy_n(sig_.data(), 3, trk_params_fpga.signal);
const std::array<char, 3> sig{'2', 'S', '\0'};
std::copy_n(sig.data(), 3, trk_params_fpga.signal);
// UIO device file
device_name = configuration->property(role + ".devicename", default_device_name_GPS_L2);
device_name_ = configuration->property(role_ + ".devicename", default_device_name_GPS_L2);
// compute the number of tracking channels that have already been instantiated. The order in which
// GNSS-SDR instantiates the tracking channels i L1, L2, L5, E1, E5a
num_prev_assigned_ch = configuration->property("Channels_1C.count", 0);
num_prev_assigned_ch_ = configuration->property("Channels_1C.count", 0);
volk_gnsssdr::vector<float> ca_codes_f(static_cast<unsigned int>(GPS_L2_M_CODE_LENGTH_CHIPS), 0.0);
// ################# 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()));
volk_gnsssdr::vector<float> ca_codes_f(static_cast<unsigned int>(GPS_L2_M_CODE_LENGTH_CHIPS), 0.0);
prn_codes_ptr_ = static_cast<int*>(volk_gnsssdr_malloc(static_cast<int>(GPS_L2_M_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment()));
for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++)
{
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]);
prn_codes_ptr_[static_cast<int>(GPS_L2_M_CODE_LENGTH_CHIPS) * (PRN - 1) + s] = static_cast<int>(ca_codes_f[s]);
}
}
trk_params_fpga.ca_codes = d_ca_codes;
trk_params_fpga.ca_codes = prn_codes_ptr_;
trk_params_fpga.code_length_chips = GPS_L2_M_CODE_LENGTH_CHIPS;
trk_params_fpga.code_samples_per_chip = 1; // 1 sample per chip
// ################# MAKE TRACKING GNU Radio object ###################
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_params_fpga);
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")";
DLOG(INFO) << "role " << role_;
tracking_fpga_sc_sptr_ = dll_pll_veml_make_tracking_fpga(trk_params_fpga);
DLOG(INFO) << "tracking(" << tracking_fpga_sc_sptr_->unique_id() << ")";
if (in_streams_ > 1)
{
@ -106,19 +110,19 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga(
GpsL2MDllPllTrackingFpga::~GpsL2MDllPllTrackingFpga()
{
volk_gnsssdr_free(d_ca_codes);
volk_gnsssdr_free(prn_codes_ptr_);
}
void GpsL2MDllPllTrackingFpga::start_tracking()
{
tracking_fpga_sc->start_tracking();
tracking_fpga_sc_sptr_->start_tracking();
}
void GpsL2MDllPllTrackingFpga::stop_tracking()
{
tracking_fpga_sc->stop_tracking();
tracking_fpga_sc_sptr_->stop_tracking();
}
@ -132,19 +136,19 @@ void GpsL2MDllPllTrackingFpga::set_channel(unsigned int channel)
// UIO device file
std::string device_io_name;
// find the uio device file corresponding to the tracking multicorrelator
if (find_uio_dev_file_name(device_io_name, device_name, channel - num_prev_assigned_ch) < 0)
if (find_uio_dev_file_name(device_io_name, device_name_, channel_ - num_prev_assigned_ch_) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name_ << std::endl;
throw std::exception();
}
tracking_fpga_sc->set_channel(channel, device_io_name);
tracking_fpga_sc_sptr_->set_channel(channel_, device_io_name);
}
void GpsL2MDllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_fpga_sc->set_gnss_synchro(p_gnss_synchro);
tracking_fpga_sc_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -168,11 +172,11 @@ void GpsL2MDllPllTrackingFpga::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GpsL2MDllPllTrackingFpga::get_left_block()
{
return tracking_fpga_sc;
return tracking_fpga_sc_sptr_;
}
gr::basic_block_sptr GpsL2MDllPllTrackingFpga::get_right_block()
{
return tracking_fpga_sc;
return tracking_fpga_sc_sptr_;
}

View File

@ -93,17 +93,16 @@ public:
private:
const std::string default_device_name_GPS_L2 = "multicorrelator_resampler_S00_AXI"; // UIO device name
std::string device_name;
uint32_t num_prev_assigned_ch;
static const uint32_t NUM_PRNs = 32;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
unsigned int channel_;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc_sptr_;
std::string role_;
std::string device_name_;
int* prn_codes_ptr_;
uint32_t num_prev_assigned_ch_;
unsigned int channel_;
unsigned int in_streams_;
unsigned int out_streams_;
int* d_ca_codes;
};

View File

@ -31,12 +31,18 @@
#include <array>
GpsL5DllPllTracking::GpsL5DllPllTracking(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
item_size_(sizeof(gr_complex)),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
Dll_Pll_Conf trk_params = Dll_Pll_Conf();
DLOG(INFO) << "role " << role;
trk_params.SetFromConfiguration(configuration, role);
trk_params.SetFromConfiguration(configuration, role_);
const auto vector_length = static_cast<int>(std::round(static_cast<double>(trk_params.fs_in) / (static_cast<double>(GPS_L5I_CODE_RATE_CPS) / static_cast<double>(GPS_L5I_CODE_LENGTH_CHIPS))));
trk_params.vector_length = vector_length;
@ -55,22 +61,23 @@ GpsL5DllPllTracking::GpsL5DllPllTracking(
std::cout << TEXT_RED << "WARNING: GPS L5. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n';
}
trk_params.system = 'G';
const std::array<char, 3> sig_{'L', '5', '\0'};
std::copy_n(sig_.data(), 3, trk_params.signal);
const std::array<char, 3> sig{'L', '5', '\0'};
std::copy_n(sig.data(), 3, trk_params.signal);
// ################# Make a GNU Radio Tracking block object ################
DLOG(INFO) << "role " << role_;
if (trk_params.item_type == "gr_complex")
{
item_size_ = sizeof(gr_complex);
tracking_ = dll_pll_veml_make_tracking(trk_params);
tracking_sptr_ = dll_pll_veml_make_tracking(trk_params);
DLOG(INFO) << "tracking(" << tracking_sptr_->unique_id() << ")";
}
else
{
item_size_ = 0;
tracking_sptr_ = nullptr;
LOG(WARNING) << trk_params.item_type << " unknown tracking item type.";
}
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
@ -84,13 +91,13 @@ GpsL5DllPllTracking::GpsL5DllPllTracking(
void GpsL5DllPllTracking::stop_tracking()
{
tracking_->stop_tracking();
tracking_sptr_->stop_tracking();
}
void GpsL5DllPllTracking::start_tracking()
{
tracking_->start_tracking();
tracking_sptr_->start_tracking();
}
@ -100,13 +107,13 @@ void GpsL5DllPllTracking::start_tracking()
void GpsL5DllPllTracking::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_->set_channel(channel);
tracking_sptr_->set_channel(channel);
}
void GpsL5DllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);
tracking_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -130,11 +137,11 @@ void GpsL5DllPllTracking::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GpsL5DllPllTracking::get_left_block()
{
return tracking_;
return tracking_sptr_;
}
gr::basic_block_sptr GpsL5DllPllTracking::get_right_block()
{
return tracking_;
return tracking_sptr_;
}

View File

@ -89,10 +89,10 @@ public:
void stop_tracking() override;
private:
dll_pll_veml_tracking_sptr tracking_;
dll_pll_veml_tracking_sptr tracking_sptr_;
std::string role_;
size_t item_size_;
unsigned int channel_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};

View File

@ -36,12 +36,18 @@
#include <array>
GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
const ConfigurationInterface *configuration, const std::string &role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const ConfigurationInterface *configuration,
const std::string &role,
unsigned int in_streams,
unsigned int out_streams)
: role_(role),
data_codes_ptr_(nullptr),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams)
{
Dll_Pll_Conf_Fpga trk_params_fpga = Dll_Pll_Conf_Fpga();
DLOG(INFO) << "role " << role;
trk_params_fpga.SetFromConfiguration(configuration, role);
trk_params_fpga.SetFromConfiguration(configuration, role_);
const auto vector_length = static_cast<int32_t>(std::round(static_cast<double>(trk_params_fpga.fs_in) / (static_cast<double>(GPS_L5I_CODE_RATE_CPS) / static_cast<double>(GPS_L5I_CODE_LENGTH_CHIPS))));
trk_params_fpga.vector_length = vector_length;
@ -59,24 +65,24 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
{
std::cout << TEXT_RED << "WARNING: GPS L5. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n';
}
d_track_pilot = trk_params_fpga.track_pilot;
track_pilot_ = trk_params_fpga.track_pilot;
trk_params_fpga.system = 'G';
const std::array<char, 3> sig_{'L', '5', '\0'};
std::copy_n(sig_.data(), 3, trk_params_fpga.signal);
const std::array<char, 3> sig{'L', '5', '\0'};
std::copy_n(sig.data(), 3, trk_params_fpga.signal);
// UIO device file
device_name = configuration->property(role + ".devicename", default_device_name_GPS_L5);
device_name_ = configuration->property(role_ + ".devicename", default_device_name_GPS_L5_);
// compute the number of tracking channels that have already been instantiated. The order in which
// GNSS-SDR instantiates the tracking channels i L1, L2, L5, E1, E5a
uint32_t num_prev_assigned_ch_1C = configuration->property("Channels_1C.count", 0);
uint32_t num_prev_assigned_ch_2S = 0;
if (configuration->property("Tracking_2S.devicename", std::string("")) != device_name)
if (configuration->property("Tracking_2S.devicename", std::string("")) != device_name_)
{
num_prev_assigned_ch_2S = configuration->property("Channels_2S.count", 0);
}
num_prev_assigned_ch = num_prev_assigned_ch_1C + num_prev_assigned_ch_2S;
num_prev_assigned_ch_ = num_prev_assigned_ch_1C + num_prev_assigned_ch_2S;
// ################# PRE-COMPUTE ALL THE CODES #################
uint32_t code_samples_per_chip = 1;
@ -85,22 +91,21 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
volk_gnsssdr::vector<float> data_code;
volk_gnsssdr::vector<float> tracking_code(code_length_chips, 0.0);
if (d_track_pilot)
if (track_pilot_)
{
data_code.resize(code_length_chips, 0.0);
}
d_ca_codes = static_cast<int32_t *>(volk_gnsssdr_malloc(static_cast<int32_t>(code_length_chips * NUM_PRNs) * sizeof(int32_t), volk_gnsssdr_get_alignment()));
prn_codes_ptr_ = static_cast<int32_t *>(volk_gnsssdr_malloc(static_cast<int32_t>(code_length_chips * NUM_PRNs) * sizeof(int32_t), volk_gnsssdr_get_alignment()));
d_data_codes = nullptr;
if (d_track_pilot)
if (track_pilot_)
{
d_data_codes = static_cast<int32_t *>(volk_gnsssdr_malloc((static_cast<uint32_t>(code_length_chips)) * NUM_PRNs * sizeof(int32_t), volk_gnsssdr_get_alignment()));
data_codes_ptr_ = static_cast<int32_t *>(volk_gnsssdr_malloc((static_cast<uint32_t>(code_length_chips)) * NUM_PRNs * sizeof(int32_t), volk_gnsssdr_get_alignment()));
}
for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++)
{
if (d_track_pilot)
if (track_pilot_)
{
gps_l5q_code_gen_float(tracking_code, PRN);
gps_l5i_code_gen_float(data_code, PRN);
@ -114,7 +119,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
tmp_value = 0;
}
tmp_value = tmp_value | LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY;
d_ca_codes[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = tmp_value;
prn_codes_ptr_[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = tmp_value;
tmp_value = static_cast<int32_t>(data_code[s]);
if (tmp_value < 0)
@ -122,7 +127,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
tmp_value = 0;
}
tmp_value = tmp_value | LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY | LOCAL_CODE_FPGA_CORRELATOR_SELECT_COUNT;
d_data_codes[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = tmp_value;
data_codes_ptr_[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = tmp_value;
}
}
else
@ -138,20 +143,20 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
tmp_value = 0;
}
tmp_value = tmp_value | LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY;
d_ca_codes[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = tmp_value;
prn_codes_ptr_[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = tmp_value;
}
}
}
trk_params_fpga.ca_codes = d_ca_codes;
trk_params_fpga.data_codes = d_data_codes;
trk_params_fpga.ca_codes = prn_codes_ptr_;
trk_params_fpga.data_codes = data_codes_ptr_;
trk_params_fpga.code_length_chips = code_length_chips;
trk_params_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip
trk_params_fpga.extended_correlation_in_fpga = false; // by default
trk_params_fpga.extend_fpga_integration_periods = 1; // (number of FPGA integrations that are combined in the SW)
trk_params_fpga.fpga_integration_period = 1; // (number of symbols that are effectively integrated in the FPGA)
if (d_track_pilot)
if (track_pilot_)
{
if (trk_params_fpga.extend_correlation_symbols > 1)
{
@ -176,9 +181,9 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
}
// ################# MAKE TRACKING GNU Radio object ###################
tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_params_fpga);
channel_ = 0;
DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")";
DLOG(INFO) << "role " << role_;
tracking_fpga_sc_sptr_ = dll_pll_veml_make_tracking_fpga(trk_params_fpga);
DLOG(INFO) << "tracking(" << tracking_fpga_sc_sptr_->unique_id() << ")";
if (in_streams_ > 1)
{
@ -193,23 +198,23 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
GpsL5DllPllTrackingFpga::~GpsL5DllPllTrackingFpga()
{
volk_gnsssdr_free(d_ca_codes);
if (d_track_pilot)
volk_gnsssdr_free(prn_codes_ptr_);
if (track_pilot_)
{
volk_gnsssdr_free(d_data_codes);
volk_gnsssdr_free(data_codes_ptr_);
}
}
void GpsL5DllPllTrackingFpga::start_tracking()
{
tracking_fpga_sc->start_tracking();
tracking_fpga_sc_sptr_->start_tracking();
}
void GpsL5DllPllTrackingFpga::stop_tracking()
{
tracking_fpga_sc->stop_tracking();
tracking_fpga_sc_sptr_->stop_tracking();
}
@ -223,19 +228,19 @@ void GpsL5DllPllTrackingFpga::set_channel(unsigned int channel)
// UIO device file
std::string device_io_name;
// find the uio device file corresponding to the tracking multicorrelator
if (find_uio_dev_file_name(device_io_name, device_name, channel - num_prev_assigned_ch) < 0)
if (find_uio_dev_file_name(device_io_name, device_name_, channel_ - num_prev_assigned_ch_) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name_ << std::endl;
throw std::exception();
}
tracking_fpga_sc->set_channel(channel, device_io_name);
tracking_fpga_sc_sptr_->set_channel(channel_, device_io_name);
}
void GpsL5DllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro)
{
tracking_fpga_sc->set_gnss_synchro(p_gnss_synchro);
tracking_fpga_sc_sptr_->set_gnss_synchro(p_gnss_synchro);
}
@ -259,11 +264,11 @@ void GpsL5DllPllTrackingFpga::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr GpsL5DllPllTrackingFpga::get_left_block()
{
return tracking_fpga_sc;
return tracking_fpga_sc_sptr_;
}
gr::basic_block_sptr GpsL5DllPllTrackingFpga::get_right_block()
{
return tracking_fpga_sc;
return tracking_fpga_sc_sptr_;
}

View File

@ -122,7 +122,7 @@ public:
void stop_tracking() override;
private:
const std::string default_device_name_GPS_L5 = "multicorrelator_resampler_3_1_AXI"; // UIO device name
const std::string default_device_name_GPS_L5_ = "multicorrelator_resampler_3_1_AXI"; // UIO device name
static const uint32_t NUM_PRNs = 32; // total number of PRNs
@ -131,17 +131,16 @@ private:
static const int32_t LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY = 0x0C000000; // flag that enables WE (Write Enable) of the local code FPGA
static const int32_t LOCAL_CODE_FPGA_CORRELATOR_SELECT_COUNT = 0x20000000; // flag that selects the writing of the pilot code in the FPGA (as opposed to the data code)
std::string device_name;
uint32_t num_prev_assigned_ch;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
uint32_t channel_;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc_sptr_;
std::string role_;
std::string device_name_;
int32_t* prn_codes_ptr_;
int32_t* data_codes_ptr_;
uint32_t channel_;
uint32_t num_prev_assigned_ch_;
uint32_t in_streams_;
uint32_t out_streams_;
bool d_track_pilot;
int32_t* d_ca_codes;
int32_t* d_data_codes;
bool track_pilot_;
};