mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-14 20:20:35 +00:00
Replace unsigned long int by uint64_t and long int by int64_t. Fixes #199
This commit is contained in:
parent
2517e7bb31
commit
6b1611b3a9
@ -48,7 +48,7 @@ using google::LogMessage;
|
||||
galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(
|
||||
unsigned int sampled_ms,
|
||||
unsigned int max_dwells,
|
||||
unsigned int doppler_max, long fs_in,
|
||||
unsigned int doppler_max, int64_t fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool dump,
|
||||
@ -67,7 +67,7 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit
|
||||
unsigned int sampled_ms,
|
||||
unsigned int max_dwells,
|
||||
unsigned int doppler_max,
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
int samples_per_ms,
|
||||
int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
|
@ -52,7 +52,7 @@ typedef boost::shared_ptr<galileo_e5a_noncoherentIQ_acquisition_caf_cc> galileo_
|
||||
galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr
|
||||
galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(unsigned int sampled_ms,
|
||||
unsigned int max_dwells,
|
||||
unsigned int doppler_max, long fs_in,
|
||||
unsigned int doppler_max, int64_t fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool dump,
|
||||
@ -74,7 +74,7 @@ private:
|
||||
galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(
|
||||
unsigned int sampled_ms,
|
||||
unsigned int max_dwells,
|
||||
unsigned int doppler_max, long fs_in,
|
||||
unsigned int doppler_max, int64_t fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool dump,
|
||||
@ -86,7 +86,7 @@ private:
|
||||
galileo_e5a_noncoherentIQ_acquisition_caf_cc(
|
||||
unsigned int sampled_ms,
|
||||
unsigned int max_dwells,
|
||||
unsigned int doppler_max, long fs_in,
|
||||
unsigned int doppler_max, int64_t fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool dump,
|
||||
@ -99,7 +99,7 @@ private:
|
||||
int doppler_offset);
|
||||
float estimate_input_power(gr_complex* in);
|
||||
|
||||
long d_fs_in;
|
||||
int64_t d_fs_in;
|
||||
int d_samples_per_ms;
|
||||
int d_sampled_ms;
|
||||
int d_samples_per_code;
|
||||
@ -111,7 +111,7 @@ private:
|
||||
unsigned int d_max_dwells;
|
||||
unsigned int d_well_count;
|
||||
unsigned int d_fft_size;
|
||||
unsigned long int d_sample_counter;
|
||||
uint64_t d_sample_counter;
|
||||
gr_complex** d_grid_doppler_wipeoffs;
|
||||
unsigned int d_num_doppler_bins;
|
||||
gr_complex* d_fft_code_I_A;
|
||||
|
@ -83,7 +83,7 @@ private:
|
||||
unsigned int d_max_dwells;
|
||||
unsigned int d_well_count;
|
||||
unsigned int d_fft_size;
|
||||
unsigned long int d_sample_counter;
|
||||
uint64_t d_sample_counter;
|
||||
gr_complex** d_grid_doppler_wipeoffs;
|
||||
unsigned int d_num_doppler_bins;
|
||||
gr_complex* d_fft_code_A;
|
||||
|
@ -156,7 +156,7 @@ pcps_acquisition::~pcps_acquisition()
|
||||
{
|
||||
if (d_num_doppler_bins > 0)
|
||||
{
|
||||
for (unsigned int i = 0; i < d_num_doppler_bins; i++)
|
||||
for (uint32_t i = 0; i < d_num_doppler_bins; i++)
|
||||
{
|
||||
volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]);
|
||||
volk_gnsssdr_free(d_magnitude_grid[i]);
|
||||
@ -166,7 +166,7 @@ pcps_acquisition::~pcps_acquisition()
|
||||
}
|
||||
if (acq_parameters.make_2_steps)
|
||||
{
|
||||
for (unsigned int i = 0; i < d_num_doppler_bins_step2; i++)
|
||||
for (uint32_t i = 0; i < d_num_doppler_bins_step2; i++)
|
||||
{
|
||||
volk_gnsssdr_free(d_grid_doppler_wipeoffs_step_two[i]);
|
||||
}
|
||||
@ -202,7 +202,7 @@ void pcps_acquisition::set_local_code(std::complex<float>* code)
|
||||
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
|
||||
if (acq_parameters.bit_transition_flag)
|
||||
{
|
||||
int offset = d_fft_size / 2;
|
||||
int32_t offset = d_fft_size / 2;
|
||||
std::fill_n(d_fft_if->get_inbuf(), offset, gr_complex(0.0, 0.0));
|
||||
memcpy(d_fft_if->get_inbuf() + offset, code, sizeof(gr_complex) * offset);
|
||||
}
|
||||
@ -246,7 +246,7 @@ bool pcps_acquisition::is_fdma()
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition::update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq)
|
||||
void pcps_acquisition::update_local_carrier(gr_complex* carrier_vector, int32_t correlator_length_samples, float freq)
|
||||
{
|
||||
float phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(acq_parameters.fs_in);
|
||||
float _phase[1];
|
||||
@ -268,29 +268,29 @@ void pcps_acquisition::init()
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
|
||||
d_num_doppler_bins = static_cast<unsigned int>(std::ceil(static_cast<double>(static_cast<int>(acq_parameters.doppler_max) - static_cast<int>(-acq_parameters.doppler_max)) / static_cast<double>(d_doppler_step)));
|
||||
d_num_doppler_bins = static_cast<uint32_t>(std::ceil(static_cast<double>(static_cast<int>(acq_parameters.doppler_max) - static_cast<int>(-acq_parameters.doppler_max)) / static_cast<double>(d_doppler_step)));
|
||||
|
||||
// Create the carrier Doppler wipeoff signals
|
||||
d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins];
|
||||
if (acq_parameters.make_2_steps)
|
||||
{
|
||||
d_grid_doppler_wipeoffs_step_two = new gr_complex*[d_num_doppler_bins_step2];
|
||||
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins_step2; doppler_index++)
|
||||
for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins_step2; doppler_index++)
|
||||
{
|
||||
d_grid_doppler_wipeoffs_step_two[doppler_index] = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
}
|
||||
}
|
||||
|
||||
d_magnitude_grid = new float*[d_num_doppler_bins];
|
||||
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
{
|
||||
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
d_magnitude_grid[doppler_index] = static_cast<float*>(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
for (unsigned k = 0; k < d_fft_size; k++)
|
||||
for (uint32_t k = 0; k < d_fft_size; k++)
|
||||
{
|
||||
d_magnitude_grid[doppler_index][k] = 0.0;
|
||||
}
|
||||
int doppler = -static_cast<int>(acq_parameters.doppler_max) + d_doppler_step * doppler_index;
|
||||
int32_t doppler = -static_cast<int>(acq_parameters.doppler_max) + d_doppler_step * doppler_index;
|
||||
update_local_carrier(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, d_old_freq + doppler);
|
||||
}
|
||||
|
||||
@ -298,7 +298,7 @@ void pcps_acquisition::init()
|
||||
|
||||
if (acq_parameters.dump)
|
||||
{
|
||||
unsigned int effective_fft_size = (acq_parameters.bit_transition_flag ? (d_fft_size / 2) : d_fft_size);
|
||||
uint32_t effective_fft_size = (acq_parameters.bit_transition_flag ? (d_fft_size / 2) : d_fft_size);
|
||||
grid_ = arma::fmat(effective_fft_size, d_num_doppler_bins, arma::fill::zeros);
|
||||
narrow_grid_ = arma::fmat(effective_fft_size, d_num_doppler_bins_step2, arma::fill::zeros);
|
||||
}
|
||||
@ -307,9 +307,9 @@ void pcps_acquisition::init()
|
||||
|
||||
void pcps_acquisition::update_grid_doppler_wipeoffs()
|
||||
{
|
||||
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
{
|
||||
int doppler = -static_cast<int>(acq_parameters.doppler_max) + d_doppler_step * doppler_index;
|
||||
int32_t doppler = -static_cast<int>(acq_parameters.doppler_max) + d_doppler_step * doppler_index;
|
||||
update_local_carrier(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, d_old_freq + doppler);
|
||||
}
|
||||
}
|
||||
@ -317,7 +317,7 @@ void pcps_acquisition::update_grid_doppler_wipeoffs()
|
||||
|
||||
void pcps_acquisition::update_grid_doppler_wipeoffs_step2()
|
||||
{
|
||||
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins_step2; doppler_index++)
|
||||
for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins_step2; doppler_index++)
|
||||
{
|
||||
float doppler = (static_cast<float>(doppler_index) - static_cast<float>(floor(d_num_doppler_bins_step2 / 2.0))) * acq_parameters.doppler_step2;
|
||||
update_local_carrier(d_grid_doppler_wipeoffs_step_two[doppler_index], d_fft_size, d_doppler_center_step_two + doppler);
|
||||
@ -325,7 +325,7 @@ void pcps_acquisition::update_grid_doppler_wipeoffs_step2()
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition::set_state(int state)
|
||||
void pcps_acquisition::set_state(int32_t state)
|
||||
{
|
||||
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
|
||||
d_state = state;
|
||||
@ -385,7 +385,7 @@ void pcps_acquisition::send_negative_acquisition()
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition::dump_results(int effective_fft_size)
|
||||
void pcps_acquisition::dump_results(int32_t effective_fft_size)
|
||||
{
|
||||
d_dump_number++;
|
||||
std::string filename = acq_parameters.dump_filename;
|
||||
@ -488,16 +488,16 @@ void pcps_acquisition::dump_results(int effective_fft_size)
|
||||
}
|
||||
|
||||
|
||||
float pcps_acquisition::max_to_input_power_statistic(uint32_t& indext, int& doppler, float input_power, unsigned int num_doppler_bins, int doppler_max, int doppler_step)
|
||||
float pcps_acquisition::max_to_input_power_statistic(uint32_t& indext, int32_t& doppler, float input_power, uint32_t num_doppler_bins, int32_t doppler_max, int32_t doppler_step)
|
||||
{
|
||||
float grid_maximum = 0.0;
|
||||
unsigned int index_doppler = 0;
|
||||
uint32_t index_doppler = 0;
|
||||
uint32_t tmp_intex_t = 0;
|
||||
uint32_t index_time = 0;
|
||||
float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
|
||||
|
||||
// Find the correlation peak and the carrier frequency
|
||||
for (unsigned int i = 0; i < num_doppler_bins; i++)
|
||||
for (uint32_t i = 0; i < num_doppler_bins; i++)
|
||||
{
|
||||
volk_gnsssdr_32f_index_max_32u(&tmp_intex_t, d_magnitude_grid[i], d_fft_size);
|
||||
if (d_magnitude_grid[i][tmp_intex_t] > grid_maximum)
|
||||
@ -522,19 +522,19 @@ float pcps_acquisition::max_to_input_power_statistic(uint32_t& indext, int& dopp
|
||||
}
|
||||
|
||||
|
||||
float pcps_acquisition::first_vs_second_peak_statistic(uint32_t& indext, int& doppler, unsigned int num_doppler_bins, int doppler_max, int doppler_step)
|
||||
float pcps_acquisition::first_vs_second_peak_statistic(uint32_t& indext, int32_t& doppler, uint32_t num_doppler_bins, int32_t doppler_max, int32_t doppler_step)
|
||||
{
|
||||
// Look for correlation peaks in the results
|
||||
// Find the highest peak and compare it to the second highest peak
|
||||
// The second peak is chosen not closer than 1 chip to the highest peak
|
||||
|
||||
float firstPeak = 0.0;
|
||||
unsigned int index_doppler = 0;
|
||||
uint32_t index_doppler = 0;
|
||||
uint32_t tmp_intex_t = 0;
|
||||
uint32_t index_time = 0;
|
||||
|
||||
// Find the correlation peak and the carrier frequency
|
||||
for (unsigned int i = 0; i < num_doppler_bins; i++)
|
||||
for (uint32_t i = 0; i < num_doppler_bins; i++)
|
||||
{
|
||||
volk_gnsssdr_32f_index_max_32u(&tmp_intex_t, d_magnitude_grid[i], d_fft_size);
|
||||
if (d_magnitude_grid[i][tmp_intex_t] > firstPeak)
|
||||
@ -588,14 +588,14 @@ float pcps_acquisition::first_vs_second_peak_statistic(uint32_t& indext, int& do
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition::acquisition_core(unsigned long int samp_count)
|
||||
void pcps_acquisition::acquisition_core(uint64_t samp_count)
|
||||
{
|
||||
gr::thread::scoped_lock lk(d_setlock);
|
||||
|
||||
// Initialize acquisition algorithm
|
||||
int doppler = 0;
|
||||
int32_t doppler = 0;
|
||||
uint32_t indext = 0;
|
||||
int effective_fft_size = (acq_parameters.bit_transition_flag ? d_fft_size / 2 : d_fft_size);
|
||||
int32_t effective_fft_size = (acq_parameters.bit_transition_flag ? d_fft_size / 2 : d_fft_size);
|
||||
if (d_cshort)
|
||||
{
|
||||
volk_gnsssdr_16ic_convert_32fc(d_data_buffer, d_data_buffer_sc, d_consumed_samples);
|
||||
@ -603,7 +603,7 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count)
|
||||
memcpy(d_input_signal, d_data_buffer, d_consumed_samples * sizeof(gr_complex));
|
||||
if (d_fft_size > d_consumed_samples)
|
||||
{
|
||||
for (unsigned int i = d_consumed_samples; i < d_fft_size; i++)
|
||||
for (uint32_t i = d_consumed_samples; i < d_fft_size; i++)
|
||||
{
|
||||
d_input_signal[i] = gr_complex(0.0, 0.0);
|
||||
}
|
||||
@ -634,7 +634,7 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count)
|
||||
// Doppler frequency grid loop
|
||||
if (!d_step_two)
|
||||
{
|
||||
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
{
|
||||
// Remove Doppler
|
||||
volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, d_grid_doppler_wipeoffs[doppler_index], d_fft_size);
|
||||
@ -682,7 +682,7 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins_step2; doppler_index++)
|
||||
for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins_step2; doppler_index++)
|
||||
{
|
||||
volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, d_grid_doppler_wipeoffs_step_two[doppler_index], d_fft_size);
|
||||
|
||||
@ -814,9 +814,9 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count)
|
||||
d_num_noncoherent_integrations_counter = 0;
|
||||
d_positive_acq = 0;
|
||||
// Reset grid
|
||||
for (unsigned int i = 0; i < d_num_doppler_bins; i++)
|
||||
for (uint32_t i = 0; i < d_num_doppler_bins; i++)
|
||||
{
|
||||
for (unsigned k = 0; k < d_fft_size; k++)
|
||||
for (uint32_t k = 0; k < d_fft_size; k++)
|
||||
{
|
||||
d_magnitude_grid[i][k] = 0.0;
|
||||
}
|
||||
@ -879,7 +879,7 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)),
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
unsigned int buff_increment;
|
||||
uint32_t buff_increment;
|
||||
if (d_cshort)
|
||||
{
|
||||
const lv_16sc_t* in = reinterpret_cast<const lv_16sc_t*>(input_items[0]); // Get the input samples pointer
|
||||
|
@ -82,21 +82,21 @@ private:
|
||||
|
||||
pcps_acquisition(const Acq_Conf& conf_);
|
||||
|
||||
void update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq);
|
||||
void update_local_carrier(gr_complex* carrier_vector, int32_t correlator_length_samples, float freq);
|
||||
void update_grid_doppler_wipeoffs();
|
||||
void update_grid_doppler_wipeoffs_step2();
|
||||
bool is_fdma();
|
||||
|
||||
void acquisition_core(unsigned long int samp_count);
|
||||
void acquisition_core(uint64_t samp_count);
|
||||
|
||||
void send_negative_acquisition();
|
||||
|
||||
void send_positive_acquisition();
|
||||
|
||||
void dump_results(int effective_fft_size);
|
||||
void dump_results(int32_t effective_fft_size);
|
||||
|
||||
float first_vs_second_peak_statistic(uint32_t& indext, int& doppler, unsigned int num_doppler_bins, int doppler_max, int doppler_step);
|
||||
float max_to_input_power_statistic(uint32_t& indext, int& doppler, float input_power, unsigned int num_doppler_bins, int doppler_max, int doppler_step);
|
||||
float first_vs_second_peak_statistic(uint32_t& indext, int32_t& doppler, uint32_t num_doppler_bins, int32_t doppler_max, int32_t doppler_step);
|
||||
float max_to_input_power_statistic(uint32_t& indext, int32_t& doppler, float input_power, uint32_t num_doppler_bins, int32_t doppler_max, int32_t doppler_step);
|
||||
|
||||
Acq_Conf acq_parameters;
|
||||
bool d_active;
|
||||
@ -104,7 +104,7 @@ private:
|
||||
bool d_cshort;
|
||||
bool d_step_two;
|
||||
bool d_use_CFAR_algorithm_flag;
|
||||
int d_positive_acq;
|
||||
int32_t d_positive_acq;
|
||||
float d_threshold;
|
||||
float d_mag;
|
||||
float d_input_power;
|
||||
@ -114,16 +114,16 @@ private:
|
||||
float* d_tmp_buffer;
|
||||
gr_complex* d_input_signal;
|
||||
uint32_t d_samplesPerChip;
|
||||
long d_old_freq;
|
||||
int d_state;
|
||||
unsigned int d_channel;
|
||||
unsigned int d_doppler_step;
|
||||
int64_t d_old_freq;
|
||||
int32_t d_state;
|
||||
uint32_t d_channel;
|
||||
uint32_t d_doppler_step;
|
||||
float d_doppler_center_step_two;
|
||||
unsigned int d_num_noncoherent_integrations_counter;
|
||||
unsigned int d_fft_size;
|
||||
unsigned int d_consumed_samples;
|
||||
unsigned int d_num_doppler_bins;
|
||||
unsigned long int d_sample_counter;
|
||||
uint32_t d_num_noncoherent_integrations_counter;
|
||||
uint32_t d_fft_size;
|
||||
uint32_t d_consumed_samples;
|
||||
uint32_t d_num_doppler_bins;
|
||||
uint64_t d_sample_counter;
|
||||
gr_complex** d_grid_doppler_wipeoffs;
|
||||
gr_complex** d_grid_doppler_wipeoffs_step_two;
|
||||
gr_complex* d_fft_codes;
|
||||
@ -134,10 +134,10 @@ private:
|
||||
Gnss_Synchro* d_gnss_synchro;
|
||||
arma::fmat grid_;
|
||||
arma::fmat narrow_grid_;
|
||||
unsigned int d_num_doppler_bins_step2;
|
||||
long int d_dump_number;
|
||||
unsigned int d_dump_channel;
|
||||
unsigned int d_buffer_count;
|
||||
uint32_t d_num_doppler_bins_step2;
|
||||
int64_t d_dump_number;
|
||||
uint32_t d_dump_channel;
|
||||
uint32_t d_buffer_count;
|
||||
|
||||
public:
|
||||
~pcps_acquisition();
|
||||
@ -156,7 +156,7 @@ public:
|
||||
/*!
|
||||
* \brief Returns the maximum peak of grid search.
|
||||
*/
|
||||
inline unsigned int mag() const
|
||||
inline uint32_t mag() const
|
||||
{
|
||||
return d_mag;
|
||||
}
|
||||
@ -188,13 +188,13 @@ public:
|
||||
* first available sample.
|
||||
* \param state - int=1 forces start of acquisition
|
||||
*/
|
||||
void set_state(int state);
|
||||
void set_state(int32_t state);
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition channel unique ID
|
||||
* \param channel - receiver channel.
|
||||
*/
|
||||
inline void set_channel(unsigned int channel)
|
||||
inline void set_channel(uint32_t channel)
|
||||
{
|
||||
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
|
||||
d_channel = channel;
|
||||
@ -215,7 +215,7 @@ public:
|
||||
* \brief Set maximum Doppler grid search
|
||||
* \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
|
||||
*/
|
||||
inline void set_doppler_max(unsigned int doppler_max)
|
||||
inline void set_doppler_max(uint32_t doppler_max)
|
||||
{
|
||||
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
|
||||
acq_parameters.doppler_max = doppler_max;
|
||||
@ -225,7 +225,7 @@ public:
|
||||
* \brief Set Doppler steps for the grid search
|
||||
* \param doppler_step - Frequency bin of the search grid [Hz].
|
||||
*/
|
||||
inline void set_doppler_step(unsigned int doppler_step)
|
||||
inline void set_doppler_step(uint32_t doppler_step)
|
||||
{
|
||||
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
|
||||
d_doppler_step = doppler_step;
|
||||
|
@ -98,7 +98,7 @@ private:
|
||||
int d_num_doppler_points;
|
||||
int d_doppler_step;
|
||||
unsigned int d_fft_size;
|
||||
unsigned long int d_sample_counter;
|
||||
uint64_t d_sample_counter;
|
||||
gr_complex* d_carrier;
|
||||
gr_complex* d_fft_codes;
|
||||
gr_complex* d_10_ms_buffer;
|
||||
@ -124,8 +124,8 @@ private:
|
||||
|
||||
std::string d_dump_filename;
|
||||
|
||||
arma::fmat grid_;
|
||||
long int d_dump_number;
|
||||
arma ::fmat grid_;
|
||||
int64_t d_dump_number;
|
||||
unsigned int d_dump_channel;
|
||||
|
||||
public:
|
||||
|
@ -113,7 +113,7 @@ private:
|
||||
unsigned int d_doppler_step;
|
||||
unsigned int d_fft_size;
|
||||
unsigned int d_num_doppler_bins;
|
||||
unsigned long int d_sample_counter;
|
||||
uint64_t d_sample_counter;
|
||||
Gnss_Synchro* d_gnss_synchro;
|
||||
std::shared_ptr<fpga_acquisition> acquisition_fpga;
|
||||
|
||||
|
@ -112,7 +112,7 @@ private:
|
||||
int d_doppler_step;
|
||||
unsigned int d_sampled_ms;
|
||||
unsigned int d_fft_size;
|
||||
unsigned long int d_sample_counter;
|
||||
uint64_t d_sample_counter;
|
||||
gr_complex* d_carrier;
|
||||
gr_complex* d_fft_codes;
|
||||
|
||||
|
@ -88,7 +88,7 @@ private:
|
||||
unsigned int d_max_dwells;
|
||||
unsigned int d_well_count;
|
||||
unsigned int d_fft_size;
|
||||
unsigned long int d_sample_counter;
|
||||
uint64_t d_sample_counter;
|
||||
gr_complex** d_grid_doppler_wipeoffs;
|
||||
unsigned int d_num_doppler_bins;
|
||||
gr_complex* d_fft_code_data;
|
||||
|
@ -387,7 +387,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_volk()
|
||||
float magt = 0.0;
|
||||
float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
|
||||
gr_complex *in = d_in_buffer[d_well_count];
|
||||
unsigned long int samplestamp = d_sample_counter_buffer[d_well_count];
|
||||
uint64_t samplestamp = d_sample_counter_buffer[d_well_count];
|
||||
|
||||
d_input_power = 0.0;
|
||||
d_mag = 0.0;
|
||||
@ -510,7 +510,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
|
||||
float magt = 0.0;
|
||||
float fft_normalization_factor = (static_cast<float>(d_fft_size_pow2) * static_cast<float>(d_fft_size)); //This works, but I am not sure why.
|
||||
gr_complex *in = d_in_buffer[d_well_count];
|
||||
unsigned long int samplestamp = d_sample_counter_buffer[d_well_count];
|
||||
uint64_t samplestamp = d_sample_counter_buffer[d_well_count];
|
||||
|
||||
d_input_power = 0.0;
|
||||
d_mag = 0.0;
|
||||
|
@ -121,7 +121,7 @@ private:
|
||||
unsigned int d_fft_size;
|
||||
unsigned int d_fft_size_pow2;
|
||||
int* d_max_doppler_indexs;
|
||||
unsigned long int d_sample_counter;
|
||||
uint64_t d_sample_counter;
|
||||
gr_complex** d_grid_doppler_wipeoffs;
|
||||
unsigned int d_num_doppler_bins;
|
||||
gr_complex* d_fft_codes;
|
||||
@ -144,7 +144,7 @@ private:
|
||||
std::string d_dump_filename;
|
||||
gr_complex* d_zero_vector;
|
||||
gr_complex** d_in_buffer;
|
||||
std::vector<unsigned long int> d_sample_counter_buffer;
|
||||
std::vector<uint64_t> d_sample_counter_buffer;
|
||||
unsigned int d_in_dwell_count;
|
||||
|
||||
cl::Platform d_cl_platform;
|
||||
|
@ -127,7 +127,7 @@ private:
|
||||
unsigned int d_max_dwells;
|
||||
unsigned int d_well_count;
|
||||
unsigned int d_fft_size;
|
||||
unsigned long int d_sample_counter;
|
||||
uint64_t d_sample_counter;
|
||||
gr_complex** d_grid_doppler_wipeoffs;
|
||||
unsigned int d_num_doppler_bins;
|
||||
gr_complex* d_fft_codes;
|
||||
|
@ -108,7 +108,7 @@ private:
|
||||
unsigned int d_tong_max_val;
|
||||
unsigned int d_tong_max_dwells;
|
||||
unsigned int d_fft_size;
|
||||
unsigned long int d_sample_counter;
|
||||
uint64_t d_sample_counter;
|
||||
gr_complex** d_grid_doppler_wipeoffs;
|
||||
unsigned int d_num_doppler_bins;
|
||||
gr_complex* d_fft_codes;
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "gnss_sdr_flags.h"
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <glog/logging.h>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
@ -66,7 +66,7 @@ Channel::Channel(ConfigurationInterface* configuration, unsigned int channel,
|
||||
// Provide a warning to the user about the change of parameter name
|
||||
if (channel_ == 0)
|
||||
{
|
||||
long int deprecation_warning = configuration->property("GNSS-SDR.internal_fs_hz", 0);
|
||||
int64_t deprecation_warning = configuration->property("GNSS-SDR.internal_fs_hz", 0);
|
||||
if (deprecation_warning != 0)
|
||||
{
|
||||
std::cout << "WARNING: The global parameter name GNSS-SDR.internal_fs_hz has been DEPRECATED." << std::endl;
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include <gnuradio/gr_complex.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <glog/logging.h>
|
||||
#include <cstdint>
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
@ -48,7 +49,7 @@ void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg)
|
||||
bool result = false;
|
||||
try
|
||||
{
|
||||
long int message = pmt::to_long(msg);
|
||||
int64_t message = pmt::to_long(msg);
|
||||
switch (message)
|
||||
{
|
||||
case 1: // positive acquisition
|
||||
|
@ -36,9 +36,9 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
gnss_sdr_fpga_sample_counter::gnss_sdr_fpga_sample_counter(double _fs, int _interval_ms) : gr::block("fpga_fpga_sample_counter",
|
||||
gr::io_signature::make(0, 0, 0),
|
||||
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)))
|
||||
gnss_sdr_fpga_sample_counter::gnss_sdr_fpga_sample_counter(double _fs, int32_t _interval_ms) : gr::block("fpga_fpga_sample_counter",
|
||||
gr::io_signature::make(0, 0, 0),
|
||||
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)))
|
||||
{
|
||||
message_port_register_out(pmt::mp("fpga_sample_counter"));
|
||||
set_max_noutput_items(1);
|
||||
@ -64,7 +64,7 @@ gnss_sdr_fpga_sample_counter::gnss_sdr_fpga_sample_counter(double _fs, int _inte
|
||||
}
|
||||
|
||||
|
||||
gnss_sdr_fpga_sample_counter_sptr gnss_sdr_make_fpga_sample_counter(double _fs, int _interval_ms)
|
||||
gnss_sdr_fpga_sample_counter_sptr gnss_sdr_make_fpga_sample_counter(double _fs, int32_t _interval_ms)
|
||||
{
|
||||
gnss_sdr_fpga_sample_counter_sptr fpga_sample_counter_(new gnss_sdr_fpga_sample_counter(_fs, _interval_ms));
|
||||
return fpga_sample_counter_;
|
||||
@ -79,6 +79,7 @@ bool gnss_sdr_fpga_sample_counter::start()
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Called by GNURadio to disable drivers, etc for i/o devices.
|
||||
bool gnss_sdr_fpga_sample_counter::stop()
|
||||
{
|
||||
@ -100,7 +101,6 @@ int gnss_sdr_fpga_sample_counter::general_work(int noutput_items __attribute__((
|
||||
// Possible problem: what happen if the PS is overloaded and gnuradio does not call this function
|
||||
// with the sufficient rate to catch all the interrupts in the counter. To be evaluated later.
|
||||
|
||||
|
||||
Gnss_Synchro *out = reinterpret_cast<Gnss_Synchro *>(output_items[0]);
|
||||
out[0] = Gnss_Synchro();
|
||||
out[0].Flag_valid_symbol_output = false;
|
||||
|
@ -33,37 +33,37 @@
|
||||
|
||||
#include <gnuradio/block.h>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class gnss_sdr_fpga_sample_counter;
|
||||
|
||||
typedef boost::shared_ptr<gnss_sdr_fpga_sample_counter> gnss_sdr_fpga_sample_counter_sptr;
|
||||
|
||||
gnss_sdr_fpga_sample_counter_sptr gnss_sdr_make_fpga_sample_counter(double _fs, int _interval_ms);
|
||||
gnss_sdr_fpga_sample_counter_sptr gnss_sdr_make_fpga_sample_counter(double _fs, int32_t _interval_ms);
|
||||
|
||||
class gnss_sdr_fpga_sample_counter : public gr::block
|
||||
{
|
||||
private:
|
||||
gnss_sdr_fpga_sample_counter(double _fs, int _interval_ms);
|
||||
gnss_sdr_fpga_sample_counter(double _fs, int32_t _interval_ms);
|
||||
bool start();
|
||||
bool stop();
|
||||
unsigned int samples_per_output;
|
||||
uint32_t samples_per_output;
|
||||
double fs;
|
||||
unsigned long long int sample_counter;
|
||||
int interval_ms;
|
||||
long long int current_T_rx_ms; // Receiver time in ms since the beginning of the run
|
||||
unsigned int current_s; // Receiver time in seconds, modulo 60
|
||||
bool flag_m; // True if the receiver has been running for at least 1 minute
|
||||
unsigned int current_m; // Receiver time in minutes, modulo 60
|
||||
bool flag_h; // True if the receiver has been running for at least 1 hour
|
||||
unsigned int current_h; // Receiver time in hours, modulo 24
|
||||
bool flag_days; // True if the receiver has been running for at least 1 day
|
||||
unsigned int current_days; // Receiver time in days since the beginning of the run
|
||||
int report_interval_ms;
|
||||
uint64_t sample_counter;
|
||||
int32_t interval_ms;
|
||||
int64_t current_T_rx_ms; // Receiver time in ms since the beginning of the run
|
||||
uint32_t current_s; // Receiver time in seconds, modulo 60
|
||||
bool flag_m; // True if the receiver has been running for at least 1 minute
|
||||
uint32_t current_m; // Receiver time in minutes, modulo 60
|
||||
bool flag_h; // True if the receiver has been running for at least 1 hour
|
||||
uint32_t current_h; // Receiver time in hours, modulo 24
|
||||
bool flag_days; // True if the receiver has been running for at least 1 day
|
||||
uint32_t current_days; // Receiver time in days since the beginning of the run
|
||||
int32_t report_interval_ms;
|
||||
bool flag_enable_send_msg;
|
||||
|
||||
public:
|
||||
friend gnss_sdr_fpga_sample_counter_sptr gnss_sdr_make_fpga_sample_counter(double _fs, int _interval_ms);
|
||||
friend gnss_sdr_fpga_sample_counter_sptr gnss_sdr_make_fpga_sample_counter(double _fs, int32_t _interval_ms);
|
||||
int general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
|
@ -36,10 +36,10 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
gnss_sdr_sample_counter::gnss_sdr_sample_counter(double _fs, int _interval_ms, size_t _size) : gr::sync_decimator("sample_counter",
|
||||
gr::io_signature::make(1, 1, _size),
|
||||
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
|
||||
static_cast<unsigned int>(std::round(_fs * static_cast<double>(_interval_ms) / 1e3)))
|
||||
gnss_sdr_sample_counter::gnss_sdr_sample_counter(double _fs, int32_t _interval_ms, size_t _size) : gr::sync_decimator("sample_counter",
|
||||
gr::io_signature::make(1, 1, _size),
|
||||
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
|
||||
static_cast<uint32_t>(std::round(_fs * static_cast<double>(_interval_ms) / 1e3)))
|
||||
{
|
||||
message_port_register_out(pmt::mp("sample_counter"));
|
||||
set_max_noutput_items(1);
|
||||
@ -60,7 +60,7 @@ gnss_sdr_sample_counter::gnss_sdr_sample_counter(double _fs, int _interval_ms, s
|
||||
}
|
||||
|
||||
|
||||
gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(double _fs, int _interval_ms, size_t _size)
|
||||
gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(double _fs, int32_t _interval_ms, size_t _size)
|
||||
{
|
||||
gnss_sdr_sample_counter_sptr sample_counter_(new gnss_sdr_sample_counter(_fs, _interval_ms, _size));
|
||||
return sample_counter_;
|
||||
|
@ -33,35 +33,36 @@
|
||||
|
||||
#include <gnuradio/sync_decimator.h>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
class gnss_sdr_sample_counter;
|
||||
|
||||
typedef boost::shared_ptr<gnss_sdr_sample_counter> gnss_sdr_sample_counter_sptr;
|
||||
|
||||
gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(double _fs, int _interval_ms, size_t _size);
|
||||
gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(double _fs, int32_t _interval_ms, size_t _size);
|
||||
|
||||
class gnss_sdr_sample_counter : public gr::sync_decimator
|
||||
{
|
||||
private:
|
||||
gnss_sdr_sample_counter(double _fs, int _interval_ms, size_t _size);
|
||||
unsigned int samples_per_output;
|
||||
gnss_sdr_sample_counter(double _fs, int32_t _interval_ms, size_t _size);
|
||||
uint32_t samples_per_output;
|
||||
double fs;
|
||||
unsigned long long int sample_counter;
|
||||
int interval_ms;
|
||||
long long int current_T_rx_ms; // Receiver time in ms since the beginning of the run
|
||||
unsigned int current_s; // Receiver time in seconds, modulo 60
|
||||
bool flag_m; // True if the receiver has been running for at least 1 minute
|
||||
unsigned int current_m; // Receiver time in minutes, modulo 60
|
||||
bool flag_h; // True if the receiver has been running for at least 1 hour
|
||||
unsigned int current_h; // Receiver time in hours, modulo 24
|
||||
bool flag_days; // True if the receiver has been running for at least 1 day
|
||||
unsigned int current_days; // Receiver time in days since the beginning of the run
|
||||
int report_interval_ms;
|
||||
uint64_t sample_counter;
|
||||
int32_t interval_ms;
|
||||
int64_t current_T_rx_ms; // Receiver time in ms since the beginning of the run
|
||||
uint32_t current_s; // Receiver time in seconds, modulo 60
|
||||
bool flag_m; // True if the receiver has been running for at least 1 minute
|
||||
uint32_t current_m; // Receiver time in minutes, modulo 60
|
||||
bool flag_h; // True if the receiver has been running for at least 1 hour
|
||||
uint32_t current_h; // Receiver time in hours, modulo 24
|
||||
bool flag_days; // True if the receiver has been running for at least 1 day
|
||||
uint32_t current_days; // Receiver time in days since the beginning of the run
|
||||
int32_t report_interval_ms;
|
||||
bool flag_enable_send_msg;
|
||||
|
||||
public:
|
||||
friend gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(double _fs, int _interval_ms, size_t _size);
|
||||
friend gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(double _fs, int32_t _interval_ms, size_t _size);
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include <gnuradio/block.h>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class gnss_sdr_time_counter;
|
||||
|
||||
@ -45,20 +45,20 @@ class gnss_sdr_time_counter : public gr::block
|
||||
{
|
||||
private:
|
||||
gnss_sdr_time_counter();
|
||||
long long int current_T_rx_ms; // Receiver time in ms since the beginning of the run
|
||||
unsigned int current_s; // Receiver time in seconds, modulo 60
|
||||
bool flag_m; // True if the receiver has been running for at least 1 minute
|
||||
unsigned int current_m; // Receiver time in minutes, modulo 60
|
||||
bool flag_h; // True if the receiver has been running for at least 1 hour
|
||||
unsigned int current_h; // Receiver time in hours, modulo 24
|
||||
bool flag_days; // True if the receiver has been running for at least 1 day
|
||||
unsigned int current_days; // Receiver time in days since the beginning of the run
|
||||
int report_interval_ms;
|
||||
int64_t current_T_rx_ms; // Receiver time in ms since the beginning of the run
|
||||
uint32_t current_s; // Receiver time in seconds, modulo 60
|
||||
bool flag_m; // True if the receiver has been running for at least 1 minute
|
||||
uint32_t current_m; // Receiver time in minutes, modulo 60
|
||||
bool flag_h; // True if the receiver has been running for at least 1 hour
|
||||
uint32_t current_h; // Receiver time in hours, modulo 24
|
||||
bool flag_days; // True if the receiver has been running for at least 1 day
|
||||
uint32_t current_days; // Receiver time in days since the beginning of the run
|
||||
int32_t report_interval_ms;
|
||||
|
||||
public:
|
||||
friend gnss_sdr_time_counter_sptr gnss_sdr_make_time_counter();
|
||||
int general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
|
||||
gr_vector_const_void_star &input_items __attribute__((unused)), gr_vector_void_star &output_items);
|
||||
gr_vector_const_void_star &input_items __attribute__((unused)), gr_vector_void_star &output_items);
|
||||
};
|
||||
|
||||
#endif /*GNSS_SDR_SAMPLE_COUNTER_H_*/
|
||||
|
@ -134,11 +134,11 @@ int hybrid_observables_cc::save_matfile()
|
||||
return 1;
|
||||
}
|
||||
// count number of epochs and rewind
|
||||
long int num_epoch = 0;
|
||||
int64_t num_epoch = 0;
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
size = dump_file.tellg();
|
||||
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes);
|
||||
num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
|
||||
dump_file.seekg(0, std::ios::beg);
|
||||
}
|
||||
else
|
||||
@ -168,7 +168,7 @@ int hybrid_observables_cc::save_matfile()
|
||||
{
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
for (long int i = 0; i < num_epoch; i++)
|
||||
for (int64_t i = 0; i < num_epoch; i++)
|
||||
{
|
||||
for (unsigned int chan = 0; chan < d_nchannels_out; chan++)
|
||||
{
|
||||
@ -216,7 +216,7 @@ int hybrid_observables_cc::save_matfile()
|
||||
double *PRN_aux = new double[d_nchannels_out * num_epoch];
|
||||
double *Flag_valid_pseudorange_aux = new double[d_nchannels_out * num_epoch];
|
||||
unsigned int k = 0;
|
||||
for (long int j = 0; j < num_epoch; j++)
|
||||
for (int64_t j = 0; j < num_epoch; j++)
|
||||
{
|
||||
for (unsigned int i = 0; i < d_nchannels_out; i++)
|
||||
{
|
||||
@ -241,7 +241,7 @@ int hybrid_observables_cc::save_matfile()
|
||||
}
|
||||
filename.append(".mat");
|
||||
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
|
||||
if (reinterpret_cast<long *>(matfp) != NULL)
|
||||
if (reinterpret_cast<int64_t *>(matfp) != NULL)
|
||||
{
|
||||
size_t dims[2] = {static_cast<size_t>(d_nchannels_out), static_cast<size_t>(num_epoch)};
|
||||
matvar = Mat_VarCreate("RX_time", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, RX_time_aux, MAT_F_DONT_COPY_DATA);
|
||||
@ -308,14 +308,14 @@ double hybrid_observables_cc::compute_T_rx_s(const Gnss_Synchro &a)
|
||||
return ((static_cast<double>(a.Tracking_sample_counter) + a.Code_phase_samples) / static_cast<double>(a.fs));
|
||||
}
|
||||
|
||||
bool hybrid_observables_cc::interp_trk_obs(Gnss_Synchro &interpolated_obs, const unsigned int &ch, const unsigned long int &rx_clock)
|
||||
bool hybrid_observables_cc::interp_trk_obs(Gnss_Synchro &interpolated_obs, const unsigned int &ch, const uint64_t &rx_clock)
|
||||
{
|
||||
int nearest_element = -1;
|
||||
long int abs_diff;
|
||||
long int old_abs_diff = std::numeric_limits<long int>::max();
|
||||
int64_t abs_diff;
|
||||
int64_t old_abs_diff = std::numeric_limits<int64_t>::max();
|
||||
for (unsigned int i = 0; i < d_gnss_synchro_history->size(ch); i++)
|
||||
{
|
||||
abs_diff = labs(static_cast<long int>(rx_clock) - static_cast<long int>(d_gnss_synchro_history->at(ch, i).Tracking_sample_counter));
|
||||
abs_diff = labs(static_cast<int64_t>(rx_clock) - static_cast<int64_t>(d_gnss_synchro_history->at(ch, i).Tracking_sample_counter));
|
||||
if (old_abs_diff > abs_diff)
|
||||
{
|
||||
old_abs_diff = abs_diff;
|
||||
|
@ -66,14 +66,14 @@ private:
|
||||
hybrid_make_observables_cc(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, std::string dump_filename);
|
||||
hybrid_observables_cc(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, std::string dump_filename);
|
||||
bool interpolate_data(Gnss_Synchro& out, const unsigned int& ch, const double& ti);
|
||||
bool interp_trk_obs(Gnss_Synchro& interpolated_obs, const unsigned int& ch, const unsigned long int& rx_clock);
|
||||
bool interp_trk_obs(Gnss_Synchro& interpolated_obs, const unsigned int& ch, const uint64_t& rx_clock);
|
||||
double compute_T_rx_s(const Gnss_Synchro& a);
|
||||
void compute_pranges(std::vector<Gnss_Synchro>& data);
|
||||
void update_TOW(std::vector<Gnss_Synchro>& data);
|
||||
int save_matfile();
|
||||
|
||||
//time history
|
||||
boost::circular_buffer<unsigned long int> d_Rx_clock_buffer;
|
||||
boost::circular_buffer<uint64_t> d_Rx_clock_buffer;
|
||||
//Tracking observable history
|
||||
Gnss_circular_deque<Gnss_Synchro>* d_gnss_synchro_history;
|
||||
unsigned int T_rx_clock_step_samples;
|
||||
|
@ -474,11 +474,11 @@ int galileo_e1b_telemetry_decoder_cc::general_work(int noutput_items __attribute
|
||||
try
|
||||
{
|
||||
double tmp_double;
|
||||
unsigned long int tmp_ulong_int;
|
||||
uint64_t tmp_ulong_int;
|
||||
tmp_double = static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
tmp_ulong_int = current_symbol.Tracking_sample_counter;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(uint64_t));
|
||||
tmp_double = static_cast<double>(d_TOW_at_Preamble_ms) / 1000.0;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
}
|
||||
|
@ -89,8 +89,8 @@ private:
|
||||
|
||||
std::deque<Gnss_Synchro> d_symbol_history;
|
||||
|
||||
long unsigned int d_sample_counter;
|
||||
long unsigned int d_preamble_index;
|
||||
uint64_t d_sample_counter;
|
||||
uint64_t d_preamble_index;
|
||||
unsigned int d_stat;
|
||||
bool d_flag_frame_sync;
|
||||
|
||||
|
@ -487,11 +487,11 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute
|
||||
try
|
||||
{
|
||||
double tmp_double;
|
||||
unsigned long int tmp_ulong_int;
|
||||
uint64_t tmp_ulong_int;
|
||||
tmp_double = static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
tmp_ulong_int = current_sample.Tracking_sample_counter;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(uint64_t));
|
||||
tmp_double = static_cast<double>(d_TOW_at_Preamble_ms) / 1000.0;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
}
|
||||
|
@ -94,8 +94,8 @@ private:
|
||||
int d_symbol_counter;
|
||||
int corr_value;
|
||||
unsigned int required_symbols;
|
||||
long unsigned int d_sample_counter;
|
||||
long unsigned int d_preamble_index;
|
||||
uint64_t d_sample_counter;
|
||||
uint64_t d_preamble_index;
|
||||
bool d_flag_frame_sync;
|
||||
bool d_flag_preamble;
|
||||
bool d_dump;
|
||||
|
@ -423,11 +423,11 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribu
|
||||
try
|
||||
{
|
||||
double tmp_double;
|
||||
unsigned long int tmp_ulong_int;
|
||||
uint64_t tmp_ulong_int;
|
||||
tmp_double = d_TOW_at_current_symbol;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
tmp_ulong_int = current_symbol.Tracking_sample_counter;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(uint64_t));
|
||||
tmp_double = 0;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
}
|
||||
|
@ -91,15 +91,15 @@ private:
|
||||
std::deque<Gnss_Synchro> d_symbol_history;
|
||||
|
||||
//!< Variables for internal functionality
|
||||
long unsigned int d_sample_counter; //!< Sample counter as an index (1,2,3,..etc) indicating number of samples processed
|
||||
long unsigned int d_preamble_index; //!< Index of sample number where preamble was found
|
||||
unsigned int d_stat; //!< Status of decoder
|
||||
bool d_flag_frame_sync; //!< Indicate when a frame sync is achieved
|
||||
bool d_flag_parity; //!< Flag indicating when parity check was achieved (crc check)
|
||||
bool d_flag_preamble; //!< Flag indicating when preamble was found
|
||||
int d_CRC_error_counter; //!< Number of failed CRC operations
|
||||
bool flag_TOW_set; //!< Indicates when time of week is set
|
||||
double delta_t; //!< GPS-GLONASS time offset
|
||||
uint64_t d_sample_counter; //!< Sample counter as an index (1,2,3,..etc) indicating number of samples processed
|
||||
uint64_t d_preamble_index; //!< Index of sample number where preamble was found
|
||||
unsigned int d_stat; //!< Status of decoder
|
||||
bool d_flag_frame_sync; //!< Indicate when a frame sync is achieved
|
||||
bool d_flag_parity; //!< Flag indicating when parity check was achieved (crc check)
|
||||
bool d_flag_preamble; //!< Flag indicating when preamble was found
|
||||
int d_CRC_error_counter; //!< Number of failed CRC operations
|
||||
bool flag_TOW_set; //!< Indicates when time of week is set
|
||||
double delta_t; //!< GPS-GLONASS time offset
|
||||
|
||||
//!< Navigation Message variable
|
||||
Glonass_Gnav_Navigation_Message d_nav;
|
||||
|
@ -423,11 +423,11 @@ int glonass_l2_ca_telemetry_decoder_cc::general_work(int noutput_items __attribu
|
||||
try
|
||||
{
|
||||
double tmp_double;
|
||||
unsigned long int tmp_ulong_int;
|
||||
uint64_t tmp_ulong_int;
|
||||
tmp_double = d_TOW_at_current_symbol;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
tmp_ulong_int = current_symbol.Tracking_sample_counter;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(uint64_t));
|
||||
tmp_double = 0;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
}
|
||||
|
@ -89,15 +89,15 @@ private:
|
||||
std::deque<Gnss_Synchro> d_symbol_history;
|
||||
|
||||
//!< Variables for internal functionality
|
||||
long unsigned int d_sample_counter; //!< Sample counter as an index (1,2,3,..etc) indicating number of samples processed
|
||||
long unsigned int d_preamble_index; //!< Index of sample number where preamble was found
|
||||
unsigned int d_stat; //!< Status of decoder
|
||||
bool d_flag_frame_sync; //!< Indicate when a frame sync is achieved
|
||||
bool d_flag_parity; //!< Flag indicating when parity check was achieved (crc check)
|
||||
bool d_flag_preamble; //!< Flag indicating when preamble was found
|
||||
int d_CRC_error_counter; //!< Number of failed CRC operations
|
||||
bool flag_TOW_set; //!< Indicates when time of week is set
|
||||
double delta_t; //!< GPS-GLONASS time offset
|
||||
uint64_t d_sample_counter; //!< Sample counter as an index (1,2,3,..etc) indicating number of samples processed
|
||||
uint64_t d_preamble_index; //!< Index of sample number where preamble was found
|
||||
unsigned int d_stat; //!< Status of decoder
|
||||
bool d_flag_frame_sync; //!< Indicate when a frame sync is achieved
|
||||
bool d_flag_parity; //!< Flag indicating when parity check was achieved (crc check)
|
||||
bool d_flag_preamble; //!< Flag indicating when preamble was found
|
||||
int d_CRC_error_counter; //!< Number of failed CRC operations
|
||||
bool flag_TOW_set; //!< Indicates when time of week is set
|
||||
double delta_t; //!< GPS-GLONASS time offset
|
||||
|
||||
//!< Navigation Message variable
|
||||
Glonass_Gnav_Navigation_Message d_nav;
|
||||
|
@ -457,11 +457,11 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__
|
||||
try
|
||||
{
|
||||
double tmp_double;
|
||||
unsigned long int tmp_ulong_int;
|
||||
uint64_t tmp_ulong_int;
|
||||
tmp_double = static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
tmp_ulong_int = current_symbol.Tracking_sample_counter;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(uint64_t));
|
||||
tmp_double = static_cast<double>(d_TOW_at_Preamble_ms) / 1000.0;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ private:
|
||||
Gnss_Satellite d_satellite;
|
||||
int d_channel;
|
||||
|
||||
unsigned long int d_preamble_time_samples;
|
||||
uint64_t d_preamble_time_samples;
|
||||
|
||||
unsigned int d_TOW_at_Preamble_ms;
|
||||
unsigned int d_TOW_at_current_symbol_ms;
|
||||
|
@ -210,11 +210,11 @@ int gps_l2c_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
|
||||
try
|
||||
{
|
||||
double tmp_double;
|
||||
unsigned long int tmp_ulong_int;
|
||||
uint64_t tmp_ulong_int;
|
||||
tmp_double = d_TOW_at_current_symbol;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
tmp_ulong_int = current_synchro_data.Tracking_sample_counter;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(uint64_t));
|
||||
tmp_double = d_TOW_at_Preamble;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
}
|
||||
|
@ -266,11 +266,11 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u
|
||||
try
|
||||
{
|
||||
double tmp_double;
|
||||
unsigned long int tmp_ulong_int;
|
||||
uint64_t tmp_ulong_int;
|
||||
tmp_double = static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
tmp_ulong_int = current_synchro_data.Tracking_sample_counter;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(uint64_t));
|
||||
tmp_double = static_cast<double>(d_TOW_at_Preamble_ms) / 1000.0;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
}
|
||||
|
@ -414,7 +414,7 @@ void dll_pll_veml_tracking::start_tracking()
|
||||
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
|
||||
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
|
||||
|
||||
long int acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp);
|
||||
int64_t acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp);
|
||||
double acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / trk_parameters.fs_in;
|
||||
DLOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples;
|
||||
DLOG(INFO) << "Number of seconds between Acquisition and Tracking = " << acq_trk_diff_seconds;
|
||||
@ -869,7 +869,7 @@ void dll_pll_veml_tracking::log_data(bool integrating)
|
||||
float tmp_VE, tmp_E, tmp_P, tmp_L, tmp_VL;
|
||||
float tmp_float;
|
||||
double tmp_double;
|
||||
unsigned long int tmp_long_int;
|
||||
uint64_t tmp_long_int;
|
||||
if (trk_parameters.track_pilot)
|
||||
{
|
||||
if (interchange_iq)
|
||||
@ -937,7 +937,7 @@ void dll_pll_veml_tracking::log_data(bool integrating)
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
|
||||
// PRN start sample stamp
|
||||
tmp_long_int = d_sample_counter + d_current_prn_length_samples;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_long_int), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_long_int), sizeof(uint64_t));
|
||||
// accumulated carrier phase
|
||||
tmp_float = d_acc_carrier_phase_rad;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
@ -984,7 +984,7 @@ int dll_pll_veml_tracking::save_matfile()
|
||||
std::ifstream::pos_type size;
|
||||
int number_of_double_vars = 1;
|
||||
int number_of_float_vars = 17;
|
||||
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars +
|
||||
int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
|
||||
sizeof(float) * number_of_float_vars + sizeof(unsigned int);
|
||||
std::ifstream dump_file;
|
||||
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
@ -998,11 +998,11 @@ int dll_pll_veml_tracking::save_matfile()
|
||||
return 1;
|
||||
}
|
||||
// count number of epochs and rewind
|
||||
long int num_epoch = 0;
|
||||
int64_t num_epoch = 0;
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
size = dump_file.tellg();
|
||||
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes);
|
||||
num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
|
||||
dump_file.seekg(0, std::ios::beg);
|
||||
}
|
||||
else
|
||||
@ -1016,7 +1016,7 @@ int dll_pll_veml_tracking::save_matfile()
|
||||
float *abs_VL = new float[num_epoch];
|
||||
float *Prompt_I = new float[num_epoch];
|
||||
float *Prompt_Q = new float[num_epoch];
|
||||
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch];
|
||||
uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
|
||||
float *acc_carrier_phase_rad = new float[num_epoch];
|
||||
float *carrier_doppler_hz = new float[num_epoch];
|
||||
float *code_freq_chips = new float[num_epoch];
|
||||
@ -1034,7 +1034,7 @@ int dll_pll_veml_tracking::save_matfile()
|
||||
{
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
for (long int i = 0; i < num_epoch; i++)
|
||||
for (int64_t i = 0; i < num_epoch; i++)
|
||||
{
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_VE[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
|
||||
@ -1043,7 +1043,7 @@ int dll_pll_veml_tracking::save_matfile()
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_VL[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
|
||||
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(float));
|
||||
@ -1093,7 +1093,7 @@ int dll_pll_veml_tracking::save_matfile()
|
||||
filename.erase(filename.length() - 4, 4);
|
||||
filename.append(".mat");
|
||||
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
|
||||
if (reinterpret_cast<long *>(matfp) != NULL)
|
||||
if (reinterpret_cast<int64_t *>(matfp) != NULL)
|
||||
{
|
||||
size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
|
||||
matvar = Mat_VarCreate("abs_VE", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_VE, 0);
|
||||
@ -1255,7 +1255,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
|
||||
case 1: // Pull-in
|
||||
{
|
||||
// Signal alignment (skip samples until the incoming signal is aligned with local replica)
|
||||
unsigned long int acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
|
||||
uint64_t acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
|
||||
double acq_trk_shif_correction_samples = static_cast<double>(d_current_prn_length_samples) - std::fmod(static_cast<double>(acq_to_trk_delay_samples), static_cast<double>(d_current_prn_length_samples));
|
||||
int samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples);
|
||||
if (samples_offset < 0)
|
||||
@ -1566,7 +1566,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
|
||||
d_sample_counter += d_current_prn_length_samples;
|
||||
if (current_synchro_data.Flag_valid_symbol_output)
|
||||
{
|
||||
current_synchro_data.fs = static_cast<long int>(trk_parameters.fs_in);
|
||||
current_synchro_data.fs = static_cast<int64_t>(trk_parameters.fs_in);
|
||||
current_synchro_data.Tracking_sample_counter = d_sample_counter;
|
||||
*out[0] = current_synchro_data;
|
||||
return 1;
|
||||
|
@ -177,8 +177,8 @@ private:
|
||||
// PRN period in samples
|
||||
int d_current_prn_length_samples;
|
||||
// processing samples counters
|
||||
unsigned long int d_sample_counter;
|
||||
unsigned long int d_acq_sample_stamp;
|
||||
uint64_t d_sample_counter;
|
||||
uint64_t d_acq_sample_stamp;
|
||||
|
||||
// CN0 estimation and lock detector
|
||||
int d_cn0_estimation_counter;
|
||||
|
@ -842,7 +842,7 @@ void dll_pll_veml_tracking_fpga::log_data(bool integrating)
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
|
||||
// PRN start sample stamp
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
|
||||
// accumulated carrier phase
|
||||
tmp_float = d_acc_carrier_phase_rad;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
@ -889,7 +889,7 @@ int dll_pll_veml_tracking_fpga::save_matfile()
|
||||
std::ifstream::pos_type size;
|
||||
int number_of_double_vars = 1;
|
||||
int number_of_float_vars = 17;
|
||||
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars +
|
||||
int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
|
||||
sizeof(float) * number_of_float_vars + sizeof(unsigned int);
|
||||
std::ifstream dump_file;
|
||||
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
@ -903,11 +903,11 @@ int dll_pll_veml_tracking_fpga::save_matfile()
|
||||
return 1;
|
||||
}
|
||||
// count number of epochs and rewind
|
||||
long int num_epoch = 0;
|
||||
int64_t num_epoch = 0;
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
size = dump_file.tellg();
|
||||
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes);
|
||||
num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
|
||||
dump_file.seekg(0, std::ios::beg);
|
||||
}
|
||||
else
|
||||
@ -921,7 +921,7 @@ int dll_pll_veml_tracking_fpga::save_matfile()
|
||||
float *abs_VL = new float[num_epoch];
|
||||
float *Prompt_I = new float[num_epoch];
|
||||
float *Prompt_Q = new float[num_epoch];
|
||||
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch];
|
||||
uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
|
||||
float *acc_carrier_phase_rad = new float[num_epoch];
|
||||
float *carrier_doppler_hz = new float[num_epoch];
|
||||
float *code_freq_chips = new float[num_epoch];
|
||||
@ -939,7 +939,7 @@ int dll_pll_veml_tracking_fpga::save_matfile()
|
||||
{
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
for (long int i = 0; i < num_epoch; i++)
|
||||
for (int64_t i = 0; i < num_epoch; i++)
|
||||
{
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_VE[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
|
||||
@ -948,7 +948,7 @@ int dll_pll_veml_tracking_fpga::save_matfile()
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_VL[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
|
||||
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(float));
|
||||
@ -998,7 +998,7 @@ int dll_pll_veml_tracking_fpga::save_matfile()
|
||||
filename.erase(filename.length() - 4, 4);
|
||||
filename.append(".mat");
|
||||
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
|
||||
if (reinterpret_cast<long *>(matfp) != NULL)
|
||||
if (reinterpret_cast<int64_t *>(matfp) != NULL)
|
||||
{
|
||||
size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
|
||||
matvar = Mat_VarCreate("abs_VE", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_VE, 0);
|
||||
@ -1464,7 +1464,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un
|
||||
}
|
||||
if (current_synchro_data.Flag_valid_symbol_output)
|
||||
{
|
||||
current_synchro_data.fs = static_cast<long int>(trk_parameters.fs_in);
|
||||
current_synchro_data.fs = static_cast<int64_t>(trk_parameters.fs_in);
|
||||
current_synchro_data.Tracking_sample_counter = d_sample_counter + d_current_prn_length_samples;
|
||||
*out[0] = current_synchro_data;
|
||||
return 1;
|
||||
|
@ -201,8 +201,8 @@ private:
|
||||
// PRN period in samples
|
||||
int d_current_prn_length_samples;
|
||||
// processing samples counters
|
||||
unsigned long int d_sample_counter;
|
||||
unsigned long int d_acq_sample_stamp;
|
||||
uint64_t d_sample_counter;
|
||||
uint64_t d_acq_sample_stamp;
|
||||
|
||||
// CN0 estimation and lock detector
|
||||
int d_cn0_estimation_counter;
|
||||
@ -219,7 +219,7 @@ private:
|
||||
// extra
|
||||
int d_correlation_length_samples;
|
||||
int d_next_prn_length_samples;
|
||||
unsigned long int d_sample_counter_next;
|
||||
uint64_t d_sample_counter_next;
|
||||
unsigned int d_pull_in = 0;
|
||||
};
|
||||
|
||||
|
@ -60,7 +60,7 @@
|
||||
using google::LogMessage;
|
||||
|
||||
galileo_e1_tcp_connector_tracking_cc_sptr galileo_e1_tcp_connector_make_tracking_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -86,7 +86,7 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::forecast(int noutput_items,
|
||||
|
||||
|
||||
Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -498,7 +498,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
|
||||
// PRN start sample stamp
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
|
||||
// accumulated carrier phase
|
||||
tmp_float = d_acc_carrier_phase_rad;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
|
@ -55,7 +55,7 @@ typedef boost::shared_ptr<Galileo_E1_Tcp_Connector_Tracking_cc> galileo_e1_tcp_c
|
||||
|
||||
galileo_e1_tcp_connector_tracking_cc_sptr
|
||||
galileo_e1_tcp_connector_make_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -85,7 +85,7 @@ public:
|
||||
private:
|
||||
friend galileo_e1_tcp_connector_tracking_cc_sptr
|
||||
galileo_e1_tcp_connector_make_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -95,7 +95,7 @@ private:
|
||||
size_t port_ch0);
|
||||
|
||||
Galileo_E1_Tcp_Connector_Tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -115,7 +115,7 @@ private:
|
||||
Gnss_Synchro *d_acquisition_gnss_synchro;
|
||||
unsigned int d_channel;
|
||||
|
||||
long d_fs_in;
|
||||
int64_t d_fs_in;
|
||||
|
||||
int d_correlation_length_samples;
|
||||
int d_n_correlator_taps;
|
||||
@ -161,8 +161,8 @@ private:
|
||||
int d_next_prn_length_samples;
|
||||
|
||||
//processing samples counters
|
||||
unsigned long int d_sample_counter;
|
||||
unsigned long int d_acq_sample_stamp;
|
||||
uint64_t d_sample_counter;
|
||||
uint64_t d_acq_sample_stamp;
|
||||
|
||||
// CN0 estimation and lock detector
|
||||
int d_cn0_estimation_counter;
|
||||
|
@ -62,7 +62,7 @@ using google::LogMessage;
|
||||
|
||||
glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr
|
||||
glonass_l1_ca_dll_pll_c_aid_make_tracking_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -102,7 +102,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index(pmt::pm
|
||||
|
||||
|
||||
glonass_l1_ca_dll_pll_c_aid_tracking_cc::glonass_l1_ca_dll_pll_c_aid_tracking_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -211,7 +211,7 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::glonass_l1_ca_dll_pll_c_aid_tracking_cc
|
||||
|
||||
d_glonass_freq_ch = 0;
|
||||
|
||||
//set_min_output_buffer((long int)300);
|
||||
//set_min_output_buffer((int64_t)300);
|
||||
}
|
||||
|
||||
|
||||
@ -224,9 +224,9 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking()
|
||||
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
|
||||
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
|
||||
|
||||
long int acq_trk_diff_samples;
|
||||
int64_t acq_trk_diff_samples;
|
||||
double acq_trk_diff_seconds;
|
||||
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length;
|
||||
acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
|
||||
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
|
||||
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
|
||||
// Doppler effect
|
||||
@ -354,7 +354,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
|
||||
std::ifstream::pos_type size;
|
||||
int number_of_double_vars = 11;
|
||||
int number_of_float_vars = 5;
|
||||
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars +
|
||||
int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
|
||||
sizeof(float) * number_of_float_vars + sizeof(unsigned int);
|
||||
std::ifstream dump_file;
|
||||
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
@ -368,11 +368,11 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
|
||||
return 1;
|
||||
}
|
||||
// count number of epochs and rewind
|
||||
long int num_epoch = 0;
|
||||
int64_t num_epoch = 0;
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
size = dump_file.tellg();
|
||||
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes);
|
||||
num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
|
||||
dump_file.seekg(0, std::ios::beg);
|
||||
}
|
||||
else
|
||||
@ -384,7 +384,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
|
||||
float *abs_L = new float[num_epoch];
|
||||
float *Prompt_I = new float[num_epoch];
|
||||
float *Prompt_Q = new float[num_epoch];
|
||||
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch];
|
||||
uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
|
||||
double *acc_carrier_phase_rad = new double[num_epoch];
|
||||
double *carrier_doppler_hz = new double[num_epoch];
|
||||
double *code_freq_chips = new double[num_epoch];
|
||||
@ -402,14 +402,14 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
|
||||
{
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
for (long int i = 0; i < num_epoch; i++)
|
||||
for (int64_t i = 0; i < num_epoch; i++)
|
||||
{
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
|
||||
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
|
||||
@ -457,7 +457,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
|
||||
filename.erase(filename.length() - 4, 4);
|
||||
filename.append(".mat");
|
||||
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
|
||||
if (reinterpret_cast<long *>(matfp) != NULL)
|
||||
if (reinterpret_cast<int64_t *>(matfp) != NULL)
|
||||
{
|
||||
size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
|
||||
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
|
||||
@ -652,7 +652,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
|
||||
bool enable_dll_pll;
|
||||
if (d_enable_extended_integration == true)
|
||||
{
|
||||
long int symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
|
||||
int64_t symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
|
||||
if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0)
|
||||
{
|
||||
// compute coherent integration and enable tracking loop
|
||||
@ -880,7 +880,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
|
||||
// PRN start sample stamp
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
|
||||
// accumulated carrier phase
|
||||
tmp_float = d_acc_carrier_phase_cycles * GLONASS_TWO_PI;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
|
@ -58,7 +58,7 @@ typedef boost::shared_ptr<glonass_l1_ca_dll_pll_c_aid_tracking_cc>
|
||||
|
||||
glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr
|
||||
glonass_l1_ca_dll_pll_c_aid_make_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -89,7 +89,7 @@ public:
|
||||
private:
|
||||
friend glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr
|
||||
glonass_l1_ca_dll_pll_c_aid_make_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -100,7 +100,7 @@ private:
|
||||
float early_late_space_chips);
|
||||
|
||||
glonass_l1_ca_dll_pll_c_aid_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -117,7 +117,7 @@ private:
|
||||
Gnss_Synchro* d_acquisition_gnss_synchro;
|
||||
unsigned int d_channel;
|
||||
|
||||
long d_fs_in;
|
||||
int64_t d_fs_in;
|
||||
double d_glonass_freq_ch;
|
||||
|
||||
double d_early_late_spc_chips;
|
||||
@ -176,8 +176,8 @@ private:
|
||||
int d_correlation_length_samples;
|
||||
|
||||
//processing samples counters
|
||||
unsigned long int d_sample_counter;
|
||||
unsigned long int d_acq_sample_stamp;
|
||||
uint64_t d_sample_counter;
|
||||
uint64_t d_acq_sample_stamp;
|
||||
|
||||
// CN0 estimation and lock detector
|
||||
int d_cn0_estimation_counter;
|
||||
|
@ -37,7 +37,6 @@
|
||||
*/
|
||||
|
||||
#include "glonass_l1_ca_dll_pll_c_aid_tracking_sc.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include "glonass_l1_signal_processing.h"
|
||||
#include "GLONASS_L1_L2_CA.h"
|
||||
#include "tracking_discriminators.h"
|
||||
@ -61,7 +60,7 @@ using google::LogMessage;
|
||||
|
||||
glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr
|
||||
glonass_l1_ca_dll_pll_c_aid_make_tracking_sc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -100,7 +99,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index(pmt::pm
|
||||
}
|
||||
|
||||
glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -208,7 +207,7 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc
|
||||
d_carrier_doppler_old_hz = 0.0;
|
||||
|
||||
d_glonass_freq_ch = 0;
|
||||
//set_min_output_buffer((long int)300);
|
||||
//set_min_output_buffer((int64_t)300);
|
||||
}
|
||||
|
||||
|
||||
@ -221,9 +220,9 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking()
|
||||
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
|
||||
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
|
||||
|
||||
long int acq_trk_diff_samples;
|
||||
int64_t acq_trk_diff_samples;
|
||||
double acq_trk_diff_seconds;
|
||||
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length;
|
||||
acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
|
||||
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
|
||||
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
|
||||
// Doppler effect
|
||||
@ -309,7 +308,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
|
||||
std::ifstream::pos_type size;
|
||||
int number_of_double_vars = 11;
|
||||
int number_of_float_vars = 5;
|
||||
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars +
|
||||
int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
|
||||
sizeof(float) * number_of_float_vars + sizeof(unsigned int);
|
||||
std::ifstream dump_file;
|
||||
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
@ -323,11 +322,11 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
|
||||
return 1;
|
||||
}
|
||||
// count number of epochs and rewind
|
||||
long int num_epoch = 0;
|
||||
int64_t num_epoch = 0;
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
size = dump_file.tellg();
|
||||
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes);
|
||||
num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
|
||||
dump_file.seekg(0, std::ios::beg);
|
||||
}
|
||||
else
|
||||
@ -339,7 +338,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
|
||||
float *abs_L = new float[num_epoch];
|
||||
float *Prompt_I = new float[num_epoch];
|
||||
float *Prompt_Q = new float[num_epoch];
|
||||
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch];
|
||||
uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
|
||||
double *acc_carrier_phase_rad = new double[num_epoch];
|
||||
double *carrier_doppler_hz = new double[num_epoch];
|
||||
double *code_freq_chips = new double[num_epoch];
|
||||
@ -357,14 +356,14 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
|
||||
{
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
for (long int i = 0; i < num_epoch; i++)
|
||||
for (int64_t i = 0; i < num_epoch; i++)
|
||||
{
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
|
||||
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
|
||||
@ -412,7 +411,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
|
||||
filename.erase(filename.length() - 4, 4);
|
||||
filename.append(".mat");
|
||||
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
|
||||
if (reinterpret_cast<long *>(matfp) != NULL)
|
||||
if (reinterpret_cast<int64_t *>(matfp) != NULL)
|
||||
{
|
||||
size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
|
||||
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
|
||||
@ -644,7 +643,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
|
||||
bool enable_dll_pll;
|
||||
if (d_enable_extended_integration == true)
|
||||
{
|
||||
long int symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
|
||||
int64_t symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
|
||||
if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0)
|
||||
{
|
||||
// compute coherent integration and enable tracking loop
|
||||
@ -870,7 +869,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
|
||||
// PRN start sample stamp
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
|
||||
// accumulated carrier phase
|
||||
tmp_float = d_acc_carrier_phase_cycles * GLONASS_TWO_PI;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
|
@ -59,7 +59,7 @@ typedef boost::shared_ptr<glonass_l1_ca_dll_pll_c_aid_tracking_sc>
|
||||
|
||||
glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr
|
||||
glonass_l1_ca_dll_pll_c_aid_make_tracking_sc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -90,7 +90,7 @@ public:
|
||||
private:
|
||||
friend glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr
|
||||
glonass_l1_ca_dll_pll_c_aid_make_tracking_sc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -101,7 +101,7 @@ private:
|
||||
float early_late_space_chips);
|
||||
|
||||
glonass_l1_ca_dll_pll_c_aid_tracking_sc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -118,8 +118,8 @@ private:
|
||||
Gnss_Synchro* d_acquisition_gnss_synchro;
|
||||
unsigned int d_channel;
|
||||
|
||||
long d_fs_in;
|
||||
long d_glonass_freq_ch;
|
||||
int64_t d_fs_in;
|
||||
int64_t d_glonass_freq_ch;
|
||||
|
||||
double d_early_late_spc_chips;
|
||||
int d_n_correlator_taps;
|
||||
@ -179,8 +179,8 @@ private:
|
||||
int d_correlation_length_samples;
|
||||
|
||||
//processing samples counters
|
||||
unsigned long int d_sample_counter;
|
||||
unsigned long int d_acq_sample_stamp;
|
||||
uint64_t d_sample_counter;
|
||||
uint64_t d_acq_sample_stamp;
|
||||
|
||||
// CN0 estimation and lock detector
|
||||
int d_cn0_estimation_counter;
|
||||
|
@ -59,7 +59,7 @@ using google::LogMessage;
|
||||
|
||||
glonass_l1_ca_dll_pll_tracking_cc_sptr
|
||||
glonass_l1_ca_dll_pll_make_tracking_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -83,7 +83,7 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::forecast(int noutput_items,
|
||||
|
||||
|
||||
Glonass_L1_Ca_Dll_Pll_Tracking_cc::Glonass_L1_Ca_Dll_Pll_Tracking_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -182,9 +182,9 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
|
||||
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
|
||||
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
|
||||
|
||||
long int acq_trk_diff_samples;
|
||||
int64_t acq_trk_diff_samples;
|
||||
double acq_trk_diff_seconds;
|
||||
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length;
|
||||
acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
|
||||
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
|
||||
acq_trk_diff_seconds = static_cast<float>(acq_trk_diff_samples) / static_cast<float>(d_fs_in);
|
||||
// Doppler effect
|
||||
@ -306,7 +306,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile()
|
||||
std::ifstream::pos_type size;
|
||||
int number_of_double_vars = 11;
|
||||
int number_of_float_vars = 5;
|
||||
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars +
|
||||
int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
|
||||
sizeof(float) * number_of_float_vars + sizeof(unsigned int);
|
||||
std::ifstream dump_file;
|
||||
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
@ -320,11 +320,11 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile()
|
||||
return 1;
|
||||
}
|
||||
// count number of epochs and rewind
|
||||
long int num_epoch = 0;
|
||||
int64_t num_epoch = 0;
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
size = dump_file.tellg();
|
||||
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes);
|
||||
num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
|
||||
dump_file.seekg(0, std::ios::beg);
|
||||
}
|
||||
else
|
||||
@ -336,7 +336,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile()
|
||||
float *abs_L = new float[num_epoch];
|
||||
float *Prompt_I = new float[num_epoch];
|
||||
float *Prompt_Q = new float[num_epoch];
|
||||
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch];
|
||||
uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
|
||||
double *acc_carrier_phase_rad = new double[num_epoch];
|
||||
double *carrier_doppler_hz = new double[num_epoch];
|
||||
double *code_freq_chips = new double[num_epoch];
|
||||
@ -354,14 +354,14 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile()
|
||||
{
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
for (long int i = 0; i < num_epoch; i++)
|
||||
for (int64_t i = 0; i < num_epoch; i++)
|
||||
{
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
|
||||
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
|
||||
@ -409,7 +409,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile()
|
||||
filename.erase(filename.length() - 4, 4);
|
||||
filename.append(".mat");
|
||||
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
|
||||
if (reinterpret_cast<long *>(matfp) != NULL)
|
||||
if (reinterpret_cast<int64_t *>(matfp) != NULL)
|
||||
{
|
||||
size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
|
||||
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
|
||||
@ -722,7 +722,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
|
||||
// PRN start sample stamp
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
|
||||
// accumulated carrier phase
|
||||
tmp_float = d_acc_carrier_phase_rad;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
|
@ -55,7 +55,7 @@ typedef boost::shared_ptr<Glonass_L1_Ca_Dll_Pll_Tracking_cc>
|
||||
|
||||
glonass_l1_ca_dll_pll_tracking_cc_sptr
|
||||
glonass_l1_ca_dll_pll_make_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -83,7 +83,7 @@ public:
|
||||
private:
|
||||
friend glonass_l1_ca_dll_pll_tracking_cc_sptr
|
||||
glonass_l1_ca_dll_pll_make_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -91,7 +91,7 @@ private:
|
||||
float early_late_space_chips);
|
||||
|
||||
Glonass_L1_Ca_Dll_Pll_Tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -105,8 +105,8 @@ private:
|
||||
Gnss_Synchro* d_acquisition_gnss_synchro;
|
||||
unsigned int d_channel;
|
||||
|
||||
long d_fs_in;
|
||||
long d_glonass_freq_ch;
|
||||
int64_t d_fs_in;
|
||||
int64_t d_glonass_freq_ch;
|
||||
|
||||
double d_early_late_spc_chips;
|
||||
|
||||
@ -144,8 +144,8 @@ private:
|
||||
int d_current_prn_length_samples;
|
||||
|
||||
//processing samples counters
|
||||
unsigned long int d_sample_counter;
|
||||
unsigned long int d_acq_sample_stamp;
|
||||
uint64_t d_sample_counter;
|
||||
uint64_t d_acq_sample_stamp;
|
||||
|
||||
// CN0 estimation and lock detector
|
||||
int d_cn0_estimation_counter;
|
||||
|
@ -59,7 +59,7 @@ using google::LogMessage;
|
||||
|
||||
glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr
|
||||
glonass_l2_ca_dll_pll_c_aid_make_tracking_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -99,7 +99,7 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index(pmt::pm
|
||||
|
||||
|
||||
glonass_l2_ca_dll_pll_c_aid_tracking_cc::glonass_l2_ca_dll_pll_c_aid_tracking_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -208,7 +208,7 @@ glonass_l2_ca_dll_pll_c_aid_tracking_cc::glonass_l2_ca_dll_pll_c_aid_tracking_cc
|
||||
|
||||
d_glonass_freq_ch = 0;
|
||||
|
||||
//set_min_output_buffer((long int)300);
|
||||
//set_min_output_buffer((int64_t)300);
|
||||
}
|
||||
|
||||
|
||||
@ -221,9 +221,9 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_cc::start_tracking()
|
||||
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
|
||||
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
|
||||
|
||||
long int acq_trk_diff_samples;
|
||||
int64_t acq_trk_diff_samples;
|
||||
double acq_trk_diff_seconds;
|
||||
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length;
|
||||
acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
|
||||
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
|
||||
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
|
||||
// Doppler effect
|
||||
@ -351,7 +351,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile()
|
||||
std::ifstream::pos_type size;
|
||||
int number_of_double_vars = 11;
|
||||
int number_of_float_vars = 5;
|
||||
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars +
|
||||
int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
|
||||
sizeof(float) * number_of_float_vars + sizeof(unsigned int);
|
||||
std::ifstream dump_file;
|
||||
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
@ -365,11 +365,11 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile()
|
||||
return 1;
|
||||
}
|
||||
// count number of epochs and rewind
|
||||
long int num_epoch = 0;
|
||||
int64_t num_epoch = 0;
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
size = dump_file.tellg();
|
||||
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes);
|
||||
num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
|
||||
dump_file.seekg(0, std::ios::beg);
|
||||
}
|
||||
else
|
||||
@ -381,7 +381,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile()
|
||||
float *abs_L = new float[num_epoch];
|
||||
float *Prompt_I = new float[num_epoch];
|
||||
float *Prompt_Q = new float[num_epoch];
|
||||
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch];
|
||||
uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
|
||||
double *acc_carrier_phase_rad = new double[num_epoch];
|
||||
double *carrier_doppler_hz = new double[num_epoch];
|
||||
double *code_freq_chips = new double[num_epoch];
|
||||
@ -399,14 +399,14 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile()
|
||||
{
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
for (long int i = 0; i < num_epoch; i++)
|
||||
for (int64_t i = 0; i < num_epoch; i++)
|
||||
{
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
|
||||
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
|
||||
@ -454,7 +454,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile()
|
||||
filename.erase(filename.length() - 4, 4);
|
||||
filename.append(".mat");
|
||||
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
|
||||
if (reinterpret_cast<long *>(matfp) != NULL)
|
||||
if (reinterpret_cast<int64_t *>(matfp) != NULL)
|
||||
{
|
||||
size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
|
||||
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
|
||||
@ -649,7 +649,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
|
||||
bool enable_dll_pll;
|
||||
if (d_enable_extended_integration == true)
|
||||
{
|
||||
long int symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
|
||||
int64_t symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
|
||||
if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0)
|
||||
{
|
||||
// compute coherent integration and enable tracking loop
|
||||
@ -877,7 +877,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
|
||||
// PRN start sample stamp
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
|
||||
// accumulated carrier phase
|
||||
tmp_float = d_acc_carrier_phase_cycles * GLONASS_TWO_PI;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
|
@ -56,7 +56,7 @@ typedef boost::shared_ptr<glonass_l2_ca_dll_pll_c_aid_tracking_cc>
|
||||
|
||||
glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr
|
||||
glonass_l2_ca_dll_pll_c_aid_make_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -87,7 +87,7 @@ public:
|
||||
private:
|
||||
friend glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr
|
||||
glonass_l2_ca_dll_pll_c_aid_make_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -98,7 +98,7 @@ private:
|
||||
float early_late_space_chips);
|
||||
|
||||
glonass_l2_ca_dll_pll_c_aid_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -115,7 +115,7 @@ private:
|
||||
Gnss_Synchro* d_acquisition_gnss_synchro;
|
||||
unsigned int d_channel;
|
||||
|
||||
long d_fs_in;
|
||||
int64_t d_fs_in;
|
||||
double d_glonass_freq_ch;
|
||||
|
||||
double d_early_late_spc_chips;
|
||||
@ -174,8 +174,8 @@ private:
|
||||
int d_correlation_length_samples;
|
||||
|
||||
//processing samples counters
|
||||
unsigned long int d_sample_counter;
|
||||
unsigned long int d_acq_sample_stamp;
|
||||
uint64_t d_sample_counter;
|
||||
uint64_t d_acq_sample_stamp;
|
||||
|
||||
// CN0 estimation and lock detector
|
||||
int d_cn0_estimation_counter;
|
||||
|
@ -35,7 +35,6 @@
|
||||
*/
|
||||
|
||||
#include "glonass_l2_ca_dll_pll_c_aid_tracking_sc.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include "glonass_l2_signal_processing.h"
|
||||
#include "tracking_discriminators.h"
|
||||
#include "lock_detectors.h"
|
||||
@ -59,7 +58,7 @@ using google::LogMessage;
|
||||
|
||||
glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr
|
||||
glonass_l2_ca_dll_pll_c_aid_make_tracking_sc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -98,7 +97,7 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index(pmt::pm
|
||||
}
|
||||
|
||||
glonass_l2_ca_dll_pll_c_aid_tracking_sc::glonass_l2_ca_dll_pll_c_aid_tracking_sc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -206,7 +205,7 @@ glonass_l2_ca_dll_pll_c_aid_tracking_sc::glonass_l2_ca_dll_pll_c_aid_tracking_sc
|
||||
d_carrier_doppler_old_hz = 0.0;
|
||||
|
||||
d_glonass_freq_ch = 0;
|
||||
//set_min_output_buffer((long int)300);
|
||||
//set_min_output_buffer((int64_t)300);
|
||||
}
|
||||
|
||||
|
||||
@ -219,9 +218,9 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_sc::start_tracking()
|
||||
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
|
||||
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
|
||||
|
||||
long int acq_trk_diff_samples;
|
||||
int64_t acq_trk_diff_samples;
|
||||
double acq_trk_diff_seconds;
|
||||
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length;
|
||||
acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
|
||||
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
|
||||
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
|
||||
// Doppler effect
|
||||
@ -307,7 +306,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile()
|
||||
std::ifstream::pos_type size;
|
||||
int number_of_double_vars = 11;
|
||||
int number_of_float_vars = 5;
|
||||
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars +
|
||||
int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
|
||||
sizeof(float) * number_of_float_vars + sizeof(unsigned int);
|
||||
std::ifstream dump_file;
|
||||
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
@ -321,11 +320,11 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile()
|
||||
return 1;
|
||||
}
|
||||
// count number of epochs and rewind
|
||||
long int num_epoch = 0;
|
||||
int64_t num_epoch = 0;
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
size = dump_file.tellg();
|
||||
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes);
|
||||
num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
|
||||
dump_file.seekg(0, std::ios::beg);
|
||||
}
|
||||
else
|
||||
@ -337,7 +336,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile()
|
||||
float *abs_L = new float[num_epoch];
|
||||
float *Prompt_I = new float[num_epoch];
|
||||
float *Prompt_Q = new float[num_epoch];
|
||||
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch];
|
||||
uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
|
||||
double *acc_carrier_phase_rad = new double[num_epoch];
|
||||
double *carrier_doppler_hz = new double[num_epoch];
|
||||
double *code_freq_chips = new double[num_epoch];
|
||||
@ -355,14 +354,14 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile()
|
||||
{
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
for (long int i = 0; i < num_epoch; i++)
|
||||
for (int64_t i = 0; i < num_epoch; i++)
|
||||
{
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
|
||||
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
|
||||
@ -410,7 +409,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile()
|
||||
filename.erase(filename.length() - 4, 4);
|
||||
filename.append(".mat");
|
||||
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
|
||||
if (reinterpret_cast<long *>(matfp) != NULL)
|
||||
if (reinterpret_cast<int64_t *>(matfp) != NULL)
|
||||
{
|
||||
size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
|
||||
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
|
||||
@ -642,7 +641,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
|
||||
bool enable_dll_pll;
|
||||
if (d_enable_extended_integration == true)
|
||||
{
|
||||
long int symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
|
||||
int64_t symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
|
||||
if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0)
|
||||
{
|
||||
// compute coherent integration and enable tracking loop
|
||||
@ -868,7 +867,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
|
||||
// PRN start sample stamp
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
|
||||
// accumulated carrier phase
|
||||
tmp_float = d_acc_carrier_phase_cycles * GLONASS_TWO_PI;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
|
@ -57,7 +57,7 @@ typedef boost::shared_ptr<glonass_l2_ca_dll_pll_c_aid_tracking_sc>
|
||||
|
||||
glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr
|
||||
glonass_l2_ca_dll_pll_c_aid_make_tracking_sc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -88,7 +88,7 @@ public:
|
||||
private:
|
||||
friend glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr
|
||||
glonass_l2_ca_dll_pll_c_aid_make_tracking_sc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -99,7 +99,7 @@ private:
|
||||
float early_late_space_chips);
|
||||
|
||||
glonass_l2_ca_dll_pll_c_aid_tracking_sc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -116,8 +116,8 @@ private:
|
||||
Gnss_Synchro* d_acquisition_gnss_synchro;
|
||||
unsigned int d_channel;
|
||||
|
||||
long d_fs_in;
|
||||
long d_glonass_freq_ch;
|
||||
int64_t d_fs_in;
|
||||
int64_t d_glonass_freq_ch;
|
||||
|
||||
double d_early_late_spc_chips;
|
||||
int d_n_correlator_taps;
|
||||
@ -177,8 +177,8 @@ private:
|
||||
int d_correlation_length_samples;
|
||||
|
||||
//processing samples counters
|
||||
unsigned long int d_sample_counter;
|
||||
unsigned long int d_acq_sample_stamp;
|
||||
uint64_t d_sample_counter;
|
||||
uint64_t d_acq_sample_stamp;
|
||||
|
||||
// CN0 estimation and lock detector
|
||||
int d_cn0_estimation_counter;
|
||||
|
@ -59,7 +59,7 @@ using google::LogMessage;
|
||||
|
||||
glonass_l2_ca_dll_pll_tracking_cc_sptr
|
||||
glonass_l2_ca_dll_pll_make_tracking_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -83,7 +83,7 @@ void Glonass_L2_Ca_Dll_Pll_Tracking_cc::forecast(int noutput_items,
|
||||
|
||||
|
||||
Glonass_L2_Ca_Dll_Pll_Tracking_cc::Glonass_L2_Ca_Dll_Pll_Tracking_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -182,9 +182,9 @@ void Glonass_L2_Ca_Dll_Pll_Tracking_cc::start_tracking()
|
||||
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
|
||||
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
|
||||
|
||||
long int acq_trk_diff_samples;
|
||||
int64_t acq_trk_diff_samples;
|
||||
double acq_trk_diff_seconds;
|
||||
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length;
|
||||
acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
|
||||
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
|
||||
acq_trk_diff_seconds = static_cast<float>(acq_trk_diff_samples) / static_cast<float>(d_fs_in);
|
||||
// Doppler effect
|
||||
@ -306,7 +306,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile()
|
||||
std::ifstream::pos_type size;
|
||||
int number_of_double_vars = 11;
|
||||
int number_of_float_vars = 5;
|
||||
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars +
|
||||
int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
|
||||
sizeof(float) * number_of_float_vars + sizeof(unsigned int);
|
||||
std::ifstream dump_file;
|
||||
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
@ -320,11 +320,11 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile()
|
||||
return 1;
|
||||
}
|
||||
// count number of epochs and rewind
|
||||
long int num_epoch = 0;
|
||||
int64_t num_epoch = 0;
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
size = dump_file.tellg();
|
||||
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes);
|
||||
num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
|
||||
dump_file.seekg(0, std::ios::beg);
|
||||
}
|
||||
else
|
||||
@ -336,7 +336,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile()
|
||||
float *abs_L = new float[num_epoch];
|
||||
float *Prompt_I = new float[num_epoch];
|
||||
float *Prompt_Q = new float[num_epoch];
|
||||
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch];
|
||||
uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
|
||||
double *acc_carrier_phase_rad = new double[num_epoch];
|
||||
double *carrier_doppler_hz = new double[num_epoch];
|
||||
double *code_freq_chips = new double[num_epoch];
|
||||
@ -354,14 +354,14 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile()
|
||||
{
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
for (long int i = 0; i < num_epoch; i++)
|
||||
for (int64_t i = 0; i < num_epoch; i++)
|
||||
{
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
|
||||
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
|
||||
@ -409,7 +409,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile()
|
||||
filename.erase(filename.length() - 4, 4);
|
||||
filename.append(".mat");
|
||||
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
|
||||
if (reinterpret_cast<long *>(matfp) != NULL)
|
||||
if (reinterpret_cast<int64_t *>(matfp) != NULL)
|
||||
{
|
||||
size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
|
||||
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
|
||||
@ -722,7 +722,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
|
||||
// PRN start sample stamp
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
|
||||
// accumulated carrier phase
|
||||
tmp_float = d_acc_carrier_phase_rad;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
|
@ -53,7 +53,7 @@ typedef boost::shared_ptr<Glonass_L2_Ca_Dll_Pll_Tracking_cc>
|
||||
|
||||
glonass_l2_ca_dll_pll_tracking_cc_sptr
|
||||
glonass_l2_ca_dll_pll_make_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -81,7 +81,7 @@ public:
|
||||
private:
|
||||
friend glonass_l2_ca_dll_pll_tracking_cc_sptr
|
||||
glonass_l2_ca_dll_pll_make_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -89,7 +89,7 @@ private:
|
||||
float early_late_space_chips);
|
||||
|
||||
Glonass_L2_Ca_Dll_Pll_Tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -103,8 +103,8 @@ private:
|
||||
Gnss_Synchro* d_acquisition_gnss_synchro;
|
||||
unsigned int d_channel;
|
||||
|
||||
long d_fs_in;
|
||||
long d_glonass_freq_ch;
|
||||
int64_t d_fs_in;
|
||||
int64_t d_glonass_freq_ch;
|
||||
|
||||
double d_early_late_spc_chips;
|
||||
|
||||
@ -142,8 +142,8 @@ private:
|
||||
int d_current_prn_length_samples;
|
||||
|
||||
//processing samples counters
|
||||
unsigned long int d_sample_counter;
|
||||
unsigned long int d_acq_sample_stamp;
|
||||
uint64_t d_sample_counter;
|
||||
uint64_t d_acq_sample_stamp;
|
||||
|
||||
// CN0 estimation and lock detector
|
||||
int d_cn0_estimation_counter;
|
||||
|
@ -51,7 +51,7 @@ using google::LogMessage;
|
||||
|
||||
gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr
|
||||
gps_l1_ca_dll_pll_c_aid_make_tracking_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -91,7 +91,7 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index(pmt::pmt_t
|
||||
|
||||
|
||||
gps_l1_ca_dll_pll_c_aid_tracking_cc::gps_l1_ca_dll_pll_c_aid_tracking_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -195,7 +195,7 @@ gps_l1_ca_dll_pll_c_aid_tracking_cc::gps_l1_ca_dll_pll_c_aid_tracking_cc(
|
||||
d_code_error_filt_chips_s = 0.0;
|
||||
d_carr_phase_error_secs_Ti = 0.0;
|
||||
d_preamble_timestamp_s = 0.0;
|
||||
//set_min_output_buffer((long int)300);
|
||||
//set_min_output_buffer((int64_t)300);
|
||||
}
|
||||
|
||||
|
||||
@ -208,9 +208,9 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking()
|
||||
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
|
||||
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
|
||||
|
||||
long int acq_trk_diff_samples;
|
||||
int64_t acq_trk_diff_samples;
|
||||
double acq_trk_diff_seconds;
|
||||
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length;
|
||||
acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
|
||||
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
|
||||
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
|
||||
// Doppler effect
|
||||
@ -333,7 +333,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
|
||||
std::ifstream::pos_type size;
|
||||
int number_of_double_vars = 11;
|
||||
int number_of_float_vars = 5;
|
||||
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars +
|
||||
int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
|
||||
sizeof(float) * number_of_float_vars + sizeof(unsigned int);
|
||||
std::ifstream dump_file;
|
||||
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
@ -347,11 +347,11 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
|
||||
return 1;
|
||||
}
|
||||
// count number of epochs and rewind
|
||||
long int num_epoch = 0;
|
||||
int64_t num_epoch = 0;
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
size = dump_file.tellg();
|
||||
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes);
|
||||
num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
|
||||
dump_file.seekg(0, std::ios::beg);
|
||||
}
|
||||
else
|
||||
@ -363,7 +363,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
|
||||
float *abs_L = new float[num_epoch];
|
||||
float *Prompt_I = new float[num_epoch];
|
||||
float *Prompt_Q = new float[num_epoch];
|
||||
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch];
|
||||
uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
|
||||
double *acc_carrier_phase_rad = new double[num_epoch];
|
||||
double *carrier_doppler_hz = new double[num_epoch];
|
||||
double *code_freq_chips = new double[num_epoch];
|
||||
@ -381,14 +381,14 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
|
||||
{
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
for (long int i = 0; i < num_epoch; i++)
|
||||
for (int64_t i = 0; i < num_epoch; i++)
|
||||
{
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
|
||||
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
|
||||
@ -436,7 +436,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile()
|
||||
filename.erase(filename.length() - 4, 4);
|
||||
filename.append(".mat");
|
||||
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
|
||||
if (reinterpret_cast<long *>(matfp) != NULL)
|
||||
if (reinterpret_cast<int64_t *>(matfp) != NULL)
|
||||
{
|
||||
size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
|
||||
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
|
||||
@ -631,7 +631,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attrib
|
||||
bool enable_dll_pll;
|
||||
if (d_enable_extended_integration == true)
|
||||
{
|
||||
long int symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
|
||||
int64_t symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
|
||||
if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0)
|
||||
{
|
||||
// compute coherent integration and enable tracking loop
|
||||
@ -858,7 +858,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attrib
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
|
||||
// PRN start sample stamp
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
|
||||
// accumulated carrier phase
|
||||
tmp_float = d_acc_carrier_phase_cycles * GPS_TWO_PI;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
|
@ -56,7 +56,7 @@ typedef boost::shared_ptr<gps_l1_ca_dll_pll_c_aid_tracking_cc>
|
||||
|
||||
gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr
|
||||
gps_l1_ca_dll_pll_c_aid_make_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -87,7 +87,7 @@ public:
|
||||
private:
|
||||
friend gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr
|
||||
gps_l1_ca_dll_pll_c_aid_make_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -98,7 +98,7 @@ private:
|
||||
float early_late_space_chips);
|
||||
|
||||
gps_l1_ca_dll_pll_c_aid_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -114,7 +114,7 @@ private:
|
||||
|
||||
Gnss_Synchro* d_acquisition_gnss_synchro;
|
||||
unsigned int d_channel;
|
||||
long d_fs_in;
|
||||
int64_t d_fs_in;
|
||||
|
||||
double d_early_late_spc_chips;
|
||||
int d_n_correlator_taps;
|
||||
@ -170,8 +170,8 @@ private:
|
||||
int d_correlation_length_samples;
|
||||
|
||||
//processing samples counters
|
||||
unsigned long int d_sample_counter;
|
||||
unsigned long int d_acq_sample_stamp;
|
||||
uint64_t d_sample_counter;
|
||||
uint64_t d_acq_sample_stamp;
|
||||
|
||||
// CN0 estimation and lock detector
|
||||
int d_cn0_estimation_counter;
|
||||
|
@ -29,7 +29,6 @@
|
||||
*/
|
||||
|
||||
#include "gps_l1_ca_dll_pll_c_aid_tracking_sc.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include "gps_sdr_signal_processing.h"
|
||||
#include "tracking_discriminators.h"
|
||||
#include "lock_detectors.h"
|
||||
@ -52,7 +51,7 @@ using google::LogMessage;
|
||||
|
||||
gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr
|
||||
gps_l1_ca_dll_pll_c_aid_make_tracking_sc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -91,7 +90,7 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index(pmt::pmt_t
|
||||
}
|
||||
|
||||
gps_l1_ca_dll_pll_c_aid_tracking_sc::gps_l1_ca_dll_pll_c_aid_tracking_sc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -195,7 +194,7 @@ gps_l1_ca_dll_pll_c_aid_tracking_sc::gps_l1_ca_dll_pll_c_aid_tracking_sc(
|
||||
d_code_error_filt_chips_Ti = 0.0;
|
||||
d_preamble_timestamp_s = 0.0;
|
||||
d_carr_phase_error_secs_Ti = 0.0;
|
||||
//set_min_output_buffer((long int)300);
|
||||
//set_min_output_buffer((int64_t)300);
|
||||
}
|
||||
|
||||
|
||||
@ -208,9 +207,9 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking()
|
||||
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
|
||||
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
|
||||
|
||||
long int acq_trk_diff_samples;
|
||||
int64_t acq_trk_diff_samples;
|
||||
double acq_trk_diff_seconds;
|
||||
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length;
|
||||
acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
|
||||
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
|
||||
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
|
||||
// Doppler effect
|
||||
@ -336,7 +335,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
|
||||
std::ifstream::pos_type size;
|
||||
int number_of_double_vars = 11;
|
||||
int number_of_float_vars = 5;
|
||||
int epoch_size_bytes = sizeof(unsigned long int) + sizeof(double) * number_of_double_vars +
|
||||
int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
|
||||
sizeof(float) * number_of_float_vars + sizeof(unsigned int);
|
||||
std::ifstream dump_file;
|
||||
dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
@ -350,11 +349,11 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
|
||||
return 1;
|
||||
}
|
||||
// count number of epochs and rewind
|
||||
long int num_epoch = 0;
|
||||
int64_t num_epoch = 0;
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
size = dump_file.tellg();
|
||||
num_epoch = static_cast<long int>(size) / static_cast<long int>(epoch_size_bytes);
|
||||
num_epoch = static_cast<int64_t>(size) / static_cast<int64_t>(epoch_size_bytes);
|
||||
dump_file.seekg(0, std::ios::beg);
|
||||
}
|
||||
else
|
||||
@ -366,7 +365,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
|
||||
float *abs_L = new float[num_epoch];
|
||||
float *Prompt_I = new float[num_epoch];
|
||||
float *Prompt_Q = new float[num_epoch];
|
||||
unsigned long int *PRN_start_sample_count = new unsigned long int[num_epoch];
|
||||
uint64_t *PRN_start_sample_count = new uint64_t[num_epoch];
|
||||
double *acc_carrier_phase_rad = new double[num_epoch];
|
||||
double *carrier_doppler_hz = new double[num_epoch];
|
||||
double *code_freq_chips = new double[num_epoch];
|
||||
@ -384,14 +383,14 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
|
||||
{
|
||||
if (dump_file.is_open())
|
||||
{
|
||||
for (long int i = 0; i < num_epoch; i++)
|
||||
for (int64_t i = 0; i < num_epoch; i++)
|
||||
{
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_E[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_P[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&abs_L[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_I[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&Prompt_Q[i]), sizeof(float));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(unsigned long int));
|
||||
dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count[i]), sizeof(uint64_t));
|
||||
dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz[i]), sizeof(double));
|
||||
dump_file.read(reinterpret_cast<char *>(&code_freq_chips[i]), sizeof(double));
|
||||
@ -439,7 +438,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile()
|
||||
filename.erase(filename.length() - 4, 4);
|
||||
filename.append(".mat");
|
||||
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
|
||||
if (reinterpret_cast<long *>(matfp) != NULL)
|
||||
if (reinterpret_cast<int64_t *>(matfp) != NULL)
|
||||
{
|
||||
size_t dims[2] = {1, static_cast<size_t>(num_epoch)};
|
||||
matvar = Mat_VarCreate("abs_E", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_E, 0);
|
||||
@ -634,7 +633,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __attrib
|
||||
bool enable_dll_pll;
|
||||
if (d_enable_extended_integration == true)
|
||||
{
|
||||
long int symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
|
||||
int64_t symbol_diff = round(1000.0 * ((static_cast<double>(d_sample_counter) + d_rem_code_phase_samples) / static_cast<double>(d_fs_in) - d_preamble_timestamp_s));
|
||||
if (symbol_diff > 0 and symbol_diff % d_extend_correlation_ms == 0)
|
||||
{
|
||||
// compute coherent integration and enable tracking loop
|
||||
@ -860,7 +859,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __attrib
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
|
||||
// PRN start sample stamp
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
|
||||
// accumulated carrier phase
|
||||
tmp_float = d_acc_carrier_phase_cycles * GPS_TWO_PI;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
|
@ -57,7 +57,7 @@ typedef boost::shared_ptr<gps_l1_ca_dll_pll_c_aid_tracking_sc>
|
||||
|
||||
gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr
|
||||
gps_l1_ca_dll_pll_c_aid_make_tracking_sc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -88,7 +88,7 @@ public:
|
||||
private:
|
||||
friend gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr
|
||||
gps_l1_ca_dll_pll_c_aid_make_tracking_sc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -99,7 +99,7 @@ private:
|
||||
float early_late_space_chips);
|
||||
|
||||
gps_l1_ca_dll_pll_c_aid_tracking_sc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -116,7 +116,7 @@ private:
|
||||
Gnss_Synchro* d_acquisition_gnss_synchro;
|
||||
unsigned int d_channel;
|
||||
|
||||
long d_fs_in;
|
||||
int64_t d_fs_in;
|
||||
|
||||
double d_early_late_spc_chips;
|
||||
int d_n_correlator_taps;
|
||||
@ -174,8 +174,8 @@ private:
|
||||
int d_correlation_length_samples;
|
||||
|
||||
//processing samples counters
|
||||
unsigned long int d_sample_counter;
|
||||
unsigned long int d_acq_sample_stamp;
|
||||
uint64_t d_sample_counter;
|
||||
uint64_t d_acq_sample_stamp;
|
||||
|
||||
// CN0 estimation and lock detector
|
||||
int d_cn0_estimation_counter;
|
||||
|
@ -49,7 +49,7 @@ using google::LogMessage;
|
||||
|
||||
gps_l1_ca_dll_pll_tracking_gpu_cc_sptr
|
||||
gps_l1_ca_dll_pll_make_tracking_gpu_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -73,7 +73,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::forecast(int noutput_items,
|
||||
|
||||
|
||||
Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -163,7 +163,7 @@ Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc(
|
||||
d_rem_code_phase_chips = 0.0;
|
||||
d_code_phase_step_chips = 0.0;
|
||||
d_carrier_phase_step_rad = 0.0;
|
||||
//set_min_output_buffer((long int)300);
|
||||
//set_min_output_buffer((int64_t)300);
|
||||
}
|
||||
|
||||
|
||||
@ -176,9 +176,9 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::start_tracking()
|
||||
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
|
||||
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
|
||||
|
||||
long int acq_trk_diff_samples;
|
||||
int64_t acq_trk_diff_samples;
|
||||
double acq_trk_diff_seconds;
|
||||
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp); //-d_vector_length;
|
||||
acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp); //-d_vector_length;
|
||||
DLOG(INFO) << "Number of samples between Acquisition and Tracking =" << acq_trk_diff_samples;
|
||||
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
|
||||
//doppler effect
|
||||
@ -516,7 +516,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribut
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
|
||||
// PRN start sample stamp
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
|
||||
// accumulated carrier phase
|
||||
tmp_float = d_acc_carrier_phase_cycles * GPS_TWO_PI;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
|
@ -53,7 +53,7 @@ typedef boost::shared_ptr<Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc>
|
||||
|
||||
gps_l1_ca_dll_pll_tracking_gpu_cc_sptr
|
||||
gps_l1_ca_dll_pll_make_tracking_gpu_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -82,7 +82,7 @@ public:
|
||||
private:
|
||||
friend gps_l1_ca_dll_pll_tracking_gpu_cc_sptr
|
||||
gps_l1_ca_dll_pll_make_tracking_gpu_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -91,7 +91,7 @@ private:
|
||||
float early_late_space_chips);
|
||||
|
||||
Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -108,8 +108,8 @@ private:
|
||||
Gnss_Synchro *d_acquisition_gnss_synchro;
|
||||
unsigned int d_channel;
|
||||
|
||||
long d_if_freq;
|
||||
long d_fs_in;
|
||||
int64_t d_if_freq;
|
||||
int64_t d_fs_in;
|
||||
|
||||
double d_early_late_spc_chips;
|
||||
int d_n_correlator_taps;
|
||||
@ -153,8 +153,8 @@ private:
|
||||
int d_correlation_length_samples;
|
||||
|
||||
//processing samples counters
|
||||
unsigned long int d_sample_counter;
|
||||
unsigned long int d_acq_sample_stamp;
|
||||
uint64_t d_sample_counter;
|
||||
uint64_t d_acq_sample_stamp;
|
||||
|
||||
// CN0 estimation and lock detector
|
||||
int d_cn0_estimation_counter;
|
||||
|
@ -58,7 +58,7 @@ using google::LogMessage;
|
||||
|
||||
gps_l1_ca_tcp_connector_tracking_cc_sptr
|
||||
gps_l1_ca_tcp_connector_make_tracking_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -81,7 +81,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::forecast(int noutput_items,
|
||||
|
||||
|
||||
Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc(
|
||||
long fs_in,
|
||||
int64_t fs_in,
|
||||
unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
@ -186,9 +186,9 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking()
|
||||
d_acq_carrier_doppler_hz = d_acquisition_gnss_synchro->Acq_doppler_hz;
|
||||
d_acq_sample_stamp = d_acquisition_gnss_synchro->Acq_samplestamp_samples;
|
||||
|
||||
long int acq_trk_diff_samples;
|
||||
int64_t acq_trk_diff_samples;
|
||||
float acq_trk_diff_seconds;
|
||||
acq_trk_diff_samples = static_cast<long int>(d_sample_counter) - static_cast<long int>(d_acq_sample_stamp);
|
||||
acq_trk_diff_samples = static_cast<int64_t>(d_sample_counter) - static_cast<int64_t>(d_acq_sample_stamp);
|
||||
std::cout << "acq_trk_diff_samples=" << acq_trk_diff_samples << std::endl;
|
||||
acq_trk_diff_seconds = static_cast<float>(acq_trk_diff_samples) / static_cast<float>(d_fs_in);
|
||||
//doppler effect
|
||||
@ -535,7 +535,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_I), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prompt_Q), sizeof(float));
|
||||
// PRN start sample stamp
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(uint64_t));
|
||||
// accumulated carrier phase
|
||||
tmp_float = d_acc_carrier_phase_rad;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
|
@ -52,7 +52,7 @@ typedef boost::shared_ptr<Gps_L1_Ca_Tcp_Connector_Tracking_cc> gps_l1_ca_tcp_con
|
||||
|
||||
gps_l1_ca_tcp_connector_tracking_cc_sptr
|
||||
gps_l1_ca_tcp_connector_make_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float early_late_space_chips,
|
||||
@ -84,14 +84,14 @@ public:
|
||||
private:
|
||||
friend gps_l1_ca_tcp_connector_tracking_cc_sptr
|
||||
gps_l1_ca_tcp_connector_make_tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float early_late_space_chips,
|
||||
size_t port_ch0);
|
||||
|
||||
Gps_L1_Ca_Tcp_Connector_Tracking_cc(
|
||||
long fs_in, unsigned int vector_length,
|
||||
int64_t fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float early_late_space_chips,
|
||||
@ -104,7 +104,7 @@ private:
|
||||
Gnss_Synchro *d_acquisition_gnss_synchro;
|
||||
unsigned int d_channel;
|
||||
|
||||
long d_fs_in;
|
||||
int64_t d_fs_in;
|
||||
int d_correlation_length_samples;
|
||||
int d_n_correlator_taps;
|
||||
double d_early_late_spc_chips;
|
||||
@ -147,8 +147,8 @@ private:
|
||||
double d_sample_counter_seconds;
|
||||
|
||||
//processing samples counters
|
||||
unsigned long int d_sample_counter;
|
||||
unsigned long int d_acq_sample_stamp;
|
||||
uint64_t d_sample_counter;
|
||||
uint64_t d_acq_sample_stamp;
|
||||
|
||||
// CN0 estimation and lock detector
|
||||
int d_cn0_estimation_counter;
|
||||
|
@ -450,9 +450,9 @@ void Galileo_Fnav_Message::decode_page(std::string data)
|
||||
}
|
||||
|
||||
|
||||
unsigned long int Galileo_Fnav_Message::read_navigation_unsigned(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
uint64_t Galileo_Fnav_Message::read_navigation_unsigned(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
{
|
||||
unsigned long int value = 0;
|
||||
uint64_t value = 0;
|
||||
int num_of_slices = parameter.size();
|
||||
for (int i = 0; i < num_of_slices; i++)
|
||||
{
|
||||
@ -469,12 +469,12 @@ unsigned long int Galileo_Fnav_Message::read_navigation_unsigned(std::bitset<GAL
|
||||
}
|
||||
|
||||
|
||||
signed long int Galileo_Fnav_Message::read_navigation_signed(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
int64_t Galileo_Fnav_Message::read_navigation_signed(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
{
|
||||
signed long int value = 0;
|
||||
int64_t value = 0;
|
||||
int num_of_slices = parameter.size();
|
||||
// Discriminate between 64 bits and 32 bits compiler
|
||||
int long_int_size_bytes = sizeof(signed long int);
|
||||
int long_int_size_bytes = sizeof(int64_t);
|
||||
if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system
|
||||
{
|
||||
// read the MSB and perform the sign extension
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include "Galileo_E5a.h"
|
||||
#include <boost/cstdint.hpp> // for boost::uint16_t
|
||||
#include <bitset>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
@ -213,8 +214,8 @@ public:
|
||||
private:
|
||||
bool _CRC_test(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, boost::uint32_t checksum);
|
||||
void decode_page(std::string data);
|
||||
unsigned long int read_navigation_unsigned(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
signed long int read_navigation_signed(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
uint64_t read_navigation_unsigned(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
int64_t read_navigation_signed(std::bitset<GALILEO_FNAV_DATA_FRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
|
||||
std::string omega0_1;
|
||||
//std::string omega0_2;
|
||||
|
@ -258,9 +258,9 @@ bool Galileo_Navigation_Message::CRC_test(std::bitset<GALILEO_DATA_FRAME_BITS> b
|
||||
}
|
||||
|
||||
|
||||
unsigned long int Galileo_Navigation_Message::read_navigation_unsigned(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter)
|
||||
uint64_t Galileo_Navigation_Message::read_navigation_unsigned(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter)
|
||||
{
|
||||
unsigned long int value = 0;
|
||||
uint64_t value = 0;
|
||||
int num_of_slices = parameter.size();
|
||||
for (int i = 0; i < num_of_slices; i++)
|
||||
{
|
||||
@ -277,9 +277,9 @@ unsigned long int Galileo_Navigation_Message::read_navigation_unsigned(std::bits
|
||||
}
|
||||
|
||||
|
||||
unsigned long int Galileo_Navigation_Message::read_page_type_unsigned(std::bitset<GALILEO_PAGE_TYPE_BITS> bits, const std::vector<std::pair<int, int> > parameter)
|
||||
uint64_t Galileo_Navigation_Message::read_page_type_unsigned(std::bitset<GALILEO_PAGE_TYPE_BITS> bits, const std::vector<std::pair<int, int> > parameter)
|
||||
{
|
||||
unsigned long int value = 0;
|
||||
uint64_t value = 0;
|
||||
int num_of_slices = parameter.size();
|
||||
for (int i = 0; i < num_of_slices; i++)
|
||||
{
|
||||
@ -296,12 +296,12 @@ unsigned long int Galileo_Navigation_Message::read_page_type_unsigned(std::bitse
|
||||
}
|
||||
|
||||
|
||||
signed long int Galileo_Navigation_Message::read_navigation_signed(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter)
|
||||
int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter)
|
||||
{
|
||||
signed long int value = 0;
|
||||
int64_t value = 0;
|
||||
int num_of_slices = parameter.size();
|
||||
// Discriminate between 64 bits and 32 bits compiler
|
||||
int long_int_size_bytes = sizeof(signed long int);
|
||||
int long_int_size_bytes = sizeof(int64_t);
|
||||
if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system
|
||||
{
|
||||
// read the MSB and perform the sign extension
|
||||
|
@ -38,8 +38,9 @@
|
||||
#include "galileo_almanac.h"
|
||||
#include "galileo_utc_model.h"
|
||||
#include "Galileo_E1.h"
|
||||
#include <boost/cstdint.hpp> // for boost::uint32_t
|
||||
//#include <boost/cstdint.hpp> // for boost::uint32_t
|
||||
#include <bitset>
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
@ -54,12 +55,12 @@
|
||||
class Galileo_Navigation_Message
|
||||
{
|
||||
private:
|
||||
bool CRC_test(std::bitset<GALILEO_DATA_FRAME_BITS> bits, boost::uint32_t checksum);
|
||||
bool CRC_test(std::bitset<GALILEO_DATA_FRAME_BITS> bits, uint32_t checksum);
|
||||
bool read_navigation_bool(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter);
|
||||
//void print_galileo_word_bytes(unsigned int GPS_word);
|
||||
unsigned long int read_navigation_unsigned(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter);
|
||||
unsigned long int read_page_type_unsigned(std::bitset<GALILEO_PAGE_TYPE_BITS> bits, const std::vector<std::pair<int, int> > parameter);
|
||||
signed long int read_navigation_signed(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter);
|
||||
uint64_t read_navigation_unsigned(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter);
|
||||
uint64_t read_page_type_unsigned(std::bitset<GALILEO_PAGE_TYPE_BITS> bits, const std::vector<std::pair<int, int> > parameter);
|
||||
int64_t read_navigation_signed(std::bitset<GALILEO_DATA_JK_BITS> bits, const std::vector<std::pair<int, int> > parameter);
|
||||
|
||||
public:
|
||||
int Page_type_time_stamp;
|
||||
|
@ -228,9 +228,9 @@ bool Glonass_Gnav_Navigation_Message::read_navigation_bool(std::bitset<GLONASS_G
|
||||
}
|
||||
|
||||
|
||||
unsigned long int Glonass_Gnav_Navigation_Message::read_navigation_unsigned(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
uint64_t Glonass_Gnav_Navigation_Message::read_navigation_unsigned(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
{
|
||||
unsigned long int value = 0;
|
||||
uint64_t value = 0;
|
||||
int num_of_slices = parameter.size();
|
||||
for (int i = 0; i < num_of_slices; i++)
|
||||
{
|
||||
@ -247,10 +247,10 @@ unsigned long int Glonass_Gnav_Navigation_Message::read_navigation_unsigned(std:
|
||||
}
|
||||
|
||||
|
||||
signed long int Glonass_Gnav_Navigation_Message::read_navigation_signed(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
int64_t Glonass_Gnav_Navigation_Message::read_navigation_signed(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
{
|
||||
signed long int value = 0;
|
||||
signed long int sign = 0;
|
||||
int64_t value = 0;
|
||||
int64_t sign = 0;
|
||||
int num_of_slices = parameter.size();
|
||||
// read the MSB and perform the sign extension
|
||||
if (bits[GLONASS_GNAV_STRING_BITS - parameter[0].first] == 1)
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include "glonass_gnav_utc_model.h"
|
||||
#include "GLONASS_L1_L2_CA.h"
|
||||
#include <bitset>
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
/*!
|
||||
@ -50,8 +51,8 @@
|
||||
class Glonass_Gnav_Navigation_Message
|
||||
{
|
||||
private:
|
||||
unsigned long int read_navigation_unsigned(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
signed long int read_navigation_signed(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
uint64_t read_navigation_unsigned(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
int64_t read_navigation_signed(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
bool read_navigation_bool(std::bitset<GLONASS_GNAV_STRING_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
|
||||
public:
|
||||
|
@ -33,7 +33,7 @@
|
||||
#define GNSS_SDR_GNSS_SYNCHRO_H_
|
||||
|
||||
#include "gnss_signal.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
/*!
|
||||
* \brief This is the class that contains the information that is shared
|
||||
@ -43,31 +43,31 @@ class Gnss_Synchro
|
||||
{
|
||||
public:
|
||||
// Satellite and signal info
|
||||
char System; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal)
|
||||
char Signal[3]; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal)
|
||||
unsigned int PRN; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal)
|
||||
int Channel_ID; //!< Set by Channel constructor
|
||||
char System; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal)
|
||||
char Signal[3]; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal)
|
||||
uint32_t PRN; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal)
|
||||
int32_t Channel_ID; //!< Set by Channel constructor
|
||||
// Acquisition
|
||||
double Acq_delay_samples; //!< Set by Acquisition processing block
|
||||
double Acq_doppler_hz; //!< Set by Acquisition processing block
|
||||
unsigned long int Acq_samplestamp_samples; //!< Set by Acquisition processing block
|
||||
bool Flag_valid_acquisition; //!< Set by Acquisition processing block
|
||||
double Acq_delay_samples; //!< Set by Acquisition processing block
|
||||
double Acq_doppler_hz; //!< Set by Acquisition processing block
|
||||
uint64_t Acq_samplestamp_samples; //!< Set by Acquisition processing block
|
||||
bool Flag_valid_acquisition; //!< Set by Acquisition processing block
|
||||
//Tracking
|
||||
long int fs; //!< Set by Tracking processing block
|
||||
double Prompt_I; //!< Set by Tracking processing block
|
||||
double Prompt_Q; //!< Set by Tracking processing block
|
||||
double CN0_dB_hz; //!< Set by Tracking processing block
|
||||
double Carrier_Doppler_hz; //!< Set by Tracking processing block
|
||||
double Carrier_phase_rads; //!< Set by Tracking processing block
|
||||
double Code_phase_samples; //!< Set by Tracking processing block
|
||||
unsigned long int Tracking_sample_counter; //!< Set by Tracking processing block
|
||||
int64_t fs; //!< Set by Tracking processing block
|
||||
double Prompt_I; //!< Set by Tracking processing block
|
||||
double Prompt_Q; //!< Set by Tracking processing block
|
||||
double CN0_dB_hz; //!< Set by Tracking processing block
|
||||
double Carrier_Doppler_hz; //!< Set by Tracking processing block
|
||||
double Carrier_phase_rads; //!< Set by Tracking processing block
|
||||
double Code_phase_samples; //!< Set by Tracking processing block
|
||||
uint64_t Tracking_sample_counter; //!< Set by Tracking processing block
|
||||
|
||||
bool Flag_valid_symbol_output; //!< Set by Tracking processing block
|
||||
int correlation_length_ms; //!< Set by Tracking processing block
|
||||
int32_t correlation_length_ms; //!< Set by Tracking processing block
|
||||
|
||||
//Telemetry Decoder
|
||||
bool Flag_valid_word; //!< Set by Telemetry Decoder processing block
|
||||
unsigned int TOW_at_current_symbol_ms; //!< Set by Telemetry Decoder processing block
|
||||
bool Flag_valid_word; //!< Set by Telemetry Decoder processing block
|
||||
uint32_t TOW_at_current_symbol_ms; //!< Set by Telemetry Decoder processing block
|
||||
|
||||
// Observables
|
||||
double Pseudorange_m; //!< Set by Observables processing block
|
||||
|
@ -88,9 +88,9 @@ bool Gps_CNAV_Navigation_Message::read_navigation_bool(std::bitset<GPS_CNAV_DATA
|
||||
}
|
||||
|
||||
|
||||
unsigned long int Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
uint64_t Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
{
|
||||
unsigned long int value = 0;
|
||||
uint64_t value = 0;
|
||||
int num_of_slices = parameter.size();
|
||||
for (int i = 0; i < num_of_slices; i++)
|
||||
{
|
||||
@ -107,12 +107,12 @@ unsigned long int Gps_CNAV_Navigation_Message::read_navigation_unsigned(std::bit
|
||||
}
|
||||
|
||||
|
||||
signed long int Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
int64_t Gps_CNAV_Navigation_Message::read_navigation_signed(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
{
|
||||
signed long int value = 0;
|
||||
int64_t value = 0;
|
||||
int num_of_slices = parameter.size();
|
||||
// Discriminate between 64 bits and 32 bits compiler
|
||||
int long_int_size_bytes = sizeof(signed long int);
|
||||
int long_int_size_bytes = sizeof(int64_t);
|
||||
if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system
|
||||
{
|
||||
// read the MSB and perform the sign extension
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "gps_cnav_iono.h"
|
||||
#include "gps_cnav_utc_model.h"
|
||||
#include <bitset>
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -55,8 +56,8 @@
|
||||
class Gps_CNAV_Navigation_Message
|
||||
{
|
||||
private:
|
||||
unsigned long int read_navigation_unsigned(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
signed long int read_navigation_signed(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
uint64_t read_navigation_unsigned(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
int64_t read_navigation_signed(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
bool read_navigation_bool(std::bitset<GPS_CNAV_DATA_PAGE_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
|
||||
Gps_CNAV_Ephemeris ephemeris_record;
|
||||
|
@ -176,9 +176,9 @@ bool Gps_Navigation_Message::read_navigation_bool(std::bitset<GPS_SUBFRAME_BITS>
|
||||
}
|
||||
|
||||
|
||||
unsigned long int Gps_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
uint64_t Gps_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
{
|
||||
unsigned long int value = 0;
|
||||
uint64_t value = 0;
|
||||
int num_of_slices = parameter.size();
|
||||
for (int i = 0; i < num_of_slices; i++)
|
||||
{
|
||||
@ -195,12 +195,12 @@ unsigned long int Gps_Navigation_Message::read_navigation_unsigned(std::bitset<G
|
||||
}
|
||||
|
||||
|
||||
signed long int Gps_Navigation_Message::read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
int64_t Gps_Navigation_Message::read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter)
|
||||
{
|
||||
signed long int value = 0;
|
||||
int64_t value = 0;
|
||||
int num_of_slices = parameter.size();
|
||||
// Discriminate between 64 bits and 32 bits compiler
|
||||
int long_int_size_bytes = sizeof(signed long int);
|
||||
int long_int_size_bytes = sizeof(int64_t);
|
||||
if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system
|
||||
{
|
||||
// read the MSB and perform the sign extension
|
||||
@ -279,114 +279,116 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
|
||||
|
||||
// Decode all 5 sub-frames
|
||||
switch (subframe_ID)
|
||||
{
|
||||
//--- Decode the sub-frame id ------------------------------------------
|
||||
// ICD (IS-GPS-200E Appendix II). http://www.losangeles.af.mil/shared/media/document/AFD-100813-045.pdf
|
||||
case 1:
|
||||
//--- It is subframe 1 -------------------------------------
|
||||
// Compute the time of week (TOW) of the first sub-frames in the array ====
|
||||
// The transmitted TOW is actual TOW of the next subframe
|
||||
// (the variable subframe at this point contains bits of the last subframe).
|
||||
//TOW = bin2dec(subframe(31:47)) * 6;
|
||||
d_TOW_SF1 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW));
|
||||
//we are in the first subframe (the transmitted TOW is the start time of the next subframe) !
|
||||
d_TOW_SF1 = d_TOW_SF1 * 6.0;
|
||||
d_TOW = d_TOW_SF1; // Set transmission time
|
||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||
i_GPS_week = static_cast<int>(read_navigation_unsigned(subframe_bits, GPS_WEEK));
|
||||
i_SV_accuracy = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_ACCURACY)); // (20.3.3.3.1.3)
|
||||
i_SV_health = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_HEALTH));
|
||||
b_L2_P_data_flag = read_navigation_bool(subframe_bits, L2_P_DATA_FLAG); //
|
||||
i_code_on_L2 = static_cast<int>(read_navigation_unsigned(subframe_bits, CA_OR_P_ON_L2));
|
||||
d_TGD = static_cast<double>(read_navigation_signed(subframe_bits, T_GD));
|
||||
d_TGD = d_TGD * T_GD_LSB;
|
||||
d_IODC = static_cast<double>(read_navigation_unsigned(subframe_bits, IODC));
|
||||
d_Toc = static_cast<double>(read_navigation_unsigned(subframe_bits, T_OC));
|
||||
d_Toc = d_Toc * T_OC_LSB;
|
||||
d_A_f0 = static_cast<double>(read_navigation_signed(subframe_bits, A_F0));
|
||||
d_A_f0 = d_A_f0 * A_F0_LSB;
|
||||
d_A_f1 = static_cast<double>(read_navigation_signed(subframe_bits, A_F1));
|
||||
d_A_f1 = d_A_f1 * A_F1_LSB;
|
||||
d_A_f2 = static_cast<double>(read_navigation_signed(subframe_bits, A_F2));
|
||||
d_A_f2 = d_A_f2 * A_F2_LSB;
|
||||
{
|
||||
//--- Decode the sub-frame id ------------------------------------------
|
||||
// ICD (IS-GPS-200E Appendix II). http://www.losangeles.af.mil/shared/media/document/AFD-100813-045.pdf
|
||||
case 1:
|
||||
//--- It is subframe 1 -------------------------------------
|
||||
// Compute the time of week (TOW) of the first sub-frames in the array ====
|
||||
// The transmitted TOW is actual TOW of the next subframe
|
||||
// (the variable subframe at this point contains bits of the last subframe).
|
||||
//TOW = bin2dec(subframe(31:47)) * 6;
|
||||
d_TOW_SF1 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW));
|
||||
//we are in the first subframe (the transmitted TOW is the start time of the next subframe) !
|
||||
d_TOW_SF1 = d_TOW_SF1 * 6.0;
|
||||
d_TOW = d_TOW_SF1; // Set transmission time
|
||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||
i_GPS_week = static_cast<int>(read_navigation_unsigned(subframe_bits, GPS_WEEK));
|
||||
i_SV_accuracy = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_ACCURACY)); // (20.3.3.3.1.3)
|
||||
i_SV_health = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_HEALTH));
|
||||
b_L2_P_data_flag = read_navigation_bool(subframe_bits, L2_P_DATA_FLAG); //
|
||||
i_code_on_L2 = static_cast<int>(read_navigation_unsigned(subframe_bits, CA_OR_P_ON_L2));
|
||||
d_TGD = static_cast<double>(read_navigation_signed(subframe_bits, T_GD));
|
||||
d_TGD = d_TGD * T_GD_LSB;
|
||||
d_IODC = static_cast<double>(read_navigation_unsigned(subframe_bits, IODC));
|
||||
d_Toc = static_cast<double>(read_navigation_unsigned(subframe_bits, T_OC));
|
||||
d_Toc = d_Toc * T_OC_LSB;
|
||||
d_A_f0 = static_cast<double>(read_navigation_signed(subframe_bits, A_F0));
|
||||
d_A_f0 = d_A_f0 * A_F0_LSB;
|
||||
d_A_f1 = static_cast<double>(read_navigation_signed(subframe_bits, A_F1));
|
||||
d_A_f1 = d_A_f1 * A_F1_LSB;
|
||||
d_A_f2 = static_cast<double>(read_navigation_signed(subframe_bits, A_F2));
|
||||
d_A_f2 = d_A_f2 * A_F2_LSB;
|
||||
|
||||
break;
|
||||
|
||||
case 2: //--- It is subframe 2 -------------------
|
||||
d_TOW_SF2 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW));
|
||||
d_TOW_SF2 = d_TOW_SF2 * 6.0;
|
||||
d_TOW = d_TOW_SF2; // Set transmission time
|
||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||
d_IODE_SF2 = static_cast<double>(read_navigation_unsigned(subframe_bits, IODE_SF2));
|
||||
d_Crs = static_cast<double>(read_navigation_signed(subframe_bits, C_RS));
|
||||
d_Crs = d_Crs * C_RS_LSB;
|
||||
d_Delta_n = static_cast<double>(read_navigation_signed(subframe_bits, DELTA_N));
|
||||
d_Delta_n = d_Delta_n * DELTA_N_LSB;
|
||||
d_M_0 = static_cast<double>(read_navigation_signed(subframe_bits, M_0));
|
||||
d_M_0 = d_M_0 * M_0_LSB;
|
||||
d_Cuc = static_cast<double>(read_navigation_signed(subframe_bits, C_UC));
|
||||
d_Cuc = d_Cuc * C_UC_LSB;
|
||||
d_e_eccentricity = static_cast<double>(read_navigation_unsigned(subframe_bits, E));
|
||||
d_e_eccentricity = d_e_eccentricity * E_LSB;
|
||||
d_Cus = static_cast<double>(read_navigation_signed(subframe_bits, C_US));
|
||||
d_Cus = d_Cus * C_US_LSB;
|
||||
d_sqrt_A = static_cast<double>(read_navigation_unsigned(subframe_bits, SQRT_A));
|
||||
d_sqrt_A = d_sqrt_A * SQRT_A_LSB;
|
||||
d_Toe = static_cast<double>(read_navigation_unsigned(subframe_bits, T_OE));
|
||||
d_Toe = d_Toe * T_OE_LSB;
|
||||
b_fit_interval_flag = read_navigation_bool(subframe_bits, FIT_INTERVAL_FLAG);
|
||||
i_AODO = static_cast<int>(read_navigation_unsigned(subframe_bits, AODO));
|
||||
i_AODO = i_AODO * AODO_LSB;
|
||||
case 2: //--- It is subframe 2 -------------------
|
||||
d_TOW_SF2 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW));
|
||||
d_TOW_SF2 = d_TOW_SF2 * 6.0;
|
||||
d_TOW = d_TOW_SF2; // Set transmission time
|
||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||
d_IODE_SF2 = static_cast<double>(read_navigation_unsigned(subframe_bits, IODE_SF2));
|
||||
d_Crs = static_cast<double>(read_navigation_signed(subframe_bits, C_RS));
|
||||
d_Crs = d_Crs * C_RS_LSB;
|
||||
d_Delta_n = static_cast<double>(read_navigation_signed(subframe_bits, DELTA_N));
|
||||
d_Delta_n = d_Delta_n * DELTA_N_LSB;
|
||||
d_M_0 = static_cast<double>(read_navigation_signed(subframe_bits, M_0));
|
||||
d_M_0 = d_M_0 * M_0_LSB;
|
||||
d_Cuc = static_cast<double>(read_navigation_signed(subframe_bits, C_UC));
|
||||
d_Cuc = d_Cuc * C_UC_LSB;
|
||||
d_e_eccentricity = static_cast<double>(read_navigation_unsigned(subframe_bits, E));
|
||||
d_e_eccentricity = d_e_eccentricity * E_LSB;
|
||||
d_Cus = static_cast<double>(read_navigation_signed(subframe_bits, C_US));
|
||||
d_Cus = d_Cus * C_US_LSB;
|
||||
d_sqrt_A = static_cast<double>(read_navigation_unsigned(subframe_bits, SQRT_A));
|
||||
d_sqrt_A = d_sqrt_A * SQRT_A_LSB;
|
||||
d_Toe = static_cast<double>(read_navigation_unsigned(subframe_bits, T_OE));
|
||||
d_Toe = d_Toe * T_OE_LSB;
|
||||
b_fit_interval_flag = read_navigation_bool(subframe_bits, FIT_INTERVAL_FLAG);
|
||||
i_AODO = static_cast<int>(read_navigation_unsigned(subframe_bits, AODO));
|
||||
i_AODO = i_AODO * AODO_LSB;
|
||||
|
||||
break;
|
||||
|
||||
case 3: // --- It is subframe 3 -------------------------------------
|
||||
d_TOW_SF3 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW));
|
||||
d_TOW_SF3 = d_TOW_SF3 * 6.0;
|
||||
d_TOW = d_TOW_SF3; // Set transmission time
|
||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||
d_Cic = static_cast<double>(read_navigation_signed(subframe_bits, C_IC));
|
||||
d_Cic = d_Cic * C_IC_LSB;
|
||||
d_OMEGA0 = static_cast<double>(read_navigation_signed(subframe_bits, OMEGA_0));
|
||||
d_OMEGA0 = d_OMEGA0 * OMEGA_0_LSB;
|
||||
d_Cis = static_cast<double>(read_navigation_signed(subframe_bits, C_IS));
|
||||
d_Cis = d_Cis * C_IS_LSB;
|
||||
d_i_0 = static_cast<double>(read_navigation_signed(subframe_bits, I_0));
|
||||
d_i_0 = d_i_0 * I_0_LSB;
|
||||
d_Crc = static_cast<double>(read_navigation_signed(subframe_bits, C_RC));
|
||||
d_Crc = d_Crc * C_RC_LSB;
|
||||
d_OMEGA = static_cast<double>(read_navigation_signed(subframe_bits, OMEGA));
|
||||
d_OMEGA = d_OMEGA * OMEGA_LSB;
|
||||
d_OMEGA_DOT = static_cast<double>(read_navigation_signed(subframe_bits, OMEGA_DOT));
|
||||
d_OMEGA_DOT = d_OMEGA_DOT * OMEGA_DOT_LSB;
|
||||
d_IODE_SF3 = static_cast<double>(read_navigation_unsigned(subframe_bits, IODE_SF3));
|
||||
d_IDOT = static_cast<double>(read_navigation_signed(subframe_bits, I_DOT));
|
||||
d_IDOT = d_IDOT * I_DOT_LSB;
|
||||
case 3: // --- It is subframe 3 -------------------------------------
|
||||
d_TOW_SF3 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW));
|
||||
d_TOW_SF3 = d_TOW_SF3 * 6.0;
|
||||
d_TOW = d_TOW_SF3; // Set transmission time
|
||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||
d_Cic = static_cast<double>(read_navigation_signed(subframe_bits, C_IC));
|
||||
d_Cic = d_Cic * C_IC_LSB;
|
||||
d_OMEGA0 = static_cast<double>(read_navigation_signed(subframe_bits, OMEGA_0));
|
||||
d_OMEGA0 = d_OMEGA0 * OMEGA_0_LSB;
|
||||
d_Cis = static_cast<double>(read_navigation_signed(subframe_bits, C_IS));
|
||||
d_Cis = d_Cis * C_IS_LSB;
|
||||
d_i_0 = static_cast<double>(read_navigation_signed(subframe_bits, I_0));
|
||||
d_i_0 = d_i_0 * I_0_LSB;
|
||||
d_Crc = static_cast<double>(read_navigation_signed(subframe_bits, C_RC));
|
||||
d_Crc = d_Crc * C_RC_LSB;
|
||||
d_OMEGA = static_cast<double>(read_navigation_signed(subframe_bits, OMEGA));
|
||||
d_OMEGA = d_OMEGA * OMEGA_LSB;
|
||||
d_OMEGA_DOT = static_cast<double>(read_navigation_signed(subframe_bits, OMEGA_DOT));
|
||||
d_OMEGA_DOT = d_OMEGA_DOT * OMEGA_DOT_LSB;
|
||||
d_IODE_SF3 = static_cast<double>(read_navigation_unsigned(subframe_bits, IODE_SF3));
|
||||
d_IDOT = static_cast<double>(read_navigation_signed(subframe_bits, I_DOT));
|
||||
d_IDOT = d_IDOT * I_DOT_LSB;
|
||||
|
||||
break;
|
||||
|
||||
case 4: // --- It is subframe 4 ---------- Almanac, ionospheric model, UTC parameters, SV health (PRN: 25-32)
|
||||
int SV_data_ID;
|
||||
int SV_page;
|
||||
d_TOW_SF4 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW));
|
||||
d_TOW_SF4 = d_TOW_SF4 * 6.0;
|
||||
d_TOW = d_TOW_SF4; // Set transmission time
|
||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||
SV_data_ID = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_DATA_ID));
|
||||
SV_page = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_PAGE));
|
||||
if (SV_page > 24 && SV_page < 33) // Page 4 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
|
||||
{
|
||||
//! \TODO read almanac
|
||||
if(SV_data_ID){}
|
||||
}
|
||||
case 4: // --- It is subframe 4 ---------- Almanac, ionospheric model, UTC parameters, SV health (PRN: 25-32)
|
||||
int SV_data_ID;
|
||||
int SV_page;
|
||||
d_TOW_SF4 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW));
|
||||
d_TOW_SF4 = d_TOW_SF4 * 6.0;
|
||||
d_TOW = d_TOW_SF4; // Set transmission time
|
||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||
SV_data_ID = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_DATA_ID));
|
||||
SV_page = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_PAGE));
|
||||
if (SV_page > 24 && SV_page < 33) // Page 4 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
|
||||
{
|
||||
//! \TODO read almanac
|
||||
if (SV_data_ID)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if (SV_page == 52) // Page 13 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
|
||||
{
|
||||
@ -447,53 +449,55 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
|
||||
|
||||
break;
|
||||
|
||||
case 5://--- It is subframe 5 -----------------almanac health (PRN: 1-24) and Almanac reference week number and time.
|
||||
int SV_data_ID_5;
|
||||
int SV_page_5;
|
||||
d_TOW_SF5 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW));
|
||||
d_TOW_SF5 = d_TOW_SF5 * 6.0;
|
||||
d_TOW = d_TOW_SF5; // Set transmission time
|
||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||
SV_data_ID_5 = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_DATA_ID));
|
||||
SV_page_5 = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_PAGE));
|
||||
if (SV_page_5 < 25)
|
||||
{
|
||||
//! \TODO read almanac
|
||||
if(SV_data_ID_5){}
|
||||
}
|
||||
if (SV_page_5 == 51) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
|
||||
{
|
||||
d_Toa = static_cast<double>(read_navigation_unsigned(subframe_bits, T_OA));
|
||||
d_Toa = d_Toa * T_OA_LSB;
|
||||
i_WN_A = static_cast<int>(read_navigation_unsigned(subframe_bits, WN_A));
|
||||
almanacHealth[1] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV1));
|
||||
almanacHealth[2] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV2));
|
||||
almanacHealth[3] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV3));
|
||||
almanacHealth[4] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV4));
|
||||
almanacHealth[5] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV5));
|
||||
almanacHealth[6] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV6));
|
||||
almanacHealth[7] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV7));
|
||||
almanacHealth[8] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV8));
|
||||
almanacHealth[9] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV9));
|
||||
almanacHealth[10] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV10));
|
||||
almanacHealth[11] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV11));
|
||||
almanacHealth[12] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV12));
|
||||
almanacHealth[13] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV13));
|
||||
almanacHealth[14] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV14));
|
||||
almanacHealth[15] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV15));
|
||||
almanacHealth[16] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV16));
|
||||
almanacHealth[17] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV17));
|
||||
almanacHealth[18] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV18));
|
||||
almanacHealth[19] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV19));
|
||||
almanacHealth[20] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV20));
|
||||
almanacHealth[21] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV21));
|
||||
almanacHealth[22] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV22));
|
||||
almanacHealth[23] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV23));
|
||||
almanacHealth[24] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV24));
|
||||
}
|
||||
break;
|
||||
case 5: //--- It is subframe 5 -----------------almanac health (PRN: 1-24) and Almanac reference week number and time.
|
||||
int SV_data_ID_5;
|
||||
int SV_page_5;
|
||||
d_TOW_SF5 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW));
|
||||
d_TOW_SF5 = d_TOW_SF5 * 6.0;
|
||||
d_TOW = d_TOW_SF5; // Set transmission time
|
||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||
SV_data_ID_5 = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_DATA_ID));
|
||||
SV_page_5 = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_PAGE));
|
||||
if (SV_page_5 < 25)
|
||||
{
|
||||
//! \TODO read almanac
|
||||
if (SV_data_ID_5)
|
||||
{
|
||||
}
|
||||
}
|
||||
if (SV_page_5 == 51) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
|
||||
{
|
||||
d_Toa = static_cast<double>(read_navigation_unsigned(subframe_bits, T_OA));
|
||||
d_Toa = d_Toa * T_OA_LSB;
|
||||
i_WN_A = static_cast<int>(read_navigation_unsigned(subframe_bits, WN_A));
|
||||
almanacHealth[1] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV1));
|
||||
almanacHealth[2] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV2));
|
||||
almanacHealth[3] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV3));
|
||||
almanacHealth[4] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV4));
|
||||
almanacHealth[5] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV5));
|
||||
almanacHealth[6] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV6));
|
||||
almanacHealth[7] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV7));
|
||||
almanacHealth[8] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV8));
|
||||
almanacHealth[9] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV9));
|
||||
almanacHealth[10] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV10));
|
||||
almanacHealth[11] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV11));
|
||||
almanacHealth[12] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV12));
|
||||
almanacHealth[13] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV13));
|
||||
almanacHealth[14] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV14));
|
||||
almanacHealth[15] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV15));
|
||||
almanacHealth[16] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV16));
|
||||
almanacHealth[17] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV17));
|
||||
almanacHealth[18] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV18));
|
||||
almanacHealth[19] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV19));
|
||||
almanacHealth[20] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV20));
|
||||
almanacHealth[21] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV21));
|
||||
almanacHealth[22] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV22));
|
||||
almanacHealth[23] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV23));
|
||||
almanacHealth[24] = static_cast<int>(read_navigation_unsigned(subframe_bits, HEALTH_SV24));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "gps_almanac.h"
|
||||
#include "gps_utc_model.h"
|
||||
#include <bitset>
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
@ -53,8 +54,8 @@
|
||||
class Gps_Navigation_Message
|
||||
{
|
||||
private:
|
||||
unsigned long int read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
signed long int read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
uint64_t read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
int64_t read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
bool read_navigation_bool(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int, int>> parameter);
|
||||
void print_gps_word_bytes(unsigned int GPS_word);
|
||||
|
||||
|
@ -195,7 +195,7 @@ std::string Rtcm::bin_to_binary_data(const std::string& s) const
|
||||
{
|
||||
s_aux.assign(s, 0, remainder);
|
||||
boost::dynamic_bitset<> rembits(s_aux);
|
||||
unsigned long int n = rembits.to_ulong();
|
||||
uint64_t n = rembits.to_ulong();
|
||||
c[0] = static_cast<unsigned char>(n);
|
||||
k++;
|
||||
}
|
||||
@ -270,7 +270,7 @@ std::string Rtcm::hex_to_bin(const std::string& s) const
|
||||
std::string s_lower = boost::to_upper_copy(ss.str());
|
||||
for (unsigned int i = 0; i < s.length(); i++)
|
||||
{
|
||||
unsigned long int n;
|
||||
uint64_t n;
|
||||
std::istringstream(s_lower.substr(i, 1)) >> std::hex >> n;
|
||||
std::bitset<4> bs(n);
|
||||
s_aux += bs.to_string();
|
||||
@ -279,26 +279,26 @@ std::string Rtcm::hex_to_bin(const std::string& s) const
|
||||
}
|
||||
|
||||
|
||||
unsigned long int Rtcm::bin_to_uint(const std::string& s) const
|
||||
uint64_t Rtcm::bin_to_uint(const std::string& s) const
|
||||
{
|
||||
if (s.length() > 32)
|
||||
{
|
||||
LOG(WARNING) << "Cannot convert to a unsigned long int";
|
||||
LOG(WARNING) << "Cannot convert to a uint64_t";
|
||||
return 0;
|
||||
}
|
||||
unsigned long int reading = strtoul(s.c_str(), NULL, 2);
|
||||
uint64_t reading = strtoul(s.c_str(), NULL, 2);
|
||||
return reading;
|
||||
}
|
||||
|
||||
|
||||
long int Rtcm::bin_to_int(const std::string& s) const
|
||||
int64_t Rtcm::bin_to_int(const std::string& s) const
|
||||
{
|
||||
if (s.length() > 32)
|
||||
{
|
||||
LOG(WARNING) << "Cannot convert to a long int";
|
||||
LOG(WARNING) << "Cannot convert to a int64_t";
|
||||
return 0;
|
||||
}
|
||||
long int reading;
|
||||
int64_t reading;
|
||||
|
||||
// Handle negative numbers
|
||||
if (s.substr(0, 1).compare("0"))
|
||||
@ -316,15 +316,15 @@ long int Rtcm::bin_to_int(const std::string& s) const
|
||||
}
|
||||
|
||||
|
||||
long int Rtcm::bin_to_sint(const std::string& s) const
|
||||
int64_t Rtcm::bin_to_sint(const std::string& s) const
|
||||
{
|
||||
if (s.length() > 32)
|
||||
{
|
||||
LOG(WARNING) << "Cannot convert to a long int";
|
||||
LOG(WARNING) << "Cannot convert to a int64_t";
|
||||
return 0;
|
||||
}
|
||||
long int reading;
|
||||
long int sign;
|
||||
int64_t reading;
|
||||
int64_t sign;
|
||||
|
||||
// Check for sign bit as defined RTCM doc
|
||||
if (s.substr(0, 1).compare("0") == 0)
|
||||
@ -343,7 +343,7 @@ long int Rtcm::bin_to_sint(const std::string& s) const
|
||||
}
|
||||
|
||||
// Find the sign for glonass data fields (neg = 1, pos = 0)
|
||||
static inline unsigned long glo_sgn(double val)
|
||||
static inline uint64_t glo_sgn(double val)
|
||||
{
|
||||
if (val < 0) return 1; // If value is negative return 1
|
||||
if (val == 0) return 0; // Positive or equal to zero return 0
|
||||
@ -360,7 +360,7 @@ double Rtcm::bin_to_double(const std::string& s) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
long long int reading_int;
|
||||
int64_t reading_int;
|
||||
|
||||
// Handle negative numbers
|
||||
if (s.substr(0, 1).compare("0"))
|
||||
@ -382,26 +382,26 @@ double Rtcm::bin_to_double(const std::string& s) const
|
||||
}
|
||||
|
||||
|
||||
unsigned long int Rtcm::hex_to_uint(const std::string& s) const
|
||||
uint64_t Rtcm::hex_to_uint(const std::string& s) const
|
||||
{
|
||||
if (s.length() > 32)
|
||||
{
|
||||
LOG(WARNING) << "Cannot convert to a unsigned long int";
|
||||
LOG(WARNING) << "Cannot convert to a uint64_t";
|
||||
return 0;
|
||||
}
|
||||
unsigned long int reading = strtoul(s.c_str(), NULL, 16);
|
||||
uint64_t reading = strtoul(s.c_str(), NULL, 16);
|
||||
return reading;
|
||||
}
|
||||
|
||||
|
||||
long int Rtcm::hex_to_int(const std::string& s) const
|
||||
int64_t Rtcm::hex_to_int(const std::string& s) const
|
||||
{
|
||||
if (s.length() > 32)
|
||||
{
|
||||
LOG(WARNING) << "Cannot convert to a long int";
|
||||
LOG(WARNING) << "Cannot convert to a int64_t";
|
||||
return 0;
|
||||
}
|
||||
long int reading = strtol(s.c_str(), NULL, 16);
|
||||
int64_t reading = strtol(s.c_str(), NULL, 16);
|
||||
return reading;
|
||||
}
|
||||
|
||||
@ -3560,7 +3560,7 @@ int Rtcm::set_DF003(unsigned int ref_station_ID)
|
||||
int Rtcm::set_DF004(double obs_time)
|
||||
{
|
||||
// TOW in milliseconds from the beginning of the GPS week, measured in GPS time
|
||||
unsigned long int tow = static_cast<unsigned long int>(std::round(obs_time * 1000));
|
||||
uint64_t tow = static_cast<uint64_t>(std::round(obs_time * 1000));
|
||||
if (tow > 604799999)
|
||||
{
|
||||
LOG(WARNING) << "To large TOW! Set to the last millisecond of the week";
|
||||
@ -3651,7 +3651,7 @@ int Rtcm::set_DF010(bool code_indicator)
|
||||
int Rtcm::set_DF011(const Gnss_Synchro& gnss_synchro)
|
||||
{
|
||||
double ambiguity = std::floor(gnss_synchro.Pseudorange_m / 299792.458);
|
||||
unsigned long int gps_L1_pseudorange = static_cast<unsigned long int>(std::round((gnss_synchro.Pseudorange_m - ambiguity * 299792.458) / 0.02));
|
||||
uint64_t gps_L1_pseudorange = static_cast<uint64_t>(std::round((gnss_synchro.Pseudorange_m - ambiguity * 299792.458) / 0.02));
|
||||
DF011 = std::bitset<24>(gps_L1_pseudorange);
|
||||
return 0;
|
||||
}
|
||||
@ -3665,7 +3665,7 @@ int Rtcm::set_DF012(const Gnss_Synchro& gnss_synchro)
|
||||
double gps_L1_pseudorange_c = gps_L1_pseudorange * 0.02 + ambiguity * 299792.458;
|
||||
double L1_phaserange_c = gnss_synchro.Carrier_phase_rads / GPS_TWO_PI;
|
||||
double L1_phaserange_c_r = std::fmod(L1_phaserange_c - gps_L1_pseudorange_c / lambda + 1500.0, 3000.0) - 1500.0;
|
||||
long int gps_L1_phaserange_minus_L1_pseudorange = static_cast<long int>(std::round(L1_phaserange_c_r * lambda / 0.0005));
|
||||
int64_t gps_L1_phaserange_minus_L1_pseudorange = static_cast<int64_t>(std::round(L1_phaserange_c_r * lambda / 0.0005));
|
||||
DF012 = std::bitset<20>(gps_L1_phaserange_minus_L1_pseudorange);
|
||||
return 0;
|
||||
}
|
||||
@ -3792,7 +3792,7 @@ int Rtcm::set_DF024(bool galileo_indicator)
|
||||
|
||||
int Rtcm::set_DF025(double antenna_ECEF_X_m)
|
||||
{
|
||||
long long int ant_ref_x = static_cast<long long int>(std::round(antenna_ECEF_X_m * 10000));
|
||||
int64_t ant_ref_x = static_cast<int64_t>(std::round(antenna_ECEF_X_m * 10000));
|
||||
DF025 = std::bitset<38>(ant_ref_x);
|
||||
return 0;
|
||||
}
|
||||
@ -3800,7 +3800,7 @@ int Rtcm::set_DF025(double antenna_ECEF_X_m)
|
||||
|
||||
int Rtcm::set_DF026(double antenna_ECEF_Y_m)
|
||||
{
|
||||
long long int ant_ref_y = static_cast<long long int>(std::round(antenna_ECEF_Y_m * 10000));
|
||||
int64_t ant_ref_y = static_cast<int64_t>(std::round(antenna_ECEF_Y_m * 10000));
|
||||
DF026 = std::bitset<38>(ant_ref_y);
|
||||
return 0;
|
||||
}
|
||||
@ -3808,7 +3808,7 @@ int Rtcm::set_DF026(double antenna_ECEF_Y_m)
|
||||
|
||||
int Rtcm::set_DF027(double antenna_ECEF_Z_m)
|
||||
{
|
||||
long long int ant_ref_z = static_cast<long long int>(std::round(antenna_ECEF_Z_m * 10000));
|
||||
int64_t ant_ref_z = static_cast<int64_t>(std::round(antenna_ECEF_Z_m * 10000));
|
||||
DF027 = std::bitset<38>(ant_ref_z);
|
||||
return 0;
|
||||
}
|
||||
@ -3832,7 +3832,7 @@ int Rtcm::set_DF031(unsigned int antenna_setup_id)
|
||||
int Rtcm::set_DF034(double obs_time)
|
||||
{
|
||||
// TOW in milliseconds from the beginning of the GLONASS day, measured in GLONASS time
|
||||
unsigned long int tk = static_cast<unsigned long int>(std::round(obs_time * 1000));
|
||||
uint64_t tk = static_cast<uint64_t>(std::round(obs_time * 1000));
|
||||
if (tk > 86400999)
|
||||
{
|
||||
LOG(WARNING) << "To large GLONASS Epoch Time (tk)! Set to the last millisecond of the day";
|
||||
@ -3943,7 +3943,7 @@ int Rtcm::set_DF040(const Glonass_Gnav_Ephemeris& glonass_gnav_eph)
|
||||
int Rtcm::set_DF041(const Gnss_Synchro& gnss_synchro)
|
||||
{
|
||||
double ambiguity = std::floor(gnss_synchro.Pseudorange_m / 599584.92);
|
||||
unsigned long int glonass_L1_pseudorange = static_cast<unsigned long int>(std::round((gnss_synchro.Pseudorange_m - ambiguity * 599584.92) / 0.02));
|
||||
uint64_t glonass_L1_pseudorange = static_cast<uint64_t>(std::round((gnss_synchro.Pseudorange_m - ambiguity * 599584.92) / 0.02));
|
||||
DF041 = std::bitset<25>(glonass_L1_pseudorange);
|
||||
return 0;
|
||||
}
|
||||
@ -3957,7 +3957,7 @@ int Rtcm::set_DF042(const Gnss_Synchro& gnss_synchro)
|
||||
double glonass_L1_pseudorange_c = glonass_L1_pseudorange * 0.02 + ambiguity * 299792.458;
|
||||
double L1_phaserange_c = gnss_synchro.Carrier_phase_rads / GLONASS_TWO_PI;
|
||||
double L1_phaserange_c_r = std::fmod(L1_phaserange_c - glonass_L1_pseudorange_c / lambda + 1500.0, 3000.0) - 1500.0;
|
||||
long int glonass_L1_phaserange_minus_L1_pseudorange = static_cast<long int>(std::round(L1_phaserange_c_r * lambda / 0.0005));
|
||||
int64_t glonass_L1_phaserange_minus_L1_pseudorange = static_cast<int64_t>(std::round(L1_phaserange_c_r * lambda / 0.0005));
|
||||
DF042 = std::bitset<20>(glonass_L1_phaserange_minus_L1_pseudorange);
|
||||
return 0;
|
||||
}
|
||||
@ -4058,7 +4058,7 @@ int Rtcm::set_DF050(const Gnss_Synchro& gnss_synchro)
|
||||
int Rtcm::set_DF051(const Gps_Ephemeris& gps_eph, double obs_time)
|
||||
{
|
||||
const double gps_t = obs_time;
|
||||
boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast<long>((gps_t + 604800 * static_cast<double>(gps_eph.i_GPS_week % 1024)) * 1000));
|
||||
boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast<int64_t>((gps_t + 604800 * static_cast<double>(gps_eph.i_GPS_week % 1024)) * 1000));
|
||||
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
|
||||
std::string now_ptime = to_iso_string(p_time);
|
||||
std::string today_ptime = now_ptime.substr(0, 8);
|
||||
@ -4072,14 +4072,14 @@ int Rtcm::set_DF051(const Gps_Ephemeris& gps_eph, double obs_time)
|
||||
int Rtcm::set_DF052(const Gps_Ephemeris& gps_eph, double obs_time)
|
||||
{
|
||||
const double gps_t = obs_time;
|
||||
boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast<long>((gps_t + 604800 * static_cast<double>(gps_eph.i_GPS_week % 1024)) * 1000));
|
||||
boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast<int64_t>((gps_t + 604800 * static_cast<double>(gps_eph.i_GPS_week % 1024)) * 1000));
|
||||
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
|
||||
std::string now_ptime = to_iso_string(p_time);
|
||||
std::string hours = now_ptime.substr(9, 2);
|
||||
std::string minutes = now_ptime.substr(11, 2);
|
||||
std::string seconds = now_ptime.substr(13, 8);
|
||||
//boost::gregorian::date d(boost::gregorian::from_undelimited_string(today_ptime));
|
||||
long unsigned int seconds_of_day = boost::lexical_cast<unsigned int>(hours) * 60 * 60 + boost::lexical_cast<unsigned int>(minutes) * 60 + boost::lexical_cast<unsigned int>(seconds);
|
||||
uint64_t seconds_of_day = boost::lexical_cast<unsigned int>(hours) * 60 * 60 + boost::lexical_cast<unsigned int>(minutes) * 60 + boost::lexical_cast<unsigned int>(seconds);
|
||||
DF052 = std::bitset<17>(seconds_of_day);
|
||||
return 0;
|
||||
}
|
||||
@ -4159,7 +4159,7 @@ int Rtcm::set_DF083(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int Rtcm::set_DF084(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
long int af0 = static_cast<long int>(std::round(gps_eph.d_A_f0 / A_F0_LSB));
|
||||
int64_t af0 = static_cast<int64_t>(std::round(gps_eph.d_A_f0 / A_F0_LSB));
|
||||
DF084 = std::bitset<22>(af0);
|
||||
return 0;
|
||||
}
|
||||
@ -4191,7 +4191,7 @@ int Rtcm::set_DF087(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int Rtcm::set_DF088(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
long int m0 = static_cast<long int>(std::round(gps_eph.d_M_0 / M_0_LSB));
|
||||
int64_t m0 = static_cast<int64_t>(std::round(gps_eph.d_M_0 / M_0_LSB));
|
||||
DF088 = std::bitset<32>(m0);
|
||||
return 0;
|
||||
}
|
||||
@ -4206,7 +4206,7 @@ int Rtcm::set_DF089(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int Rtcm::set_DF090(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
unsigned long int ecc = static_cast<unsigned long int>(std::round(gps_eph.d_e_eccentricity / E_LSB));
|
||||
uint64_t ecc = static_cast<uint64_t>(std::round(gps_eph.d_e_eccentricity / E_LSB));
|
||||
DF090 = std::bitset<32>(ecc);
|
||||
return 0;
|
||||
}
|
||||
@ -4222,7 +4222,7 @@ int Rtcm::set_DF091(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int Rtcm::set_DF092(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
unsigned long int sqr_a = static_cast<unsigned long int>(std::round(gps_eph.d_sqrt_A / SQRT_A_LSB));
|
||||
uint64_t sqr_a = static_cast<uint64_t>(std::round(gps_eph.d_sqrt_A / SQRT_A_LSB));
|
||||
DF092 = std::bitset<32>(sqr_a);
|
||||
return 0;
|
||||
}
|
||||
@ -4246,7 +4246,7 @@ int Rtcm::set_DF094(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int Rtcm::set_DF095(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
long int Omega0 = static_cast<long int>(std::round(gps_eph.d_OMEGA0 / OMEGA_0_LSB));
|
||||
int64_t Omega0 = static_cast<int64_t>(std::round(gps_eph.d_OMEGA0 / OMEGA_0_LSB));
|
||||
DF095 = std::bitset<32>(Omega0);
|
||||
return 0;
|
||||
}
|
||||
@ -4262,7 +4262,7 @@ int Rtcm::set_DF096(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int Rtcm::set_DF097(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
long int i0 = static_cast<long int>(std::round(gps_eph.d_i_0 / I_0_LSB));
|
||||
int64_t i0 = static_cast<int64_t>(std::round(gps_eph.d_i_0 / I_0_LSB));
|
||||
DF097 = std::bitset<32>(i0);
|
||||
return 0;
|
||||
}
|
||||
@ -4278,7 +4278,7 @@ int Rtcm::set_DF098(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int Rtcm::set_DF099(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
long int omega = static_cast<long int>(std::round(gps_eph.d_OMEGA / OMEGA_LSB));
|
||||
int64_t omega = static_cast<int64_t>(std::round(gps_eph.d_OMEGA / OMEGA_LSB));
|
||||
DF099 = std::bitset<32>(omega);
|
||||
return 0;
|
||||
}
|
||||
@ -4286,7 +4286,7 @@ int Rtcm::set_DF099(const Gps_Ephemeris& gps_eph)
|
||||
|
||||
int Rtcm::set_DF100(const Gps_Ephemeris& gps_eph)
|
||||
{
|
||||
long int omegadot = static_cast<long int>(std::round(gps_eph.d_OMEGA_DOT / OMEGA_DOT_LSB));
|
||||
int64_t omegadot = static_cast<int64_t>(std::round(gps_eph.d_OMEGA_DOT / OMEGA_DOT_LSB));
|
||||
DF100 = std::bitset<24>(omegadot);
|
||||
return 0;
|
||||
}
|
||||
@ -4636,7 +4636,7 @@ int Rtcm::set_DF137(const Gps_Ephemeris& gps_eph)
|
||||
int Rtcm::set_DF248(double obs_time)
|
||||
{
|
||||
// TOW in milliseconds from the beginning of the Galileo week, measured in Galileo time
|
||||
unsigned long int tow = static_cast<unsigned long int>(std::round(obs_time * 1000));
|
||||
uint64_t tow = static_cast<uint64_t>(std::round(obs_time * 1000));
|
||||
if (tow > 604799999)
|
||||
{
|
||||
LOG(WARNING) << "To large TOW! Set to the last millisecond of the week";
|
||||
@ -4722,7 +4722,7 @@ int Rtcm::set_DF294(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int Rtcm::set_DF295(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
long int af1 = static_cast<long int>(std::round(gal_eph.af1_4 / FNAV_af1_1_LSB));
|
||||
int64_t af1 = static_cast<int64_t>(std::round(gal_eph.af1_4 / FNAV_af1_1_LSB));
|
||||
DF295 = std::bitset<21>(af1);
|
||||
return 0;
|
||||
}
|
||||
@ -4730,7 +4730,7 @@ int Rtcm::set_DF295(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int Rtcm::set_DF296(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
long int af0 = static_cast<unsigned int>(std::round(gal_eph.af0_4 / FNAV_af0_1_LSB));
|
||||
int64_t af0 = static_cast<unsigned int>(std::round(gal_eph.af0_4 / FNAV_af0_1_LSB));
|
||||
DF296 = std::bitset<31>(af0);
|
||||
return 0;
|
||||
}
|
||||
@ -4754,7 +4754,7 @@ int Rtcm::set_DF298(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int Rtcm::set_DF299(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
long int m0 = static_cast<long int>(std::round(gal_eph.M0_1 / FNAV_M0_2_LSB));
|
||||
int64_t m0 = static_cast<int64_t>(std::round(gal_eph.M0_1 / FNAV_M0_2_LSB));
|
||||
DF299 = std::bitset<32>(m0);
|
||||
return 0;
|
||||
}
|
||||
@ -4770,7 +4770,7 @@ int Rtcm::set_DF300(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int Rtcm::set_DF301(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
unsigned long int ecc = static_cast<unsigned long int>(std::round(gal_eph.e_1 / FNAV_e_2_LSB));
|
||||
uint64_t ecc = static_cast<uint64_t>(std::round(gal_eph.e_1 / FNAV_e_2_LSB));
|
||||
DF301 = std::bitset<32>(ecc);
|
||||
return 0;
|
||||
}
|
||||
@ -4786,7 +4786,7 @@ int Rtcm::set_DF302(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int Rtcm::set_DF303(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
unsigned long int sqr_a = static_cast<unsigned long int>(std::round(gal_eph.A_1 / FNAV_a12_2_LSB));
|
||||
uint64_t sqr_a = static_cast<uint64_t>(std::round(gal_eph.A_1 / FNAV_a12_2_LSB));
|
||||
DF303 = std::bitset<32>(sqr_a);
|
||||
return 0;
|
||||
}
|
||||
@ -4810,7 +4810,7 @@ int Rtcm::set_DF305(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int Rtcm::set_DF306(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
long int Omega0 = static_cast<long int>(std::round(gal_eph.OMEGA_0_2 / FNAV_omega0_2_LSB));
|
||||
int64_t Omega0 = static_cast<int64_t>(std::round(gal_eph.OMEGA_0_2 / FNAV_omega0_2_LSB));
|
||||
DF306 = std::bitset<32>(Omega0);
|
||||
return 0;
|
||||
}
|
||||
@ -4826,7 +4826,7 @@ int Rtcm::set_DF307(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int Rtcm::set_DF308(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
long int i0 = static_cast<long int>(std::round(gal_eph.i_0_2 / FNAV_i0_3_LSB));
|
||||
int64_t i0 = static_cast<int64_t>(std::round(gal_eph.i_0_2 / FNAV_i0_3_LSB));
|
||||
DF308 = std::bitset<32>(i0);
|
||||
return 0;
|
||||
}
|
||||
@ -4850,7 +4850,7 @@ int Rtcm::set_DF310(const Galileo_Ephemeris& gal_eph)
|
||||
|
||||
int Rtcm::set_DF311(const Galileo_Ephemeris& gal_eph)
|
||||
{
|
||||
long int Omegadot = static_cast<long int>(std::round(gal_eph.OMEGA_dot_3 / FNAV_omegadot_2_LSB));
|
||||
int64_t Omegadot = static_cast<int64_t>(std::round(gal_eph.OMEGA_dot_3 / FNAV_omegadot_2_LSB));
|
||||
DF311 = std::bitset<24>(Omegadot);
|
||||
return 0;
|
||||
}
|
||||
@ -5226,7 +5226,7 @@ int Rtcm::set_DF401(const Gnss_Synchro& gnss_synchro)
|
||||
double meters_to_miliseconds = GPS_C_m_s * 0.001;
|
||||
double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10;
|
||||
double phrng_m;
|
||||
long int fine_phaserange;
|
||||
int64_t fine_phaserange;
|
||||
|
||||
double lambda = 0.0;
|
||||
std::string sig_(gnss_synchro.Signal);
|
||||
@ -5284,7 +5284,7 @@ int Rtcm::set_DF401(const Gnss_Synchro& gnss_synchro)
|
||||
}
|
||||
else
|
||||
{
|
||||
fine_phaserange = static_cast<long int>(std::round(phrng_m / meters_to_miliseconds / TWO_N29));
|
||||
fine_phaserange = static_cast<int64_t>(std::round(phrng_m / meters_to_miliseconds / TWO_N29));
|
||||
}
|
||||
|
||||
DF401 = std::bitset<22>(fine_phaserange);
|
||||
@ -5397,7 +5397,7 @@ int Rtcm::set_DF405(const Gnss_Synchro& gnss_synchro)
|
||||
double meters_to_miliseconds = GPS_C_m_s * 0.001;
|
||||
double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10;
|
||||
double psrng_s;
|
||||
long int fine_pseudorange;
|
||||
int64_t fine_pseudorange;
|
||||
|
||||
psrng_s = gnss_synchro.Pseudorange_m - rough_range_m;
|
||||
|
||||
@ -5411,7 +5411,7 @@ int Rtcm::set_DF405(const Gnss_Synchro& gnss_synchro)
|
||||
}
|
||||
else
|
||||
{
|
||||
fine_pseudorange = static_cast<long int>(std::round(psrng_s / meters_to_miliseconds / TWO_N29));
|
||||
fine_pseudorange = static_cast<int64_t>(std::round(psrng_s / meters_to_miliseconds / TWO_N29));
|
||||
}
|
||||
DF405 = std::bitset<20>(fine_pseudorange);
|
||||
return 0;
|
||||
@ -5420,7 +5420,7 @@ int Rtcm::set_DF405(const Gnss_Synchro& gnss_synchro)
|
||||
|
||||
int Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro)
|
||||
{
|
||||
long int fine_phaserange_ex;
|
||||
int64_t fine_phaserange_ex;
|
||||
double meters_to_miliseconds = GPS_C_m_s * 0.001;
|
||||
double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10;
|
||||
double phrng_m;
|
||||
@ -5479,7 +5479,7 @@ int Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro)
|
||||
}
|
||||
else
|
||||
{
|
||||
fine_phaserange_ex = static_cast<long int>(std::round(phrng_m / meters_to_miliseconds / TWO_N31));
|
||||
fine_phaserange_ex = static_cast<int64_t>(std::round(phrng_m / meters_to_miliseconds / TWO_N31));
|
||||
}
|
||||
|
||||
DF406 = std::bitset<24>(fine_phaserange_ex);
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <bitset>
|
||||
#include <cstdint>
|
||||
#include <deque>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
@ -347,8 +348,8 @@ public:
|
||||
std::string bin_to_binary_data(const std::string& s) const; //<! Returns a string of binary data from a string of binary symbols
|
||||
std::string binary_data_to_bin(const std::string& s) const; //<! Returns a string of binary symbols from a string of binary data
|
||||
|
||||
unsigned long int bin_to_uint(const std::string& s) const; //<! Returns an unsigned long int from a string of binary symbols
|
||||
long int bin_to_int(const std::string& s) const;
|
||||
uint64_t bin_to_uint(const std::string& s) const; //<! Returns an uint64_t from a string of binary symbols
|
||||
int64_t bin_to_int(const std::string& s) const;
|
||||
double bin_to_double(const std::string& s) const; //<! Returns double from a string of binary symbols
|
||||
/*!
|
||||
* \brief Locks time period in which GLONASS signals have been continually tracked.
|
||||
@ -356,11 +357,11 @@ public:
|
||||
* \param eph GLONASS GNAV Broadcast Ephemeris
|
||||
* \param obs_time Time of observation at the moment of printing
|
||||
* \param observables Set of observables as defined by the platform
|
||||
* \return //<! Returns a long int from a string of binary symbols
|
||||
* \return //<! Returns a int64_t from a string of binary symbols
|
||||
*/
|
||||
long int bin_to_sint(const std::string& s) const;
|
||||
unsigned long int hex_to_uint(const std::string& s) const; //<! Returns an unsigned long int from a string of hexadecimal symbols
|
||||
long int hex_to_int(const std::string& s) const; //<! Returns a long int from a string of hexadecimal symbols
|
||||
int64_t bin_to_sint(const std::string& s) const;
|
||||
uint64_t hex_to_uint(const std::string& s) const; //<! Returns an uint64_t from a string of hexadecimal symbols
|
||||
int64_t hex_to_int(const std::string& s) const; //<! Returns a int64_t from a string of hexadecimal symbols
|
||||
|
||||
bool check_CRC(const std::string& message) const; //<! Checks that the CRC of a RTCM package is correct
|
||||
|
||||
|
@ -68,6 +68,7 @@
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <stdlib.h>
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <ctime> // for ctime
|
||||
#include <exception>
|
||||
#include <memory>
|
||||
@ -123,7 +124,7 @@ void FrontEndCal_msg_rx::msg_handler_events(pmt::pmt_t msg)
|
||||
{
|
||||
try
|
||||
{
|
||||
long int message = pmt::to_long(msg);
|
||||
int64_t message = pmt::to_long(msg);
|
||||
rx_message = message;
|
||||
channel_internal_queue.push(rx_message);
|
||||
}
|
||||
@ -204,7 +205,7 @@ bool front_end_capture(std::shared_ptr<ConfigurationInterface> configuration)
|
||||
sink = gr::blocks::file_sink::make(sizeof(gr_complex), "tmp_capture.dat");
|
||||
|
||||
//--- Find number of samples per spreading code ---
|
||||
long fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", 2048000);
|
||||
int64_t fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", 2048000);
|
||||
int samples_per_code = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
int nsamples = samples_per_code * 50;
|
||||
|
||||
@ -234,7 +235,7 @@ bool front_end_capture(std::shared_ptr<ConfigurationInterface> configuration)
|
||||
}
|
||||
|
||||
|
||||
static time_t utc_time(int week, long tow)
|
||||
static time_t utc_time(int week, int64_t tow)
|
||||
{
|
||||
time_t t;
|
||||
|
||||
@ -350,7 +351,7 @@ int main(int argc, char** argv)
|
||||
signal.copy(gnss_synchro->Signal, 2, 0);
|
||||
gnss_synchro->PRN = 1;
|
||||
|
||||
long fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", 2048000);
|
||||
int64_t fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", 2048000);
|
||||
configuration->set_property("Acquisition.max_dwells", "10");
|
||||
|
||||
GNSSBlockFactory block_factory;
|
||||
@ -480,11 +481,11 @@ int main(int argc, char** argv)
|
||||
Eph_map = global_gps_ephemeris_map.get_map_copy();
|
||||
current_TOW = Eph_map.begin()->second.d_TOW;
|
||||
|
||||
time_t t = utc_time(Eph_map.begin()->second.i_GPS_week, (long int)current_TOW);
|
||||
time_t t = utc_time(Eph_map.begin()->second.i_GPS_week, (int64_t)current_TOW);
|
||||
|
||||
fprintf(stdout, "Reference Time:\n");
|
||||
fprintf(stdout, " GPS Week: %d\n", Eph_map.begin()->second.i_GPS_week);
|
||||
fprintf(stdout, " GPS TOW: %ld %lf\n", (long int)current_TOW, (long int)current_TOW * 0.08);
|
||||
fprintf(stdout, " GPS TOW: %ld %lf\n", (int64_t)current_TOW, (int64_t)current_TOW * 0.08);
|
||||
fprintf(stdout, " ~ UTC: %s", ctime(&t));
|
||||
std::cout << "Current TOW obtained from SUPL assistance = " << current_TOW << std::endl;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user