diff --git a/docs/xml-schemas/gal_ephemeris_map.xsd b/docs/xml-schemas/gal_ephemeris_map.xsd
index a104f489f..1fe68f863 100644
--- a/docs/xml-schemas/gal_ephemeris_map.xsd
+++ b/docs/xml-schemas/gal_ephemeris_map.xsd
@@ -41,7 +41,7 @@
-
+
@@ -53,6 +53,7 @@
+
diff --git a/docs/xml-schemas/gal_iono_model.xsd b/docs/xml-schemas/gal_iono_model.xsd
index 29855b7d2..35041236d 100644
--- a/docs/xml-schemas/gal_iono_model.xsd
+++ b/docs/xml-schemas/gal_iono_model.xsd
@@ -10,13 +10,13 @@
+
+
-
-
diff --git a/docs/xml-schemas/utc_model.xsd b/docs/xml-schemas/utc_model.xsd
index a388863c5..d1e7dee4b 100644
--- a/docs/xml-schemas/utc_model.xsd
+++ b/docs/xml-schemas/utc_model.xsd
@@ -7,7 +7,6 @@
-
@@ -16,6 +15,7 @@
+
diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h
index 8a42144b5..b658731bf 100644
--- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h
+++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h
@@ -160,51 +160,6 @@ private:
bool save_gnss_synchro_map_xml(const std::string& file_name); // debug helper function
bool load_gnss_synchro_map_xml(const std::string& file_name); // debug helper function
- bool d_dump;
- bool d_dump_mat;
- bool d_rinex_output_enabled;
- bool d_rinex_header_written;
- bool d_rinex_header_updated;
- bool d_geojson_output_enabled;
- bool d_gpx_output_enabled;
- bool d_kml_output_enabled;
- bool d_nmea_output_file_enabled;
- bool d_first_fix;
- bool d_xml_storage;
- bool d_flag_monitor_pvt_enabled;
- bool d_show_local_time_zone;
- bool d_waiting_obs_block_rx_clock_offset_correction_msg;
- bool d_enable_rx_clock_correction;
- bool d_rtcm_writing_started;
- bool d_rtcm_enabled;
-
- int32_t d_rinexobs_rate_ms;
- int32_t d_rtcm_MT1045_rate_ms; // Galileo Broadcast Ephemeris
- int32_t d_rtcm_MT1019_rate_ms; // GPS Broadcast Ephemeris (orbits)
- int32_t d_rtcm_MT1020_rate_ms; // GLONASS Broadcast Ephemeris (orbits)
- int32_t d_rtcm_MT1077_rate_ms; // The type 7 Multiple Signal Message format for the USA’s GPS system, popular
- int32_t d_rtcm_MT1087_rate_ms; // GLONASS MSM7. The type 7 Multiple Signal Message format for the Russian GLONASS system
- int32_t d_rtcm_MT1097_rate_ms; // Galileo MSM7. The type 7 Multiple Signal Message format for Europe’s Galileo system
- int32_t d_rtcm_MSM_rate_ms;
- int32_t d_kml_rate_ms;
- int32_t d_gpx_rate_ms;
- int32_t d_geojson_rate_ms;
- int32_t d_nmea_rate_ms;
- int32_t d_last_status_print_seg; // for status printer
- int32_t d_output_rate_ms;
- int32_t d_display_rate_ms;
- int32_t d_report_rate_ms;
- int32_t d_max_obs_block_rx_clock_offset_ms;
-
- uint32_t d_nchannels;
- uint32_t d_type_of_rx;
-
- double d_rinex_version;
- double d_rx_time;
-
- key_t d_sysv_msg_key;
- int d_sysv_msqid;
-
std::unique_ptr d_rp;
std::unique_ptr d_kml_dump;
std::unique_ptr d_gpx_dump;
@@ -246,6 +201,51 @@ private:
std::map d_gnss_observables_map_t1;
boost::posix_time::time_duration d_utc_diff_time;
+
+ double d_rinex_version;
+ double d_rx_time;
+
+ key_t d_sysv_msg_key;
+ int d_sysv_msqid;
+
+ int32_t d_rinexobs_rate_ms;
+ int32_t d_rtcm_MT1045_rate_ms; // Galileo Broadcast Ephemeris
+ int32_t d_rtcm_MT1019_rate_ms; // GPS Broadcast Ephemeris (orbits)
+ int32_t d_rtcm_MT1020_rate_ms; // GLONASS Broadcast Ephemeris (orbits)
+ int32_t d_rtcm_MT1077_rate_ms; // The type 7 Multiple Signal Message format for the USA’s GPS system, popular
+ int32_t d_rtcm_MT1087_rate_ms; // GLONASS MSM7. The type 7 Multiple Signal Message format for the Russian GLONASS system
+ int32_t d_rtcm_MT1097_rate_ms; // Galileo MSM7. The type 7 Multiple Signal Message format for Europe’s Galileo system
+ int32_t d_rtcm_MSM_rate_ms;
+ int32_t d_kml_rate_ms;
+ int32_t d_gpx_rate_ms;
+ int32_t d_geojson_rate_ms;
+ int32_t d_nmea_rate_ms;
+ int32_t d_last_status_print_seg; // for status printer
+ int32_t d_output_rate_ms;
+ int32_t d_display_rate_ms;
+ int32_t d_report_rate_ms;
+ int32_t d_max_obs_block_rx_clock_offset_ms;
+
+ uint32_t d_nchannels;
+ uint32_t d_type_of_rx;
+
+ bool d_dump;
+ bool d_dump_mat;
+ bool d_rinex_output_enabled;
+ bool d_rinex_header_written;
+ bool d_rinex_header_updated;
+ bool d_geojson_output_enabled;
+ bool d_gpx_output_enabled;
+ bool d_kml_output_enabled;
+ bool d_nmea_output_file_enabled;
+ bool d_first_fix;
+ bool d_xml_storage;
+ bool d_flag_monitor_pvt_enabled;
+ bool d_show_local_time_zone;
+ bool d_waiting_obs_block_rx_clock_offset_correction_msg;
+ bool d_enable_rx_clock_correction;
+ bool d_rtcm_writing_started;
+ bool d_rtcm_enabled;
};
#endif // GNSS_SDR_RTKLIB_PVT_GS_H
diff --git a/src/algorithms/PVT/libs/geojson_printer.h b/src/algorithms/PVT/libs/geojson_printer.h
index ec4dfe2dc..6a3d56e5e 100644
--- a/src/algorithms/PVT/libs/geojson_printer.h
+++ b/src/algorithms/PVT/libs/geojson_printer.h
@@ -24,7 +24,6 @@
#include
-#include
#include
class Pvt_Solution;
@@ -45,9 +44,9 @@ public:
private:
std::ofstream geojson_file;
- bool first_pos;
std::string filename_;
std::string geojson_base_path;
+ bool first_pos;
};
#endif
diff --git a/src/algorithms/PVT/libs/gpx_printer.h b/src/algorithms/PVT/libs/gpx_printer.h
index 0500eaff8..4c6efd491 100644
--- a/src/algorithms/PVT/libs/gpx_printer.h
+++ b/src/algorithms/PVT/libs/gpx_printer.h
@@ -24,7 +24,6 @@
#include
-#include
#include
class Pvt_Solution;
@@ -45,10 +44,10 @@ public:
private:
std::ofstream gpx_file;
- bool positions_printed;
std::string gpx_filename;
std::string indent;
std::string gpx_base_path;
+ bool positions_printed;
};
#endif
diff --git a/src/algorithms/PVT/libs/kml_printer.h b/src/algorithms/PVT/libs/kml_printer.h
index 6d9fa2ac4..44cf613b2 100644
--- a/src/algorithms/PVT/libs/kml_printer.h
+++ b/src/algorithms/PVT/libs/kml_printer.h
@@ -23,7 +23,6 @@
#define GNSS_SDR_KML_PRINTER_H
#include // for ofstream
-#include // for shared_ptr
#include
class Pvt_Solution;
@@ -45,12 +44,12 @@ public:
private:
std::ofstream kml_file;
std::ofstream tmp_file;
- bool positions_printed;
std::string kml_filename;
std::string kml_base_path;
std::string tmp_file_str;
- unsigned int point_id;
std::string indent;
+ unsigned int point_id;
+ bool positions_printed;
};
#endif
diff --git a/src/algorithms/PVT/libs/nmea_printer.h b/src/algorithms/PVT/libs/nmea_printer.h
index c05ca4af1..7c894cd4f 100644
--- a/src/algorithms/PVT/libs/nmea_printer.h
+++ b/src/algorithms/PVT/libs/nmea_printer.h
@@ -46,23 +46,17 @@ public:
*/
Nmea_Printer(const std::string& filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_devname, const std::string& base_path = ".");
- /*!
- * \brief Print NMEA PVT and satellite info to the initialized device
- */
- bool Print_Nmea_Line(const Rtklib_Solver* pvt_data, bool print_average_values);
-
/*!
* \brief Default destructor.
*/
~Nmea_Printer();
+ /*!
+ * \brief Print NMEA PVT and satellite info to the initialized device
+ */
+ bool Print_Nmea_Line(const Rtklib_Solver* pvt_data, bool print_average_values);
+
private:
- std::string nmea_filename; // String with the NMEA log filename
- std::string nmea_base_path;
- std::ofstream nmea_file_descriptor; // Output file stream for NMEA log file
- std::string nmea_devname;
- int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port)
- const Rtklib_Solver* d_PVT_data;
int init_serial(const std::string& serial_device); // serial port control
void close_serial();
std::string get_GPGGA(); // fix data
@@ -73,6 +67,17 @@ private:
std::string longitude_to_hm(double longitude);
std::string latitude_to_hm(double lat);
char checkSum(const std::string& sentence);
+
+ const Rtklib_Solver* d_PVT_data;
+
+ std::ofstream nmea_file_descriptor; // Output file stream for NMEA log file
+
+ std::string nmea_filename; // String with the NMEA log filename
+ std::string nmea_base_path;
+ std::string nmea_devname;
+
+ int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port)
+
bool print_avg_pos;
bool d_flag_nmea_output_file;
};
diff --git a/src/algorithms/PVT/libs/pvt_conf.h b/src/algorithms/PVT/libs/pvt_conf.h
index a2223d090..436de1562 100644
--- a/src/algorithms/PVT/libs/pvt_conf.h
+++ b/src/algorithms/PVT/libs/pvt_conf.h
@@ -27,44 +27,15 @@
class Pvt_Conf
{
public:
- uint32_t type_of_receiver;
- int32_t output_rate_ms;
- int32_t display_rate_ms;
- int32_t kml_rate_ms;
- int32_t gpx_rate_ms;
- int32_t geojson_rate_ms;
- int32_t nmea_rate_ms;
+ Pvt_Conf();
- int32_t rinex_version;
- int32_t rinexobs_rate_ms;
- std::string rinex_name;
std::map rtcm_msg_rate_ms;
- bool dump;
- bool dump_mat;
+ std::string rinex_name;
std::string dump_filename;
-
- bool flag_nmea_tty_port;
std::string nmea_dump_filename;
std::string nmea_dump_devname;
-
- bool flag_rtcm_server;
- bool flag_rtcm_tty_port;
- uint16_t rtcm_tcp_port;
- uint16_t rtcm_station_id;
std::string rtcm_dump_devname;
-
- bool output_enabled;
- bool rinex_output_enabled;
- bool gpx_output_enabled;
- bool geojson_output_enabled;
- bool nmea_output_file_enabled;
- bool kml_output_enabled;
- bool xml_output_enabled;
- bool rtcm_output_file_enabled;
-
- int32_t max_obs_block_rx_clock_offset_ms;
-
std::string output_path;
std::string rinex_output_path;
std::string gpx_output_path;
@@ -73,17 +44,41 @@ public:
std::string kml_output_path;
std::string xml_output_path;
std::string rtcm_output_file_path;
-
- bool monitor_enabled;
- bool protobuf_enabled;
std::string udp_addresses;
+
+ uint32_t type_of_receiver;
+ int32_t output_rate_ms;
+ int32_t display_rate_ms;
+ int32_t kml_rate_ms;
+ int32_t gpx_rate_ms;
+ int32_t geojson_rate_ms;
+ int32_t nmea_rate_ms;
+ int32_t rinex_version;
+ int32_t rinexobs_rate_ms;
+ int32_t max_obs_block_rx_clock_offset_ms;
int udp_port;
+ uint16_t rtcm_tcp_port;
+ uint16_t rtcm_station_id;
+
+ bool flag_nmea_tty_port;
+ bool flag_rtcm_server;
+ bool flag_rtcm_tty_port;
+ bool output_enabled;
+ bool rinex_output_enabled;
+ bool gpx_output_enabled;
+ bool geojson_output_enabled;
+ bool nmea_output_file_enabled;
+ bool kml_output_enabled;
+ bool xml_output_enabled;
+ bool rtcm_output_file_enabled;
+ bool monitor_enabled;
+ bool protobuf_enabled;
bool enable_rx_clock_correction;
bool show_local_time_zone;
bool pre_2009_file;
-
- Pvt_Conf();
+ bool dump;
+ bool dump_mat;
};
#endif
diff --git a/src/algorithms/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h
index afbb694da..cb1eb5289 100644
--- a/src/algorithms/PVT/libs/pvt_solution.h
+++ b/src/algorithms/PVT/libs/pvt_solution.h
@@ -132,6 +132,14 @@ public:
protected:
bool d_pre_2009_file; // Flag to correct week rollover in post processing mode for signals older than 2009
private:
+ arma::vec d_rx_pos;
+ arma::vec d_rx_vel;
+ boost::posix_time::ptime d_position_UTC_time;
+
+ std::deque d_hist_latitude_d;
+ std::deque d_hist_longitude_d;
+ std::deque d_hist_height_m;
+
double d_rx_dt_s; // RX time offset [s]
double d_rx_clock_drift_ppm; // RX clock drift [ppm]
@@ -145,19 +153,11 @@ private:
double d_avg_longitude_d; // Averaged longitude in degrees
double d_avg_height_m; // Averaged height [m]
- bool b_valid_position;
-
- std::deque d_hist_latitude_d;
- std::deque d_hist_longitude_d;
- std::deque d_hist_height_m;
-
- bool d_flag_averaging;
int d_averaging_depth; // Length of averaging window
-
- arma::vec d_rx_pos;
- arma::vec d_rx_vel;
- boost::posix_time::ptime d_position_UTC_time;
int d_valid_observations;
+
+ bool b_valid_position;
+ bool d_flag_averaging;
};
#endif
diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc
index bf6ae5a28..3293bb912 100644
--- a/src/algorithms/PVT/libs/rinex_printer.cc
+++ b/src/algorithms/PVT/libs/rinex_printer.cc
@@ -11888,13 +11888,13 @@ boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Gps_Navigation_Me
{
// if we are processing a file -> wait to leap second to resolve the ambiguity else take the week from the local system time
// idea: resolve the ambiguity with the leap second
- const double utc_t = nav_msg.utc_time(nav_msg.d_TOW);
- boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast((utc_t + 604800 * static_cast(nav_msg.i_GPS_week)) * 1000));
+ const double utc_t = nav_msg.utc_time(nav_msg.get_TOW());
+ boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast((utc_t + 604800 * static_cast(nav_msg.get_GPS_week())) * 1000));
// Handle week rollover
if (pre_2009_file_ == false)
{
// Handle week rollover (valid from 2009 to 2029)
- if (nav_msg.i_GPS_week < 512)
+ if (nav_msg.get_GPS_week() < 512)
{
boost::posix_time::ptime p_time(boost::gregorian::date(2019, 4, 7), t);
return p_time;
diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h
index c40712ac6..d4cca80a0 100644
--- a/src/algorithms/PVT/libs/rinex_printer.h
+++ b/src/algorithms/PVT/libs/rinex_printer.h
@@ -440,10 +440,6 @@ public:
void set_pre_2009_file(bool pre_2009_file);
private:
- int version; // RINEX version (2 for 2.10/2.11 and 3 for 3.01)
- int numberTypesObservations; // Number of available types of observable in the system. Should be public?
- bool pre_2009_file_;
-
/*
* Generation of RINEX signal strength indicators
*/
@@ -477,8 +473,6 @@ private:
*/
void lengthCheck(const std::string& line);
- double fake_cnav_iode;
-
/*
* If the string is bigger than length, truncate it from the right.
* otherwise, add pad characters to its right.
@@ -653,6 +647,11 @@ private:
inline std::string asString(const X x);
inline std::string asFixWidthString(const int x, const int width, char fill_digit);
+
+ double fake_cnav_iode;
+ int version; // RINEX version (2 for 2.10/2.11 and 3 for 3.01)
+ int numberTypesObservations; // Number of available types of observable in the system. Should be public?
+ bool pre_2009_file_;
};
diff --git a/src/algorithms/PVT/libs/rtcm_printer.h b/src/algorithms/PVT/libs/rtcm_printer.h
index 78f42b96f..9cb36464a 100644
--- a/src/algorithms/PVT/libs/rtcm_printer.h
+++ b/src/algorithms/PVT/libs/rtcm_printer.h
@@ -146,17 +146,18 @@ public:
uint32_t lock_time(const Glonass_Gnav_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro);
private:
- std::string rtcm_filename; // String with the RTCM log filename
- std::string rtcm_base_path;
- std::ofstream rtcm_file_descriptor; // Output file stream for RTCM log file
- std::string rtcm_devname;
- uint16_t port;
- uint16_t station_id;
- int32_t rtcm_dev_descriptor; // RTCM serial device descriptor (i.e. COM port)
int32_t init_serial(const std::string& serial_device); // serial port control
void close_serial();
- std::shared_ptr rtcm;
bool Print_Message(const std::string& message);
+
+ std::shared_ptr rtcm;
+ std::ofstream rtcm_file_descriptor; // Output file stream for RTCM log file
+ std::string rtcm_filename; // String with the RTCM log filename
+ std::string rtcm_base_path;
+ std::string rtcm_devname;
+ int32_t rtcm_dev_descriptor; // RTCM serial device descriptor (i.e. COM port)
+ uint16_t port;
+ uint16_t station_id;
bool d_rtcm_file_dump;
};
diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h
index b07642bba..bf8fcd2aa 100644
--- a/src/algorithms/PVT/libs/rtklib_solver.h
+++ b/src/algorithms/PVT/libs/rtklib_solver.h
@@ -73,14 +73,15 @@ public:
bool get_PVT(const std::map& gnss_observables_map, bool flag_averaging);
- sol_t pvt_sol{};
- std::array pvt_ssat{};
double get_hdop() const override;
double get_vdop() const override;
double get_pdop() const override;
double get_gdop() const override;
Monitor_Pvt get_monitor_pvt() const;
+ sol_t pvt_sol{};
+ std::array pvt_ssat{};
+
std::map galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
std::map gps_ephemeris_map; //!< Map storing new GPS_Ephemeris
std::map gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris
@@ -106,16 +107,17 @@ public:
std::map beidou_dnav_almanac_map;
private:
- rtk_t rtk_{};
- Monitor_Pvt monitor_pvt{};
+ bool save_matfile();
+
std::array obs_data{};
std::array dop_{};
+ rtk_t rtk_{};
+ Monitor_Pvt monitor_pvt{};
std::string d_dump_filename;
std::ofstream d_dump_file;
int d_nchannels; // Number of available channels for positioning
bool d_flag_dump_enabled;
bool d_flag_dump_mat_enabled;
- bool save_matfile();
};
#endif // GNSS_SDR_RTKLIB_SOLVER_H
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h
index 00fd045af..55f8916cf 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h
@@ -234,37 +234,6 @@ private:
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, uint32_t num_doppler_bins, int32_t doppler_max, int32_t doppler_step);
- bool d_active;
- bool d_worker_active;
- bool d_cshort;
- bool d_step_two;
- bool d_use_CFAR_algorithm_flag;
- bool d_dump;
- int32_t d_state;
- int32_t d_positive_acq;
- uint32_t d_channel;
- uint32_t d_samplesPerChip;
- uint32_t d_doppler_step;
- int32_t d_doppler_center;
- int32_t d_doppler_bias;
- uint32_t d_num_noncoherent_integrations_counter;
- uint32_t d_fft_size;
- uint32_t d_consumed_samples;
- uint32_t d_num_doppler_bins;
- uint32_t d_num_doppler_bins_step2;
- uint32_t d_dump_channel;
- uint32_t d_buffer_count;
- uint64_t d_sample_counter;
- int64_t d_dump_number;
- float d_threshold;
- float d_mag;
- float d_input_power;
- float d_test_statistics;
- float d_doppler_center_step_two;
- std::string d_dump_filename;
- std::unique_ptr d_fft_if;
- std::unique_ptr d_ifft;
- std::weak_ptr d_channel_fsm;
volk_gnsssdr::vector> d_magnitude_grid;
volk_gnsssdr::vector d_tmp_buffer;
volk_gnsssdr::vector> d_input_signal;
@@ -273,10 +242,47 @@ private:
volk_gnsssdr::vector> d_fft_codes;
volk_gnsssdr::vector> d_data_buffer;
volk_gnsssdr::vector d_data_buffer_sc;
+
+ std::string d_dump_filename;
+ std::unique_ptr d_fft_if;
+ std::unique_ptr d_ifft;
+ std::weak_ptr d_channel_fsm;
+
Acq_Conf d_acq_parameters;
Gnss_Synchro* d_gnss_synchro;
arma::fmat d_grid;
arma::fmat d_narrow_grid;
+
+ int64_t d_dump_number;
+ uint64_t d_sample_counter;
+
+ float d_threshold;
+ float d_mag;
+ float d_input_power;
+ float d_test_statistics;
+ float d_doppler_center_step_two;
+
+ int32_t d_state;
+ int32_t d_positive_acq;
+ int32_t d_doppler_center;
+ int32_t d_doppler_bias;
+ uint32_t d_channel;
+ uint32_t d_samplesPerChip;
+ uint32_t d_doppler_step;
+ uint32_t d_num_noncoherent_integrations_counter;
+ uint32_t d_fft_size;
+ uint32_t d_consumed_samples;
+ uint32_t d_num_doppler_bins;
+ uint32_t d_num_doppler_bins_step2;
+ uint32_t d_dump_channel;
+ uint32_t d_buffer_count;
+
+ bool d_active;
+ bool d_worker_active;
+ bool d_cshort;
+ bool d_step_two;
+ bool d_use_CFAR_algorithm_flag;
+ bool d_dump;
};
#endif // GNSS_SDR_PCPS_ACQUISITION_H
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h
index 95625ba7a..011531d50 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h
@@ -42,21 +42,21 @@ class Gnss_Synchro;
typedef struct
{
/* pcps acquisition configuration */
- uint32_t doppler_max;
- int64_t fs_in;
- int32_t samples_per_code;
- int32_t code_length;
- uint32_t select_queue_Fpga;
std::string device_name;
+ int64_t fs_in;
+ float doppler_step2;
uint32_t* all_fft_codes; // pointer to memory that contains all the code ffts
+ uint32_t doppler_max;
+ uint32_t select_queue_Fpga;
uint32_t downsampling_factor;
uint32_t total_block_exp;
uint32_t excludelimit;
- bool make_2_steps;
uint32_t num_doppler_bins_step2;
- float doppler_step2;
- bool repeat_satellite;
uint32_t max_num_acqs;
+ int32_t samples_per_code;
+ int32_t code_length;
+ bool make_2_steps;
+ bool repeat_satellite;
} pcpsconf_fpga_t;
class pcps_acquisition_fpga;
@@ -195,12 +195,28 @@ private:
void acquisition_core(uint32_t num_doppler_bins, uint32_t doppler_step, int32_t doppler_min);
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);
- bool d_active;
- bool d_make_2_steps;
+ pcpsconf_fpga_t d_acq_parameters;
+
+ std::shared_ptr d_acquisition_fpga;
+ std::weak_ptr d_channel_fsm;
+
+ Gnss_Synchro* d_gnss_synchro;
+
+ uint64_t d_sample_counter;
+
+ float d_threshold;
+ float d_mag;
+ float d_input_power;
+ float d_test_statistics;
+ float d_doppler_step2;
+ float d_doppler_center_step_two;
+
+ int32_t d_doppler_center;
+ int32_t d_state;
+
uint32_t d_doppler_index;
uint32_t d_channel;
uint32_t d_doppler_step;
- int32_t d_doppler_center;
uint32_t d_doppler_max;
uint32_t d_fft_size;
uint32_t d_num_doppler_bins;
@@ -209,18 +225,9 @@ private:
uint32_t d_total_block_exp;
uint32_t d_num_doppler_bins_step2;
uint32_t d_max_num_acqs;
- int32_t d_state;
- uint64_t d_sample_counter;
- float d_threshold;
- float d_mag;
- float d_input_power;
- float d_test_statistics;
- float d_doppler_step2;
- float d_doppler_center_step_two;
- std::shared_ptr d_acquisition_fpga;
- std::weak_ptr d_channel_fsm;
- pcpsconf_fpga_t d_acq_parameters;
- Gnss_Synchro* d_gnss_synchro;
+
+ bool d_active;
+ bool d_make_2_steps;
};
#endif // GNSS_SDR_PCPS_ACQUISITION_FPGA_H
diff --git a/src/algorithms/acquisition/libs/acq_conf.h b/src/algorithms/acquisition/libs/acq_conf.h
index 12d8d5957..27472a458 100644
--- a/src/algorithms/acquisition/libs/acq_conf.h
+++ b/src/algorithms/acquisition/libs/acq_conf.h
@@ -33,21 +33,33 @@ public:
void SetFromConfiguration(ConfigurationInterface *configuration, const std::string &role, double chip_rate, double opt_freq);
/* PCPS Acquisition configuration */
+ std::string item_type;
+ std::string dump_filename;
+
+ int64_t fs_in;
+ int64_t resampled_fs;
+
+ size_t it_size;
+
+ float doppler_step;
+ float samples_per_ms;
+ float doppler_step2;
+ float pfa;
+ float pfa2;
+ float samples_per_code;
+ float resampler_ratio;
+
uint32_t sampled_ms;
uint32_t ms_per_code;
uint32_t samples_per_chip;
uint32_t chips_per_second;
uint32_t max_dwells;
+ uint32_t num_doppler_bins_step2;
+ uint32_t resampler_latency_samples;
+ uint32_t dump_channel;
int32_t doppler_max;
int32_t doppler_min;
- float doppler_step;
- uint32_t num_doppler_bins_step2;
- float doppler_step2;
- float pfa;
- float pfa2;
- int64_t fs_in;
- float samples_per_ms;
- float samples_per_code;
+
bool bit_transition_flag;
bool use_CFAR_algorithm_flag;
bool dump;
@@ -55,13 +67,6 @@ public:
bool blocking_on_standby; // enable it only for unit testing to avoid sample consume on idle status
bool make_2_steps;
bool use_automatic_resampler;
- float resampler_ratio;
- int64_t resampled_fs;
- uint32_t resampler_latency_samples;
- std::string dump_filename;
- uint32_t dump_channel;
- size_t it_size;
- std::string item_type;
private:
void SetDerivedParams();
diff --git a/src/algorithms/acquisition/libs/fpga_acquisition.h b/src/algorithms/acquisition/libs/fpga_acquisition.h
index 6a5f91edd..1d7ac65c0 100644
--- a/src/algorithms/acquisition/libs/fpga_acquisition.h
+++ b/src/algorithms/acquisition/libs/fpga_acquisition.h
@@ -148,6 +148,12 @@ private:
static const uint32_t SELECT_ALL_CODE_BITS = 0xFFFFFFFF; // Select a 20 bit word
static const uint32_t SHL_CODE_BITS = 65536; // shift left by 10 bits
+ // FPGA private functions
+ void fpga_acquisition_test_register(void);
+ void read_result_valid(uint32_t *result_valid);
+
+ std::string d_device_name; // HW device name
+
int64_t d_fs_in;
// data related to the hardware module and the driver
int32_t d_fd; // driver descriptor
@@ -158,13 +164,9 @@ private:
uint32_t d_nsamples_total; // number of samples including padding
uint32_t d_nsamples; // number of samples not including padding
uint32_t d_select_queue; // queue selection
- std::string d_device_name; // HW device name
uint32_t d_doppler_max; // max doppler
uint32_t d_doppler_step; // doppler step
uint32_t d_PRN; // PRN
- // FPGA private functions
- void fpga_acquisition_test_register(void);
- void read_result_valid(uint32_t *result_valid);
};
#endif // GNSS_SDR_FPGA_ACQUISITION_H
diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h
index 847749dd7..b62f1af10 100644
--- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h
+++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h
@@ -76,15 +76,7 @@ private:
void smooth_pseudoranges(std::vector& data);
int32_t save_matfile() const;
- bool d_T_rx_TOW_set; // rx time follow GPST
- bool d_dump;
- bool d_dump_mat;
- uint32_t d_T_rx_TOW_ms;
- uint32_t d_T_rx_step_ms;
- uint32_t d_T_status_report_timer_ms;
- uint32_t d_nchannels_in;
- uint32_t d_nchannels_out;
- double d_smooth_filter_M;
+ Obs_Conf d_conf;
enum StringValue_
{
@@ -102,6 +94,10 @@ private:
};
std::map d_mapStringValues;
+ std::unique_ptr> d_gnss_synchro_history; // Tracking observable history
+
+ boost::circular_buffer d_Rx_clock_buffer; // time history
+
std::vector d_channel_last_pll_lock;
std::vector d_channel_last_pseudorange_smooth;
std::vector d_channel_last_carrier_phase_rads;
@@ -110,11 +106,17 @@ private:
std::ofstream d_dump_file;
- std::unique_ptr> d_gnss_synchro_history; // Tracking observable history
+ double d_smooth_filter_M;
- boost::circular_buffer d_Rx_clock_buffer; // time history
+ uint32_t d_T_rx_TOW_ms;
+ uint32_t d_T_rx_step_ms;
+ uint32_t d_T_status_report_timer_ms;
+ uint32_t d_nchannels_in;
+ uint32_t d_nchannels_out;
- Obs_Conf d_conf;
+ bool d_T_rx_TOW_set; // rx time follow GPST
+ bool d_dump;
+ bool d_dump_mat;
};
#endif // GNSS_SDR_HYBRID_OBSERVABLES_GS_H
diff --git a/src/algorithms/observables/libs/obs_conf.cc b/src/algorithms/observables/libs/obs_conf.cc
index c2a8ad0f6..c5ff646cf 100644
--- a/src/algorithms/observables/libs/obs_conf.cc
+++ b/src/algorithms/observables/libs/obs_conf.cc
@@ -23,11 +23,11 @@
Obs_Conf::Obs_Conf()
{
- enable_carrier_smoothing = false;
+ dump_filename = "obs_dump.dat";
smoothing_factor = FLAGS_carrier_smoothing_factor;
nchannels_in = 0;
nchannels_out = 0;
+ enable_carrier_smoothing = false;
dump = false;
dump_mat = false;
- dump_filename = "obs_dump.dat";
}
diff --git a/src/algorithms/observables/libs/obs_conf.h b/src/algorithms/observables/libs/obs_conf.h
index e7d98030f..0faa4b4c0 100644
--- a/src/algorithms/observables/libs/obs_conf.h
+++ b/src/algorithms/observables/libs/obs_conf.h
@@ -27,15 +27,15 @@
class Obs_Conf
{
public:
- bool enable_carrier_smoothing;
+ Obs_Conf();
+
+ std::string dump_filename;
int32_t smoothing_factor;
uint32_t nchannels_in;
uint32_t nchannels_out;
+ bool enable_carrier_smoothing;
bool dump;
bool dump_mat;
- std::string dump_filename;
-
- Obs_Conf();
};
#endif
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc
index 7d2e133a1..7b957e0bf 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc
@@ -226,7 +226,7 @@ void beidou_b1i_telemetry_decoder_gs::decode_subframe(float *frame_symbols)
}
// 3. Check operation executed correctly
- if (d_nav.flag_crc_test == true)
+ if (d_nav.get_flag_CRC_test() == true)
{
DLOG(INFO) << "BeiDou DNAV CRC correct in channel " << d_channel
<< " from satellite " << d_satellite;
@@ -281,8 +281,8 @@ void beidou_b1i_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satell
// Update satellite information for DNAV decoder
sat_prn = d_satellite.get_PRN();
- d_nav.i_satellite_PRN = sat_prn;
- d_nav.i_signal_type = 1; // BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q)
+ d_nav.set_satellite_PRN(sat_prn);
+ d_nav.set_signal_type(1); // BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q)
// Update tel dec parameters for D2 NAV Messages
if (sat_prn > 0 and sat_prn < 6)
@@ -448,7 +448,7 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_
// call the decoder
decode_subframe(d_subframe_symbols.data());
- if (d_nav.flag_crc_test == true)
+ if (d_nav.get_flag_CRC_test() == true)
{
d_CRC_error_counter = 0;
d_flag_preamble = true; // valid preamble indicator (initialized to false every work())
@@ -505,7 +505,7 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_
// call the decoder
decode_subframe(d_subframe_symbols.data());
- if (d_nav.flag_crc_test == true)
+ if (d_nav.get_flag_CRC_test() == true)
{
d_CRC_error_counter = 0;
d_flag_preamble = true; // valid preamble indicator (initialized to false every work())
@@ -532,17 +532,17 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_
}
// UPDATE GNSS SYNCHRO DATA
// 2. Add the telemetry decoder information
- if (this->d_flag_preamble == true and d_nav.flag_new_SOW_available == true)
+ if (this->d_flag_preamble == true and d_nav.get_flag_new_SOW_available() == true)
// update TOW at the preamble instant
{
// Reporting sow as gps time of week
- d_TOW_at_Preamble_ms = static_cast((d_nav.d_SOW + BEIDOU_DNAV_BDT2GPST_LEAP_SEC_OFFSET) * 1000.0);
+ d_TOW_at_Preamble_ms = static_cast((d_nav.get_SOW() + BEIDOU_DNAV_BDT2GPST_LEAP_SEC_OFFSET) * 1000.0);
// check TOW update consistency
uint32_t last_d_TOW_at_current_symbol_ms = d_TOW_at_current_symbol_ms;
// compute new TOW
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + d_required_symbols * d_symbol_duration_ms;
flag_SOW_set = true;
- d_nav.flag_new_SOW_available = false;
+ d_nav.set_flag_new_SOW_available(false);
if (last_d_TOW_at_current_symbol_ms != 0 and abs(static_cast(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms)) > static_cast(d_symbol_duration_ms))
{
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.h
index 970cd6ab5..dd1a627da 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.h
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.h
@@ -83,42 +83,45 @@ private:
// Preamble decoding
std::array d_preamble_samples{};
- int32_t d_symbols_per_preamble;
- int32_t d_samples_per_preamble;
- int32_t d_preamble_period_samples;
+
std::array d_subframe_symbols{};
- uint32_t d_required_symbols;
// Storage for incoming data
boost::circular_buffer d_symbol_history;
- // Variables for internal functionality
- 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
- uint32_t d_stat; // Status of decoder
- bool d_flag_frame_sync; // Indicate when a frame sync is achieved
- bool d_flag_preamble; // Flag indicating when preamble was found
- int32_t d_CRC_error_counter; // Number of failed CRC operations
- bool flag_SOW_set; // Indicates when time of week is set
-
// Navigation Message variable
Beidou_Dnav_Navigation_Message d_nav;
+ // Satellite Information and logging capacity
+ Gnss_Satellite d_satellite;
+ std::string d_dump_filename;
+ std::ofstream d_dump_file;
+
+ 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
+
+ int32_t d_channel;
+ int32_t d_symbols_per_preamble;
+ int32_t d_samples_per_preamble;
+ int32_t d_preamble_period_samples;
+ int32_t d_CRC_error_counter; // Number of failed CRC operations
+ uint32_t d_required_symbols;
+ uint32_t d_stat; // Status of decoder
+
// Values to populate gnss synchronization structure
+ uint64_t d_last_valid_preamble;
uint32_t d_symbol_duration_ms;
uint32_t d_TOW_at_Preamble_ms;
uint32_t d_TOW_at_current_symbol_ms;
- uint64_t d_last_valid_preamble;
+
+ bool flag_SOW_set; // Indicates when time of week is set
+ bool d_flag_frame_sync; // Indicate when a frame sync is achieved
+ bool d_flag_preamble; // Flag indicating when preamble was found
+
bool d_flag_valid_word;
bool d_sent_tlm_failed_msg;
bool Flag_valid_word;
-
- // Satellite Information and logging capacity
- Gnss_Satellite d_satellite;
- int32_t d_channel;
bool d_dump;
- std::string d_dump_filename;
- std::ofstream d_dump_file;
};
#endif // GNSS_SDR_BEIDOU_B1I_TELEMETRY_DECODER_GS_H
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc
index d42283fa1..ee43b094f 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc
@@ -227,7 +227,7 @@ void beidou_b3i_telemetry_decoder_gs::decode_subframe(float *frame_symbols)
}
// 3. Check operation executed correctly
- if (d_nav.flag_crc_test == true)
+ if (d_nav.get_flag_CRC_test() == true)
{
DLOG(INFO) << "BeiDou DNAV CRC correct in channel " << d_channel
<< " from satellite " << d_satellite;
@@ -299,8 +299,8 @@ void beidou_b3i_telemetry_decoder_gs::set_satellite(
// Update satellite information for DNAV decoder
sat_prn = d_satellite.get_PRN();
- d_nav.i_satellite_PRN = sat_prn;
- d_nav.i_signal_type = 5; // BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q)
+ d_nav.set_satellite_PRN(sat_prn);
+ d_nav.set_signal_type(5); // BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q)
// Update tel dec parameters for D2 NAV Messages
if (sat_prn > 0 and sat_prn < 6)
@@ -474,7 +474,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work(
// call the decoder
decode_subframe(d_subframe_symbols.data());
- if (d_nav.flag_crc_test == true)
+ if (d_nav.get_flag_CRC_test() == true)
{
d_CRC_error_counter = 0;
d_flag_preamble = true; // valid preamble indicator (initialized to false every work())
@@ -534,7 +534,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work(
// call the decoder
decode_subframe(d_subframe_symbols.data());
- if (d_nav.flag_crc_test == true)
+ if (d_nav.get_flag_CRC_test() == true)
{
d_CRC_error_counter = 0;
d_flag_preamble = true; // valid preamble indicator (initialized to false every work())
@@ -563,17 +563,17 @@ int beidou_b3i_telemetry_decoder_gs::general_work(
}
// UPDATE GNSS SYNCHRO DATA
// 2. Add the telemetry decoder information
- if (this->d_flag_preamble == true and d_nav.flag_new_SOW_available == true)
+ if (this->d_flag_preamble == true and d_nav.get_flag_new_SOW_available() == true)
// update TOW at the preamble instant
{
// Reporting sow as gps time of week
- d_TOW_at_Preamble_ms = static_cast((d_nav.d_SOW + BEIDOU_DNAV_BDT2GPST_LEAP_SEC_OFFSET) * 1000.0);
+ d_TOW_at_Preamble_ms = static_cast((d_nav.get_SOW() + BEIDOU_DNAV_BDT2GPST_LEAP_SEC_OFFSET) * 1000.0);
// check TOW update consistency
uint32_t last_d_TOW_at_current_symbol_ms = d_TOW_at_current_symbol_ms;
// compute new TOW
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + d_required_symbols * d_symbol_duration_ms;
flag_SOW_set = true;
- d_nav.flag_new_SOW_available = false;
+ d_nav.set_flag_new_SOW_available(false);
if (last_d_TOW_at_current_symbol_ms != 0 and abs(static_cast(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms)) > static_cast(d_symbol_duration_ms))
{
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.h
index 71a3976c2..a7f28fb99 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.h
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.h
@@ -81,42 +81,43 @@ private:
// Preamble decoding
std::array d_preamble_samples{};
- int32_t d_symbols_per_preamble;
- int32_t d_samples_per_preamble;
- int32_t d_preamble_period_samples;
std::array d_subframe_symbols{};
- uint32_t d_required_symbols;
// Storage for incoming data
boost::circular_buffer d_symbol_history;
- // Variables for internal functionality
- 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
- uint32_t d_stat; // Status of decoder
- bool d_flag_frame_sync; // Indicate when a frame sync is achieved
- bool d_flag_preamble; // Flag indicating when preamble was found
- int32_t d_CRC_error_counter; // Number of failed CRC operations
- bool flag_SOW_set; // Indicates when time of week is set
-
// Navigation Message variable
Beidou_Dnav_Navigation_Message d_nav;
+ Gnss_Satellite d_satellite;
+
+ std::string d_dump_filename;
+ std::ofstream d_dump_file;
+
+ 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
+ uint32_t d_required_symbols;
+ uint32_t d_stat; // Status of decoder
+
+ int32_t d_channel;
+ int32_t d_CRC_error_counter; // Number of failed CRC operations
+ int32_t d_symbols_per_preamble;
+ int32_t d_samples_per_preamble;
+ int32_t d_preamble_period_samples;
+
// Values to populate gnss synchronization structure
+ uint64_t d_last_valid_preamble;
uint32_t d_symbol_duration_ms;
uint32_t d_TOW_at_Preamble_ms;
uint32_t d_TOW_at_current_symbol_ms;
- uint64_t d_last_valid_preamble;
+
+ bool flag_SOW_set; // Indicates when time of week is set
+ bool d_flag_frame_sync; // Indicate when a frame sync is achieved
+ bool d_flag_preamble; // Flag indicating when preamble was found
bool d_flag_valid_word;
bool d_sent_tlm_failed_msg;
bool Flag_valid_word;
-
- // Satellite Information and logging capacity
- Gnss_Satellite d_satellite;
- int32_t d_channel;
bool d_dump;
- std::string d_dump_filename;
- std::ofstream d_dump_file;
};
#endif // GNSS_SDR_BEIDOU_B3I_TELEMETRY_DECODER_GS_H
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc
index bb83638b3..4d5205a07 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc
@@ -252,7 +252,7 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in
{
// DECODE COMPLETE WORD (even + odd) and TEST CRC
d_inav_nav.split_page(page_String, flag_even_word_arrived);
- if (d_inav_nav.flag_CRC_test == true)
+ if (d_inav_nav.get_flag_CRC_test() == true)
{
DLOG(INFO) << "Galileo E1 CRC correct in channel " << d_channel << " from satellite " << d_satellite;
}
@@ -290,7 +290,7 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in
std::shared_ptr tmp_obj = std::make_shared(d_inav_nav.get_utc_model());
std::cout << "New Galileo E1 I/NAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << std::endl;
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
- d_delta_t = tmp_obj->A_0G_10 + tmp_obj->A_1G_10 * (static_cast(d_TOW_at_current_symbol_ms) / 1000.0 - tmp_obj->t_0G_10 + 604800 * (fmod((d_inav_nav.WN_0 - tmp_obj->WN_0G_10), 64)));
+ d_delta_t = tmp_obj->A_0G_10 + tmp_obj->A_1G_10 * (static_cast(d_TOW_at_current_symbol_ms) / 1000.0 - tmp_obj->t_0G_10 + 604800 * (std::fmod(static_cast(d_inav_nav.get_Galileo_week() - tmp_obj->WN_0G_10), 64.0)));
DLOG(INFO) << "delta_t=" << d_delta_t << "[s]";
}
if (d_inav_nav.have_new_almanac() == true)
@@ -301,7 +301,7 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in
std::cout << "Galileo E1 I/NAV almanac received in channel " << d_channel << " from satellite " << d_satellite << std::endl;
DLOG(INFO) << "Current parameters:";
DLOG(INFO) << "d_TOW_at_current_symbol_ms=" << d_TOW_at_current_symbol_ms;
- DLOG(INFO) << "d_nav.WN_0=" << d_inav_nav.WN_0;
+ DLOG(INFO) << "d_nav.WN_0=" << d_inav_nav.get_Galileo_week();
}
}
@@ -341,7 +341,7 @@ void galileo_telemetry_decoder_gs::decode_FNAV_word(float *page_symbols, int32_t
// DECODE COMPLETE WORD (even + odd) and TEST CRC
d_fnav_nav.split_page(page_String);
- if (d_fnav_nav.flag_CRC_test == true)
+ if (d_fnav_nav.get_flag_CRC_test() == true)
{
DLOG(INFO) << "Galileo E5a CRC correct in channel " << d_channel << " from satellite " << d_satellite;
}
@@ -595,7 +595,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
break;
}
d_preamble_index = d_sample_counter; // record the preamble sample stamp (t_P)
- if (d_inav_nav.flag_CRC_test == true or d_fnav_nav.flag_CRC_test == true)
+ if (d_inav_nav.get_flag_CRC_test() == true or d_fnav_nav.get_flag_CRC_test() == true)
{
d_CRC_error_counter = 0;
d_flag_preamble = true; // valid preamble indicator (initialized to false every work())
@@ -617,8 +617,8 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
d_stat = 0;
d_TOW_at_current_symbol_ms = 0;
d_TOW_at_Preamble_ms = 0;
- d_fnav_nav.flag_TOW_set = false;
- d_inav_nav.flag_TOW_set = false;
+ d_fnav_nav.set_flag_TOW_set(false);
+ d_inav_nav.set_flag_TOW_set(false);
}
}
}
@@ -635,22 +635,22 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
{
case 1: // INAV
{
- if (d_inav_nav.flag_TOW_set == true)
+ if (d_inav_nav.is_TOW_set() == true)
{
- if (d_inav_nav.flag_TOW_5 == true) // page 5 arrived and decoded, so we are in the odd page (since Tow refers to the even page, we have to add 1 sec)
+ if (d_inav_nav.is_TOW5_set() == true) // page 5 arrived and decoded, so we are in the odd page (since Tow refers to the even page, we have to add 1 sec)
{
// TOW_5 refers to the even preamble, but when we decode it we are in the odd part, so 1 second later plus the decoding delay
- d_TOW_at_Preamble_ms = static_cast(d_inav_nav.TOW_5 * 1000.0);
+ d_TOW_at_Preamble_ms = static_cast(d_inav_nav.get_TOW5() * 1000.0);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast(GALILEO_INAV_PAGE_PART_MS + (d_required_symbols + 1) * GALILEO_E1_CODE_PERIOD_MS);
- d_inav_nav.flag_TOW_5 = false;
+ d_inav_nav.set_TOW5_flag(false);
}
- else if (d_inav_nav.flag_TOW_6 == true) // page 6 arrived and decoded, so we are in the odd page (since Tow refers to the even page, we have to add 1 sec)
+ else if (d_inav_nav.is_TOW5_set() == true) // page 6 arrived and decoded, so we are in the odd page (since Tow refers to the even page, we have to add 1 sec)
{
// TOW_6 refers to the even preamble, but when we decode it we are in the odd part, so 1 second later plus the decoding delay
- d_TOW_at_Preamble_ms = static_cast(d_inav_nav.TOW_6 * 1000.0);
+ d_TOW_at_Preamble_ms = static_cast(d_inav_nav.get_TOW6() * 1000.0);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast(GALILEO_INAV_PAGE_PART_MS + (d_required_symbols + 1) * GALILEO_E1_CODE_PERIOD_MS);
- d_inav_nav.flag_TOW_6 = false;
+ d_inav_nav.set_TOW6_flag(false);
}
else
{
@@ -662,35 +662,35 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
}
case 2: // FNAV
{
- if (d_fnav_nav.flag_TOW_set == true)
+ if (d_fnav_nav.is_TOW_set() == true)
{
- if (d_fnav_nav.flag_TOW_1 == true)
+ if (d_fnav_nav.is_TOW1_set() == true)
{
- d_TOW_at_Preamble_ms = static_cast(d_fnav_nav.FNAV_TOW_1 * 1000.0);
+ d_TOW_at_Preamble_ms = static_cast(d_fnav_nav.get_TOW1() * 1000.0);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((d_required_symbols + 1) * GALILEO_FNAV_CODES_PER_SYMBOL * GALILEO_E5A_CODE_PERIOD_MS);
// d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS);
- d_fnav_nav.flag_TOW_1 = false;
+ d_fnav_nav.set_TOW1_flag(false);
}
- else if (d_fnav_nav.flag_TOW_2 == true)
+ else if (d_fnav_nav.is_TOW2_set() == true)
{
- d_TOW_at_Preamble_ms = static_cast(d_fnav_nav.FNAV_TOW_2 * 1000.0);
+ d_TOW_at_Preamble_ms = static_cast(d_fnav_nav.get_TOW2() * 1000.0);
// d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((d_required_symbols + 1) * GALILEO_FNAV_CODES_PER_SYMBOL * GALILEO_E5A_CODE_PERIOD_MS);
- d_fnav_nav.flag_TOW_2 = false;
+ d_fnav_nav.set_TOW2_flag(false);
}
- else if (d_fnav_nav.flag_TOW_3 == true)
+ else if (d_fnav_nav.is_TOW3_set() == true)
{
- d_TOW_at_Preamble_ms = static_cast(d_fnav_nav.FNAV_TOW_3 * 1000.0);
+ d_TOW_at_Preamble_ms = static_cast(d_fnav_nav.get_TOW3() * 1000.0);
// d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((d_required_symbols + 1) * GALILEO_FNAV_CODES_PER_SYMBOL * GALILEO_E5A_CODE_PERIOD_MS);
- d_fnav_nav.flag_TOW_3 = false;
+ d_fnav_nav.set_TOW3_flag(false);
}
- else if (d_fnav_nav.flag_TOW_4 == true)
+ else if (d_fnav_nav.is_TOW4_set() == true)
{
- d_TOW_at_Preamble_ms = static_cast(d_fnav_nav.FNAV_TOW_4 * 1000.0);
+ d_TOW_at_Preamble_ms = static_cast(d_fnav_nav.get_TOW4() * 1000.0);
// d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS);
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((d_required_symbols + 1) * GALILEO_FNAV_CODES_PER_SYMBOL * GALILEO_E5A_CODE_PERIOD_MS);
- d_fnav_nav.flag_TOW_4 = false;
+ d_fnav_nav.set_TOW4_flag(false);
}
else
{
@@ -707,7 +707,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
{
case 1: // INAV
{
- if (d_inav_nav.flag_TOW_set == true)
+ if (d_inav_nav.is_TOW_set() == true)
{
d_TOW_at_current_symbol_ms += d_PRN_code_period_ms;
}
@@ -715,7 +715,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
}
case 2: // FNAV
{
- if (d_fnav_nav.flag_TOW_set == true)
+ if (d_fnav_nav.is_TOW_set() == true)
{
d_TOW_at_current_symbol_ms += d_PRN_code_period_ms;
}
@@ -728,11 +728,11 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
{
case 1: // INAV
{
- if (d_inav_nav.flag_TOW_set)
+ if (d_inav_nav.is_TOW_set())
{
- if (d_inav_nav.flag_GGTO_1 == true and d_inav_nav.flag_GGTO_2 == true and d_inav_nav.flag_GGTO_3 == true and d_inav_nav.flag_GGTO_4 == true) // all GGTO parameters arrived
+ if (d_inav_nav.get_flag_GGTO()) // all GGTO parameters arrived
{
- d_delta_t = d_inav_nav.A_0G_10 + d_inav_nav.A_1G_10 * (static_cast(d_TOW_at_current_symbol_ms) / 1000.0 - d_inav_nav.t_0G_10 + 604800.0 * (fmod((d_inav_nav.WN_0 - d_inav_nav.WN_0G_10), 64.0)));
+ d_delta_t = d_inav_nav.get_A0G() + d_inav_nav.get_A1G() * (static_cast(d_TOW_at_current_symbol_ms) / 1000.0 - d_inav_nav.get_t0G() + 604800.0 * (std::fmod(static_cast(d_inav_nav.get_Galileo_week() - d_inav_nav.get_WN0G()), 64.0)));
}
current_symbol.Flag_valid_word = true;
@@ -742,7 +742,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
case 2: // FNAV
{
- if (d_fnav_nav.flag_TOW_set)
+ if (d_fnav_nav.is_TOW_set())
{
current_symbol.Flag_valid_word = true;
}
@@ -750,7 +750,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
}
}
- if (d_inav_nav.flag_TOW_set or d_fnav_nav.flag_TOW_set)
+ if (d_inav_nav.is_TOW_set() or d_fnav_nav.is_TOW_set())
{
current_symbol.TOW_at_current_symbol_ms = d_TOW_at_current_symbol_ms;
// todo: Galileo to GPS time conversion should be moved to observable block.
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.h
index 575ac3437..71aa3ad00 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.h
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.h
@@ -78,24 +78,42 @@ private:
galileo_telemetry_decoder_gs(const Gnss_Satellite &satellite, int frame_type, bool dump);
+ const int32_t d_nn = 2; // Coding rate 1/n
+ const int32_t d_KK = 7; // Constraint Length
+
void viterbi_decoder(float *page_part_symbols, int32_t *page_part_bits);
void deinterleaver(int32_t rows, int32_t cols, const float *in, float *out);
void decode_INAV_word(float *page_part_symbols, int32_t frame_length);
void decode_FNAV_word(float *page_symbols, int32_t frame_length);
- bool d_sent_tlm_failed_msg;
- bool d_flag_frame_sync;
- bool d_flag_PLL_180_deg_phase_locked;
- bool d_flag_parity;
- bool d_flag_preamble;
- bool d_dump;
+ // vars for Viterbi decoder
+ std::vector d_preamble_samples;
+ std::vector d_page_part_symbols;
+ std::vector d_out0;
+ std::vector d_out1;
+ std::vector d_state0;
+ std::vector d_state1;
+
+ std::string d_dump_filename;
+ std::ofstream d_dump_file;
+
+ boost::circular_buffer d_symbol_history;
+
+ Gnss_Satellite d_satellite;
+
+ // navigation message vars
+ Galileo_Navigation_Message d_inav_nav;
+ Galileo_Fnav_Message d_fnav_nav;
+
+ double d_delta_t; // GPS-GALILEO time offset
+
+ uint64_t d_sample_counter;
+ uint64_t d_preamble_index;
+ uint64_t d_last_valid_preamble;
- const int32_t d_nn = 2; // Coding rate 1/n
- const int32_t d_KK = 7; // Constraint Length
int32_t d_mm = d_KK - 1;
int32_t d_codelength;
int32_t d_datalength;
-
int32_t d_frame_type;
int32_t d_bits_per_preamble;
int32_t d_samples_per_preamble;
@@ -109,32 +127,14 @@ private:
uint32_t d_stat;
uint32_t d_TOW_at_Preamble_ms;
uint32_t d_TOW_at_current_symbol_ms;
- uint64_t d_sample_counter;
- uint64_t d_preamble_index;
- uint64_t d_last_valid_preamble;
uint32_t d_max_symbols_without_valid_frame;
- double d_delta_t; // GPS-GALILEO time offset
-
- // vars for Viterbi decoder
- std::vector d_out0;
- std::vector d_out1;
- std::vector d_state0;
- std::vector d_state1;
-
- std::vector d_preamble_samples;
- std::vector d_page_part_symbols;
-
- std::string d_dump_filename;
- std::ofstream d_dump_file;
-
- boost::circular_buffer d_symbol_history;
-
- Gnss_Satellite d_satellite;
-
- // navigation message vars
- Galileo_Navigation_Message d_inav_nav;
- Galileo_Fnav_Message d_fnav_nav;
+ bool d_sent_tlm_failed_msg;
+ bool d_flag_frame_sync;
+ bool d_flag_PLL_180_deg_phase_locked;
+ bool d_flag_parity;
+ bool d_flag_preamble;
+ bool d_dump;
};
#endif // GNSS_SDR_GALILEO_TELEMETRY_DECODER_GS_H
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.cc
index c1b16e66f..31994074a 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.cc
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.cc
@@ -165,7 +165,7 @@ void glonass_l1_ca_telemetry_decoder_gs::decode_string(const double *frame_symbo
d_nav.string_decoder(data_bits);
// 3. Check operation executed correctly
- if (d_nav.flag_CRC_test == true)
+ if (d_nav.get_flag_CRC_test() == true)
{
LOG(INFO) << "GLONASS GNAV CRC correct in channel " << d_channel << " from satellite " << d_satellite;
}
@@ -177,7 +177,7 @@ void glonass_l1_ca_telemetry_decoder_gs::decode_string(const double *frame_symbo
if (d_nav.have_new_ephemeris() == true)
{
// get object for this SV (mandatory)
- d_nav.gnav_ephemeris.i_satellite_freq_channel = d_satellite.get_rf_link();
+ d_nav.set_rf_link(d_satellite.get_rf_link());
std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris());
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
LOG(INFO) << "GLONASS GNAV Ephemeris have been received in channel" << d_channel << " from satellite " << d_satellite;
@@ -193,19 +193,20 @@ void glonass_l1_ca_telemetry_decoder_gs::decode_string(const double *frame_symbo
}
if (d_nav.have_new_almanac() == true)
{
- uint32_t slot_nbr = d_nav.i_alm_satellite_slot_number;
- std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac(slot_nbr));
+ uint32_t slot_nbr = d_nav.get_alm_satellite_slot_number();
+ std::shared_ptr
+ tmp_obj = std::make_shared(d_nav.get_almanac(slot_nbr));
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
LOG(INFO) << "GLONASS GNAV Almanac have been received in channel" << d_channel << " in slot number " << slot_nbr;
std::cout << "New GLONASS L1 GNAV almanac received in channel " << d_channel << " from satellite " << d_satellite << std::endl;
}
// 5. Update satellite information on system
- if (d_nav.flag_update_slot_number == true)
+ if (d_nav.get_flag_update_slot_number() == true)
{
LOG(INFO) << "GLONASS GNAV Slot Number Identified in channel " << d_channel;
- d_satellite.update_PRN(d_nav.gnav_ephemeris.d_n);
- d_satellite.what_block(d_satellite.get_system(), d_nav.gnav_ephemeris.d_n);
- d_nav.flag_update_slot_number = false;
+ d_satellite.update_PRN(d_nav.get_ephemeris().d_n);
+ d_satellite.what_block(d_satellite.get_system(), d_nav.get_ephemeris().d_n);
+ d_nav.set_flag_update_slot_number(false);
}
}
@@ -342,7 +343,7 @@ int glonass_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribu
// call the decoder
decode_string(string_symbols.data(), string_length);
- if (d_nav.flag_CRC_test == true)
+ if (d_nav.get_flag_CRC_test() == true)
{
d_CRC_error_counter = 0;
d_flag_preamble = true; // valid preamble indicator (initialized to false every work())
@@ -370,25 +371,25 @@ int glonass_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribu
// UPDATE GNSS SYNCHRO DATA
// 2. Add the telemetry decoder information
- if (this->d_flag_preamble == true and d_nav.flag_TOW_new == true)
+ if (this->d_flag_preamble == true and d_nav.get_flag_TOW_new() == true)
// update TOW at the preamble instant
{
- d_TOW_at_current_symbol = floor((d_nav.gnav_ephemeris.d_TOW - GLONASS_GNAV_PREAMBLE_DURATION_S) * 1000) / 1000;
- d_nav.flag_TOW_new = false;
+ d_TOW_at_current_symbol = floor((d_nav.get_ephemeris().d_TOW - GLONASS_GNAV_PREAMBLE_DURATION_S) * 1000) / 1000;
+ d_nav.set_flag_TOW_new(false);
}
else // if there is not a new preamble, we define the TOW of the current symbol
{
d_TOW_at_current_symbol = d_TOW_at_current_symbol + GLONASS_L1_CA_CODE_PERIOD_S;
}
- // if (d_flag_frame_sync == true and d_nav.flag_TOW_set==true and d_nav.flag_CRC_test == true)
+ // if (d_flag_frame_sync == true and d_nav.flag_TOW_set==true and d_nav.get_flag_CRC_test() == true)
// if(d_nav.flag_GGTO_1 == true and d_nav.flag_GGTO_2 == true and d_nav.flag_GGTO_3 == true and d_nav.flag_GGTO_4 == true) // all GGTO parameters arrived
// {
// delta_t = d_nav.A_0G_10 + d_nav.A_1G_10 * (d_TOW_at_current_symbol - d_nav.t_0G_10 + 604800.0 * (fmod((d_nav.WN_0 - d_nav.WN_0G_10), 64)));
// }
- if (d_flag_frame_sync == true and d_nav.flag_TOW_set == true)
+ if (d_flag_frame_sync == true and d_nav.is_flag_TOW_set() == true)
{
current_symbol.Flag_valid_word = true;
}
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.h
index 294a22763..dbf16754a 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.h
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.h
@@ -81,43 +81,46 @@ private:
glonass_l1_ca_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump);
+ const std::array d_preambles_bits{GLONASS_GNAV_PREAMBLE};
+
+ const int32_t d_symbols_per_preamble = GLONASS_GNAV_PREAMBLE_LENGTH_SYMBOLS;
+
void decode_string(const double *symbols, int32_t frame_length);
// Help with coherent tracking
- double d_preamble_time_samples;
// Preamble decoding
- const std::array d_preambles_bits{GLONASS_GNAV_PREAMBLE};
std::array d_preambles_symbols{};
- const int32_t d_symbols_per_preamble = GLONASS_GNAV_PREAMBLE_LENGTH_SYMBOLS;
// Storage for incoming data
boost::circular_buffer d_symbol_history;
- // Variables for internal functionality
- 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
- uint32_t 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
- int32_t 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;
- // Values to populate gnss synchronization structure
- double d_TOW_at_current_symbol;
- bool Flag_valid_word;
-
- // Satellite Information and logging capacity
Gnss_Satellite d_satellite;
- int32_t d_channel;
- bool d_dump;
+
std::string d_dump_filename;
std::ofstream d_dump_file;
+
+ double d_preamble_time_samples;
+ double d_TOW_at_current_symbol;
+ double delta_t; // GPS-GLONASS time offset
+
+ // Variables for internal functionality
+ 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
+
+ uint32_t d_stat; // Status of decoder
+ int32_t d_CRC_error_counter; // Number of failed CRC operations
+ int32_t d_channel;
+
+ 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
+ bool flag_TOW_set; // Indicates when time of week is set
+ bool Flag_valid_word;
+ bool d_dump;
};
#endif // GNSS_SDR_GLONASS_L1_CA_TELEMETRY_DECODER_GS_H
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.cc
index 9833a3a18..1cec12e96 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.cc
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.cc
@@ -165,7 +165,7 @@ void glonass_l2_ca_telemetry_decoder_gs::decode_string(const double *frame_symbo
d_nav.string_decoder(data_bits);
// 3. Check operation executed correctly
- if (d_nav.flag_CRC_test == true)
+ if (d_nav.get_flag_CRC_test() == true)
{
LOG(INFO) << "GLONASS GNAV CRC correct in channel " << d_channel << " from satellite " << d_satellite;
}
@@ -177,7 +177,7 @@ void glonass_l2_ca_telemetry_decoder_gs::decode_string(const double *frame_symbo
if (d_nav.have_new_ephemeris() == true)
{
// get object for this SV (mandatory)
- d_nav.gnav_ephemeris.i_satellite_freq_channel = d_satellite.get_rf_link();
+ d_nav.set_rf_link(d_satellite.get_rf_link());
std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris());
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
LOG(INFO) << "GLONASS GNAV Ephemeris have been received in channel" << d_channel << " from satellite " << d_satellite;
@@ -193,19 +193,19 @@ void glonass_l2_ca_telemetry_decoder_gs::decode_string(const double *frame_symbo
}
if (d_nav.have_new_almanac() == true)
{
- uint32_t slot_nbr = d_nav.i_alm_satellite_slot_number;
+ uint32_t slot_nbr = d_nav.get_alm_satellite_slot_number();
std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac(slot_nbr));
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
LOG(INFO) << "GLONASS GNAV Almanac have been received in channel" << d_channel << " in slot number " << slot_nbr;
std::cout << TEXT_CYAN << "New GLONASS L2 GNAV almanac received in channel " << d_channel << " from satellite " << d_satellite << TEXT_RESET << std::endl;
}
// 5. Update satellite information on system
- if (d_nav.flag_update_slot_number == true)
+ if (d_nav.get_flag_update_slot_number() == true)
{
LOG(INFO) << "GLONASS GNAV Slot Number Identified in channel " << d_channel;
- d_satellite.update_PRN(d_nav.gnav_ephemeris.d_n);
- d_satellite.what_block(d_satellite.get_system(), d_nav.gnav_ephemeris.d_n);
- d_nav.flag_update_slot_number = false;
+ d_satellite.update_PRN(d_nav.get_ephemeris().d_n);
+ d_satellite.what_block(d_satellite.get_system(), d_nav.get_ephemeris().d_n);
+ d_nav.set_flag_update_slot_number(false);
}
}
@@ -342,7 +342,7 @@ int glonass_l2_ca_telemetry_decoder_gs::general_work(int noutput_items __attribu
// call the decoder
decode_string(string_symbols.data(), string_length);
- if (d_nav.flag_CRC_test == true)
+ if (d_nav.get_flag_CRC_test() == true)
{
d_CRC_error_counter = 0;
d_flag_preamble = true; // valid preamble indicator (initialized to false every work())
@@ -370,25 +370,25 @@ int glonass_l2_ca_telemetry_decoder_gs::general_work(int noutput_items __attribu
// UPDATE GNSS SYNCHRO DATA
// 2. Add the telemetry decoder information
- if (this->d_flag_preamble == true and d_nav.flag_TOW_new == true)
+ if (this->d_flag_preamble == true and d_nav.get_flag_TOW_new() == true)
// update TOW at the preamble instant
{
- d_TOW_at_current_symbol = floor((d_nav.gnav_ephemeris.d_TOW - GLONASS_GNAV_PREAMBLE_DURATION_S) * 1000) / 1000;
- d_nav.flag_TOW_new = false;
+ d_TOW_at_current_symbol = floor((d_nav.get_ephemeris().d_TOW - GLONASS_GNAV_PREAMBLE_DURATION_S) * 1000) / 1000;
+ d_nav.set_flag_TOW_new(false);
}
else // if there is not a new preamble, we define the TOW of the current symbol
{
d_TOW_at_current_symbol = d_TOW_at_current_symbol + GLONASS_L2_CA_CODE_PERIOD_S;
}
- // if (d_flag_frame_sync == true and d_nav.flag_TOW_set==true and d_nav.flag_CRC_test == true)
+ // if (d_flag_frame_sync == true and d_nav.flag_TOW_set==true and d_nav.get_flag_CRC_test() == true)
// if(d_nav.flag_GGTO_1 == true and d_nav.flag_GGTO_2 == true and d_nav.flag_GGTO_3 == true and d_nav.flag_GGTO_4 == true) // all GGTO parameters arrived
// {
// delta_t = d_nav.A_0G_10 + d_nav.A_1G_10 * (d_TOW_at_current_symbol - d_nav.t_0G_10 + 604800.0 * (fmod((d_nav.WN_0 - d_nav.WN_0G_10), 64)));
// }
- if (d_flag_frame_sync == true and d_nav.flag_TOW_set == true)
+ if (d_flag_frame_sync == true and d_nav.is_flag_TOW_set() == true)
{
current_symbol.Flag_valid_word = true;
}
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.h
index c39f61f0f..fa5148a16 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.h
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.h
@@ -78,43 +78,42 @@ private:
glonass_l2_ca_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump);
- void decode_string(const double *symbols, int32_t frame_length);
-
- // Help with coherent tracking
- double d_preamble_time_samples;
-
- // Preamble decoding
const std::array d_preambles_bits{GLONASS_GNAV_PREAMBLE};
- std::array d_preambles_symbols{};
+
const int32_t d_symbols_per_preamble = GLONASS_GNAV_PREAMBLE_LENGTH_SYMBOLS;
+ void decode_string(const double *symbols, int32_t frame_length);
+
// Storage for incoming data
boost::circular_buffer d_symbol_history;
- // Variables for internal functionality
- 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
- uint32_t 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
- int32_t 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
+ std::array d_preambles_symbols{};
// Navigation Message variable
Glonass_Gnav_Navigation_Message d_nav;
- // Values to populate gnss synchronization structure
- double d_TOW_at_current_symbol;
- bool Flag_valid_word;
-
- // Satellite Information and logging capacity
Gnss_Satellite d_satellite;
- int32_t d_channel;
- bool d_dump;
+
std::string d_dump_filename;
std::ofstream d_dump_file;
+
+ double d_preamble_time_samples;
+ double delta_t; // GPS-GLONASS time offset
+ double d_TOW_at_current_symbol;
+
+ 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
+ uint32_t d_stat; // Status of decoder
+
+ int32_t d_CRC_error_counter; // Number of failed CRC operations
+ int32_t d_channel;
+
+ bool Flag_valid_word;
+ 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
+ bool flag_TOW_set; // Indicates when time of week is set
+ bool d_dump;
};
#endif // GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_GS_H
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc
index 11f91c130..94175ef34 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc
@@ -172,7 +172,7 @@ void gps_l1_ca_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satelli
d_nav = Gps_Navigation_Message();
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite;
- d_nav.i_satellite_PRN = d_satellite.get_PRN();
+ d_nav.set_satellite_PRN(d_satellite.get_PRN());
DLOG(INFO) << "Navigation Satellite set to " << d_satellite;
}
@@ -180,7 +180,7 @@ void gps_l1_ca_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satelli
void gps_l1_ca_telemetry_decoder_gs::set_channel(int32_t channel)
{
d_channel = channel;
- d_nav.i_channel_ID = channel;
+ d_nav.set_channel(channel);
DLOG(INFO) << "Navigation channel set to " << channel;
// ############# ENABLE DATA FILE LOG #################
if (d_dump == true)
@@ -274,7 +274,7 @@ bool gps_l1_ca_telemetry_decoder_gs::decode_subframe()
std::cout << "New GPS NAV message received in channel " << this->d_channel << ": "
<< "subframe "
<< subframe_ID << " from satellite "
- << Gnss_Satellite(std::string("GPS"), d_nav.i_satellite_PRN) << std::endl;
+ << Gnss_Satellite(std::string("GPS"), d_nav.get_satellite_PRN()) << std::endl;
switch (subframe_ID)
{
@@ -287,12 +287,12 @@ bool gps_l1_ca_telemetry_decoder_gs::decode_subframe()
}
break;
case 4: // Possible IONOSPHERE and UTC model update (page 18)
- if (d_nav.flag_iono_valid == true)
+ if (d_nav.get_flag_iono_valid() == true)
{
std::shared_ptr tmp_obj = std::make_shared(d_nav.get_iono());
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
}
- if (d_nav.flag_utc_model_valid == true)
+ if (d_nav.get_flag_utc_model_valid() == true)
{
std::shared_ptr tmp_obj = std::make_shared(d_nav.get_utc_model());
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
@@ -474,15 +474,15 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
// 2. Add the telemetry decoder information
if (d_flag_preamble == true)
{
- if (!(d_nav.d_TOW == 0))
+ if (!(d_nav.get_TOW() == 0))
{
- d_TOW_at_current_symbol_ms = static_cast(d_nav.d_TOW * 1000.0);
- d_TOW_at_Preamble_ms = static_cast(d_nav.d_TOW * 1000.0);
+ d_TOW_at_current_symbol_ms = static_cast(d_nav.get_TOW() * 1000.0);
+ d_TOW_at_Preamble_ms = static_cast(d_nav.get_TOW() * 1000.0);
d_flag_TOW_set = true;
}
else
{
- DLOG(INFO) << "Received GPS L1 TOW equal to zero at sat " << d_nav.i_satellite_PRN;
+ DLOG(INFO) << "Received GPS L1 TOW equal to zero at sat " << d_nav.get_satellite_PRN();
}
}
else
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h
index 2d520be29..decb1f9a1 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h
@@ -76,13 +76,19 @@ private:
bool gps_word_parityCheck(uint32_t gpsword);
bool decode_subframe();
- bool d_flag_frame_sync;
- bool d_flag_parity;
- bool d_flag_preamble;
- bool d_sent_tlm_failed_msg;
- bool d_flag_PLL_180_deg_phase_locked;
- bool d_flag_TOW_set;
- bool d_dump;
+ Gps_Navigation_Message d_nav;
+ Gnss_Satellite d_satellite;
+
+ std::array d_preamble_samples{};
+
+ std::string d_dump_filename;
+ std::ofstream d_dump_file;
+
+ boost::circular_buffer d_symbol_history;
+
+ uint64_t d_sample_counter;
+ uint64_t d_preamble_index;
+ uint64_t d_last_valid_preamble;
int32_t d_bits_per_preamble;
int32_t d_samples_per_preamble;
@@ -98,19 +104,13 @@ private:
uint32_t d_TOW_at_Preamble_ms;
uint32_t d_TOW_at_current_symbol_ms;
- uint64_t d_sample_counter;
- uint64_t d_preamble_index;
- uint64_t d_last_valid_preamble;
-
- std::array d_preamble_samples{};
-
- std::string d_dump_filename;
- std::ofstream d_dump_file;
-
- boost::circular_buffer d_symbol_history;
-
- Gps_Navigation_Message d_nav;
- Gnss_Satellite d_satellite;
+ bool d_flag_frame_sync;
+ bool d_flag_parity;
+ bool d_flag_preamble;
+ bool d_sent_tlm_failed_msg;
+ bool d_flag_PLL_180_deg_phase_locked;
+ bool d_flag_TOW_set;
+ bool d_dump;
};
#endif // GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_GS_H
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.h
index 01a6722c2..a3c69ce26 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.h
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.h
@@ -75,31 +75,31 @@ private:
gps_l2c_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump);
- bool d_dump;
- bool d_sent_tlm_failed_msg;
- bool d_flag_PLL_180_deg_phase_locked;
- bool d_flag_valid_word;
-
- int32_t d_channel;
- int32_t d_state;
- int32_t d_crc_error_count;
-
- uint64_t d_sample_counter;
-
- uint64_t d_last_valid_preamble;
- uint32_t d_max_symbols_without_valid_frame;
-
- double d_TOW_at_current_symbol;
- double d_TOW_at_Preamble;
-
- std::string d_dump_filename;
- std::ofstream d_dump_file;
-
Gnss_Satellite d_satellite;
cnav_msg_decoder_t d_cnav_decoder{};
Gps_CNAV_Navigation_Message d_CNAV_Message;
+
+ std::string d_dump_filename;
+ std::ofstream d_dump_file;
+
+ double d_TOW_at_current_symbol;
+ double d_TOW_at_Preamble;
+
+ uint64_t d_sample_counter;
+ uint64_t d_last_valid_preamble;
+
+ int32_t d_channel;
+ int32_t d_state;
+ int32_t d_crc_error_count;
+
+ uint32_t d_max_symbols_without_valid_frame;
+
+ bool d_dump;
+ bool d_sent_tlm_failed_msg;
+ bool d_flag_PLL_180_deg_phase_locked;
+ bool d_flag_valid_word;
};
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.h
index 8e8c19a11..c06e6e685 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.h
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.h
@@ -74,27 +74,28 @@ private:
gps_l5_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump);
- bool d_dump;
- bool d_flag_PLL_180_deg_phase_locked;
- bool d_flag_valid_word;
- bool d_sent_tlm_failed_msg;
-
- int32_t d_channel;
-
- uint32_t d_TOW_at_current_symbol_ms;
- uint32_t d_TOW_at_Preamble_ms;
- uint64_t d_sample_counter;
- uint64_t d_last_valid_preamble;
- uint32_t d_max_symbols_without_valid_frame;
-
- std::string d_dump_filename;
- std::ofstream d_dump_file;
-
cnav_msg_decoder_t d_cnav_decoder{};
Gnss_Satellite d_satellite;
Gps_CNAV_Navigation_Message d_CNAV_Message;
+
+ std::string d_dump_filename;
+ std::ofstream d_dump_file;
+
+ uint64_t d_sample_counter;
+ uint64_t d_last_valid_preamble;
+
+ int32_t d_channel;
+
+ uint32_t d_TOW_at_current_symbol_ms;
+ uint32_t d_TOW_at_Preamble_ms;
+ uint32_t d_max_symbols_without_valid_frame;
+
+ bool d_flag_PLL_180_deg_phase_locked;
+ bool d_flag_valid_word;
+ bool d_sent_tlm_failed_msg;
+ bool d_dump;
};
diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h
index a389e7fb7..324bacfd0 100644
--- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h
+++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h
@@ -88,41 +88,30 @@ private:
bool acquire_secondary();
int32_t save_matfile();
- bool d_pull_in_transitory;
- bool d_corrected_doppler;
- bool d_interchange_iq;
- bool d_veml;
- bool d_cloop;
- bool d_secondary;
- bool d_dump;
- bool d_dump_mat;
- bool d_acc_carrier_phase_initialized;
- bool d_enable_extended_integration;
+ Cpu_Multicorrelator_Real_Codes d_multicorrelator_cpu;
+ Cpu_Multicorrelator_Real_Codes d_correlator_data_cpu; // for data channel
- int32_t d_symbols_per_bit;
- int32_t d_preamble_length_symbols;
- int32_t d_state;
- int32_t d_correlation_length_ms;
- int32_t d_n_correlator_taps;
- int32_t d_current_prn_length_samples;
- int32_t d_extend_correlation_symbols_count;
- int32_t d_current_symbol;
- int32_t d_current_data_symbol;
- int32_t d_cn0_estimation_counter;
- int32_t d_carrier_lock_fail_counter;
- int32_t d_code_lock_fail_counter;
+ Dll_Pll_Conf d_trk_parameters;
- uint32_t d_channel;
- uint32_t d_secondary_code_length;
- uint32_t d_data_secondary_code_length;
- uint32_t d_code_length_chips;
- uint32_t d_code_samples_per_chip; // All signals have 1 sample per chip code except Gal. E1 which has 2 (CBOC disabled) or 12 (CBOC enabled)
+ Exponential_Smoother d_cn0_smoother;
+ Exponential_Smoother d_carrier_lock_test_smoother;
- uint64_t d_sample_counter;
- uint64_t d_acq_sample_stamp;
+ Tracking_loop_filter d_code_loop_filter;
+ Tracking_FLL_PLL_filter d_carrier_loop_filter;
- float *d_prompt_data_shift;
- float d_rem_carr_phase_rad;
+ Gnss_Synchro *d_acquisition_gnss_synchro;
+
+ volk_gnsssdr::vector d_tracking_code;
+ volk_gnsssdr::vector d_data_code;
+ volk_gnsssdr::vector d_local_code_shift_chips;
+ volk_gnsssdr::vector d_correlator_outs;
+ volk_gnsssdr::vector d_Prompt_Data;
+ volk_gnsssdr::vector d_Prompt_buffer;
+
+ boost::circular_buffer d_dll_filt_history;
+ boost::circular_buffer> d_code_ph_history;
+ boost::circular_buffer> d_carr_ph_history;
+ boost::circular_buffer d_Prompt_circular_buffer;
double d_signal_carrier_freq;
double d_code_period;
@@ -175,30 +164,41 @@ private:
std::ofstream d_dump_file;
- boost::circular_buffer d_dll_filt_history;
- boost::circular_buffer> d_code_ph_history;
- boost::circular_buffer> d_carr_ph_history;
- boost::circular_buffer d_Prompt_circular_buffer;
+ uint64_t d_sample_counter;
+ uint64_t d_acq_sample_stamp;
- volk_gnsssdr::vector d_tracking_code;
- volk_gnsssdr::vector d_data_code;
- volk_gnsssdr::vector d_local_code_shift_chips;
- volk_gnsssdr::vector d_correlator_outs;
- volk_gnsssdr::vector d_Prompt_Data;
- volk_gnsssdr::vector d_Prompt_buffer;
+ float *d_prompt_data_shift;
+ float d_rem_carr_phase_rad;
- Cpu_Multicorrelator_Real_Codes d_multicorrelator_cpu;
- Cpu_Multicorrelator_Real_Codes d_correlator_data_cpu; // for data channel
+ int32_t d_symbols_per_bit;
+ int32_t d_preamble_length_symbols;
+ int32_t d_state;
+ int32_t d_correlation_length_ms;
+ int32_t d_n_correlator_taps;
+ int32_t d_current_prn_length_samples;
+ int32_t d_extend_correlation_symbols_count;
+ int32_t d_current_symbol;
+ int32_t d_current_data_symbol;
+ int32_t d_cn0_estimation_counter;
+ int32_t d_carrier_lock_fail_counter;
+ int32_t d_code_lock_fail_counter;
- Dll_Pll_Conf d_trk_parameters;
+ uint32_t d_channel;
+ uint32_t d_secondary_code_length;
+ uint32_t d_data_secondary_code_length;
+ uint32_t d_code_length_chips;
+ uint32_t d_code_samples_per_chip; // All signals have 1 sample per chip code except Gal. E1 which has 2 (CBOC disabled) or 12 (CBOC enabled)
- Exponential_Smoother d_cn0_smoother;
- Exponential_Smoother d_carrier_lock_test_smoother;
-
- Gnss_Synchro *d_acquisition_gnss_synchro;
-
- Tracking_loop_filter d_code_loop_filter;
- Tracking_FLL_PLL_filter d_carrier_loop_filter;
+ bool d_pull_in_transitory;
+ bool d_corrected_doppler;
+ bool d_interchange_iq;
+ bool d_veml;
+ bool d_cloop;
+ bool d_secondary;
+ bool d_dump;
+ bool d_dump_mat;
+ bool d_acc_carrier_phase_initialized;
+ bool d_enable_extended_integration;
};
#endif // GNSS_SDR_DLL_PLL_VEML_TRACKING_H
diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h
index 14fd9b987..89d35c84f 100644
--- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h
+++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h
@@ -117,50 +117,41 @@ private:
void log_data();
int32_t save_matfile();
- bool d_veml;
- bool d_cloop;
- bool d_secondary;
- bool d_enable_extended_integration;
- bool d_dump;
- bool d_dump_mat;
- bool d_pull_in_transitory;
- bool d_corrected_doppler;
- bool d_interchange_iq;
- bool d_acc_carrier_phase_initialized;
- bool d_worker_is_done;
- bool d_extended_correlation_in_fpga;
- bool d_current_extended_correlation_in_fpga;
- bool d_stop_tracking;
- bool d_sc_demodulate_enabled;
+ Dll_Pll_Conf_Fpga d_trk_parameters;
- int32_t d_symbols_per_bit;
- int32_t d_state;
- int32_t d_extend_correlation_symbols_count;
- int32_t d_current_symbol;
- int32_t d_current_data_symbol;
- int32_t d_current_integration_length_samples;
- int32_t d_cn0_estimation_counter;
- int32_t d_carrier_lock_fail_counter;
- int32_t d_code_lock_fail_counter;
- int32_t d_correlation_length_ms;
- int32_t d_n_correlator_taps;
- int32_t d_next_integration_length_samples;
- int32_t d_extend_fpga_integration_periods;
+ Exponential_Smoother d_cn0_smoother;
+ Exponential_Smoother d_carrier_lock_test_smoother;
- uint32_t d_channel;
- uint32_t d_secondary_code_length;
- uint32_t d_data_secondary_code_length;
- uint32_t d_code_length_chips;
- uint32_t d_code_samples_per_chip; // All signals have 1 sample per chip code except Gal. E1 which has 2 (CBOC disabled) or 12 (CBOC enabled)
- uint32_t d_fpga_integration_period;
- uint32_t d_current_fpga_integration_period;
+ Gnss_Synchro *d_acquisition_gnss_synchro;
- uint64_t d_sample_counter;
- uint64_t d_acq_sample_stamp;
- uint64_t d_sample_counter_next;
+ Tracking_loop_filter d_code_loop_filter;
- float *d_prompt_data_shift;
- float d_rem_carr_phase_rad;
+ Tracking_FLL_PLL_filter d_carrier_loop_filter;
+
+ volk_gnsssdr::vector d_local_code_shift_chips;
+ volk_gnsssdr::vector d_correlator_outs;
+ volk_gnsssdr::vector d_Prompt_Data;
+ volk_gnsssdr::vector d_Prompt_buffer;
+
+ boost::circular_buffer d_dll_filt_history;
+ boost::circular_buffer> d_code_ph_history;
+ boost::circular_buffer> d_carr_ph_history;
+ boost::circular_buffer d_Prompt_circular_buffer;
+
+ std::string d_systemName;
+ std::string d_signal_type;
+ std::string *d_secondary_code_string;
+ std::string *d_data_secondary_code_string;
+ std::string d_signal_pretty_name;
+ std::string d_dump_filename;
+
+ std::ofstream d_dump_file;
+
+ std::shared_ptr d_multicorrelator_fpga;
+
+ boost::condition_variable d_m_condition;
+
+ boost::mutex d_mutex;
double d_signal_carrier_freq;
double d_code_period;
@@ -205,41 +196,50 @@ private:
gr_complex d_VL_accu;
gr_complex d_P_data_accu;
- std::string d_systemName;
- std::string d_signal_type;
- std::string *d_secondary_code_string;
- std::string *d_data_secondary_code_string;
- std::string d_signal_pretty_name;
- std::string d_dump_filename;
+ uint64_t d_sample_counter;
+ uint64_t d_acq_sample_stamp;
+ uint64_t d_sample_counter_next;
- std::ofstream d_dump_file;
+ float *d_prompt_data_shift;
+ float d_rem_carr_phase_rad;
- std::shared_ptr d_multicorrelator_fpga;
+ int32_t d_symbols_per_bit;
+ int32_t d_state;
+ int32_t d_extend_correlation_symbols_count;
+ int32_t d_current_symbol;
+ int32_t d_current_data_symbol;
+ int32_t d_current_integration_length_samples;
+ int32_t d_cn0_estimation_counter;
+ int32_t d_carrier_lock_fail_counter;
+ int32_t d_code_lock_fail_counter;
+ int32_t d_correlation_length_ms;
+ int32_t d_n_correlator_taps;
+ int32_t d_next_integration_length_samples;
+ int32_t d_extend_fpga_integration_periods;
- volk_gnsssdr::vector d_local_code_shift_chips;
- volk_gnsssdr::vector d_correlator_outs;
- volk_gnsssdr::vector d_Prompt_Data;
- volk_gnsssdr::vector d_Prompt_buffer;
+ uint32_t d_channel;
+ uint32_t d_secondary_code_length;
+ uint32_t d_data_secondary_code_length;
+ uint32_t d_code_length_chips;
+ uint32_t d_code_samples_per_chip; // All signals have 1 sample per chip code except Gal. E1 which has 2 (CBOC disabled) or 12 (CBOC enabled)
+ uint32_t d_fpga_integration_period;
+ uint32_t d_current_fpga_integration_period;
- boost::circular_buffer d_dll_filt_history;
- boost::circular_buffer> d_code_ph_history;
- boost::circular_buffer> d_carr_ph_history;
- boost::circular_buffer d_Prompt_circular_buffer;
-
- boost::condition_variable d_m_condition;
-
- boost::mutex d_mutex;
-
- Dll_Pll_Conf_Fpga d_trk_parameters;
-
- Exponential_Smoother d_cn0_smoother;
- Exponential_Smoother d_carrier_lock_test_smoother;
-
- Gnss_Synchro *d_acquisition_gnss_synchro;
-
- Tracking_loop_filter d_code_loop_filter;
-
- Tracking_FLL_PLL_filter d_carrier_loop_filter;
+ bool d_veml;
+ bool d_cloop;
+ bool d_secondary;
+ bool d_enable_extended_integration;
+ bool d_dump;
+ bool d_dump_mat;
+ bool d_pull_in_transitory;
+ bool d_corrected_doppler;
+ bool d_interchange_iq;
+ bool d_acc_carrier_phase_initialized;
+ bool d_worker_is_done;
+ bool d_extended_correlation_in_fpga;
+ bool d_current_extended_correlation_in_fpga;
+ bool d_stop_tracking;
+ bool d_sc_demodulate_enabled;
};
#endif // GNSS_SDR_DLL_PLL_VEML_TRACKING_FPGA_H
diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator.h b/src/algorithms/tracking/libs/cpu_multicorrelator.h
index b4d138db5..de28df786 100644
--- a/src/algorithms/tracking/libs/cpu_multicorrelator.h
+++ b/src/algorithms/tracking/libs/cpu_multicorrelator.h
@@ -45,8 +45,8 @@ public:
private:
// Allocate the device input vectors
const std::complex *d_sig_in;
- std::complex **d_local_codes_resampled;
const std::complex *d_local_code_in;
+ std::complex **d_local_codes_resampled;
std::complex *d_corr_out;
float *d_shifts_chips;
int d_code_length_chips;
diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.h b/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.h
index a918fd33c..af5a4976d 100644
--- a/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.h
+++ b/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.h
@@ -45,8 +45,8 @@ public:
private:
// Allocate the device input vectors
const lv_16sc_t *d_sig_in;
- lv_16sc_t **d_local_codes_resampled;
const lv_16sc_t *d_local_code_in;
+ lv_16sc_t **d_local_codes_resampled;
lv_16sc_t *d_corr_out;
float *d_shifts_chips;
int d_code_length_chips;
diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.h b/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.h
index 533665a69..03fc8580a 100644
--- a/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.h
+++ b/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.h
@@ -48,13 +48,13 @@ public:
private:
// Allocate the device input vectors
const std::complex *d_sig_in;
- float **d_local_codes_resampled;
const float *d_local_code_in;
std::complex *d_corr_out;
+ float **d_local_codes_resampled;
float *d_shifts_chips;
- bool d_use_high_dynamics_resampler;
int d_code_length_chips;
int d_n_correlators;
+ bool d_use_high_dynamics_resampler;
};
diff --git a/src/algorithms/tracking/libs/dll_pll_conf.h b/src/algorithms/tracking/libs/dll_pll_conf.h
index 83ac7d4e6..769906a6c 100644
--- a/src/algorithms/tracking/libs/dll_pll_conf.h
+++ b/src/algorithms/tracking/libs/dll_pll_conf.h
@@ -33,18 +33,10 @@ public:
void SetFromConfiguration(ConfigurationInterface *configuration, const std::string &role);
/* DLL/PLL tracking configuration */
- int32_t fll_filter_order;
- bool enable_fll_pull_in;
- bool enable_fll_steady_state;
- uint32_t pull_in_time_s;
- uint32_t bit_synchronization_time_limit_s;
- int32_t pll_filter_order;
- int32_t dll_filter_order;
- double fs_in;
- uint32_t vector_length;
- bool dump;
- bool dump_mat;
+ std::string item_type;
std::string dump_filename;
+ double fs_in;
+ double carrier_lock_th;
float pll_pull_in_bw_hz;
float dll_pull_in_bw_hz;
float fll_bw_hz;
@@ -59,24 +51,32 @@ public:
float slope;
float spc;
float y_intercept;
+ float cn0_smoother_alpha;
+ float carrier_lock_test_smoother_alpha;
+ uint32_t pull_in_time_s;
+ uint32_t bit_synchronization_time_limit_s;
+ uint32_t vector_length;
+ uint32_t smoother_length;
+ int32_t fll_filter_order;
+ int32_t pll_filter_order;
+ int32_t dll_filter_order;
int32_t extend_correlation_symbols;
- bool carrier_aiding;
- bool high_dyn;
- std::string item_type;
int32_t cn0_samples;
int32_t cn0_smoother_samples;
- float cn0_smoother_alpha;
int32_t carrier_lock_test_smoother_samples;
- float carrier_lock_test_smoother_alpha;
int32_t cn0_min;
int32_t max_code_lock_fail;
int32_t max_carrier_lock_fail;
- uint32_t smoother_length;
- double carrier_lock_th;
+ char signal[3]{};
+ char system;
+ bool enable_fll_pull_in;
+ bool enable_fll_steady_state;
bool track_pilot;
bool enable_doppler_correction;
- char system;
- char signal[3]{};
+ bool carrier_aiding;
+ bool high_dyn;
+ bool dump;
+ bool dump_mat;
};
#endif
diff --git a/src/algorithms/tracking/libs/dll_pll_conf_fpga.h b/src/algorithms/tracking/libs/dll_pll_conf_fpga.h
index 90a9bff2c..e014ef697 100644
--- a/src/algorithms/tracking/libs/dll_pll_conf_fpga.h
+++ b/src/algorithms/tracking/libs/dll_pll_conf_fpga.h
@@ -35,19 +35,12 @@ public:
void SetFromConfiguration(ConfigurationInterface* configuration, const std::string& role);
/* DLL/PLL tracking configuration */
- int32_t fll_filter_order;
- bool enable_fll_pull_in;
- bool enable_fll_steady_state;
- uint32_t pull_in_time_s; // signed integer, when pull in time is not yet reached it has to be compared against a negative number
- uint32_t bit_synchronization_time_limit_s;
- int32_t pll_filter_order;
- int32_t dll_filter_order;
+ std::string device_name;
+ std::string dump_filename;
double fs_in;
- uint32_t vector_length;
- bool dump;
- bool dump_mat;
- std::string dump_filename;
+ double carrier_lock_th;
+
float pll_pull_in_bw_hz;
float dll_pull_in_bw_hz;
float fll_bw_hz;
@@ -62,36 +55,47 @@ public:
float slope;
float spc;
float y_intercept;
- int32_t extend_correlation_symbols;
- bool carrier_aiding;
- bool high_dyn;
- int32_t cn0_samples;
- int32_t cn0_min;
- int32_t max_code_lock_fail;
- int32_t max_carrier_lock_fail;
-
- int32_t cn0_smoother_samples;
float cn0_smoother_alpha;
- int32_t carrier_lock_test_smoother_samples;
float carrier_lock_test_smoother_alpha;
- // int32_t max_lock_fail;
+ uint32_t pull_in_time_s; // signed integer, when pull in time is not yet reached it has to be compared against a negative number
+ uint32_t bit_synchronization_time_limit_s;
+ uint32_t vector_length;
uint32_t smoother_length;
- double carrier_lock_th;
- bool track_pilot;
- bool enable_doppler_correction;
- char system;
- char signal[3];
- std::string device_name;
uint32_t dev_file_num;
uint32_t num_prev_assigned_ch;
uint32_t code_length_chips;
uint32_t code_samples_per_chip;
- int32_t* ca_codes;
- int32_t* data_codes;
- bool extended_correlation_in_fpga;
uint32_t extend_fpga_integration_periods;
uint32_t fpga_integration_period;
+
+ int32_t fll_filter_order;
+ int32_t pll_filter_order;
+ int32_t dll_filter_order;
+ int32_t extend_correlation_symbols;
+ int32_t cn0_samples;
+ int32_t cn0_min;
+ int32_t max_code_lock_fail;
+ int32_t max_carrier_lock_fail;
+ int32_t cn0_smoother_samples;
+ int32_t carrier_lock_test_smoother_samples;
+ // int32_t max_lock_fail;
+
+ int32_t* ca_codes;
+ int32_t* data_codes;
+
+ char signal[3];
+ char system;
+
+ bool extended_correlation_in_fpga;
+ bool track_pilot;
+ bool enable_doppler_correction;
+ bool enable_fll_pull_in;
+ bool enable_fll_steady_state;
+ bool carrier_aiding;
+ bool high_dyn;
+ bool dump;
+ bool dump_mat;
};
#endif
diff --git a/src/algorithms/tracking/libs/exponential_smoother.h b/src/algorithms/tracking/libs/exponential_smoother.h
index c87674539..2e9930c05 100644
--- a/src/algorithms/tracking/libs/exponential_smoother.h
+++ b/src/algorithms/tracking/libs/exponential_smoother.h
@@ -36,8 +36,12 @@
class Exponential_Smoother
{
public:
- Exponential_Smoother(); //!< Constructor
- ~Exponential_Smoother() = default; //!< Destructor
+ Exponential_Smoother(); //!< Constructor
+ ~Exponential_Smoother() = default; //!< Destructor
+
+ Exponential_Smoother(Exponential_Smoother&&) = default; //!< Move operator
+ Exponential_Smoother& operator=(Exponential_Smoother&& /*other*/) = default; //!< Move assignment operator
+
void set_alpha(float alpha); //!< 0 < alpha < 1. The higher, the most responsive, but more variance. Default value: 0.001
void set_samples_for_initialization(int num_samples); //!< Number of samples averaged for initialization. Default value: 200
void reset();
@@ -45,18 +49,17 @@ public:
void set_offset(float offset);
float smooth(float raw);
double smooth(double raw);
- Exponential_Smoother(Exponential_Smoother&&) = default; //!< Move operator
- Exponential_Smoother& operator=(Exponential_Smoother&& /*other*/) = default; //!< Move assignment operator
+
private:
+ std::vector init_buffer_;
float alpha_; // takes value 0.0001 if not set
- int samples_for_initialization_;
float one_minus_alpha_;
float old_value_;
float min_value_;
float offset_;
- bool initializing_;
+ int samples_for_initialization_;
int init_counter_;
- std::vector init_buffer_;
+ bool initializing_;
};
#endif // GNSS_SDR_EXPONENTIAL_SMOOTHER_H
diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator.h b/src/algorithms/tracking/libs/fpga_multicorrelator.h
index 04bdbbdf9..242f3b468 100644
--- a/src/algorithms/tracking/libs/fpga_multicorrelator.h
+++ b/src/algorithms/tracking/libs/fpga_multicorrelator.h
@@ -193,10 +193,36 @@ private:
static const uint32_t local_code_fpga_clear_address_counter = 0x10000000;
static const uint32_t test_register_track_writeval = 0x55AA;
+ // private functions
+ uint32_t fpga_acquisition_test_register(uint32_t writeval);
+ void fpga_configure_tracking_gps_local_code(int32_t PRN);
+ void fpga_compute_code_shift_parameters();
+ void fpga_configure_code_parameters_in_fpga();
+ void fpga_compute_signal_parameters_in_fpga();
+ void fpga_configure_signal_parameters_in_fpga();
+ void fpga_launch_multicorrelator_fpga();
+ void read_tracking_gps_results();
+ void close_device(void);
+ void write_secondary_code(uint32_t secondary_code_length, std::string *secondary_code_string, uint32_t reg_addr);
+
+ volk_gnsssdr::vector d_initial_index;
+ volk_gnsssdr::vector d_initial_interp_counter;
+
+ uint64_t d_initial_sample_counter;
+
gr_complex *d_corr_out;
gr_complex *d_Prompt_Data;
+
float *d_shifts_chips;
float *d_prompt_data_shift;
+
+ float d_rem_code_phase_chips;
+ float d_code_phase_step_chips;
+ float d_code_phase_rate_step_chips;
+ float d_rem_carrier_phase_in_rad;
+ float d_phase_step_rad;
+ float d_carrier_phase_rate_step_rad;
+
uint32_t d_code_length_chips;
uint32_t d_code_length_samples;
uint32_t d_n_correlators; // number of correlators
@@ -208,24 +234,13 @@ private:
// configuration data received from the interface
uint32_t d_channel; // channel number
uint32_t d_correlator_length_samples;
- float d_rem_code_phase_chips;
- float d_code_phase_step_chips;
- float d_code_phase_rate_step_chips;
- float d_rem_carrier_phase_in_rad;
- float d_phase_step_rad;
- float d_carrier_phase_rate_step_rad;
uint32_t d_code_samples_per_chip;
- bool d_track_pilot;
- // configuration data computed in the format that the FPGA expects
- volk_gnsssdr::vector d_initial_index;
- volk_gnsssdr::vector d_initial_interp_counter;
uint32_t d_code_phase_step_chips_num;
uint32_t d_code_phase_rate_step_chips_num;
int32_t d_rem_carr_phase_rad_int;
int32_t d_phase_step_rad_int;
int32_t d_carrier_phase_rate_step_rad_int;
- uint64_t d_initial_sample_counter;
// driver
std::string d_device_name;
@@ -239,19 +254,9 @@ private:
// secondary code configuration
uint32_t d_secondary_code_0_length;
uint32_t d_secondary_code_1_length;
- bool d_secondary_code_enabled;
- // private functions
- uint32_t fpga_acquisition_test_register(uint32_t writeval);
- void fpga_configure_tracking_gps_local_code(int32_t PRN);
- void fpga_compute_code_shift_parameters();
- void fpga_configure_code_parameters_in_fpga();
- void fpga_compute_signal_parameters_in_fpga();
- void fpga_configure_signal_parameters_in_fpga();
- void fpga_launch_multicorrelator_fpga();
- void read_tracking_gps_results();
- void close_device(void);
- void write_secondary_code(uint32_t secondary_code_length, std::string *secondary_code_string, uint32_t reg_addr);
+ bool d_track_pilot;
+ bool d_secondary_code_enabled;
};
#endif // GNSS_SDR_FPGA_MULTICORRELATOR_H
diff --git a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h
index 14f217004..6a3228009 100644
--- a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h
+++ b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.h
@@ -37,15 +37,18 @@
class Tracking_2nd_DLL_filter
{
public:
+ Tracking_2nd_DLL_filter();
+ ~Tracking_2nd_DLL_filter() = default;
+ explicit Tracking_2nd_DLL_filter(float pdi_code);
+
void set_DLL_BW(float dll_bw_hz); //!< Set DLL filter bandwidth [Hz]
void set_pdi(float pdi_code); //!< Set Summation interval for code [s]
void initialize(); //!< Start tracking with acquisition information
float get_code_nco(float DLL_discriminator); //!< Numerically controlled oscillator
- explicit Tracking_2nd_DLL_filter(float pdi_code);
- Tracking_2nd_DLL_filter();
- ~Tracking_2nd_DLL_filter() = default;
private:
+ void calculate_lopp_coef(float* tau1, float* tau2, float lbw, float zeta, float k);
+
// PLL filter parameters
float d_tau1_code = 0.0;
float d_tau2_code = 0.0;
@@ -54,7 +57,6 @@ private:
float d_dlldampingratio = 0.0;
float d_old_code_error = 0.0;
float d_old_code_nco = 0.0;
- void calculate_lopp_coef(float* tau1, float* tau2, float lbw, float zeta, float k);
};
#endif
diff --git a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h
index 1414a1883..ea6d2db19 100644
--- a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h
+++ b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.h
@@ -36,15 +36,17 @@
class Tracking_2nd_PLL_filter
{
public:
+ Tracking_2nd_PLL_filter();
+ ~Tracking_2nd_PLL_filter() = default;
+ explicit Tracking_2nd_PLL_filter(float pdi_carr);
+
void set_PLL_BW(float pll_bw_hz); //!< Set PLL loop bandwidth [Hz]
void set_pdi(float pdi_carr); //!< Set Summation interval for code [s]
void initialize();
float get_carrier_nco(float PLL_discriminator);
- explicit Tracking_2nd_PLL_filter(float pdi_carr);
- Tracking_2nd_PLL_filter();
- ~Tracking_2nd_PLL_filter() = default;
private:
+ void calculate_lopp_coef(float* tau1, float* tau2, float lbw, float zeta, float k);
// PLL filter parameters
float d_tau1_carr = 0.0;
float d_tau2_carr = 0.0;
@@ -53,7 +55,6 @@ private:
float d_plldampingratio = 0.0;
float d_old_carr_error = 0.0;
float d_old_carr_nco = 0.0;
- void calculate_lopp_coef(float* tau1, float* tau2, float lbw, float zeta, float k);
};
#endif
diff --git a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.h b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.h
index 0b167f6eb..323a971da 100644
--- a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.h
+++ b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.h
@@ -26,15 +26,14 @@
class Tracking_FLL_PLL_filter
{
public:
+ Tracking_FLL_PLL_filter();
+ ~Tracking_FLL_PLL_filter() = default;
void set_params(float fll_bw_hz, float pll_bw_hz, int order);
void initialize(float d_acq_carrier_doppler_hz);
float get_carrier_error(float FLL_discriminator, float PLL_discriminator, float correlation_time_s);
- Tracking_FLL_PLL_filter();
- ~Tracking_FLL_PLL_filter() = default;
private:
// FLL + PLL filter parameters
- int d_order;
float d_pll_w;
float d_pll_w0p3;
float d_pll_w0f2;
@@ -45,6 +44,7 @@ private:
float d_pll_w0p2;
float d_pll_b3;
float d_pll_w0p;
+ int d_order;
};
#endif
diff --git a/src/algorithms/tracking/libs/tracking_loop_filter.cc b/src/algorithms/tracking/libs/tracking_loop_filter.cc
index dd1b83929..88e1522e2 100644
--- a/src/algorithms/tracking/libs/tracking_loop_filter.cc
+++ b/src/algorithms/tracking/libs/tracking_loop_filter.cc
@@ -33,11 +33,11 @@ Tracking_loop_filter::Tracking_loop_filter(float update_interval,
float noise_bandwidth,
int loop_order,
bool include_last_integrator)
- : d_loop_order(loop_order),
+ : d_noise_bandwidth(noise_bandwidth),
+ d_update_interval(update_interval),
+ d_loop_order(loop_order),
d_current_index(0),
- d_include_last_integrator(include_last_integrator),
- d_noise_bandwidth(noise_bandwidth),
- d_update_interval(update_interval)
+ d_include_last_integrator(include_last_integrator)
{
d_inputs.resize(MAX_LOOP_HISTORY_LENGTH, 0.0);
d_outputs.resize(MAX_LOOP_HISTORY_LENGTH, 0.0);
@@ -46,11 +46,11 @@ Tracking_loop_filter::Tracking_loop_filter(float update_interval,
Tracking_loop_filter::Tracking_loop_filter()
- : d_loop_order(2),
+ : d_noise_bandwidth(15.0),
+ d_update_interval(0.001),
+ d_loop_order(2),
d_current_index(0),
- d_include_last_integrator(false),
- d_noise_bandwidth(15.0),
- d_update_interval(0.001)
+ d_include_last_integrator(false)
{
d_inputs.resize(MAX_LOOP_HISTORY_LENGTH, 0.0);
d_outputs.resize(MAX_LOOP_HISTORY_LENGTH, 0.0);
diff --git a/src/algorithms/tracking/libs/tracking_loop_filter.h b/src/algorithms/tracking/libs/tracking_loop_filter.h
index d79ab024c..780618ab9 100644
--- a/src/algorithms/tracking/libs/tracking_loop_filter.h
+++ b/src/algorithms/tracking/libs/tracking_loop_filter.h
@@ -57,6 +57,9 @@ public:
float apply(float current_input);
private:
+ // Compute the filter coefficients:
+ void update_coefficients();
+
// Store the last inputs and outputs:
std::vector d_inputs;
std::vector d_outputs;
@@ -65,15 +68,6 @@ private:
std::vector d_input_coefficients;
std::vector d_output_coefficients;
- // The loop order:
- int d_loop_order;
-
- // The current index in the i/o arrays:
- int d_current_index;
-
- // Should the last integrator be included?
- bool d_include_last_integrator;
-
// The noise bandwidth (in Hz)
// Note this is an approximation only valid when the product of this
// number and the update interval (T) is small.
@@ -82,8 +76,14 @@ private:
// Loop update interval
float d_update_interval;
- // Compute the filter coefficients:
- void update_coefficients();
+ // The loop order:
+ int d_loop_order;
+
+ // The current index in the i/o arrays:
+ int d_current_index;
+
+ // Should the last integrator be included?
+ bool d_include_last_integrator;
};
#endif
diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt
index 402da9a1d..594d771b4 100644
--- a/src/core/receiver/CMakeLists.txt
+++ b/src/core/receiver/CMakeLists.txt
@@ -155,6 +155,8 @@ target_link_libraries(core_receiver
Armadillo::armadillo
)
+target_include_directories(core_receiver PRIVATE ${CMAKE_SOURCE_DIR}/src/algorithms/libs)
+
if(ENABLE_ARMA_NO_DEBUG)
target_compile_definitions(core_receiver
PRIVATE -DARMA_NO_BOUND_CHECKING=1
diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc
index 9b8e7f99f..ff56f1572 100644
--- a/src/core/receiver/control_thread.cc
+++ b/src/core/receiver/control_thread.cc
@@ -357,6 +357,7 @@ int ControlThread::run()
fpga_helper_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000));
#endif
+ std::this_thread::sleep_for(std::chrono::milliseconds(500));
// Terminate keyboard thread
pthread_t id = keyboard_thread_.native_handle();
keyboard_thread_.detach();
diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h
index b349d2893..7436d2d03 100644
--- a/src/core/receiver/control_thread.h
+++ b/src/core/receiver/control_thread.h
@@ -152,19 +152,14 @@ private:
std::thread sysv_queue_thread_;
std::thread gps_acq_assist_data_collector_thread_;
+#ifdef ENABLE_FPGA
+ boost::thread fpga_helper_thread_;
+#endif
+
std::shared_ptr flowgraph_;
std::shared_ptr configuration_;
std::shared_ptr> control_queue_;
- bool receiver_on_standby_;
- bool pre_2009_file_; // to override the system time to postprocess old gnss records and avoid wrong week rollover
- bool stop_;
- bool restart_;
- bool delete_configuration_;
- unsigned int processed_control_messages_;
- unsigned int applied_actions_;
- int msqid_;
-
// default filename for assistance data
const std::string eph_default_xml_filename_ = "./gps_ephemeris.xml";
const std::string utc_default_xml_filename_ = "./gps_utc_model.xml";
@@ -194,9 +189,15 @@ private:
Agnss_Ref_Location agnss_ref_location_;
Agnss_Ref_Time agnss_ref_time_;
-#ifdef ENABLE_FPGA
- boost::thread fpga_helper_thread_;
-#endif
+ unsigned int processed_control_messages_;
+ unsigned int applied_actions_;
+ int msqid_;
+
+ bool receiver_on_standby_;
+ bool pre_2009_file_; // to override the system time to postprocess old gnss records and avoid wrong week rollover
+ bool stop_;
+ bool restart_;
+ bool delete_configuration_;
};
#endif // GNSS_SDR_CONTROL_THREAD_H
diff --git a/src/core/receiver/file_configuration.cc b/src/core/receiver/file_configuration.cc
index ea57f23b4..66a488449 100644
--- a/src/core/receiver/file_configuration.cc
+++ b/src/core/receiver/file_configuration.cc
@@ -23,9 +23,7 @@
*/
#include "file_configuration.h"
-#include "INIReader.h"
-#include "in_memory_configuration.h"
-#include "string_converter.h"
+#include "gnss_sdr_make_unique.h"
#include
#include
@@ -44,6 +42,27 @@ FileConfiguration::FileConfiguration()
}
+void FileConfiguration::init()
+{
+ converter_ = std::make_unique();
+ overrided_ = std::make_unique();
+ ini_reader_ = std::make_unique(filename_);
+ error_ = ini_reader_->ParseError();
+ if (error_ == 0)
+ {
+ DLOG(INFO) << "Configuration file " << filename_ << " opened with no errors";
+ }
+ else if (error_ > 0)
+ {
+ LOG(WARNING) << "Configuration file " << filename_ << " contains errors in line " << error_;
+ }
+ else
+ {
+ LOG(WARNING) << "Unable to open configuration file " << filename_;
+ }
+}
+
+
std::string FileConfiguration::property(std::string property_name, std::string default_value)
{
if (overrided_->is_present(property_name))
@@ -157,24 +176,3 @@ void FileConfiguration::set_property(std::string property_name, std::string valu
{
overrided_->set_property(property_name, value);
}
-
-
-void FileConfiguration::init()
-{
- converter_ = std::make_shared();
- overrided_ = std::make_shared();
- ini_reader_ = std::make_shared(filename_);
- error_ = ini_reader_->ParseError();
- if (error_ == 0)
- {
- DLOG(INFO) << "Configuration file " << filename_ << " opened with no errors";
- }
- else if (error_ > 0)
- {
- LOG(WARNING) << "Configuration file " << filename_ << " contains errors in line " << error_;
- }
- else
- {
- LOG(WARNING) << "Unable to open configuration file " << filename_;
- }
-}
diff --git a/src/core/receiver/file_configuration.h b/src/core/receiver/file_configuration.h
index c03ebd540..25c3116bf 100644
--- a/src/core/receiver/file_configuration.h
+++ b/src/core/receiver/file_configuration.h
@@ -25,15 +25,14 @@
#ifndef GNSS_SDR_FILE_CONFIGURATION_H
#define GNSS_SDR_FILE_CONFIGURATION_H
+#include "INIReader.h"
#include "configuration_interface.h"
+#include "in_memory_configuration.h"
+#include "string_converter.h"
#include
#include
#include
-class INIReader;
-class StringConverter;
-class InMemoryConfiguration;
-
/*!
* \brief This class is an implementation of the interface ConfigurationInterface
*
@@ -64,9 +63,9 @@ public:
private:
void init();
std::string filename_;
- std::shared_ptr ini_reader_;
- std::shared_ptr overrided_;
- std::shared_ptr converter_;
+ std::unique_ptr ini_reader_;
+ std::unique_ptr overrided_;
+ std::unique_ptr converter_;
int error_{};
};
diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h
index dc977d3a4..36bd3a90b 100644
--- a/src/core/receiver/gnss_flowgraph.h
+++ b/src/core/receiver/gnss_flowgraph.h
@@ -176,21 +176,6 @@ private:
std::vector split_string(const std::string& s, char delim);
- bool connected_;
- bool running_;
- bool multiband_;
- bool enable_monitor_;
-
- int sources_count_;
-
- unsigned int channels_count_;
- unsigned int acq_channels_count_;
- unsigned int max_acq_channels_;
-
- std::string config_file_;
-
- std::mutex signal_list_mutex_;
-
std::vector> sig_source_;
std::vector> sig_conditioner_;
std::vector null_sinks_;
@@ -236,6 +221,21 @@ private:
#if ENABLE_FPGA
gnss_sdr_fpga_sample_counter_sptr ch_out_fpga_sample_counter_;
#endif
+
+ std::string config_file_;
+
+ std::mutex signal_list_mutex_;
+
+ int sources_count_;
+
+ unsigned int channels_count_;
+ unsigned int acq_channels_count_;
+ unsigned int max_acq_channels_;
+
+ bool connected_;
+ bool running_;
+ bool multiband_;
+ bool enable_monitor_;
};
#endif // GNSS_SDR_GNSS_FLOWGRAPH_H
diff --git a/src/core/receiver/in_memory_configuration.cc b/src/core/receiver/in_memory_configuration.cc
index 607671c37..bc84bde87 100644
--- a/src/core/receiver/in_memory_configuration.cc
+++ b/src/core/receiver/in_memory_configuration.cc
@@ -20,14 +20,13 @@
#include "in_memory_configuration.h"
-#include "string_converter.h"
+#include "gnss_sdr_make_unique.h"
#include
InMemoryConfiguration::InMemoryConfiguration()
{
- std::unique_ptr converter_aux(new StringConverter);
- converter_ = std::move(converter_aux);
+ converter_ = std::make_unique();
}
diff --git a/src/core/receiver/in_memory_configuration.h b/src/core/receiver/in_memory_configuration.h
index 99627cc45..59f69e133 100644
--- a/src/core/receiver/in_memory_configuration.h
+++ b/src/core/receiver/in_memory_configuration.h
@@ -25,14 +25,13 @@
#define GNSS_SDR_IN_MEMORY_CONFIGURATION_H
#include "configuration_interface.h"
+#include "string_converter.h"
#include
#include