From b785fe6ba4d08e461852147c61cefc958a045a85 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 23 Oct 2018 00:16:36 +0200 Subject: [PATCH 001/143] Replace SUPL parameter name MNS by MNC --- conf/front-end-cal.conf | 2 +- conf/gnss-sdr.conf | 2 +- conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf | 2 +- conf/gnss-sdr_GPS_L1_USRP_realtime.conf | 2 +- conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf | 2 +- conf/gnss-sdr_GPS_L1_nsr.conf | 2 +- conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf | 2 +- conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf | 2 +- conf/gnss-sdr_GPS_L1_pulse_blanking_gr_complex.conf | 2 +- conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf | 2 +- conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf | 2 +- conf/gnss-sdr_GPS_L1_two_bits_cpx.conf | 2 +- conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf | 2 +- conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf | 2 +- conf/gnss-sdr_Galileo_E5a.conf | 2 +- conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf | 2 +- conf/gnss-sdr_Hybrid_ishort.conf | 2 +- .../gnss-sdr_multichannel_GPS_L1_Flexiband_bin_file_III_1a.conf | 2 +- .../gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1a.conf | 2 +- .../gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1b.conf | 2 +- conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_II_3b.conf | 2 +- conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_I_1b.conf | 2 +- ...ss-sdr_multichannel_GPS_L1_L2_Flexiband_realtime_III_1b.conf | 2 +- ...channel_GPS_L1_L2_Galileo_E1B_Flexiband_bin_file_III_1b.conf | 2 +- conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf | 2 +- ...nss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b.conf | 2 +- ...dr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b_real.conf | 2 +- ...s-sdr_multichannel_all_in_one_Flexiband_bin_file_III_1b.conf | 2 +- src/core/receiver/control_thread.cc | 2 +- src/tests/system-tests/position_test.cc | 2 +- src/tests/system-tests/ttff.cc | 2 +- src/utils/front-end-cal/front_end_cal.cc | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/conf/front-end-cal.conf b/conf/front-end-cal.conf index 16bf70407..8a2b55cb5 100644 --- a/conf/front-end-cal.conf +++ b/conf/front-end-cal.conf @@ -39,7 +39,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=217 -GNSS-SDR.SUPL_MNS=7 +GNSS-SDR.SUPL_MNC=7 GNSS-SDR.SUPL_LAC=861 GNSS-SDR.SUPL_CI=40184 diff --git a/conf/gnss-sdr.conf b/conf/gnss-sdr.conf index 4c9ae11a4..353bdb2fd 100644 --- a/conf/gnss-sdr.conf +++ b/conf/gnss-sdr.conf @@ -23,7 +23,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf b/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf index ba96a533e..f437366bf 100644 --- a/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf @@ -24,7 +24,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_GPS_L1_USRP_realtime.conf b/conf/gnss-sdr_GPS_L1_USRP_realtime.conf index b432eb6b2..323feec08 100644 --- a/conf/gnss-sdr_GPS_L1_USRP_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_USRP_realtime.conf @@ -23,7 +23,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf b/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf index 3de8486d8..b2d0604bb 100644 --- a/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf @@ -21,7 +21,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_GPS_L1_nsr.conf b/conf/gnss-sdr_GPS_L1_nsr.conf index 49ae18b56..4b0b05ae2 100644 --- a/conf/gnss-sdr_GPS_L1_nsr.conf +++ b/conf/gnss-sdr_GPS_L1_nsr.conf @@ -25,7 +25,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf b/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf index 82d382a27..dfe6e331a 100644 --- a/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf +++ b/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf @@ -25,7 +25,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf b/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf index fa8996dc7..872f56bf4 100644 --- a/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf @@ -24,7 +24,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_GPS_L1_pulse_blanking_gr_complex.conf b/conf/gnss-sdr_GPS_L1_pulse_blanking_gr_complex.conf index e186f1da7..618341f48 100644 --- a/conf/gnss-sdr_GPS_L1_pulse_blanking_gr_complex.conf +++ b/conf/gnss-sdr_GPS_L1_pulse_blanking_gr_complex.conf @@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf b/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf index 91b952ad0..4b91a9344 100644 --- a/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf @@ -24,7 +24,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5_1C +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf b/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf index f3252578b..2cec70e8c 100644 --- a/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf @@ -24,7 +24,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf b/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf index 84753bee7..b58fc57ba 100644 --- a/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf +++ b/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf @@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf b/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf index 6d61e063b..cce644be9 100644 --- a/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf +++ b/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf @@ -23,7 +23,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf b/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf index 55a84a13e..49868f37a 100644 --- a/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf +++ b/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf @@ -23,7 +23,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_Galileo_E5a.conf b/conf/gnss-sdr_Galileo_E5a.conf index c4df4139f..81dddd613 100644 --- a/conf/gnss-sdr_Galileo_E5a.conf +++ b/conf/gnss-sdr_Galileo_E5a.conf @@ -22,7 +22,7 @@ GNSS-SDR.internal_fs_sps=32000000 ;GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com ;GNSS-SDR.SUPL_gps_acquisition_port=7275 ;GNSS-SDR.SUPL_MCC=244 -;GNSS-SDR.SUPL_MNS=5 +;GNSS-SDR.SUPL_MNC=5 ;GNSS-SDR.SUPL_LAC=0x59e2 ;GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf b/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf index f66079cb4..26d01617d 100644 --- a/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf +++ b/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf @@ -21,7 +21,7 @@ GNSS-SDR.internal_fs_sps=50000000 ;GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com ;GNSS-SDR.SUPL_gps_acquisition_port=7275 ;GNSS-SDR.SUPL_MCC=244 -;GNSS-SDR.SUPL_MNS=5 +;GNSS-SDR.SUPL_MNC=5 ;GNSS-SDR.SUPL_LAC=0x59e2 ;GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_Hybrid_ishort.conf b/conf/gnss-sdr_Hybrid_ishort.conf index 55a70b7a2..c634009f3 100644 --- a/conf/gnss-sdr_Hybrid_ishort.conf +++ b/conf/gnss-sdr_Hybrid_ishort.conf @@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_bin_file_III_1a.conf b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_bin_file_III_1a.conf index 7b978be5b..c395a5f3c 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_bin_file_III_1a.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_bin_file_III_1a.conf @@ -21,7 +21,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1a.conf b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1a.conf index bb5d4327e..134bfa457 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1a.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1a.conf @@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1b.conf b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1b.conf index 2ef22b956..9552ebabe 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1b.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1b.conf @@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_II_3b.conf b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_II_3b.conf index 1d7fa6097..f1e5d264b 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_II_3b.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_II_3b.conf @@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_I_1b.conf b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_I_1b.conf index 2072f8c7d..201fff1ab 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_I_1b.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_I_1b.conf @@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_multichannel_GPS_L1_L2_Flexiband_realtime_III_1b.conf b/conf/gnss-sdr_multichannel_GPS_L1_L2_Flexiband_realtime_III_1b.conf index 3094d8c97..48eabee34 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_L2_Flexiband_realtime_III_1b.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_L2_Flexiband_realtime_III_1b.conf @@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_multichannel_GPS_L1_L2_Galileo_E1B_Flexiband_bin_file_III_1b.conf b/conf/gnss-sdr_multichannel_GPS_L1_L2_Galileo_E1B_Flexiband_bin_file_III_1b.conf index d27d98d62..7c19ebc2c 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_L2_Galileo_E1B_Flexiband_bin_file_III_1b.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_L2_Galileo_E1B_Flexiband_bin_file_III_1b.conf @@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf b/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf index 411a712ab..63746aea4 100644 --- a/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf +++ b/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf @@ -22,7 +22,7 @@ GNSS-SDR.SUPL_1C_ephemeris_port=7275 GNSS-SDR.SUPL_1C_acquisition_server=supl.google.com GNSS-SDR.SUPL_1C_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b.conf b/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b.conf index fb6fae1c2..9c2a86def 100644 --- a/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b.conf +++ b/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b.conf @@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b_real.conf b/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b_real.conf index 6d62e65b3..a52349af1 100644 --- a/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b_real.conf +++ b/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b_real.conf @@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/conf/gnss-sdr_multichannel_all_in_one_Flexiband_bin_file_III_1b.conf b/conf/gnss-sdr_multichannel_all_in_one_Flexiband_bin_file_III_1b.conf index 50e49f2e9..a3e23b001 100644 --- a/conf/gnss-sdr_multichannel_all_in_one_Flexiband_bin_file_III_1b.conf +++ b/conf/gnss-sdr_multichannel_all_in_one_Flexiband_bin_file_III_1b.conf @@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275 GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com GNSS-SDR.SUPL_gps_acquisition_port=7275 GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNS=5 +GNSS-SDR.SUPL_MNC=5 GNSS-SDR.SUPL_LAC=0x59e2 GNSS-SDR.SUPL_CI=0x31b0 diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 16a6389fb..1ee965920 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -413,7 +413,7 @@ void ControlThread::assist_GNSS() supl_client_ephemeris_.server_port = configuration_->property("GNSS-SDR.SUPL_gps_ephemeris_port", 7275); supl_client_acquisition_.server_port = configuration_->property("GNSS-SDR.SUPL_gps_acquisition_port", 7275); supl_mcc = configuration_->property("GNSS-SDR.SUPL_MCC", 244); - supl_mns = configuration_->property("GNSS-SDR.SUPL_MNS", 5); + supl_mns = configuration_->property("GNSS-SDR.SUPL_MNC ", 5); std::string default_lac = "0x59e2"; std::string default_ci = "0x31b0"; diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index 8cda047ed..1a4c5e780 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -193,7 +193,7 @@ int PositionSystemTest::configure_receiver() config->set_property("GNSS-SDR.SUPL_gps_acquisition_server", "supl.google.com"); config->set_property("GNSS-SDR.SUPL_gps_acquisition_port", std::to_string(7275)); config->set_property("GNSS-SDR.SUPL_MCC", std::to_string(244)); - config->set_property("GNSS-SDR.SUPL_MNS", std::to_string(5)); + config->set_property("GNSS-SDR.SUPL_MNC", std::to_string(5)); config->set_property("GNSS-SDR.SUPL_LAC", "0x59e2"); config->set_property("GNSS-SDR.SUPL_CI", "0x31b0"); diff --git a/src/tests/system-tests/ttff.cc b/src/tests/system-tests/ttff.cc index 2d5dbba44..6bea0a570 100644 --- a/src/tests/system-tests/ttff.cc +++ b/src/tests/system-tests/ttff.cc @@ -135,7 +135,7 @@ void TtffTest::config_1() config->set_property("GNSS-SDR.SUPL_gps_acquisition_server", "supl.google.com"); config->set_property("GNSS-SDR.SUPL_gps_acquisition_port", std::to_string(7275)); config->set_property("GNSS-SDR.SUPL_MCC", std::to_string(244)); - config->set_property("GNSS-SDR.SUPL_MNS", std::to_string(5)); + config->set_property("GNSS-SDR.SUPL_MNC", std::to_string(5)); config->set_property("GNSS-SDR.SUPL_LAC", "0x59e2"); config->set_property("GNSS-SDR.SUPL_CI", "0x31b0"); diff --git a/src/utils/front-end-cal/front_end_cal.cc b/src/utils/front-end-cal/front_end_cal.cc index 6b8b937ac..9fec07116 100644 --- a/src/utils/front-end-cal/front_end_cal.cc +++ b/src/utils/front-end-cal/front_end_cal.cc @@ -110,7 +110,7 @@ int FrontEndCal::Get_SUPL_Assist() supl_client_ephemeris_.server_port = configuration_->property("GNSS-SDR.SUPL_gps_ephemeris_port", 7275); supl_client_acquisition_.server_port = configuration_->property("GNSS-SDR.SUPL_gps_acquisition_port", 7275); supl_mcc = configuration_->property("GNSS-SDR.SUPL_MCC", 244); - supl_mns = configuration_->property("GNSS-SDR.SUPL_MNS", 5); + supl_mns = configuration_->property("GNSS-SDR.SUPL_MNC", 5); std::string default_lac = "0x59e2"; std::string default_ci = "0x31b0"; From 966d935fbc2ac50b8b6b6619b6b018b337b1ef0e Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 23 Oct 2018 16:54:06 +0200 Subject: [PATCH 002/143] Adding the restart telecommand functionality by using external helper startup script --- src/core/receiver/control_thread.cc | 26 ++++++++-- src/core/receiver/control_thread.h | 3 +- src/core/receiver/tcp_cmd_interface.cc | 71 ++++++++++++++++++-------- src/core/receiver/tcp_cmd_interface.h | 21 +++++--- src/main/main.cc | 5 +- src/utils/scripts/gnss-sdr-harness.sh | 10 ++++ 6 files changed, 103 insertions(+), 33 deletions(-) create mode 100755 src/utils/scripts/gnss-sdr-harness.sh diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 1ee965920..ff4cd82c7 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -80,6 +80,7 @@ ControlThread::ControlThread() configuration_ = std::make_shared(FLAGS_c); } delete_configuration_ = false; + restart_ = false; init(); } @@ -115,7 +116,7 @@ void ControlThread::telecommand_listener() * while (flowgraph_->running() && !stop)_{ * 3- Read control messages and process them } */ -void ControlThread::run() +int ControlThread::run() { // Connect the flowgraph try @@ -125,7 +126,7 @@ void ControlThread::run() catch (const std::exception &e) { LOG(ERROR) << e.what(); - return; + return 0; } if (flowgraph_->connected()) { @@ -134,7 +135,7 @@ void ControlThread::run() else { LOG(ERROR) << "Unable to connect flowgraph"; - return; + return 0; } // Start the flowgraph flowgraph_->start(); @@ -145,7 +146,7 @@ void ControlThread::run() else { LOG(ERROR) << "Unable to start flowgraph"; - return; + return 0; } //launch GNSS assistance process AFTER the flowgraph is running because the GNURadio asynchronous queues must be already running to transport msgs @@ -189,6 +190,15 @@ void ControlThread::run() #endif LOG(INFO) << "Flowgraph stopped"; + + if (restart_) + { + return 42; //signal the gnss-sdr-harness.sh to restart the receiver program + } + else + { + return 0; //normal shutdown + } } @@ -200,6 +210,7 @@ void ControlThread::set_control_queue(gr::msg_queue::sptr control_queue) return; } control_queue_ = control_queue; + cmd_interface_.set_msg_queue(control_queue_); } @@ -602,6 +613,7 @@ void ControlThread::init() { // Instantiates a control queue, a GNSS flowgraph, and a control message factory control_queue_ = gr::msg_queue::make(0); + cmd_interface_.set_msg_queue(control_queue_); //set also the queue pointer for the telecommand thread try { flowgraph_ = std::make_shared(configuration_, control_queue_); @@ -668,6 +680,12 @@ void ControlThread::apply_action(unsigned int what) stop_ = true; applied_actions_++; break; + case 1: + DLOG(INFO) << "Received action RESTART"; + stop_ = true; + restart_ = true; + applied_actions_++; + break; default: DLOG(INFO) << "Unrecognized action."; break; diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index 3c67595c6..e8e62b5fe 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -83,7 +83,7 @@ public: * * - Read control messages and process them; } */ - void run(); + int run(); /*! * \brief Sets the control_queue @@ -155,6 +155,7 @@ private: std::shared_ptr control_message_factory_; std::shared_ptr>> control_messages_; bool stop_; + bool restart_; bool delete_configuration_; unsigned int processed_control_messages_; unsigned int applied_actions_; diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 76144d297..c59b96224 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -30,8 +30,27 @@ */ #include "tcp_cmd_interface.h" +#include "control_message_factory.h" +#include +std::string TcpCmdInterface::reset(const std::vector &commandLine) +{ + std::string response; + std::unique_ptr cmf(new ControlMessageFactory()); + if (control_queue_ != nullptr) + { + control_queue_->handle(cmf->GetQueueMessage(200, 1)); //send the restart message (who=200,what=1) + response = "OK\n"; + } + else + { + response = "ERROR\n"; + } + + return response; +} + std::string TcpCmdInterface::stop(const std::vector &commandLine) { std::string response; @@ -78,21 +97,28 @@ std::string TcpCmdInterface::set_ch_satellite(const std::vector &co void TcpCmdInterface::register_functions() { - functions["status"] = status; - functions["stop"] = stop; - functions["assistedstart"] = assistedstart; - functions["warmstart"] = warmstart; - functions["coldstart"] = coldstart; - functions["set_ch_satellite"] = set_ch_satellite; + functions["status"] = std::bind(&TcpCmdInterface::status, this, std::placeholders::_1); + functions["stop"] = std::bind(&TcpCmdInterface::stop, this, std::placeholders::_1); + functions["reset"] = std::bind(&TcpCmdInterface::reset, this, std::placeholders::_1); + functions["assistedstart"] = std::bind(&TcpCmdInterface::assistedstart, this, std::placeholders::_1); + functions["warmstart"] = std::bind(&TcpCmdInterface::warmstart, this, std::placeholders::_1); + functions["coldstart"] = std::bind(&TcpCmdInterface::coldstart, this, std::placeholders::_1); + functions["set_ch_satellite"] = std::bind(&TcpCmdInterface::set_ch_satellite, this, std::placeholders::_1); } TcpCmdInterface::TcpCmdInterface() { register_functions(); + keep_running_ = true; + control_queue_ = nullptr; } +void TcpCmdInterface::set_msg_queue(gr::msg_queue::sptr control_queue) +{ + control_queue_ = control_queue; +} void TcpCmdInterface::run_cmd_server(int tcp_port) { // Get the port from the parameters @@ -106,18 +132,18 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) try { boost::asio::ip::tcp::acceptor acceptor(service, boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), port)); - bool keep_running = true; - while (keep_running) + + while (keep_running_) { try { - std::cout << "Telecommand TCP interface listening on port " << tcp_port << std::endl; + std::cout << "TcpCmdInterface: Telecommand TCP interface listening on port " << tcp_port << std::endl; boost::asio::ip::tcp::socket socket(service); acceptor.accept(socket, not_throw); if (not_throw) { - std::cerr << "Error when binding the port in the socket" << std::endl; + std::cout << "TcpCmdInterface: Error when binding the port in the socket" << std::endl; continue; } @@ -127,12 +153,10 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) { std::string response; boost::asio::streambuf b; - boost::asio::read_until(socket, b, '\n'); + boost::asio::read_until(socket, b, '\n', error); std::istream is(&b); std::string line; std::getline(is, line); - std::cout << "received command: " << line << std::endl; - std::istringstream iss(line); std::vector cmd_vector(std::istream_iterator{iss}, std::istream_iterator()); @@ -141,7 +165,14 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) { try { - response = functions[cmd_vector.at(0)](cmd_vector); + if (cmd_vector.at(0).compare("exit") == 0) + { + error = boost::asio::error::eof; + } + else + { + response = functions[cmd_vector.at(0)](cmd_vector); + } } catch (const std::exception &ex) { @@ -157,19 +188,19 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) socket.write_some(boost::asio::buffer(response), not_throw); if (not_throw) { - std::cerr << "Error sending(" << not_throw.value() << "): " << not_throw.message() << std::endl; + std::cout << "Error sending(" << not_throw.value() << "): " << not_throw.message() << std::endl; break; } } - while (!error); // && error != boost::asio::error::eof); + while (error != boost::asio::error::eof); if (error == boost::asio::error::eof) { - std::cout << "EOF detected\n"; + std::cout << "TcpCmdInterface: EOF detected\n"; } else { - std::cout << "error: " << error << std::endl; + std::cout << "TcpCmdInterface unexpected error: " << error << std::endl; } // Close socket @@ -177,11 +208,11 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) } catch (const boost::exception &e) { - std::cout << "Boost exception " << std::endl; + std::cout << "TcpCmdInterface: Boost exception " << std::endl; } catch (const std::exception &ex) { - std::cout << "Exception " << ex.what() << std::endl; + std::cout << "TcpCmdInterface: Exception " << ex.what() << std::endl; } } } diff --git a/src/core/receiver/tcp_cmd_interface.h b/src/core/receiver/tcp_cmd_interface.h index 5ffc44cb1..a6a9c297c 100644 --- a/src/core/receiver/tcp_cmd_interface.h +++ b/src/core/receiver/tcp_cmd_interface.h @@ -38,7 +38,10 @@ #include #include #include +#include #include +#include +#include class TcpCmdInterface @@ -47,18 +50,24 @@ public: TcpCmdInterface(); virtual ~TcpCmdInterface(); void run_cmd_server(int tcp_port); + void set_msg_queue(gr::msg_queue::sptr control_queue); + private: std::unordered_map &)>> functions; - static std::string status(const std::vector &commandLine); - static std::string stop(const std::vector &commandLine); - static std::string assistedstart(const std::vector &commandLine); - static std::string warmstart(const std::vector &commandLine); - static std::string coldstart(const std::vector &commandLine); - static std::string set_ch_satellite(const std::vector &commandLine); + std::string status(const std::vector &commandLine); + std::string reset(const std::vector &commandLine); + std::string stop(const std::vector &commandLine); + std::string assistedstart(const std::vector &commandLine); + std::string warmstart(const std::vector &commandLine); + std::string coldstart(const std::vector &commandLine); + std::string set_ch_satellite(const std::vector &commandLine); void register_functions(); + + gr::msg_queue::sptr control_queue_; + bool keep_running_; }; #endif /* GNSS_SDR_TCPCMDINTERFACE_H_ */ diff --git a/src/main/main.cc b/src/main/main.cc index d64f9bab6..9b3680115 100644 --- a/src/main/main.cc +++ b/src/main/main.cc @@ -135,9 +135,10 @@ int main(int argc, char** argv) std::chrono::time_point start, end; start = std::chrono::system_clock::now(); + int return_code; try { - control_thread->run(); + return_code = control_thread->run(); } catch (const boost::exception& e) { @@ -189,5 +190,5 @@ int main(int argc, char** argv) google::ShutDownCommandLineFlags(); std::cout << "GNSS-SDR program ended." << std::endl; - return 0; + return return_code; } diff --git a/src/utils/scripts/gnss-sdr-harness.sh b/src/utils/scripts/gnss-sdr-harness.sh new file mode 100755 index 000000000..b025bb07b --- /dev/null +++ b/src/utils/scripts/gnss-sdr-harness.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# GNSS-SDR shell script that enables the remote GNSS-SDR restart telecommand +# usage: ./gnss-sdr-harness.sh ./gnss-sdr -c config_file.conf +echo $@ +$@ +while [ $? -eq 42 ] +do + echo "restarting GNSS-SDR..." + $@ +done From 07d1a74f6b2beebc7ee0e48518695c20bf7c4241 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 24 Oct 2018 17:28:12 +0200 Subject: [PATCH 003/143] Decode and store Galileo almanac --- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 83 +++++---- src/algorithms/PVT/libs/hybrid_ls_pvt.h | 1 + src/algorithms/PVT/libs/rinex_printer.cc | 48 +++--- src/algorithms/PVT/libs/rinex_printer.h | 12 +- src/algorithms/PVT/libs/rtklib_solver.h | 3 +- .../galileo_telemetry_decoder_cc.cc | 11 +- .../galileo_telemetry_decoder_cc.h | 2 +- src/core/system_parameters/CMakeLists.txt | 4 +- src/core/system_parameters/galileo_almanac.cc | 81 +++------ src/core/system_parameters/galileo_almanac.h | 112 ++++++------- .../galileo_almanac_helper.cc | 157 ++++++++++++++++++ .../galileo_almanac_helper.h | 104 ++++++++++++ .../system_parameters/galileo_fnav_message.cc | 4 +- .../system_parameters/galileo_fnav_message.h | 4 +- .../galileo_navigation_message.cc | 15 +- .../galileo_navigation_message.h | 6 +- .../system_parameters/galileo_utc_model.cc | 5 + .../system_parameters/galileo_utc_model.h | 7 + 18 files changed, 448 insertions(+), 211 deletions(-) create mode 100644 src/core/system_parameters/galileo_almanac_helper.cc create mode 100644 src/core/system_parameters/galileo_almanac_helper.h diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index f055915cc..3030d536f 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -29,6 +29,8 @@ */ #include "rtklib_pvt_cc.h" +#include "galileo_almanac.h" +#include "galileo_almanac_helper.h" #include "display.h" #include #include @@ -50,11 +52,6 @@ namespace bc = boost::math; namespace bc = boost::integer; #endif -//includes used by the observables serializarion (export observables for rtklib unit test) -#include -#include -#include - using google::LogMessage; @@ -189,14 +186,20 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) d_ls_pvt->galileo_utc_model = *galileo_utc_model; DLOG(INFO) << "New UTC record has arrived "; } - else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### Galileo Almanac ### - std::shared_ptr galileo_almanac; - galileo_almanac = boost::any_cast>(pmt::any_ref(msg)); - // update/insert new ephemeris record to the global ephemeris map - d_ls_pvt->galileo_almanac = *galileo_almanac; - DLOG(INFO) << "New Galileo Almanac has arrived "; + std::shared_ptr galileo_almanac_helper; + galileo_almanac_helper = boost::any_cast>(pmt::any_ref(msg)); + + Galileo_Almanac sv1 = galileo_almanac_helper->get_almanac(1); + Galileo_Almanac sv2 = galileo_almanac_helper->get_almanac(2); + Galileo_Almanac sv3 = galileo_almanac_helper->get_almanac(3); + + if (sv1.i_satellite_PRN != 0) d_ls_pvt->galileo_almanac_map[sv1.i_satellite_PRN] = sv1; + if (sv2.i_satellite_PRN != 0) d_ls_pvt->galileo_almanac_map[sv2.i_satellite_PRN] = sv2; + if (sv3.i_satellite_PRN != 0) d_ls_pvt->galileo_almanac_map[sv3.i_satellite_PRN] = sv3; + DLOG(INFO) << "New Galileo Almanac data have arrived "; } // **************** GLONASS GNAV Telemetry ************************** @@ -527,6 +530,28 @@ rtklib_pvt_cc::~rtklib_pvt_cc() LOG(INFO) << "Failed to save Galileo UTC model parameters, not valid data"; } + // Save Galileo almanac + file_name = "gal_almanac.xml"; + if (d_ls_pvt->galileo_almanac_map.empty() == false) + { + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_almanac_map", d_ls_pvt->galileo_almanac_map); + LOG(INFO) << "Saved Galileo almanac data"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + } + } + else + { + LOG(INFO) << "Failed to save Galileo almanac, not valid data"; + } + // Save GPS CNAV UTC model parameters file_name = "gps_cnav_utc_model.xml"; if (d_ls_pvt->gps_cnav_utc_model.valid) @@ -921,7 +946,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } } @@ -931,7 +956,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } } @@ -941,7 +966,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } } @@ -961,7 +986,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { std::string gal_signal("1B"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } } @@ -971,7 +996,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { std::string gal_signal("5X"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } } @@ -981,7 +1006,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { std::string gal_signal("7X"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } } @@ -991,7 +1016,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { std::string gal_signal("1B 5X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } } @@ -1001,7 +1026,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { std::string gal_signal("1B 7X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } } @@ -1059,7 +1084,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string glo_signal("1G"); std::string gal_signal("1B"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_written = true; // do not write header anymore } } @@ -1096,7 +1121,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string glo_signal("2G"); std::string gal_signal("1B"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_written = true; // do not write header anymore } } @@ -1239,7 +1264,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } @@ -1252,7 +1277,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } @@ -1265,7 +1290,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } @@ -1292,7 +1317,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0)) { rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } } @@ -1304,7 +1329,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } @@ -1317,7 +1342,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); + rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } @@ -1383,7 +1408,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) { rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } } @@ -1422,7 +1447,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (!b_rinex_header_updated && (d_ls_pvt->galileo_utc_model.A0_6 != 0)) { rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } } diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.h b/src/algorithms/PVT/libs/hybrid_ls_pvt.h index f8a6fc32c..2fe5fd9f3 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.h +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.h @@ -36,6 +36,7 @@ #include "galileo_navigation_message.h" #include "gps_navigation_message.h" #include "gps_cnav_navigation_message.h" +#include "galileo_almanac.h" #include "gnss_synchro.h" #include "rtklib_rtkcmn.h" #include diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index e09a4be8c..c942779b7 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -725,13 +725,13 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps } -void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac) +void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac) { if (glonass_gnav_almanac.i_satellite_freq_channel) { } //Avoid compiler warning //Avoid compiler warning, there is not time system correction between Galileo and GLONASS - if (galileo_almanac.A_0G_10) + if (galileo_utc_model.A_0G_10) { } std::string line; @@ -839,7 +839,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali } -void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono, const Galileo_Utc_Model& utc_model, const Galileo_Almanac& galileo_almanac) +void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono, const Galileo_Utc_Model& utc_model) { std::string line; @@ -915,10 +915,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono // -------- Line system time correction 2 line.clear(); line += std::string("GPGA"); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_0G_10, 16, 2), 18); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_1G_10, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_almanac.t_0G_10), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_almanac.WN_0G_10), 5); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A_0G_10, 16, 2), 18); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A_1G_10, 15, 2), 16); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.t_0G_10), 7); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WN_0G_10), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -1238,7 +1238,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co } -void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac) +void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model) { std::string line; @@ -1327,10 +1327,10 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono // -------- Line system time correction 2 line.clear(); line += std::string("GPGA"); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_0G_10, 16, 2), 18); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_1G_10, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_almanac.t_0G_10), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_almanac.WN_0G_10), 5); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_0G_10, 16, 2), 18); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_1G_10, 15, 2), 16); + line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t_0G_10), 7); + line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WN_0G_10), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); @@ -1552,7 +1552,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_ } -void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& utc_model, const Galileo_Almanac& galileo_almanac) +void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& utc_model) { std::vector data; std::string line_aux; @@ -1599,10 +1599,10 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal else if ((line_str.find("GPGA", 0) != std::string::npos) && (line_str.find("TIME SYSTEM CORR", 59) != std::string::npos)) { line_aux += std::string("GPGA"); - line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_0G_10, 16, 2), 18); - line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_1G_10, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_almanac.t_0G_10), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_almanac.WN_0G_10), 5); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A_0G_10, 16, 2), 18); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.A_1G_10, 15, 2), 16); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.t_0G_10), 7); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WN_0G_10), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -1893,7 +1893,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Mode } -void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac) +void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model) { std::vector data; std::string line_aux; @@ -1975,10 +1975,10 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion else if ((line_str.find("GPGA", 0) != std::string::npos) && (line_str.find("TIME SYSTEM CORR", 59) != std::string::npos)) { line_aux += std::string("GPGA"); - line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_0G_10, 16, 2), 18); - line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_1G_10, 15, 2), 16); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_almanac.t_0G_10), 7); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_almanac.WN_0G_10), 5); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_0G_10, 16, 2), 18); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_1G_10, 15, 2), 16); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t_0G_10), 7); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WN_0G_10), 5); line_aux += std::string(10, ' '); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); data.push_back(line_aux); @@ -2239,13 +2239,13 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp } -void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac) +void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac) { if (glonass_gnav_almanac.i_satellite_freq_channel) { } //Avoid compiler warning //Avoid compiler warning, there is not time system correction between Galileo and GLONASS - if (galileo_almanac.A_0G_10) + if (galileo_utc_model.A_0G_10) { } std::vector data; diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index faa3599d1..66017c2e9 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -106,12 +106,12 @@ public: /*! * \brief Generates the Galileo Navigation Data header */ - void rinex_nav_header(std::fstream& out, const Galileo_Iono& iono, const Galileo_Utc_Model& utc_model, const Galileo_Almanac& galileo_almanac); + void rinex_nav_header(std::fstream& out, const Galileo_Iono& iono, const Galileo_Utc_Model& utc_model); /*! * \brief Generates the Mixed (GPS/Galileo) Navigation Data header */ - void rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac); + void rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model); /*! * \brief Generates the GLONASS L1, L2 C/A Navigation Data header @@ -121,7 +121,7 @@ public: /*! * \brief Generates the Mixed (Galileo/GLONASS) Navigation Data header */ - void rinex_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); + void rinex_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); /*! * \brief Generates the Mixed (GPS L1 C/A/GLONASS L1, L2) Navigation Data header @@ -318,9 +318,9 @@ public: void update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Model& utc_model, const Gps_CNAV_Iono& iono); - void update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac); + void update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model); - void update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& utc_model, const Galileo_Almanac& galileo_almanac); + void update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& utc_model); void update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); @@ -328,7 +328,7 @@ public: void update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_cnav_iono, const Gps_CNAV_Utc_Model& gps_cnav_utc, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); - void update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); + void update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); void update_obs_header(std::fstream& out, const Gps_Utc_Model& utc_model); diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index df9dd9ab5..1f817658a 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -60,6 +60,7 @@ #include "gps_navigation_message.h" #include "gps_cnav_navigation_message.h" #include "glonass_gnav_navigation_message.h" +#include "galileo_almanac.h" #include "gnss_synchro.h" #include "pvt_solution.h" #include @@ -99,7 +100,7 @@ public: Galileo_Utc_Model galileo_utc_model; Galileo_Iono galileo_iono; - Galileo_Almanac galileo_almanac; + std::map galileo_almanac_map; Gps_Utc_Model gps_utc_model; Gps_Iono gps_iono; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc index 2648788c9..da1851fad 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc @@ -335,23 +335,18 @@ void galileo_telemetry_decoder_cc::decode_INAV_word(double *page_part_symbols, i 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)); + 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))); + DLOG(INFO) << "delta_t=" << delta_t << "[s]"; } if (d_inav_nav.have_new_almanac() == true) { - std::shared_ptr tmp_obj = std::make_shared(d_inav_nav.get_almanac()); + std::shared_ptr tmp_obj = std::make_shared(d_inav_nav.get_almanac()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); //debug std::cout << "Galileo E1 I/NAV almanac received in channel " << d_channel << " from satellite " << d_satellite << std::endl; - DLOG(INFO) << "GPS_to_Galileo time conversion:"; - DLOG(INFO) << "A0G=" << tmp_obj->A_0G_10; - DLOG(INFO) << "A1G=" << tmp_obj->A_1G_10; - DLOG(INFO) << "T0G=" << tmp_obj->t_0G_10; - DLOG(INFO) << "WN_0G_10=" << tmp_obj->WN_0G_10; 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; - 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))); - DLOG(INFO) << "delta_t=" << delta_t << "[s]"; } } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h index a009fe66a..6dc96f309 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h @@ -38,7 +38,7 @@ #include "galileo_navigation_message.h" #include "galileo_fnav_message.h" #include "galileo_ephemeris.h" -#include "galileo_almanac.h" +#include "galileo_almanac_helper.h" #include "galileo_iono.h" #include "galileo_utc_model.h" #include "gnss_satellite.h" diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index ec8880116..9561d7c72 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -30,6 +30,7 @@ set(SYSTEM_PARAMETERS_SOURCES galileo_utc_model.cc galileo_ephemeris.cc galileo_almanac.cc + galileo_almanac_helper.cc galileo_iono.cc galileo_navigation_message.cc sbas_ephemeris.cc @@ -59,6 +60,7 @@ set(SYSTEM_PARAMETERS_HEADERS galileo_utc_model.h galileo_ephemeris.h galileo_almanac.h + galileo_almanac_helper.h galileo_iono.h galileo_navigation_message.h sbas_ephemeris.h @@ -83,7 +85,7 @@ set(SYSTEM_PARAMETERS_HEADERS GPS_L1_CA.h GPS_L2C.h GPS_L5.h - MATH_CONSTANTS.h + MATH_CONSTANTS.h ) diff --git a/src/core/system_parameters/galileo_almanac.cc b/src/core/system_parameters/galileo_almanac.cc index 805e8b6e3..27931f8b0 100644 --- a/src/core/system_parameters/galileo_almanac.cc +++ b/src/core/system_parameters/galileo_almanac.cc @@ -1,7 +1,7 @@ /*! * \file galileo_almanac.cc - * \brief Implementation of a Galileo ALMANAC storage - * \author Javier Arribas, 2013. jarribas(at)cttc.es + * \brief Interface of a Galileo ALMANAC storage + * \author Carles Fernandez, 2018. cfernandez(at)cttc.cat * * ------------------------------------------------------------------------- * @@ -30,66 +30,23 @@ #include "galileo_almanac.h" + Galileo_Almanac::Galileo_Almanac() { - // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number - IOD_a_7 = 0; - WN_a_7 = 0.0; - t0a_7 = 0.0; - SVID1_7 = 0; - DELTA_A_7 = 0.0; - e_7 = 0.0; - omega_7 = 0.0; - delta_i_7 = 0.0; - Omega0_7 = 0.0; - Omega_dot_7 = 0.0; - M0_7 = 0.0; - - // Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2) - IOD_a_8 = 0; - af0_8 = 0.0; - af1_8 = 0.0; - E5b_HS_8 = 0.0; - E1B_HS_8 = 0.0; - E5a_HS_8 = 0.0; - SVID2_8 = 0; - DELTA_A_8 = 0.0; - e_8 = 0.0; - omega_8 = 0.0; - delta_i_8 = 0.0; - Omega0_8 = 0.0; - Omega_dot_8 = 0.0; - - // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) - IOD_a_9 = 0; - WN_a_9 = 0.0; - t0a_9 = 0.0; - M0_9 = 0.0; - af0_9 = 0.0; - af1_9 = 0.0; - E5b_HS_9 = 0.0; - E1B_HS_9 = 0.0; - E5a_HS_9 = 0.0; - SVID3_9 = 0; - DELTA_A_9 = 0.0; - e_9 = 0.0; - omega_9 = 0.0; - delta_i_9 = 0.0; - - // Word type 10: Almanac for SVID3 (2/2) - IOD_a_10 = 0; - Omega0_10 = 0.0; - Omega_dot_10 = 0.0; - M0_10 = 0.0; - af0_10 = 0.0; - af1_10 = 0.0; - E5b_HS_10 = 0.0; - E1B_HS_10 = 0.0; - E5a_HS_10 = 0.0; - - // GPS to Galileo GST conversion parameters - A_0G_10 = 0.0; - A_1G_10 = 0.0; - t_0G_10 = 0.0; - WN_0G_10 = 0.0; + i_satellite_PRN = 0U; + d_Toa = 0.0; + d_WNa = 0.0; + d_IODa = 0.0; + d_Delta_i = 0.0; + d_M_0 = 0.0; + d_e_eccentricity = 0.0; + d_Delta_sqrt_A = 0.0; + d_OMEGA0 = 0.0; + d_OMEGA = 0.0; + d_OMEGA_DOT = 0.0; + d_A_f0 = 0.0; + d_A_f1 = 0.0; + E5b_HS = 0.0; + E1B_HS = 0.0; + E5a_HS = 0.0; } diff --git a/src/core/system_parameters/galileo_almanac.h b/src/core/system_parameters/galileo_almanac.h index c8fb51e70..1529355ae 100644 --- a/src/core/system_parameters/galileo_almanac.h +++ b/src/core/system_parameters/galileo_almanac.h @@ -1,8 +1,8 @@ /*! * \file galileo_almanac.h * \brief Interface of a Galileo ALMANAC storage - * \author Javier Arribas, 2013. jarribas(at)cttc.es - * \author Mara Branzanti 2013. mara.branzanti(at)gmail.com + * \author Carles Fernandez, 2018. cfernandez(at)cttc.cat + * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) @@ -28,81 +28,65 @@ * ------------------------------------------------------------------------- */ + #ifndef GNSS_SDR_GALILEO_ALMANAC_H_ #define GNSS_SDR_GALILEO_ALMANAC_H_ +#include #include /*! - * \brief This class is a storage for the GALILEO ALMANAC data as described in GALILEO ICD - * - * See https://www.gsc-europa.eu/system/files/galileo_documents/Galileo_OS_SIS_ICD.pdf paragraph 5.1.10 + * \brief This class is a storage for the Galileo SV ALMANAC data */ class Galileo_Almanac { public: - // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number - int32_t IOD_a_7; - double WN_a_7; - double t0a_7; - int32_t SVID1_7; - double DELTA_A_7; - double e_7; - double omega_7; - double delta_i_7; - double Omega0_7; - double Omega_dot_7; - double M0_7; + uint32_t i_satellite_PRN; //!< SV PRN NUMBER + double d_Toa; + double d_WNa; + double d_IODa; + double d_Delta_i; + double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] + double d_e_eccentricity; //!< Eccentricity [dimensionless] + double d_Delta_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_OMEGA; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] + double d_A_f0; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] + double E5b_HS; + double E1B_HS; + double E5a_HS; - // Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2) - int32_t IOD_a_8; - double af0_8; - double af1_8; - double E5b_HS_8; - double E1B_HS_8; - double E5a_HS_8; - int32_t SVID2_8; - double DELTA_A_8; - double e_8; - double omega_8; - double delta_i_8; - double Omega0_8; - double Omega_dot_8; + /*! + * Default constructor + */ + Galileo_Almanac(); - // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) - int32_t IOD_a_9; - double WN_a_9; - double t0a_9; - double M0_9; - double af0_9; - double af1_9; - double E5b_HS_9; - double E1B_HS_9; - double E5a_HS_9; - int32_t SVID3_9; - double DELTA_A_9; - double e_9; - double omega_9; - double delta_i_9; + template - // Word type 10: Almanac for SVID3 (2/2) - int32_t IOD_a_10; - double Omega0_10; - double Omega_dot_10; - double M0_10; - double af0_10; - double af1_10; - double E5b_HS_10; - double E1B_HS_10; - double E5a_HS_10; - - // GPS to Galileo GST conversion parameters - double A_0G_10; - double A_1G_10; - double t_0G_10; - double WN_0G_10; - - Galileo_Almanac(); //!< Default constructor + void serialize(Archive& ar, const unsigned int version) + { + if (version) + { + }; + ar& BOOST_SERIALIZATION_NVP(i_satellite_PRN); + ar& BOOST_SERIALIZATION_NVP(d_Toa); + ar& BOOST_SERIALIZATION_NVP(d_WNa); + ar& BOOST_SERIALIZATION_NVP(d_IODa); + ar& BOOST_SERIALIZATION_NVP(d_Delta_i); + ar& BOOST_SERIALIZATION_NVP(d_M_0); + ar& BOOST_SERIALIZATION_NVP(d_e_eccentricity); + ar& BOOST_SERIALIZATION_NVP(d_Delta_sqrt_A); + ar& BOOST_SERIALIZATION_NVP(d_OMEGA0); + ar& BOOST_SERIALIZATION_NVP(d_OMEGA); + ar& BOOST_SERIALIZATION_NVP(d_OMEGA_DOT); + ar& BOOST_SERIALIZATION_NVP(d_A_f0); + ar& BOOST_SERIALIZATION_NVP(d_A_f1); + ar& BOOST_SERIALIZATION_NVP(E5b_HS); + ar& BOOST_SERIALIZATION_NVP(E1B_HS); + ar& BOOST_SERIALIZATION_NVP(E5a_HS); + } }; #endif diff --git a/src/core/system_parameters/galileo_almanac_helper.cc b/src/core/system_parameters/galileo_almanac_helper.cc new file mode 100644 index 000000000..738ecc8dc --- /dev/null +++ b/src/core/system_parameters/galileo_almanac_helper.cc @@ -0,0 +1,157 @@ +/*! + * \file galileo_almanac_helper.cc + * \brief Implementation of a Galileo ALMANAC storage helper + * \author Javier Arribas, 2013. jarribas(at)cttc.es + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#include "galileo_almanac_helper.h" + +Galileo_Almanac_Helper::Galileo_Almanac_Helper() +{ + // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number + IOD_a_7 = 0; + WN_a_7 = 0.0; + t0a_7 = 0.0; + SVID1_7 = 0; + DELTA_A_7 = 0.0; + e_7 = 0.0; + omega_7 = 0.0; + delta_i_7 = 0.0; + Omega0_7 = 0.0; + Omega_dot_7 = 0.0; + M0_7 = 0.0; + + // Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2) + IOD_a_8 = 0; + af0_8 = 0.0; + af1_8 = 0.0; + E5b_HS_8 = 0.0; + E1B_HS_8 = 0.0; + E5a_HS_8 = 0.0; + SVID2_8 = 0; + DELTA_A_8 = 0.0; + e_8 = 0.0; + omega_8 = 0.0; + delta_i_8 = 0.0; + Omega0_8 = 0.0; + Omega_dot_8 = 0.0; + + // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) + IOD_a_9 = 0; + WN_a_9 = 0.0; + t0a_9 = 0.0; + M0_9 = 0.0; + af0_9 = 0.0; + af1_9 = 0.0; + E5b_HS_9 = 0.0; + E1B_HS_9 = 0.0; + E5a_HS_9 = 0.0; + SVID3_9 = 0; + DELTA_A_9 = 0.0; + e_9 = 0.0; + omega_9 = 0.0; + delta_i_9 = 0.0; + + // Word type 10: Almanac for SVID3 (2/2) + IOD_a_10 = 0; + Omega0_10 = 0.0; + Omega_dot_10 = 0.0; + M0_10 = 0.0; + af0_10 = 0.0; + af1_10 = 0.0; + E5b_HS_10 = 0.0; + E1B_HS_10 = 0.0; + E5a_HS_10 = 0.0; +} + +Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) +{ + Galileo_Almanac galileo_almanac; + switch (i) + { + case 1: + galileo_almanac.i_satellite_PRN = this->SVID1_7; + galileo_almanac.d_Toa = this->t0a_7; + galileo_almanac.d_WNa = this->WN_a_7; + galileo_almanac.d_IODa = this->IOD_a_7; + galileo_almanac.d_Delta_i = this->delta_i_7; + galileo_almanac.d_M_0 = this->M0_7; + galileo_almanac.d_e_eccentricity = this->e_7; + galileo_almanac.d_Delta_sqrt_A = this->DELTA_A_7; + galileo_almanac.d_OMEGA0 = this->Omega0_7; + galileo_almanac.d_OMEGA = this->omega_7; + galileo_almanac.d_OMEGA_DOT = this->Omega_dot_7; + galileo_almanac.d_A_f0 = this->af0_8; + galileo_almanac.d_A_f1 = this->af1_8; + galileo_almanac.E5b_HS = this->E5b_HS_8; + galileo_almanac.E1B_HS = this->E1B_HS_8; + galileo_almanac.E5a_HS = this->E5a_HS_8; + break; + + case 2: + galileo_almanac.i_satellite_PRN = this->SVID2_8; + galileo_almanac.d_Toa = this->t0a_9; + galileo_almanac.d_WNa = this->WN_a_9; + galileo_almanac.d_IODa = this->IOD_a_9; + galileo_almanac.d_Delta_i = this->delta_i_8; + galileo_almanac.d_M_0 = this->M0_9; + galileo_almanac.d_e_eccentricity = this->e_8; + galileo_almanac.d_Delta_sqrt_A = this->DELTA_A_8; + galileo_almanac.d_OMEGA0 = this->Omega0_8; + galileo_almanac.d_OMEGA = this->omega_8; + galileo_almanac.d_OMEGA_DOT = this->Omega_dot_8; + galileo_almanac.d_A_f0 = this->af0_9; + galileo_almanac.d_A_f1 = this->af1_9; + galileo_almanac.E5b_HS = this->E5b_HS_9; + galileo_almanac.E1B_HS = this->E1B_HS_9; + galileo_almanac.E5a_HS = this->E5a_HS_9; + break; + + case 3: + galileo_almanac.i_satellite_PRN = this->SVID3_9; + galileo_almanac.d_Toa = this->t0a_9; + galileo_almanac.d_WNa = this->WN_a_9; + galileo_almanac.d_IODa = this->IOD_a_10; + galileo_almanac.d_Delta_i = this->delta_i_9; + galileo_almanac.d_M_0 = this->M0_10; + galileo_almanac.d_e_eccentricity = this->e_9; + galileo_almanac.d_Delta_sqrt_A = this->DELTA_A_9; + galileo_almanac.d_OMEGA0 = this->Omega0_10; + galileo_almanac.d_OMEGA = this->omega_9; + galileo_almanac.d_OMEGA_DOT = this->Omega_dot_10; + galileo_almanac.d_A_f0 = this->af0_10; + galileo_almanac.d_A_f1 = this->af1_10; + galileo_almanac.E5b_HS = this->E5b_HS_10; + galileo_almanac.E1B_HS = this->E1B_HS_10; + galileo_almanac.E5a_HS = this->E5a_HS_10; + break; + + default: + break; + } + return galileo_almanac; +} diff --git a/src/core/system_parameters/galileo_almanac_helper.h b/src/core/system_parameters/galileo_almanac_helper.h new file mode 100644 index 000000000..c0541a214 --- /dev/null +++ b/src/core/system_parameters/galileo_almanac_helper.h @@ -0,0 +1,104 @@ +/*! + * \file galileo_almanac_helper.h + * \brief Interface of a Galileo ALMANAC storage helper + * \author Javier Arribas, 2013. jarribas(at)cttc.es + * \author Mara Branzanti 2013. mara.branzanti(at)gmail.com + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#ifndef GNSS_SDR_GALILEO_ALMANAC_HELPER_H_ +#define GNSS_SDR_GALILEO_ALMANAC_HELPER_H_ + +#include "galileo_almanac.h" +#include + +/*! + * \brief This class is a storage for the GALILEO ALMANAC data as described in GALILEO ICD + * + * See https://www.gsc-europa.eu/system/files/galileo_documents/Galileo_OS_SIS_ICD.pdf paragraph 5.1.10 + */ +class Galileo_Almanac_Helper +{ +public: + // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number + int32_t IOD_a_7; + double WN_a_7; + double t0a_7; + int32_t SVID1_7; + double DELTA_A_7; + double e_7; + double omega_7; + double delta_i_7; + double Omega0_7; + double Omega_dot_7; + double M0_7; + + // Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2) + int32_t IOD_a_8; + double af0_8; + double af1_8; + double E5b_HS_8; + double E1B_HS_8; + double E5a_HS_8; + int32_t SVID2_8; + double DELTA_A_8; + double e_8; + double omega_8; + double delta_i_8; + double Omega0_8; + double Omega_dot_8; + + // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) + int32_t IOD_a_9; + double WN_a_9; + double t0a_9; + double M0_9; + double af0_9; + double af1_9; + double E5b_HS_9; + double E1B_HS_9; + double E5a_HS_9; + int32_t SVID3_9; + double DELTA_A_9; + double e_9; + double omega_9; + double delta_i_9; + + // Word type 10: Almanac for SVID3 (2/2) + int32_t IOD_a_10; + double Omega0_10; + double Omega_dot_10; + double M0_10; + double af0_10; + double af1_10; + double E5b_HS_10; + double E1B_HS_10; + double E5a_HS_10; + + Galileo_Almanac_Helper(); //!< Default constructor + Galileo_Almanac get_almanac(int i); +}; + +#endif diff --git a/src/core/system_parameters/galileo_fnav_message.cc b/src/core/system_parameters/galileo_fnav_message.cc index cc1509b4c..42a4a7c1b 100644 --- a/src/core/system_parameters/galileo_fnav_message.cc +++ b/src/core/system_parameters/galileo_fnav_message.cc @@ -630,9 +630,9 @@ Galileo_Utc_Model Galileo_Fnav_Message::get_utc_model() } -Galileo_Almanac Galileo_Fnav_Message::get_almanac() +Galileo_Almanac_Helper Galileo_Fnav_Message::get_almanac() { - Galileo_Almanac almanac; + Galileo_Almanac_Helper almanac; // FNAV equivalent of INAV Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number almanac.IOD_a_7 = FNAV_IODa_5; almanac.WN_a_7 = FNAV_WNa_5; diff --git a/src/core/system_parameters/galileo_fnav_message.h b/src/core/system_parameters/galileo_fnav_message.h index 3cb6e76a5..2a16578be 100644 --- a/src/core/system_parameters/galileo_fnav_message.h +++ b/src/core/system_parameters/galileo_fnav_message.h @@ -40,7 +40,7 @@ #include "galileo_ephemeris.h" #include "galileo_iono.h" -#include "galileo_almanac.h" +#include "galileo_almanac_helper.h" #include "galileo_utc_model.h" #include "Galileo_E5a.h" #include @@ -66,7 +66,7 @@ public: Galileo_Ephemeris get_ephemeris(); Galileo_Iono get_iono(); Galileo_Utc_Model get_utc_model(); - Galileo_Almanac get_almanac(); + Galileo_Almanac_Helper get_almanac(); Galileo_Fnav_Message(); diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index 3fb375712..6d157aa46 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -578,13 +578,18 @@ Galileo_Utc_Model Galileo_Navigation_Message::get_utc_model() utc_model.DN_6 = DN_6; utc_model.Delta_tLSF_6 = Delta_tLSF_6; utc_model.flag_utc_model = flag_utc_model; + // GPS to Galileo GST conversion parameters + utc_model.A_0G_10 = A_0G_10; + utc_model.A_1G_10 = A_1G_10; + utc_model.t_0G_10 = t_0G_10; + utc_model.WN_0G_10 = WN_0G_10; return utc_model; } -Galileo_Almanac Galileo_Navigation_Message::get_almanac() +Galileo_Almanac_Helper Galileo_Navigation_Message::get_almanac() { - Galileo_Almanac almanac; + Galileo_Almanac_Helper almanac; // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number almanac.IOD_a_7 = IOD_a_7; almanac.WN_a_7 = WN_a_7; @@ -637,12 +642,6 @@ Galileo_Almanac Galileo_Navigation_Message::get_almanac() almanac.E5b_HS_10 = E5b_HS_10; almanac.E1B_HS_10 = E1B_HS_10; - // GPS to Galileo GST conversion parameters - almanac.A_0G_10 = A_0G_10; - almanac.A_1G_10 = A_1G_10; - almanac.t_0G_10 = t_0G_10; - almanac.WN_0G_10 = WN_0G_10; - return almanac; } diff --git a/src/core/system_parameters/galileo_navigation_message.h b/src/core/system_parameters/galileo_navigation_message.h index 6b41312c4..d54e1b980 100644 --- a/src/core/system_parameters/galileo_navigation_message.h +++ b/src/core/system_parameters/galileo_navigation_message.h @@ -35,7 +35,7 @@ #include "galileo_ephemeris.h" #include "galileo_iono.h" -#include "galileo_almanac.h" +#include "galileo_almanac_helper.h" #include "galileo_utc_model.h" #include "Galileo_E1.h" #include @@ -290,9 +290,9 @@ public: Galileo_Utc_Model get_utc_model(); /* - * \brief Returns a Galileo_Almanac object filled with the latest navigation data received + * \brief Returns a Galileo_Almanac_Helper object filled with the latest navigation data received */ - Galileo_Almanac get_almanac(); + Galileo_Almanac_Helper get_almanac(); Galileo_Navigation_Message(); }; diff --git a/src/core/system_parameters/galileo_utc_model.cc b/src/core/system_parameters/galileo_utc_model.cc index 9464e51e9..660c20ca1 100644 --- a/src/core/system_parameters/galileo_utc_model.cc +++ b/src/core/system_parameters/galileo_utc_model.cc @@ -43,6 +43,11 @@ Galileo_Utc_Model::Galileo_Utc_Model() DN_6 = 0.0; Delta_tLSF_6 = 0.0; flag_utc_model = false; + // GPS to Galileo GST conversion parameters + A_0G_10 = 0.0; + A_1G_10 = 0.0; + t_0G_10 = 0.0; + WN_0G_10 = 0.0; } diff --git a/src/core/system_parameters/galileo_utc_model.h b/src/core/system_parameters/galileo_utc_model.h index 53e930880..174fb0754 100644 --- a/src/core/system_parameters/galileo_utc_model.h +++ b/src/core/system_parameters/galileo_utc_model.h @@ -53,6 +53,13 @@ public: double DN_6; double Delta_tLSF_6; bool flag_utc_model; + + // GPS to Galileo GST conversion parameters + double A_0G_10; + double A_1G_10; + double t_0G_10; + double WN_0G_10; + //double TOW_6; double GST_to_UTC_time(double t_e, int WN); //!< GST-UTC Conversion Algorithm and Parameters /*! From c4b2aa8cc42cc2d5dc7d1235f9dfc880291a0545 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 25 Oct 2018 00:43:25 +0200 Subject: [PATCH 004/143] Read Galileo almamac xml file if present --- src/core/libs/gnss_sdr_supl_client.cc | 47 +++++++++++++++++++++++++++ src/core/libs/gnss_sdr_supl_client.h | 12 +++++++ src/core/receiver/control_thread.cc | 16 +++++++++ src/core/receiver/control_thread.h | 1 + 4 files changed, 76 insertions(+) diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index 022f658fe..9218009c6 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -786,6 +786,53 @@ bool gnss_sdr_supl_client::save_gal_iono_xml(const std::string file_name, Galile } +bool gnss_sdr_supl_client::load_gal_almanac_xml(const std::string file_name) +{ + std::ifstream ifs; + try + { + ifs.open(file_name.c_str(), std::ifstream::binary | std::ifstream::in); + boost::archive::xml_iarchive xml(ifs); + gal_almanac_map.clear(); + xml >> boost::serialization::make_nvp("GNSS-SDR_gal_almanac_map", this->gal_almanac_map); + LOG(INFO) << "Loaded Galileo almanac map data with " << this->gal_almanac_map.size() << " satellites"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what() << "File: " << file_name; + return false; + } + return true; +} + + +bool gnss_sdr_supl_client::save_gal_almanac_xml(const std::string file_name, std::map gal_almanac_map) +{ + if (gal_almanac_map.empty() == false) + { + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_almanac_map", gal_almanac_map); + LOG(INFO) << "Saved Galileo almanac data"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + return false; + } + } + else + { + LOG(WARNING) << "Failed to save Galileo almanac, map is empty"; + return false; + } + return true; +} + + bool gnss_sdr_supl_client::load_glo_utc_xml(const std::string file_name) { std::ifstream ifs; diff --git a/src/core/libs/gnss_sdr_supl_client.h b/src/core/libs/gnss_sdr_supl_client.h index 465e552f3..b58b4a62f 100644 --- a/src/core/libs/gnss_sdr_supl_client.h +++ b/src/core/libs/gnss_sdr_supl_client.h @@ -51,6 +51,7 @@ extern "C" #include "galileo_ephemeris.h" #include "galileo_utc_model.h" #include "galileo_iono.h" +#include "galileo_almanac.h" #include "glonass_gnav_ephemeris.h" #include "glonass_gnav_utc_model.h" #include @@ -90,6 +91,7 @@ public: // almanac map std::map gps_almanac_map; + std::map gal_almanac_map; // ionospheric model Gps_Iono gps_iono; @@ -195,6 +197,16 @@ public: */ bool save_gal_utc_xml(const std::string file_name, Galileo_Utc_Model& utc); + /*! + * \brief Read Galileo almanac map from XML file + */ + bool load_gal_almanac_xml(const std::string file_name); + + /*! + * \brief Save Galileo almanac map to XML file + */ + bool save_gal_almanac_xml(const std::string file_name, std::map gal_almanac); + /*! * \brief Read iono from XML file */ diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index ff4cd82c7..49f31dafa 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -234,6 +234,7 @@ bool ControlThread::read_assistance_from_XML() std::string cnav_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_cnav_utc_model_xml", cnav_utc_default_xml_filename); std::string eph_glo_xml_filename = configuration_->property("GNSS-SDR.SUPL_glo_ephemeris_xml", eph_glo_gnav_default_xml_filename); std::string glo_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_glo_utc_model_xml", glo_utc_default_xml_filename); + std::string gal_almanac_xml_filename = configuration_->property("GNSS-SDR.SUPL_gal_almanacl_xml", gal_almanac_default_xml_filename); if (configuration_->property("GNSS-SDR.AGNSS_XML_enabled", false) == true) { @@ -249,6 +250,7 @@ bool ControlThread::read_assistance_from_XML() cnav_utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_cnav_utc_model_xml", cnav_utc_default_xml_filename); eph_glo_xml_filename = configuration_->property("GNSS-SDR.AGNSS_glo_ephemeris_xml", eph_glo_gnav_default_xml_filename); glo_utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_glo_utc_model_xml", glo_utc_default_xml_filename); + gal_almanac_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gal_almanacl_xml", gal_almanac_default_xml_filename); } std::cout << "Trying to read GNSS ephemeris from XML file(s)..." << std::endl; @@ -317,6 +319,20 @@ bool ControlThread::read_assistance_from_XML() std::cout << "From XML file: Read Galileo UTC model parameters." << std::endl; ret = true; } + + if (supl_client_ephemeris_.load_gal_almanac_xml(gal_almanac_xml_filename) == true) + { + std::map::const_iterator gal_alm_iter; + for (gal_alm_iter = supl_client_ephemeris_.gal_almanac_map.cbegin(); + gal_alm_iter != supl_client_ephemeris_.gal_almanac_map.cend(); + gal_alm_iter++) + { + std::cout << "From XML file: Read Galileo almanac for satellite " << Gnss_Satellite("Galileo", gal_alm_iter->second.i_satellite_PRN) << std::endl; + std::shared_ptr tmp_obj = std::make_shared(gal_alm_iter->second); + flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); + } + ret = true; + } } if ((configuration_->property("Channels_2S.count", 0) > 0) or (configuration_->property("Channels_L5.count", 0) > 0)) diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index e8e62b5fe..2fda50752 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -180,6 +180,7 @@ private: const std::string cnav_utc_default_xml_filename = "./gps_cnav_utc_model.xml"; const std::string eph_glo_gnav_default_xml_filename = "./glo_gnav_ephemeris.xml"; const std::string glo_utc_default_xml_filename = "./glo_utc_model.xml"; + const std::string gal_almanac_default_xml_filename = "./gal_almanac.xml"; }; #endif /*GNSS_SDR_CONTROL_THREAD_H_*/ From 20302ed28fc7c8fcfa5dd980a05f2e4c3d005b8b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 25 Oct 2018 00:52:29 +0200 Subject: [PATCH 005/143] Read Almanac data from AGNSS --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 3030d536f..94f040bd7 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -201,6 +201,14 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) if (sv3.i_satellite_PRN != 0) d_ls_pvt->galileo_almanac_map[sv3.i_satellite_PRN] = sv3; DLOG(INFO) << "New Galileo Almanac data have arrived "; } + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) + { + // ### Galileo Almanac ### + std::shared_ptr galileo_alm; + galileo_alm = boost::any_cast>(pmt::any_ref(msg)); + // update/insert new almanac record to the global almanac map + d_ls_pvt->galileo_almanac_map[galileo_alm->i_satellite_PRN] = *galileo_alm; + } // **************** GLONASS GNAV Telemetry ************************** else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) From bc058d33dacf98cc51a34a6db79a3235d1919965 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 25 Oct 2018 11:01:29 +0200 Subject: [PATCH 006/143] Read GPS almanac file if present --- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 22 +++++++++ src/algorithms/PVT/libs/rtklib_solver.h | 1 + src/core/libs/gnss_sdr_supl_client.cc | 47 +++++++++++++++++++ src/core/libs/gnss_sdr_supl_client.h | 10 ++++ src/core/receiver/control_thread.cc | 15 ++++++ src/core/receiver/control_thread.h | 1 + src/core/system_parameters/gps_almanac.h | 22 +++++++++ 7 files changed, 118 insertions(+) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 94f040bd7..be2c4591e 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -538,6 +538,28 @@ rtklib_pvt_cc::~rtklib_pvt_cc() LOG(INFO) << "Failed to save Galileo UTC model parameters, not valid data"; } + // save GPS almanac to XML file + file_name = "gps_almanac.xml"; + if (d_ls_pvt->gps_almanac_map.empty() == false) + { + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gps_almanac_map", d_ls_pvt->gps_almanac_map); + LOG(INFO) << "Saved GPS almanac map data"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } + } + else + { + LOG(INFO) << "Failed to save GPS almanac, map is empty"; + } + // Save Galileo almanac file_name = "gal_almanac.xml"; if (d_ls_pvt->galileo_almanac_map.empty() == false) diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 1f817658a..3bd054954 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -104,6 +104,7 @@ public: Gps_Utc_Model gps_utc_model; Gps_Iono gps_iono; + std::map gps_almanac_map; Gps_CNAV_Iono gps_cnav_iono; Gps_CNAV_Utc_Model gps_cnav_utc_model; diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index 9218009c6..dae736999 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -786,6 +786,53 @@ bool gnss_sdr_supl_client::save_gal_iono_xml(const std::string file_name, Galile } +bool gnss_sdr_supl_client::load_gps_almanac_xml(const std::string file_name) +{ + std::ifstream ifs; + try + { + ifs.open(file_name.c_str(), std::ifstream::binary | std::ifstream::in); + boost::archive::xml_iarchive xml(ifs); + gps_almanac_map.clear(); + xml >> boost::serialization::make_nvp("GNSS-SDR_gps_almanac_map", this->gps_almanac_map); + LOG(INFO) << "Loaded GPS almanac map data with " << this->gps_almanac_map.size() << " satellites"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what() << "File: " << file_name; + return false; + } + return true; +} + + +bool gnss_sdr_supl_client::save_gps_almanac_xml(const std::string file_name, std::map gps_almanac_map) +{ + if (gps_almanac_map.empty() == false) + { + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gps_almanac_map", gps_almanac_map); + LOG(INFO) << "Saved GPS almanac data"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + return false; + } + } + else + { + LOG(WARNING) << "Failed to save GPS almanac, map is empty"; + return false; + } + return true; +} + + bool gnss_sdr_supl_client::load_gal_almanac_xml(const std::string file_name) { std::ifstream ifs; diff --git a/src/core/libs/gnss_sdr_supl_client.h b/src/core/libs/gnss_sdr_supl_client.h index b58b4a62f..52e4ed371 100644 --- a/src/core/libs/gnss_sdr_supl_client.h +++ b/src/core/libs/gnss_sdr_supl_client.h @@ -207,6 +207,16 @@ public: */ bool save_gal_almanac_xml(const std::string file_name, std::map gal_almanac); + /*! + * \brief Read GPS almanac map from XML file + */ + bool load_gps_almanac_xml(const std::string file_name); + + /*! + * \brief Save GPS almanac map to XML file + */ + bool save_gps_almanac_xml(const std::string file_name, std::map gps_almanac_map); + /*! * \brief Read iono from XML file */ diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 49f31dafa..a73d2b446 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -235,6 +235,7 @@ bool ControlThread::read_assistance_from_XML() std::string eph_glo_xml_filename = configuration_->property("GNSS-SDR.SUPL_glo_ephemeris_xml", eph_glo_gnav_default_xml_filename); std::string glo_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_glo_utc_model_xml", glo_utc_default_xml_filename); std::string gal_almanac_xml_filename = configuration_->property("GNSS-SDR.SUPL_gal_almanacl_xml", gal_almanac_default_xml_filename); + std::string gps_almanac_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_almanacl_xml", gps_almanac_default_xml_filename); if (configuration_->property("GNSS-SDR.AGNSS_XML_enabled", false) == true) { @@ -286,6 +287,20 @@ bool ControlThread::read_assistance_from_XML() std::cout << "From XML file: Read GPS ionosphere model parameters." << std::endl; ret = true; } + + if (supl_client_ephemeris_.load_gps_almanac_xml(gps_almanac_xml_filename) == true) + { + std::map::const_iterator gps_alm_iter; + for (gps_alm_iter = supl_client_ephemeris_.gps_almanac_map.cbegin(); + gps_alm_iter != supl_client_ephemeris_.gps_almanac_map.cend(); + gps_alm_iter++) + { + std::cout << "From XML file: Read GPS almanac for satellite " << Gnss_Satellite("GPS", gps_alm_iter->second.i_satellite_PRN) << std::endl; + std::shared_ptr tmp_obj = std::make_shared(gps_alm_iter->second); + flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); + } + ret = true; + } } if ((configuration_->property("Channels_1B.count", 0) > 0) or (configuration_->property("Channels_5X.count", 0) > 0)) diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index 2fda50752..ffc2ffa39 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -181,6 +181,7 @@ private: const std::string eph_glo_gnav_default_xml_filename = "./glo_gnav_ephemeris.xml"; const std::string glo_utc_default_xml_filename = "./glo_utc_model.xml"; const std::string gal_almanac_default_xml_filename = "./gal_almanac.xml"; + const std::string gps_almanac_default_xml_filename = "./gps_almanac.xml"; }; #endif /*GNSS_SDR_CONTROL_THREAD_H_*/ diff --git a/src/core/system_parameters/gps_almanac.h b/src/core/system_parameters/gps_almanac.h index 22bb79c4c..d3628059e 100644 --- a/src/core/system_parameters/gps_almanac.h +++ b/src/core/system_parameters/gps_almanac.h @@ -32,6 +32,7 @@ #ifndef GNSS_SDR_GPS_ALMANAC_H_ #define GNSS_SDR_GPS_ALMANAC_H_ +#include #include /*! @@ -59,6 +60,27 @@ public: * Default constructor */ Gps_Almanac(); + + template + + void serialize(Archive& ar, const unsigned int version) + { + if (version) + { + }; + ar& BOOST_SERIALIZATION_NVP(i_satellite_PRN); + ar& BOOST_SERIALIZATION_NVP(d_Delta_i); + ar& BOOST_SERIALIZATION_NVP(d_Toa); + ar& BOOST_SERIALIZATION_NVP(d_M_0); + ar& BOOST_SERIALIZATION_NVP(d_e_eccentricity); + ar& BOOST_SERIALIZATION_NVP(d_sqrt_A); + ar& BOOST_SERIALIZATION_NVP(d_OMEGA0); + ar& BOOST_SERIALIZATION_NVP(d_OMEGA); + ar& BOOST_SERIALIZATION_NVP(d_OMEGA_DOT); + ar& BOOST_SERIALIZATION_NVP(i_SV_health); + ar& BOOST_SERIALIZATION_NVP(d_A_f0); + ar& BOOST_SERIALIZATION_NVP(d_A_f1); + } }; #endif From 49769059a79269ccb3dca4542e8d30b08f0dfbee Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 25 Oct 2018 11:10:30 +0200 Subject: [PATCH 007/143] Store GPS almanac --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index be2c4591e..d3d752a07 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -157,6 +157,15 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) DLOG(INFO) << "New CNAV UTC record has arrived "; } + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) + { + // ### GPS ALMANAC ### + std::shared_ptr gps_almanac; + gps_almanac = boost::any_cast>(pmt::any_ref(msg)); + d_ls_pvt->gps_almanac_map[gps_almanac->i_satellite_PRN] = *gps_almanac; + DLOG(INFO) << "New GPS almanac record has arrived "; + } + // **************** Galileo telemetry ******************** else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { From b3d4ba33f3e1dfbe7eee9113d0c391297ec5e233 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 25 Oct 2018 16:48:19 +0200 Subject: [PATCH 008/143] Fix possible duplication of satellites --- src/core/receiver/gnss_flowgraph.cc | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 0504da9ea..fafefa155 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -833,34 +833,42 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) DLOG(INFO) << "Channel " << who << " ACQ FAILED satellite " << channels_[who]->get_signal().get_satellite() << ", Signal " << channels_[who]->get_signal().get_signal_str(); if (sat == 0) { - switch (mapStringValues_[channels_[who]->get_signal().get_signal_str()]) + Gnss_Signal gs = channels_[who]->get_signal(); + switch (mapStringValues_[gs.get_signal_str()]) { case evGPS_1C: - available_GPS_1C_signals_.push_back(channels_[who]->get_signal()); + available_GPS_1C_signals_.remove(gs); + available_GPS_1C_signals_.push_back(gs); break; case evGPS_2S: - available_GPS_2S_signals_.push_back(channels_[who]->get_signal()); + available_GPS_2S_signals_.remove(gs); + available_GPS_2S_signals_.push_back(gs); break; case evGPS_L5: - available_GPS_L5_signals_.push_back(channels_[who]->get_signal()); + available_GPS_L5_signals_.remove(gs); + available_GPS_L5_signals_.push_back(gs); break; case evGAL_1B: - available_GAL_1B_signals_.push_back(channels_[who]->get_signal()); + available_GAL_1B_signals_.remove(gs); + available_GAL_1B_signals_.push_back(gs); break; case evGAL_5X: - available_GAL_5X_signals_.push_back(channels_[who]->get_signal()); + available_GAL_5X_signals_.remove(gs); + available_GAL_5X_signals_.push_back(gs); break; case evGLO_1G: - available_GLO_1G_signals_.push_back(channels_[who]->get_signal()); + available_GLO_1G_signals_.remove(gs); + available_GLO_1G_signals_.push_back(gs); break; case evGLO_2G: - available_GLO_2G_signals_.push_back(channels_[who]->get_signal()); + available_GLO_2G_signals_.remove(gs); + available_GLO_2G_signals_.push_back(gs); break; default: From 560ff94f764794fb44cad08c588bbd6c934d2708 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 25 Oct 2018 21:21:36 +0200 Subject: [PATCH 009/143] Add XML Schemas for Assisted GNSS --- docs/xml-schemas/README.md | 28 +++++++++ docs/xml-schemas/cnav_ephemeris_map.xsd | 72 +++++++++++++++++++++++ docs/xml-schemas/ephemeris_map.xsd | 78 +++++++++++++++++++++++++ docs/xml-schemas/gal_almanac_map.xsd | 56 ++++++++++++++++++ docs/xml-schemas/gal_ephemeris_map.xsd | 60 +++++++++++++++++++ docs/xml-schemas/gal_utc_model.xsd | 28 +++++++++ docs/xml-schemas/gps_almanac_map.xsd | 52 +++++++++++++++++ docs/xml-schemas/iono_model.xsd | 27 +++++++++ docs/xml-schemas/utc_model.xsd | 28 +++++++++ 9 files changed, 429 insertions(+) create mode 100644 docs/xml-schemas/README.md create mode 100644 docs/xml-schemas/cnav_ephemeris_map.xsd create mode 100644 docs/xml-schemas/ephemeris_map.xsd create mode 100644 docs/xml-schemas/gal_almanac_map.xsd create mode 100644 docs/xml-schemas/gal_ephemeris_map.xsd create mode 100644 docs/xml-schemas/gal_utc_model.xsd create mode 100644 docs/xml-schemas/gps_almanac_map.xsd create mode 100644 docs/xml-schemas/iono_model.xsd create mode 100644 docs/xml-schemas/utc_model.xsd diff --git a/docs/xml-schemas/README.md b/docs/xml-schemas/README.md new file mode 100644 index 000000000..bd1a06a78 --- /dev/null +++ b/docs/xml-schemas/README.md @@ -0,0 +1,28 @@ +# XML Schemas for Assisted GNSS-SDR + +GNSS-SDR can read assistance data from [Extensible Markup Language (XML)](https://www.w3.org/XML/) files, and can store navigation data decoded from GNSS signals in the same format. This page provides XML Schemas which describe the structure for those XML files. + +[XSD (XML Schema Definition)](https://www.w3.org/XML/Schema) is a World Wide Web Consortium (W3C) recommendation that specifies how to formally describe the elements in an XML document. + + +GPS L1 C/A +---------- + + - [ephemeris_map.xsd](./ephemeris_map.xsd) + - [iono_model.xsd](./iono_model.xsd) + - [utc_model.xsd](./utc_model.xsd) + - [gps_almanac_map.xsd](./gps_almanac_map.xsd) + + +GPS L2C and L5 +-------------- + + - [cnav_ephemeris_map.xsd](./cnav_ephemeris_map.xsd) + + +Galileo OS +---------- + + - [gal_ephemeris_map.xsd](./gal_ephemeris_map.xsd) + - [gal_utc_model.xsd](./gal_utc_model.xsd) + - [gal_almanac_map.xsd](./gal_almanac_map.xsd) diff --git a/docs/xml-schemas/cnav_ephemeris_map.xsd b/docs/xml-schemas/cnav_ephemeris_map.xsd new file mode 100644 index 000000000..139756f36 --- /dev/null +++ b/docs/xml-schemas/cnav_ephemeris_map.xsd @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/xml-schemas/ephemeris_map.xsd b/docs/xml-schemas/ephemeris_map.xsd new file mode 100644 index 000000000..f76c5e900 --- /dev/null +++ b/docs/xml-schemas/ephemeris_map.xsd @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/xml-schemas/gal_almanac_map.xsd b/docs/xml-schemas/gal_almanac_map.xsd new file mode 100644 index 000000000..887caf064 --- /dev/null +++ b/docs/xml-schemas/gal_almanac_map.xsd @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/xml-schemas/gal_ephemeris_map.xsd b/docs/xml-schemas/gal_ephemeris_map.xsd new file mode 100644 index 000000000..06c541af5 --- /dev/null +++ b/docs/xml-schemas/gal_ephemeris_map.xsd @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/xml-schemas/gal_utc_model.xsd b/docs/xml-schemas/gal_utc_model.xsd new file mode 100644 index 000000000..a589f94fb --- /dev/null +++ b/docs/xml-schemas/gal_utc_model.xsd @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/xml-schemas/gps_almanac_map.xsd b/docs/xml-schemas/gps_almanac_map.xsd new file mode 100644 index 000000000..818dc49c3 --- /dev/null +++ b/docs/xml-schemas/gps_almanac_map.xsd @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/xml-schemas/iono_model.xsd b/docs/xml-schemas/iono_model.xsd new file mode 100644 index 000000000..26cda74bd --- /dev/null +++ b/docs/xml-schemas/iono_model.xsd @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/xml-schemas/utc_model.xsd b/docs/xml-schemas/utc_model.xsd new file mode 100644 index 000000000..44005a628 --- /dev/null +++ b/docs/xml-schemas/utc_model.xsd @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d04c4b3f1e1eef8c1d993e3e890aa5e735aa2f63 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 25 Oct 2018 21:45:46 +0200 Subject: [PATCH 010/143] Add Galileo ionospheric model --- docs/xml-schemas/README.md | 5 +++-- docs/xml-schemas/gal_iono_model.xsd | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 docs/xml-schemas/gal_iono_model.xsd diff --git a/docs/xml-schemas/README.md b/docs/xml-schemas/README.md index bd1a06a78..ab5a9b37f 100644 --- a/docs/xml-schemas/README.md +++ b/docs/xml-schemas/README.md @@ -20,9 +20,10 @@ GPS L2C and L5 - [cnav_ephemeris_map.xsd](./cnav_ephemeris_map.xsd) -Galileo OS ----------- +Galileo +------- - [gal_ephemeris_map.xsd](./gal_ephemeris_map.xsd) - [gal_utc_model.xsd](./gal_utc_model.xsd) + - [gal_iono_model.xsd](./gal_iono_model.xsd) - [gal_almanac_map.xsd](./gal_almanac_map.xsd) diff --git a/docs/xml-schemas/gal_iono_model.xsd b/docs/xml-schemas/gal_iono_model.xsd new file mode 100644 index 000000000..dc0219273 --- /dev/null +++ b/docs/xml-schemas/gal_iono_model.xsd @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 443bd5afa6ab83f5c4aa90eb5945482cd9b39ed8 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 25 Oct 2018 22:17:42 +0200 Subject: [PATCH 011/143] Add link to TTFF definition --- docs/xml-schemas/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/xml-schemas/README.md b/docs/xml-schemas/README.md index ab5a9b37f..2b3641a0c 100644 --- a/docs/xml-schemas/README.md +++ b/docs/xml-schemas/README.md @@ -1,6 +1,6 @@ # XML Schemas for Assisted GNSS-SDR -GNSS-SDR can read assistance data from [Extensible Markup Language (XML)](https://www.w3.org/XML/) files, and can store navigation data decoded from GNSS signals in the same format. This page provides XML Schemas which describe the structure for those XML files. +GNSS-SDR can read assistance data from [Extensible Markup Language (XML)](https://www.w3.org/XML/) files for faster [Time-To-First-Fix](https://gnss-sdr.org/design-forces/availability/#time-to-first-fix-ttff), and can store navigation data decoded from GNSS signals in the same format. This folder provides XML Schemas which describe those XML files structure. [XSD (XML Schema Definition)](https://www.w3.org/XML/Schema) is a World Wide Web Consortium (W3C) recommendation that specifies how to formally describe the elements in an XML document. @@ -24,6 +24,6 @@ Galileo ------- - [gal_ephemeris_map.xsd](./gal_ephemeris_map.xsd) - - [gal_utc_model.xsd](./gal_utc_model.xsd) - [gal_iono_model.xsd](./gal_iono_model.xsd) + - [gal_utc_model.xsd](./gal_utc_model.xsd) - [gal_almanac_map.xsd](./gal_almanac_map.xsd) From 8cbc14ce9d42a2bb5a687c97fea979d932a92ded Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 25 Oct 2018 22:39:07 +0200 Subject: [PATCH 012/143] Add description of XSD files --- docs/xml-schemas/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/xml-schemas/README.md b/docs/xml-schemas/README.md index 2b3641a0c..cba42485e 100644 --- a/docs/xml-schemas/README.md +++ b/docs/xml-schemas/README.md @@ -8,22 +8,22 @@ GNSS-SDR can read assistance data from [Extensible Markup Language (XML)](https: GPS L1 C/A ---------- - - [ephemeris_map.xsd](./ephemeris_map.xsd) - - [iono_model.xsd](./iono_model.xsd) - - [utc_model.xsd](./utc_model.xsd) - - [gps_almanac_map.xsd](./gps_almanac_map.xsd) + - [ephemeris_map.xsd](./ephemeris_map.xsd) - GPS NAV message ephemeris parameters. + - [iono_model.xsd](./iono_model.xsd) - GPS NAV message ionospheric model parameters. + - [utc_model.xsd](./utc_model.xsd) - GPS NAV message UTC model parameters. + - [gps_almanac_map.xsd](./gps_almanac_map.xsd) - GPS NAV messsage almanac. GPS L2C and L5 -------------- - - [cnav_ephemeris_map.xsd](./cnav_ephemeris_map.xsd) + - [cnav_ephemeris_map.xsd](./cnav_ephemeris_map.xsd) - GPS CNAV message ephemeris parameters. Galileo ------- - - [gal_ephemeris_map.xsd](./gal_ephemeris_map.xsd) - - [gal_iono_model.xsd](./gal_iono_model.xsd) - - [gal_utc_model.xsd](./gal_utc_model.xsd) - - [gal_almanac_map.xsd](./gal_almanac_map.xsd) + - [gal_ephemeris_map.xsd](./gal_ephemeris_map.xsd) - Galileo ephemeris parameters. + - [gal_iono_model.xsd](./gal_iono_model.xsd) - Galileo ionospheric model parameters. + - [gal_utc_model.xsd](./gal_utc_model.xsd) - Galileo UTC model parameters. + - [gal_almanac_map.xsd](./gal_almanac_map.xsd) - Galileo almanac. From f7b324023d2adb2829e82a47c494c5d62abd8f7c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 25 Oct 2018 22:44:01 +0200 Subject: [PATCH 013/143] Fix typo --- docs/xml-schemas/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/xml-schemas/README.md b/docs/xml-schemas/README.md index cba42485e..c79fa1726 100644 --- a/docs/xml-schemas/README.md +++ b/docs/xml-schemas/README.md @@ -1,6 +1,6 @@ # XML Schemas for Assisted GNSS-SDR -GNSS-SDR can read assistance data from [Extensible Markup Language (XML)](https://www.w3.org/XML/) files for faster [Time-To-First-Fix](https://gnss-sdr.org/design-forces/availability/#time-to-first-fix-ttff), and can store navigation data decoded from GNSS signals in the same format. This folder provides XML Schemas which describe those XML files structure. +GNSS-SDR can read assistance data from [Extensible Markup Language (XML)](https://www.w3.org/XML/) files for faster [Time-To-First-Fix](https://gnss-sdr.org/design-forces/availability/#time-to-first-fix-ttff), and can store navigation data decoded from GNSS signals in the same format. This folder provides XML Schemas which describe those XML files' structure. [XSD (XML Schema Definition)](https://www.w3.org/XML/Schema) is a World Wide Web Consortium (W3C) recommendation that specifies how to formally describe the elements in an XML document. @@ -11,7 +11,7 @@ GPS L1 C/A - [ephemeris_map.xsd](./ephemeris_map.xsd) - GPS NAV message ephemeris parameters. - [iono_model.xsd](./iono_model.xsd) - GPS NAV message ionospheric model parameters. - [utc_model.xsd](./utc_model.xsd) - GPS NAV message UTC model parameters. - - [gps_almanac_map.xsd](./gps_almanac_map.xsd) - GPS NAV messsage almanac. + - [gps_almanac_map.xsd](./gps_almanac_map.xsd) - GPS NAV message almanac. GPS L2C and L5 From 5ac848e73503b47607615d9e48dce38a4015d649 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 25 Oct 2018 22:49:48 +0200 Subject: [PATCH 014/143] Fix typo --- docs/xml-schemas/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/xml-schemas/README.md b/docs/xml-schemas/README.md index c79fa1726..059279ea1 100644 --- a/docs/xml-schemas/README.md +++ b/docs/xml-schemas/README.md @@ -1,6 +1,6 @@ # XML Schemas for Assisted GNSS-SDR -GNSS-SDR can read assistance data from [Extensible Markup Language (XML)](https://www.w3.org/XML/) files for faster [Time-To-First-Fix](https://gnss-sdr.org/design-forces/availability/#time-to-first-fix-ttff), and can store navigation data decoded from GNSS signals in the same format. This folder provides XML Schemas which describe those XML files' structure. +GNSS-SDR can read assistance data from [Extensible Markup Language (XML)](https://www.w3.org/XML/) files for faster [Time-To-First-Fix](https://gnss-sdr.org/design-forces/availability/#time-to-first-fix-ttff), and can store navigation data decoded from GNSS signals in the same format. This folder provides XML Schemas which describe those XML files structure. [XSD (XML Schema Definition)](https://www.w3.org/XML/Schema) is a World Wide Web Consortium (W3C) recommendation that specifies how to formally describe the elements in an XML document. From ebc6ffa6b899f73656d502aba3fb325b691d7529 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 26 Oct 2018 09:13:29 +0200 Subject: [PATCH 015/143] Add link to the documentation page --- docs/xml-schemas/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/xml-schemas/README.md b/docs/xml-schemas/README.md index 059279ea1..c74912386 100644 --- a/docs/xml-schemas/README.md +++ b/docs/xml-schemas/README.md @@ -27,3 +27,8 @@ Galileo - [gal_iono_model.xsd](./gal_iono_model.xsd) - Galileo ionospheric model parameters. - [gal_utc_model.xsd](./gal_utc_model.xsd) - Galileo UTC model parameters. - [gal_almanac_map.xsd](./gal_almanac_map.xsd) - Galileo almanac. + +------- + + Please check https//gnss-sdr.org/sp-blocks/global-parameters/ for more information about the usage of XML files in GNSS-SDR. + From 5dbf59ee4f850f37db4fa67eb12ef05afb8a0d38 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 26 Oct 2018 09:34:54 +0200 Subject: [PATCH 016/143] Fix link --- docs/xml-schemas/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/xml-schemas/README.md b/docs/xml-schemas/README.md index c74912386..b04b7e3ab 100644 --- a/docs/xml-schemas/README.md +++ b/docs/xml-schemas/README.md @@ -30,5 +30,5 @@ Galileo ------- - Please check https//gnss-sdr.org/sp-blocks/global-parameters/ for more information about the usage of XML files in GNSS-SDR. +Please check [https//gnss-sdr.org/sp-blocks/global-parameters/](https//gnss-sdr.org/sp-blocks/global-parameters/) for more information about the usage of XML files in GNSS-SDR. From 59efffb4dd1d31425612beb809e62f72d13d661c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 26 Oct 2018 09:36:35 +0200 Subject: [PATCH 017/143] Fix link --- docs/xml-schemas/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/xml-schemas/README.md b/docs/xml-schemas/README.md index b04b7e3ab..9f4bcb0df 100644 --- a/docs/xml-schemas/README.md +++ b/docs/xml-schemas/README.md @@ -30,5 +30,5 @@ Galileo ------- -Please check [https//gnss-sdr.org/sp-blocks/global-parameters/](https//gnss-sdr.org/sp-blocks/global-parameters/) for more information about the usage of XML files in GNSS-SDR. +Please check https://gnss-sdr.org/sp-blocks/global-parameters/ for more information about the usage of XML files in GNSS-SDR. From e56d0cf0183e2698c29708981c8c43756dcfd43e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 26 Oct 2018 09:38:17 +0200 Subject: [PATCH 018/143] Fix link :-) --- docs/xml-schemas/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/xml-schemas/README.md b/docs/xml-schemas/README.md index 9f4bcb0df..e85c643fe 100644 --- a/docs/xml-schemas/README.md +++ b/docs/xml-schemas/README.md @@ -30,5 +30,5 @@ Galileo ------- -Please check https://gnss-sdr.org/sp-blocks/global-parameters/ for more information about the usage of XML files in GNSS-SDR. +Please check https://gnss-sdr.org/docs/sp-blocks/global-parameters/ for more information about the usage of XML files in GNSS-SDR. From c124541814a0a09fc9919d50d7b6bca4c03fa01b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 26 Oct 2018 17:44:20 +0200 Subject: [PATCH 019/143] Update Matio version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a209fcaf..62f3cec71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -351,7 +351,7 @@ set(GNSSSDR_ARMADILLO_LOCAL_VERSION "9.200.x") set(GNSSSDR_GTEST_LOCAL_VERSION "1.8.1") set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master") set(GNSSSDR_GPSTK_LOCAL_VERSION "2.10.6") -set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.12") +set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.13") From b183fe63ba6cf6e9b8c1441c20907171cc5df98c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 28 Oct 2018 00:42:28 +0200 Subject: [PATCH 020/143] Improve PVT block configuration. Allow to store data products in different folders --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 157 +- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 1556 +++++++++-------- .../PVT/gnuradio_blocks/rtklib_pvt_cc.h | 63 +- src/algorithms/PVT/libs/CMakeLists.txt | 2 + src/algorithms/PVT/libs/geojson_printer.cc | 37 +- src/algorithms/PVT/libs/geojson_printer.h | 3 +- src/algorithms/PVT/libs/gpx_printer.cc | 51 +- src/algorithms/PVT/libs/gpx_printer.h | 3 +- src/algorithms/PVT/libs/kml_printer.cc | 48 +- src/algorithms/PVT/libs/kml_printer.h | 3 +- src/algorithms/PVT/libs/nmea_printer.cc | 134 +- src/algorithms/PVT/libs/nmea_printer.h | 6 +- src/algorithms/PVT/libs/pvt_conf.cc | 69 + src/algorithms/PVT/libs/pvt_conf.h | 85 + src/algorithms/PVT/libs/rinex_printer.cc | 47 +- src/algorithms/PVT/libs/rinex_printer.h | 6 +- src/algorithms/PVT/libs/rtcm_printer.cc | 68 +- src/algorithms/PVT/libs/rtcm_printer.h | 6 +- .../pvt/nmea_printer_test.cc | 6 +- .../pvt/rtcm_printer_test.cc | 6 +- 20 files changed, 1415 insertions(+), 941 deletions(-) create mode 100644 src/algorithms/PVT/libs/pvt_conf.cc create mode 100644 src/algorithms/PVT/libs/pvt_conf.h diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 3e63a19a6..65152bf8d 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -30,6 +30,7 @@ #include "rtklib_pvt.h" +#include "pvt_conf.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" #include @@ -54,84 +55,85 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, in_streams_(in_streams), out_streams_(out_streams) { + Pvt_Conf pvt_output_parameters = Pvt_Conf(); // dump parameters std::string default_dump_filename = "./pvt.dat"; std::string default_nmea_dump_filename = "./nmea_pvt.nmea"; std::string default_nmea_dump_devname = "/dev/tty1"; std::string default_rtcm_dump_devname = "/dev/pts/1"; DLOG(INFO) << "role " << role; - dump_ = configuration->property(role + ".dump", false); - dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); + pvt_output_parameters.dump = configuration->property(role + ".dump", false); + pvt_output_parameters.dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); // output rate - int output_rate_ms = configuration->property(role + ".output_rate_ms", 500); + pvt_output_parameters.output_rate_ms = configuration->property(role + ".output_rate_ms", 500); // display rate - int display_rate_ms = configuration->property(role + ".display_rate_ms", 500); + pvt_output_parameters.display_rate_ms = configuration->property(role + ".display_rate_ms", 500); // NMEA Printer settings - bool flag_nmea_tty_port = configuration->property(role + ".flag_nmea_tty_port", false); - std::string nmea_dump_filename = configuration->property(role + ".nmea_dump_filename", default_nmea_dump_filename); + pvt_output_parameters.flag_nmea_tty_port = configuration->property(role + ".flag_nmea_tty_port", false); + pvt_output_parameters.nmea_dump_filename = configuration->property(role + ".nmea_dump_filename", default_nmea_dump_filename); std::string nmea_dump_devname = configuration->property(role + ".nmea_dump_devname", default_nmea_dump_devname); // RINEX version - int rinex_version = configuration->property(role + ".rinex_version", 3); + pvt_output_parameters.rinex_version = configuration->property(role + ".rinex_version", 3); if (FLAGS_RINEX_version.compare("3.01") == 0) { - rinex_version = 3; + pvt_output_parameters.rinex_version = 3; } else if (FLAGS_RINEX_version.compare("3.02") == 0) { - rinex_version = 3; + pvt_output_parameters.rinex_version = 3; } else if (FLAGS_RINEX_version.compare("3") == 0) { - rinex_version = 3; + pvt_output_parameters.rinex_version = 3; } else if (FLAGS_RINEX_version.compare("2.11") == 0) { - rinex_version = 2; + pvt_output_parameters.rinex_version = 2; } else if (FLAGS_RINEX_version.compare("2.10") == 0) { - rinex_version = 2; + pvt_output_parameters.rinex_version = 2; } else if (FLAGS_RINEX_version.compare("2") == 0) { - rinex_version = 2; + pvt_output_parameters.rinex_version = 2; } - int rinexobs_rate_ms = bc::lcm(configuration->property(role + ".rinexobs_rate_ms", 1000), output_rate_ms); - int rinexnav_rate_ms = bc::lcm(configuration->property(role + ".rinexnav_rate_ms", 6000), output_rate_ms); + pvt_output_parameters.rinexobs_rate_ms = bc::lcm(configuration->property(role + ".rinexobs_rate_ms", 1000), pvt_output_parameters.output_rate_ms); + pvt_output_parameters.rinexnav_rate_ms = bc::lcm(configuration->property(role + ".rinexnav_rate_ms", 6000), pvt_output_parameters.output_rate_ms); // RTCM Printer settings - bool flag_rtcm_tty_port = configuration->property(role + ".flag_rtcm_tty_port", false); - std::string rtcm_dump_devname = configuration->property(role + ".rtcm_dump_devname", default_rtcm_dump_devname); - bool flag_rtcm_server = configuration->property(role + ".flag_rtcm_server", false); - unsigned short rtcm_tcp_port = configuration->property(role + ".rtcm_tcp_port", 2101); - unsigned short rtcm_station_id = configuration->property(role + ".rtcm_station_id", 1234); + pvt_output_parameters.flag_rtcm_tty_port = configuration->property(role + ".flag_rtcm_tty_port", false); + pvt_output_parameters.rtcm_dump_devname = configuration->property(role + ".rtcm_dump_devname", default_rtcm_dump_devname); + pvt_output_parameters.flag_rtcm_server = configuration->property(role + ".flag_rtcm_server", false); + pvt_output_parameters.rtcm_tcp_port = configuration->property(role + ".rtcm_tcp_port", 2101); + pvt_output_parameters.rtcm_station_id = configuration->property(role + ".rtcm_station_id", 1234); // RTCM message rates: least common multiple with output_rate_ms - int rtcm_MT1019_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1019_rate_ms", 5000), output_rate_ms); - int rtcm_MT1020_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1020_rate_ms", 5000), output_rate_ms); - int rtcm_MT1045_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1045_rate_ms", 5000), output_rate_ms); - int rtcm_MSM_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MSM_rate_ms", 1000), output_rate_ms); - int rtcm_MT1077_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1077_rate_ms", rtcm_MSM_rate_ms), output_rate_ms); - int rtcm_MT1087_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1087_rate_ms", rtcm_MSM_rate_ms), output_rate_ms); - int rtcm_MT1097_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1097_rate_ms", rtcm_MSM_rate_ms), output_rate_ms); - std::map rtcm_msg_rate_ms; - rtcm_msg_rate_ms[1019] = rtcm_MT1019_rate_ms; - rtcm_msg_rate_ms[1020] = rtcm_MT1020_rate_ms; - rtcm_msg_rate_ms[1045] = rtcm_MT1045_rate_ms; + int rtcm_MT1019_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1019_rate_ms", 5000), pvt_output_parameters.output_rate_ms); + int rtcm_MT1020_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1020_rate_ms", 5000), pvt_output_parameters.output_rate_ms); + int rtcm_MT1045_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1045_rate_ms", 5000), pvt_output_parameters.output_rate_ms); + int rtcm_MSM_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MSM_rate_ms", 1000), pvt_output_parameters.output_rate_ms); + int rtcm_MT1077_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1077_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms); + int rtcm_MT1087_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1087_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms); + int rtcm_MT1097_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1097_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms); + //std::map rtcm_msg_rate_ms; + pvt_output_parameters.rtcm_msg_rate_ms[1019] = rtcm_MT1019_rate_ms; + pvt_output_parameters.rtcm_msg_rate_ms[1020] = rtcm_MT1020_rate_ms; + pvt_output_parameters.rtcm_msg_rate_ms[1045] = rtcm_MT1045_rate_ms; for (int k = 1071; k < 1078; k++) // All GPS MSM { - rtcm_msg_rate_ms[k] = rtcm_MT1077_rate_ms; + pvt_output_parameters.rtcm_msg_rate_ms[k] = rtcm_MT1077_rate_ms; } for (int k = 1081; k < 1088; k++) // All GLONASS MSM { - rtcm_msg_rate_ms[k] = rtcm_MT1087_rate_ms; + pvt_output_parameters.rtcm_msg_rate_ms[k] = rtcm_MT1087_rate_ms; } for (int k = 1091; k < 1098; k++) // All Galileo MSM { - rtcm_msg_rate_ms[k] = rtcm_MT1097_rate_ms; + pvt_output_parameters.rtcm_msg_rate_ms[k] = rtcm_MT1097_rate_ms; } // Infer the type of receiver @@ -176,42 +178,42 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, int glo_1G_count = configuration->property("Channels_1G.count", 0); int glo_2G_count = configuration->property("Channels_2G.count", 0); - unsigned int type_of_receiver = 0; + //unsigned int type_of_receiver = 0; // *******************WARNING!!!!!!!*********** // GPS L5 only configurable for single frequency, single system at the moment!!!!!! - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 1; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 2; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 3; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 4; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 5; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 6; + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 1; + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 2; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 3; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 4; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 5; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 6; - if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 7; - //if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 8; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 9; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 10; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 11; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 12; - //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 13; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 14; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 15; - //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 16; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 17; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 18; - //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 19; - //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 20; - if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 21; - //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count = 0)) type_of_receiver = 22; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 23; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 24; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0)) type_of_receiver = 25; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) type_of_receiver = 26; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) type_of_receiver = 27; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) type_of_receiver = 28; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 29; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 30; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 31; + if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 7; + //if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 8; + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 9; + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 10; + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 11; + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 12; + //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 13; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 14; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 15; + //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 16; + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 17; + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 18; + //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 19; + //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 20; + if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 21; + //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count = 0)) pvt_output_parameters.type_of_receiver = 22; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) pvt_output_parameters.type_of_receiver = 23; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 24; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 25; + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 26; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 27; + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 28; + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 29; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 30; + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 31; //RTKLIB PVT solver options // Settings 1 int positioning_mode = -1; @@ -477,8 +479,29 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, rtkinit(&rtk, &rtklib_configuration_options); + // Outputs + bool default_output_enabled = configuration->property(role + ".output_enabled", true); + pvt_output_parameters.output_enabled = default_output_enabled; + pvt_output_parameters.rinex_output_enabled = configuration->property(role + ".rinex_output_enabled", default_output_enabled); + pvt_output_parameters.gpx_output_enabled = configuration->property(role + ".gpx_output_enabled", default_output_enabled); + pvt_output_parameters.geojson_output_enabled = configuration->property(role + ".geojson_output_enabled", default_output_enabled); + pvt_output_parameters.kml_output_enabled = configuration->property(role + ".kml_output_enabled", default_output_enabled); + pvt_output_parameters.xml_output_enabled = configuration->property(role + ".xml_output_enabled", default_output_enabled); + pvt_output_parameters.nmea_output_file_enabled = configuration->property(role + ".nmea_output_file_enabled", default_output_enabled); + pvt_output_parameters.rtcm_output_file_enabled = configuration->property(role + ".rtcm_output_file_enabled", default_output_enabled); + + std::string default_output_path = configuration->property(role + ".output_path", std::string(".")); + pvt_output_parameters.output_path = default_output_path; + pvt_output_parameters.rinex_output_path = configuration->property(role + ".rinex_output_path", default_output_path); + pvt_output_parameters.gpx_output_path = configuration->property(role + ".gpx_output_path", default_output_path); + pvt_output_parameters.geojson_output_path = configuration->property(role + ".geojson_output_path", default_output_path); + pvt_output_parameters.kml_output_path = configuration->property(role + ".kml_output_path", default_output_path); + pvt_output_parameters.xml_output_path = configuration->property(role + ".xml_output_path", default_output_path); + pvt_output_parameters.nmea_output_file_path = configuration->property(role + ".nmea_output_file_path", default_output_path); + pvt_output_parameters.rtcm_output_file_path = configuration->property(role + ".rtcm_output_file_path", default_output_path); + // make PVT object - pvt_ = rtklib_make_pvt_cc(in_streams_, dump_, dump_filename_, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname, rinex_version, rinexobs_rate_ms, rinexnav_rate_ms, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_msg_rate_ms, rtcm_dump_devname, type_of_receiver, rtk); + pvt_ = rtklib_make_pvt_cc(in_streams_, pvt_output_parameters, rtk); DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")"; if (out_streams_ > 0) { diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index d3d752a07..8bb5df354 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -31,6 +31,7 @@ #include "rtklib_pvt_cc.h" #include "galileo_almanac.h" #include "galileo_almanac_helper.h" +#include "pvt_conf.h" #include "display.h" #include #include @@ -56,43 +57,11 @@ using google::LogMessage; rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, - bool dump, - std::string dump_filename, - int32_t output_rate_ms, - int32_t display_rate_ms, - bool flag_nmea_tty_port, - std::string nmea_dump_filename, - std::string nmea_dump_devname, - int32_t rinex_version, - int32_t rinexobs_rate_ms, - int32_t rinexnav_rate_ms, - bool flag_rtcm_server, - bool flag_rtcm_tty_port, - uint16_t rtcm_tcp_port, - uint16_t rtcm_station_id, - std::map rtcm_msg_rate_ms, - std::string rtcm_dump_devname, - const uint32_t type_of_receiver, + const Pvt_Conf& conf_, rtk_t& rtk) { return rtklib_pvt_cc_sptr(new rtklib_pvt_cc(nchannels, - dump, - dump_filename, - output_rate_ms, - display_rate_ms, - flag_nmea_tty_port, - nmea_dump_filename, - nmea_dump_devname, - rinex_version, - rinexobs_rate_ms, - rinexnav_rate_ms, - flag_rtcm_server, - flag_rtcm_tty_port, - rtcm_tcp_port, - rtcm_station_id, - rtcm_msg_rate_ms, - rtcm_dump_devname, - type_of_receiver, + conf_, rtk)); } @@ -270,34 +239,18 @@ std::map rtklib_pvt_cc::get_GPS_L1_ephemeris_map() rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, - bool dump, - std::string dump_filename, - int32_t output_rate_ms, - int32_t display_rate_ms, - bool flag_nmea_tty_port, - std::string nmea_dump_filename, - std::string nmea_dump_devname, - int32_t rinex_version, - int32_t rinexobs_rate_ms, - int32_t rinexnav_rate_ms, - bool flag_rtcm_server, - bool flag_rtcm_tty_port, - uint16_t rtcm_tcp_port, - uint16_t rtcm_station_id, - std::map rtcm_msg_rate_ms, - std::string rtcm_dump_devname, - const uint32_t type_of_receiver, + const Pvt_Conf& conf_, rtk_t& rtk) : gr::sync_block("rtklib_pvt_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), gr::io_signature::make(0, 0, 0)) { - d_output_rate_ms = output_rate_ms; - d_display_rate_ms = display_rate_ms; - d_dump = dump; + d_output_rate_ms = conf_.output_rate_ms; + d_display_rate_ms = conf_.display_rate_ms; + d_dump = conf_.dump; d_nchannels = nchannels; - d_dump_filename = dump_filename; - std::string dump_ls_pvt_filename = dump_filename; - type_of_rx = type_of_receiver; + d_dump_filename = conf_.dump_filename; + std::string dump_ls_pvt_filename = conf_.dump_filename; + type_of_rx = conf_.type_of_receiver; // GPS Ephemeris data message port in this->message_port_register_in(pmt::mp("telemetry")); @@ -306,28 +259,54 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, // initialize kml_printer std::string kml_dump_filename; kml_dump_filename = d_dump_filename; - d_kml_dump = std::make_shared(); - d_kml_dump->set_headers(kml_dump_filename); + d_kml_output_enabled = conf_.kml_output_enabled; + if (d_kml_output_enabled) + { + d_kml_dump = std::make_shared(conf_.kml_output_path); + d_kml_dump->set_headers(kml_dump_filename); + } + else + { + d_kml_dump = nullptr; + } // initialize gpx_printer std::string gpx_dump_filename; gpx_dump_filename = d_dump_filename; - d_gpx_dump = std::make_shared(); - d_gpx_dump->set_headers(gpx_dump_filename); + d_gpx_output_enabled = conf_.gpx_output_enabled; + if (d_gpx_output_enabled) + { + d_gpx_dump = std::make_shared(conf_.gpx_output_path); + d_gpx_dump->set_headers(gpx_dump_filename); + } + else + { + d_gpx_dump = nullptr; + } // initialize geojson_printer std::string geojson_dump_filename; geojson_dump_filename = d_dump_filename; - d_geojson_printer = std::make_shared(); - d_geojson_printer->set_headers(geojson_dump_filename); + + d_geojson_output_enabled = conf_.geojson_output_enabled; + if (d_geojson_output_enabled) + { + d_geojson_printer = std::make_shared(conf_.geojson_output_path); + d_geojson_printer->set_headers(geojson_dump_filename); + } + else + { + d_geojson_printer = nullptr; + } // initialize nmea_printer - d_nmea_printer = std::make_shared(nmea_dump_filename, flag_nmea_tty_port, nmea_dump_devname); + d_nmea_printer = std::make_shared(conf_.nmea_dump_filename, conf_.nmea_output_file_enabled, conf_.flag_nmea_tty_port, conf_.nmea_dump_devname, conf_.nmea_output_file_path); // initialize rtcm_printer std::string rtcm_dump_filename; rtcm_dump_filename = d_dump_filename; - d_rtcm_printer = std::make_shared(rtcm_dump_filename, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_dump_devname); + d_rtcm_printer = std::make_shared(rtcm_dump_filename, conf_.rtcm_output_file_enabled, conf_.flag_rtcm_server, conf_.flag_rtcm_tty_port, conf_.rtcm_tcp_port, conf_.rtcm_station_id, conf_.rtcm_dump_devname, true, conf_.rtcm_output_file_path); + std::map rtcm_msg_rate_ms = conf_.rtcm_msg_rate_ms; if (rtcm_msg_rate_ms.find(1019) != rtcm_msg_rate_ms.end()) { d_rtcm_MT1019_rate_ms = rtcm_msg_rate_ms[1019]; @@ -383,10 +362,55 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, // initialize RINEX printer b_rinex_header_written = false; b_rinex_header_updated = false; - d_rinex_version = rinex_version; - rp = std::make_shared(d_rinex_version); - d_rinexobs_rate_ms = rinexobs_rate_ms; - d_rinexnav_rate_ms = rinexnav_rate_ms; + b_rinex_output_enabled = conf_.rinex_output_enabled; + d_rinex_version = conf_.rinex_version; + if (b_rinex_output_enabled) + { + rp = std::make_shared(d_rinex_version, conf_.rinex_output_path); + } + else + { + rp = nullptr; + } + d_rinexobs_rate_ms = conf_.rinexobs_rate_ms; + d_rinexnav_rate_ms = conf_.rinexnav_rate_ms; + + // XML printer + d_xml_storage = conf_.xml_output_enabled; + if (d_xml_storage) + { + xml_base_path = conf_.xml_output_path; + boost::filesystem::path full_path(boost::filesystem::current_path()); + const boost::filesystem::path p(xml_base_path); + if (!boost::filesystem::exists(p)) + { + std::string new_folder; + for (auto& folder : boost::filesystem::path(xml_base_path)) + { + new_folder += folder.string(); + boost::system::error_code ec; + if (!boost::filesystem::exists(new_folder)) + { + if (!boost::filesystem::create_directory(new_folder, ec)) + { + std::cout << "Could not create the " << new_folder << " folder." << std::endl; + xml_base_path = full_path.string(); + } + } + new_folder += boost::filesystem::path::preferred_separator; + } + } + else + { + xml_base_path = p.string(); + } + if (xml_base_path.compare(".") != 0) + { + std::cout << "XML files will be stored at " << xml_base_path << std::endl; + } + + xml_base_path = xml_base_path + boost::filesystem::path::preferred_separator; + } dump_ls_pvt_filename.append("_pvt.dat"); @@ -397,7 +421,6 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, d_last_status_print_seg = 0; - // Create Sys V message queue first_fix = true; sysv_msg_key = 1101; @@ -414,247 +437,316 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, rtklib_pvt_cc::~rtklib_pvt_cc() { msgctl(sysv_msqid, IPC_RMID, NULL); + if (d_xml_storage) + { + // save GPS L2CM ephemeris to XML file + std::string file_name = xml_base_path + "gps_cnav_ephemeris.xml"; + if (d_ls_pvt->gps_cnav_ephemeris_map.empty() == false) + { + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_cnav_ephemeris_map", d_ls_pvt->gps_cnav_ephemeris_map); + LOG(INFO) << "Saved GPS L2CM or L5 Ephemeris map data"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + } + } + else + { + LOG(INFO) << "Failed to save GPS L2CM or L5 Ephemeris, map is empty"; + } - // save GPS L2CM ephemeris to XML file - std::string file_name = "gps_cnav_ephemeris.xml"; - if (d_ls_pvt->gps_cnav_ephemeris_map.empty() == false) - { - std::ofstream ofs; - try + // save GPS L1 CA ephemeris to XML file + file_name = xml_base_path + "gps_ephemeris.xml"; + if (d_ls_pvt->gps_ephemeris_map.empty() == false) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_cnav_ephemeris_map", d_ls_pvt->gps_cnav_ephemeris_map); - LOG(INFO) << "Saved GPS L2CM or L5 Ephemeris map data"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_ls_pvt->gps_ephemeris_map); + LOG(INFO) << "Saved GPS L1 CA Ephemeris map data"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GPS L1 CA Ephemeris, map is empty"; } - } - else - { - LOG(INFO) << "Failed to save GPS L2CM or L5 Ephemeris, map is empty"; - } - // save GPS L1 CA ephemeris to XML file - file_name = "gps_ephemeris.xml"; - if (d_ls_pvt->gps_ephemeris_map.empty() == false) - { - std::ofstream ofs; - try + // save Galileo E1 ephemeris to XML file + file_name = xml_base_path + "gal_ephemeris.xml"; + if (d_ls_pvt->galileo_ephemeris_map.empty() == false) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_ls_pvt->gps_ephemeris_map); - LOG(INFO) << "Saved GPS L1 CA Ephemeris map data"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_ephemeris_map", d_ls_pvt->galileo_ephemeris_map); + LOG(INFO) << "Saved Galileo E1 Ephemeris map data"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (const std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save Galileo E1 Ephemeris, map is empty"; } - } - else - { - LOG(INFO) << "Failed to save GPS L1 CA Ephemeris, map is empty"; - } - // save Galileo E1 ephemeris to XML file - file_name = "gal_ephemeris.xml"; - if (d_ls_pvt->galileo_ephemeris_map.empty() == false) - { - std::ofstream ofs; - try + // save GLONASS GNAV ephemeris to XML file + file_name = xml_base_path + "eph_GLONASS_GNAV.xml"; + if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gal_ephemeris_map", d_ls_pvt->galileo_ephemeris_map); - LOG(INFO) << "Saved Galileo E1 Ephemeris map data"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_ls_pvt->glonass_gnav_ephemeris_map); + LOG(INFO) << "Saved GLONASS GNAV Ephemeris map data"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (const std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GLONASS GNAV Ephemeris, map is empty"; } - } - else - { - LOG(INFO) << "Failed to save Galileo E1 Ephemeris, map is empty"; - } - // save GLONASS GNAV ephemeris to XML file - file_name = "eph_GLONASS_GNAV.xml"; - if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false) - { - std::ofstream ofs; - try + // Save GPS UTC model parameters + file_name = xml_base_path + "gps_utc_model.xml"; + if (d_ls_pvt->gps_utc_model.valid) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_ls_pvt->glonass_gnav_ephemeris_map); - LOG(INFO) << "Saved GLONASS GNAV Ephemeris map data"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_utc_model", d_ls_pvt->gps_utc_model); + LOG(INFO) << "Saved GPS UTC model parameters"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GPS UTC model parameters, not valid data"; } - } - else - { - LOG(INFO) << "Failed to save GLONASS GNAV Ephemeris, map is empty"; - } - // Save GPS UTC model parameters - file_name = "gps_utc_model.xml"; - if (d_ls_pvt->gps_utc_model.valid) - { - std::ofstream ofs; - try + // Save Galileo UTC model parameters + file_name = xml_base_path + "gal_utc_model.xml"; + if (d_ls_pvt->galileo_utc_model.Delta_tLS_6 != 0.0) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_utc_model", d_ls_pvt->gps_utc_model); - LOG(INFO) << "Saved GPS UTC model parameters"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_utc_model", d_ls_pvt->galileo_utc_model); + LOG(INFO) << "Saved Galileo UTC model parameters"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save Galileo UTC model parameters, not valid data"; } - } - else - { - LOG(INFO) << "Failed to save GPS UTC model parameters, not valid data"; - } - // Save Galileo UTC model parameters - file_name = "gal_utc_model.xml"; - if (d_ls_pvt->galileo_utc_model.Delta_tLS_6 != 0.0) - { - std::ofstream ofs; - try + // Save GPS iono parameters + file_name = xml_base_path + "gps_iono.xml"; + if (d_ls_pvt->gps_iono.valid == true) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gal_utc_model", d_ls_pvt->galileo_utc_model); - LOG(INFO) << "Saved Galileo UTC model parameters"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_iono_model", d_ls_pvt->gps_iono); + LOG(INFO) << "Saved GPS ionospheric model parameters"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GPS ionospheric model parameters, not valid data"; } - } - else - { - LOG(INFO) << "Failed to save Galileo UTC model parameters, not valid data"; - } - // save GPS almanac to XML file - file_name = "gps_almanac.xml"; - if (d_ls_pvt->gps_almanac_map.empty() == false) - { - std::ofstream ofs; - try + // Save GPS CNAV iono parameters + file_name = xml_base_path + "gps_iono.xml"; + if (d_ls_pvt->gps_iono.valid == true) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gps_almanac_map", d_ls_pvt->gps_almanac_map); - LOG(INFO) << "Saved GPS almanac map data"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_iono_model", d_ls_pvt->gps_iono); + LOG(INFO) << "Saved GPS ionospheric model parameters"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (const std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GPS ionospheric model parameters, not valid data"; } - } - else - { - LOG(INFO) << "Failed to save GPS almanac, map is empty"; - } - // Save Galileo almanac - file_name = "gal_almanac.xml"; - if (d_ls_pvt->galileo_almanac_map.empty() == false) - { - std::ofstream ofs; - try - { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gal_almanac_map", d_ls_pvt->galileo_almanac_map); - LOG(INFO) << "Saved Galileo almanac data"; - } - catch (std::exception& e) - { - LOG(WARNING) << e.what(); - } - } - else - { - LOG(INFO) << "Failed to save Galileo almanac, not valid data"; - } - // Save GPS CNAV UTC model parameters - file_name = "gps_cnav_utc_model.xml"; - if (d_ls_pvt->gps_cnav_utc_model.valid) - { - std::ofstream ofs; - try + // Save Galileo iono parameters + file_name = xml_base_path + "gal_iono.xml"; + if (d_ls_pvt->galileo_iono.ai0_5 != 0.0) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_cnav_utc_model", d_ls_pvt->gps_cnav_utc_model); - LOG(INFO) << "Saved GPS CNAV UTC model parameters"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_iono_model", d_ls_pvt->galileo_iono); + LOG(INFO) << "Saved Galileo ionospheric model parameters"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save Galileo ionospheric model parameters, not valid data"; } - } - else - { - LOG(INFO) << "Failed to save GPS CNAV UTC model parameters, not valid data"; - } - // save GLONASS GNAV ephemeris to XML file - file_name = "glo_gnav_ephemeris.xml"; - if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false) - { - std::ofstream ofs; - try + // save GPS almanac to XML file + file_name = xml_base_path + "gps_almanac.xml"; + if (d_ls_pvt->gps_almanac_map.empty() == false) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_ls_pvt->glonass_gnav_ephemeris_map); - LOG(INFO) << "Saved GLONASS GNAV ephemeris map data"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gps_almanac_map", d_ls_pvt->gps_almanac_map); + LOG(INFO) << "Saved GPS almanac map data"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GPS almanac, map is empty"; } - } - else - { - LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, map is empty"; - } - // save GLONASS UTC model parameters to XML file - file_name = "glo_utc_model.xml"; - if (d_ls_pvt->glonass_gnav_utc_model.valid) - { - std::ofstream ofs; - try + // Save Galileo almanac + file_name = xml_base_path + "gal_almanac.xml"; + if (d_ls_pvt->galileo_almanac_map.empty() == false) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gnav_utc_model", d_ls_pvt->glonass_gnav_utc_model); - LOG(INFO) << "Saved GLONASS UTC model parameters"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_almanac_map", d_ls_pvt->galileo_almanac_map); + LOG(INFO) << "Saved Galileo almanac data"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save Galileo almanac, not valid data"; + } + + // Save GPS CNAV UTC model parameters + file_name = xml_base_path + "gps_cnav_utc_model.xml"; + if (d_ls_pvt->gps_cnav_utc_model.valid) + { + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_cnav_utc_model", d_ls_pvt->gps_cnav_utc_model); + LOG(INFO) << "Saved GPS CNAV UTC model parameters"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + } + } + else + { + LOG(INFO) << "Failed to save GPS CNAV UTC model parameters, not valid data"; + } + + // save GLONASS GNAV ephemeris to XML file + file_name = xml_base_path + "glo_gnav_ephemeris.xml"; + if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false) + { + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_ls_pvt->glonass_gnav_ephemeris_map); + LOG(INFO) << "Saved GLONASS GNAV ephemeris map data"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + } + } + else + { + LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, map is empty"; + } + + // save GLONASS UTC model parameters to XML file + file_name = xml_base_path + "glo_utc_model.xml"; + if (d_ls_pvt->glonass_gnav_utc_model.valid) + { + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gnav_utc_model", d_ls_pvt->glonass_gnav_utc_model); + LOG(INFO) << "Saved GLONASS UTC model parameters"; + } + catch (std::exception& e) + { + LOG(WARNING) << e.what(); + } + } + else + { + LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, not valid data"; } - } - else - { - LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, not valid data"; } } @@ -897,9 +989,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item send_sys_v_ttff_msg(ttff); first_fix = false; } - d_kml_dump->print_position(d_ls_pvt, false); - d_gpx_dump->print_position(d_ls_pvt, false); - d_geojson_printer->print_position(d_ls_pvt, false); + if (d_kml_output_enabled) d_kml_dump->print_position(d_ls_pvt, false); + if (d_gpx_output_enabled) d_gpx_dump->print_position(d_ls_pvt, false); + if (d_geojson_output_enabled) d_geojson_printer->print_position(d_ls_pvt, false); d_nmea_printer->Print_Nmea_Line(d_ls_pvt, false); /* @@ -937,575 +1029,577 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item * 30 | Galileo E1B + GLONASS L2 C/A * 31 | GPS L2C + GLONASS L2 C/A */ - - // ####################### RINEX FILES ################# - std::map::const_iterator galileo_ephemeris_iter; std::map::const_iterator gps_ephemeris_iter; std::map::const_iterator gps_cnav_ephemeris_iter; std::map::const_iterator glonass_gnav_ephemeris_iter; std::map::const_iterator gnss_observables_iter; - if (!b_rinex_header_written) // & we have utc data in nav message! + // ####################### RINEX FILES ################# + if (b_rinex_output_enabled) { - galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + if (!b_rinex_header_written) // & we have utc data in nav message! + { + galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); + glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); - if (type_of_rx == 1) // GPS L1 C/A only - { - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) - { - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time); - rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 2) // GPS L2C only - { - if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) - { - rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time); - rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 3) // GPS L5 only - { - if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) - { - rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time); - rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 4) // Galileo E1B only - { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) - { - rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 5) // Galileo E5a only - { - std::string signal("5X"); - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) - { - rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 6) // Galileo E5b only - { - std::string signal("7X"); - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) - { - rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 7) // GPS L1 C/A + GPS L2C - { - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) - { - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time); - rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); - b_rinex_header_written = true; // do not write header anymore - } - } - - if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B - { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) - { - std::string gal_signal("1B"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 10) // GPS L1 C/A + Galileo E5a - { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) - { - std::string gal_signal("5X"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 11) // GPS L1 C/A + Galileo E5b - { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) - { - std::string gal_signal("7X"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 14) // Galileo E1B + Galileo E5a - { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) - { - std::string gal_signal("1B 5X"); - rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 15) // Galileo E1B + Galileo E5b - { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) - { - std::string gal_signal("1B 7X"); - rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 23) // GLONASS L1 C/A only - { - std::string signal("1G"); - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) - { - rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 24) // GLONASS L2 C/A only - { - std::string signal("2G"); - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) - { - rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 25) // GLONASS L1 C/A + GLONASS L2 C/A - { - std::string signal("1G 2G"); - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) - { - rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - b_rinex_header_written = true; // do not write header anymore - } - } - - if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A - { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) - { - std::string glo_signal("1G"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); - if (d_rinex_version == 3) - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - if (d_rinex_version == 2) - { - rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); - rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - } - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A - { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) - { - std::string glo_signal("1G"); - std::string gal_signal("1B"); - rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A - { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) - { - std::string glo_signal("1G"); - rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A - { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) - { - std::string glo_signal("2G"); - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); - if (d_rinex_version == 3) - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - if (d_rinex_version == 2) - { - rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); - rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - } - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A - { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) - { - std::string glo_signal("2G"); - std::string gal_signal("1B"); - rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - b_rinex_header_written = true; // do not write header anymore - } - } - if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A - { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) - { - std::string glo_signal("2G"); - rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - b_rinex_header_written = true; // do not write header anymore - } - } - } - if (b_rinex_header_written) // The header is already written, we can now log the navigation message data - { - if (flag_write_RINEX_nav_output) - { if (type_of_rx == 1) // GPS L1 C/A only { - rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); + if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) + { + rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time); + rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); + b_rinex_header_written = true; // do not write header anymore + } } if (type_of_rx == 2) // GPS L2C only { - rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); + if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) + { + rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time); + rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model); + b_rinex_header_written = true; // do not write header anymore + } } if (type_of_rx == 3) // GPS L5 only { - rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); - } - if ((type_of_rx == 4) or (type_of_rx == 5) or (type_of_rx == 6)) // Galileo - { - rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map); - } - if (type_of_rx == 7) // GPS L1 C/A + GPS L2C - { - rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); - } - if ((type_of_rx == 9) or (type_of_rx == 10) or (type_of_rx == 11)) // GPS L1 C/A + Galileo - { - rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->galileo_ephemeris_map); - } - if ((type_of_rx == 14) or (type_of_rx == 15)) // Galileo E1B + Galileo E5a - { - rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map); - } - if ((type_of_rx == 23) or (type_of_rx == 24) or (type_of_rx == 25)) // GLONASS L1 C/A, GLONASS L2 C/A - { - rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); - } - if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A - { - if (d_rinex_version == 3) - rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); - if (d_rinex_version == 2) + if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { - rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); - rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); - } - } - if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A - { - rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); - } - if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A - { - rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); - } - if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A - { - if (d_rinex_version == 3) - rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); - if (d_rinex_version == 2) - { - rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); - rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); - } - } - if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A - { - rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); - } - if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A - { - rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); - } - } - galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); - - // Log observables into the RINEX file - if (flag_write_RINEX_obs_output) - { - if (type_of_rx == 1) // GPS L1 C/A only - { - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) - { - rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, d_rx_time, gnss_observables_map); - } - if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0)) - { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono); - b_rinex_header_updated = true; - } - } - if (type_of_rx == 2) // GPS L2C only - { - if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) - { - rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - } - if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)) - { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); - rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono); - b_rinex_header_updated = true; - } - } - if (type_of_rx == 3) // GPS L5 - { - if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) - { - rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - } - if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)) - { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); - rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono); - b_rinex_header_updated = true; + rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time); + rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model); + b_rinex_header_written = true; // do not write header anymore } } if (type_of_rx == 4) // Galileo E1B only { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B"); - } - if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) - { - rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); - b_rinex_header_updated = true; + rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time); + rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + b_rinex_header_written = true; // do not write header anymore } } if (type_of_rx == 5) // Galileo E5a only { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + std::string signal("5X"); + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "5X"); - } - if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) - { - rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); - b_rinex_header_updated = true; + rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); + rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + b_rinex_header_written = true; // do not write header anymore } } if (type_of_rx == 6) // Galileo E5b only { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + std::string signal("7X"); + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "7X"); - } - if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) - { - rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); - b_rinex_header_updated = true; + rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); + rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + b_rinex_header_written = true; // do not write header anymore } } if (type_of_rx == 7) // GPS L1 C/A + GPS L2C { - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - } - if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0)) - { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono); - b_rinex_header_updated = true; + rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time); + rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); + b_rinex_header_written = true; // do not write header anymore } } + if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())) + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); - } - if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0)) - { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - b_rinex_header_updated = true; + std::string gal_signal("1B"); + rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + b_rinex_header_written = true; // do not write header anymore } } - if (type_of_rx == 14) // Galileo E1B + Galileo E5a + if (type_of_rx == 10) // GPS L1 C/A + Galileo E5a { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 5X"); - } - if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) - { - rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); - b_rinex_header_updated = true; + std::string gal_signal("5X"); + rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + b_rinex_header_written = true; // do not write header anymore } } - if (type_of_rx == 15) // Galileo E1B + Galileo E5b + if (type_of_rx == 11) // GPS L1 C/A + Galileo E5b { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 7X"); + std::string gal_signal("7X"); + rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + b_rinex_header_written = true; // do not write header anymore } - if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + } + if (type_of_rx == 14) // Galileo E1B + Galileo E5a + { + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { - rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); - b_rinex_header_updated = true; + std::string gal_signal("1B 5X"); + rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); + rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + b_rinex_header_written = true; // do not write header anymore + } + } + if (type_of_rx == 15) // Galileo E1B + Galileo E5b + { + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) + { + std::string gal_signal("1B 7X"); + rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); + rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + b_rinex_header_written = true; // do not write header anymore } } if (type_of_rx == 23) // GLONASS L1 C/A only { - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + std::string signal("1G"); + if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C"); - } - if (!b_rinex_header_updated and (d_ls_pvt->glonass_gnav_utc_model.d_tau_c != 0)) - { - rp->update_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model); - b_rinex_header_updated = true; + rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); + rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + b_rinex_header_written = true; // do not write header anymore } } if (type_of_rx == 24) // GLONASS L2 C/A only { - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + std::string signal("2G"); + if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "2C"); - } - if (!b_rinex_header_updated and (d_ls_pvt->glonass_gnav_utc_model.d_tau_c != 0)) - { - rp->update_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model); - b_rinex_header_updated = true; + rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); + rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + b_rinex_header_written = true; // do not write header anymore } } if (type_of_rx == 25) // GLONASS L1 C/A + GLONASS L2 C/A { - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + std::string signal("1G 2G"); + if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { - rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C 2C"); - } - if (!b_rinex_header_updated and (d_ls_pvt->glonass_gnav_utc_model.d_tau_c != 0)) - { - rp->update_nav_header(rp->navMixFile, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model); - b_rinex_header_updated = true; + rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); + rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + b_rinex_header_written = true; // do not write header anymore } } + if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - } - if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0)) - { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - b_rinex_header_updated = true; // do not write header anymore + std::string glo_signal("1G"); + rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); + if (d_rinex_version == 3) + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + if (d_rinex_version == 2) + { + rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); + rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + } + b_rinex_header_written = true; // do not write header anymore } } - if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A + if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - } - if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) - { - rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - b_rinex_header_updated = true; // do not write header anymore + std::string glo_signal("1G"); + std::string gal_signal("1B"); + rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal); + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + b_rinex_header_written = true; // do not write header anymore } } if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - } - if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)) - { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - b_rinex_header_updated = true; // do not write header anymore + std::string glo_signal("1G"); + rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + b_rinex_header_written = true; // do not write header anymore } } if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - } - if (!b_rinex_header_updated && (d_ls_pvt->gps_utc_model.d_A0 != 0)) - { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - b_rinex_header_updated = true; // do not write header anymore + std::string glo_signal("2G"); + rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); + if (d_rinex_version == 3) + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + if (d_rinex_version == 2) + { + rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); + rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + } + b_rinex_header_written = true; // do not write header anymore } } - if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A + if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - } - if (!b_rinex_header_updated && (d_ls_pvt->galileo_utc_model.A0_6 != 0)) - { - rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - b_rinex_header_updated = true; // do not write header anymore + std::string glo_signal("2G"); + std::string gal_signal("1B"); + rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal); + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + b_rinex_header_written = true; // do not write header anymore } } if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { - rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + std::string glo_signal("2G"); + rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + b_rinex_header_written = true; // do not write header anymore } - if (!b_rinex_header_updated && (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)) + } + } + + + if (b_rinex_header_written) // The header is already written, we can now log the navigation message data + { + if (flag_write_RINEX_nav_output) + { + if (type_of_rx == 1) // GPS L1 C/A only { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - b_rinex_header_updated = true; // do not write header anymore + rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); + } + if (type_of_rx == 2) // GPS L2C only + { + rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); + } + if (type_of_rx == 3) // GPS L5 only + { + rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); + } + if ((type_of_rx == 4) or (type_of_rx == 5) or (type_of_rx == 6)) // Galileo + { + rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map); + } + if (type_of_rx == 7) // GPS L1 C/A + GPS L2C + { + rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); + } + if ((type_of_rx == 9) or (type_of_rx == 10) or (type_of_rx == 11)) // GPS L1 C/A + Galileo + { + rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->galileo_ephemeris_map); + } + if ((type_of_rx == 14) or (type_of_rx == 15)) // Galileo E1B + Galileo E5a + { + rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map); + } + if ((type_of_rx == 23) or (type_of_rx == 24) or (type_of_rx == 25)) // GLONASS L1 C/A, GLONASS L2 C/A + { + rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); + } + if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A + { + if (d_rinex_version == 3) + rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); + if (d_rinex_version == 2) + { + rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); + rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); + } + } + if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A + { + rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); + } + if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A + { + rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); + } + if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A + { + if (d_rinex_version == 3) + rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); + if (d_rinex_version == 2) + { + rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); + rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); + } + } + if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A + { + rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); + } + if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A + { + rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); + } + } + galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); + glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + + // Log observables into the RINEX file + if (flag_write_RINEX_obs_output) + { + if (type_of_rx == 1) // GPS L1 C/A only + { + if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) + { + rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0)) + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); + rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono); + b_rinex_header_updated = true; + } + } + if (type_of_rx == 2) // GPS L2C only + { + if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) + { + rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)) + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); + rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono); + b_rinex_header_updated = true; + } + } + if (type_of_rx == 3) // GPS L5 + { + if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) + { + rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)) + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); + rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono); + b_rinex_header_updated = true; + } + } + if (type_of_rx == 4) // Galileo E1B only + { + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + { + rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B"); + } + if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + { + rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); + b_rinex_header_updated = true; + } + } + if (type_of_rx == 5) // Galileo E5a only + { + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + { + rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "5X"); + } + if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + { + rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); + b_rinex_header_updated = true; + } + } + if (type_of_rx == 6) // Galileo E5b only + { + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + { + rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "7X"); + } + if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + { + rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); + b_rinex_header_updated = true; + } + } + if (type_of_rx == 7) // GPS L1 C/A + GPS L2C + { + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) + { + rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0)) + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); + rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono); + b_rinex_header_updated = true; + } + } + if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B + { + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())) + { + rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0)) + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + b_rinex_header_updated = true; + } + } + if (type_of_rx == 14) // Galileo E1B + Galileo E5a + { + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + { + rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 5X"); + } + if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + { + rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); + b_rinex_header_updated = true; + } + } + if (type_of_rx == 15) // Galileo E1B + Galileo E5b + { + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + { + rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 7X"); + } + if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + { + rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); + b_rinex_header_updated = true; + } + } + if (type_of_rx == 23) // GLONASS L1 C/A only + { + if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + { + rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C"); + } + if (!b_rinex_header_updated and (d_ls_pvt->glonass_gnav_utc_model.d_tau_c != 0)) + { + rp->update_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model); + b_rinex_header_updated = true; + } + } + if (type_of_rx == 24) // GLONASS L2 C/A only + { + if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + { + rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "2C"); + } + if (!b_rinex_header_updated and (d_ls_pvt->glonass_gnav_utc_model.d_tau_c != 0)) + { + rp->update_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model); + b_rinex_header_updated = true; + } + } + if (type_of_rx == 25) // GLONASS L1 C/A + GLONASS L2 C/A + { + if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + { + rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C 2C"); + } + if (!b_rinex_header_updated and (d_ls_pvt->glonass_gnav_utc_model.d_tau_c != 0)) + { + rp->update_nav_header(rp->navMixFile, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model); + b_rinex_header_updated = true; + } + } + if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A + { + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())) + { + rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0)) + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + b_rinex_header_updated = true; // do not write header anymore + } + } + if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A + { + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())) + { + rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + b_rinex_header_updated = true; // do not write header anymore + } + } + if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A + { + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) + { + rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)) + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + b_rinex_header_updated = true; // do not write header anymore + } + } + if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A + { + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())) + { + rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated && (d_ls_pvt->gps_utc_model.d_A0 != 0)) + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + b_rinex_header_updated = true; // do not write header anymore + } + } + if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A + { + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())) + { + rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated && (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + b_rinex_header_updated = true; // do not write header anymore + } + } + if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A + { + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) + { + rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated && (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)) + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + b_rinex_header_updated = true; // do not write header anymore + } } } } } - // ####################### RTCM MESSAGES ################# try { diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index 3dfb87858..45ba07461 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -38,6 +38,7 @@ #include "geojson_printer.h" #include "rinex_printer.h" #include "rtcm_printer.h" +#include "pvt_conf.h" #include "rtklib_solver.h" #include #include @@ -55,23 +56,7 @@ class rtklib_pvt_cc; typedef boost::shared_ptr rtklib_pvt_cc_sptr; rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t n_channels, - bool dump, - std::string dump_filename, - int32_t output_rate_ms, - int32_t display_rate_ms, - bool flag_nmea_tty_port, - std::string nmea_dump_filename, - std::string nmea_dump_devname, - int32_t rinex_version, - int32_t rinexobs_rate_ms, - int32_t rinexnav_rate_ms, - bool flag_rtcm_server, - bool flag_rtcm_tty_port, - uint16_t rtcm_tcp_port, - uint16_t rtcm_station_id, - std::map rtcm_msg_rate_ms, - std::string rtcm_dump_devname, - const uint32_t type_of_receiver, + const Pvt_Conf& conf_, rtk_t& rtk); /*! @@ -81,28 +66,13 @@ class rtklib_pvt_cc : public gr::sync_block { private: friend rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, - bool dump, - std::string dump_filename, - int32_t output_rate_ms, - int32_t display_rate_ms, - bool flag_nmea_tty_port, - std::string nmea_dump_filename, - std::string nmea_dump_devname, - int32_t rinex_version, - int32_t rinexobs_rate_ms, - int32_t rinexnav_rate_ms, - bool flag_rtcm_server, - bool flag_rtcm_tty_port, - uint16_t rtcm_tcp_port, - uint16_t rtcm_station_id, - std::map rtcm_msg_rate_ms, - std::string rtcm_dump_devname, - const uint32_t type_of_receiver, + const Pvt_Conf& conf_, rtk_t& rtk); void msg_handler_telemetry(pmt::pmt_t msg); bool d_dump; + bool b_rinex_output_enabled; bool b_rinex_header_written; bool b_rinex_header_updated; double d_rinex_version; @@ -134,6 +104,10 @@ private: std::shared_ptr d_rtcm_printer; double d_rx_time; + bool d_geojson_output_enabled; + bool d_gpx_output_enabled; + bool d_kml_output_enabled; + std::shared_ptr d_ls_pvt; std::map gnss_observables_map; @@ -156,24 +130,13 @@ private: bool load_gnss_synchro_map_xml(const std::string file_name); //debug helper function + bool d_xml_storage; + std::string xml_base_path; + + public: rtklib_pvt_cc(uint32_t nchannels, - bool dump, std::string dump_filename, - int32_t output_rate_ms, - int32_t display_rate_ms, - bool flag_nmea_tty_port, - std::string nmea_dump_filename, - std::string nmea_dump_devname, - int32_t rinex_version, - int32_t rinexobs_rate_ms, - int32_t rinexnav_rate_ms, - bool flag_rtcm_server, - bool flag_rtcm_tty_port, - uint16_t rtcm_tcp_port, - uint16_t rtcm_station_id, - std::map rtcm_msg_rate_ms, - std::string rtcm_dump_devname, - const uint32_t type_of_receiver, + const Pvt_Conf& conf_, rtk_t& rtk); /*! diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index caf02a4ce..31eaa70f7 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -29,6 +29,7 @@ set(PVT_LIB_SOURCES rtcm_printer.cc geojson_printer.cc rtklib_solver.cc + pvt_conf.cc ) set(PVT_LIB_HEADERS @@ -42,6 +43,7 @@ set(PVT_LIB_HEADERS rtcm_printer.h geojson_printer.h rtklib_solver.h + pvt_conf.h ) diff --git a/src/algorithms/PVT/libs/geojson_printer.cc b/src/algorithms/PVT/libs/geojson_printer.cc index 5dd3ecdba..335f5b54a 100644 --- a/src/algorithms/PVT/libs/geojson_printer.cc +++ b/src/algorithms/PVT/libs/geojson_printer.cc @@ -32,14 +32,48 @@ #include "geojson_printer.h" #include +#include // for create_directories, exists +#include // for path, operator<< +#include // for filesystem #include #include #include -GeoJSON_Printer::GeoJSON_Printer() +GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path) { first_pos = true; + geojson_base_path = base_path; + boost::filesystem::path full_path(boost::filesystem::current_path()); + const boost::filesystem::path p(geojson_base_path); + if (!boost::filesystem::exists(p)) + { + std::string new_folder; + for (auto& folder : boost::filesystem::path(geojson_base_path)) + { + new_folder += folder.string(); + boost::system::error_code ec; + if (!boost::filesystem::exists(new_folder)) + { + if (!boost::filesystem::create_directory(new_folder, ec)) + { + std::cout << "Could not create the " << new_folder << " folder." << std::endl; + geojson_base_path = full_path.string(); + } + } + new_folder += boost::filesystem::path::preferred_separator; + } + } + else + { + geojson_base_path = p.string(); + } + if (geojson_base_path.compare(".") != 0) + { + std::cout << "GeoJSON files will be stored at " << geojson_base_path << std::endl; + } + + geojson_base_path = geojson_base_path + boost::filesystem::path::preferred_separator; } @@ -96,6 +130,7 @@ bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name) { filename_ = filename + ".geojson"; } + filename_ = geojson_base_path + filename_; geojson_file.open(filename_.c_str()); diff --git a/src/algorithms/PVT/libs/geojson_printer.h b/src/algorithms/PVT/libs/geojson_printer.h index 9963e64d2..63630552c 100644 --- a/src/algorithms/PVT/libs/geojson_printer.h +++ b/src/algorithms/PVT/libs/geojson_printer.h @@ -50,9 +50,10 @@ private: std::ofstream geojson_file; bool first_pos; std::string filename_; + std::string geojson_base_path; public: - GeoJSON_Printer(); + GeoJSON_Printer(const std::string& base_path = "."); ~GeoJSON_Printer(); bool set_headers(std::string filename, bool time_tag_name = true); bool print_position(const std::shared_ptr& position, bool print_average_values); diff --git a/src/algorithms/PVT/libs/gpx_printer.cc b/src/algorithms/PVT/libs/gpx_printer.cc index 51fa6760f..3918c5702 100644 --- a/src/algorithms/PVT/libs/gpx_printer.cc +++ b/src/algorithms/PVT/libs/gpx_printer.cc @@ -32,11 +32,53 @@ #include "gpx_printer.h" #include +#include // for create_directories, exists +#include // for path, operator<< +#include // for filesystem #include #include using google::LogMessage; + +Gpx_Printer::Gpx_Printer(const std::string& base_path) +{ + positions_printed = false; + indent = " "; + gpx_base_path = base_path; + boost::filesystem::path full_path(boost::filesystem::current_path()); + const boost::filesystem::path p(gpx_base_path); + if (!boost::filesystem::exists(p)) + { + std::string new_folder; + for (auto& folder : boost::filesystem::path(gpx_base_path)) + { + new_folder += folder.string(); + boost::system::error_code ec; + if (!boost::filesystem::exists(new_folder)) + { + if (!boost::filesystem::create_directory(new_folder, ec)) + { + std::cout << "Could not create the " << new_folder << " folder." << std::endl; + gpx_base_path = full_path.string(); + } + } + new_folder += boost::filesystem::path::preferred_separator; + } + } + else + { + gpx_base_path = p.string(); + } + if (gpx_base_path.compare(".") != 0) + { + std::cout << "GPX files will be stored at " << gpx_base_path << std::endl; + } + + gpx_base_path = gpx_base_path + boost::filesystem::path::preferred_separator; +} + + bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name) { boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); @@ -84,6 +126,8 @@ bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name) { gpx_filename = filename + ".gpx"; } + + gpx_filename = gpx_base_path + gpx_filename; gpx_file.open(gpx_filename.c_str()); if (gpx_file.is_open()) @@ -171,13 +215,6 @@ bool Gpx_Printer::close_file() } -Gpx_Printer::Gpx_Printer() -{ - positions_printed = false; - indent = " "; -} - - Gpx_Printer::~Gpx_Printer() { close_file(); diff --git a/src/algorithms/PVT/libs/gpx_printer.h b/src/algorithms/PVT/libs/gpx_printer.h index f158b6fb9..d4efcf81d 100644 --- a/src/algorithms/PVT/libs/gpx_printer.h +++ b/src/algorithms/PVT/libs/gpx_printer.h @@ -52,9 +52,10 @@ private: bool positions_printed; std::string gpx_filename; std::string indent; + std::string gpx_base_path; public: - Gpx_Printer(); + Gpx_Printer(const std::string& base_path = "."); ~Gpx_Printer(); bool set_headers(std::string filename, bool time_tag_name = true); bool print_position(const std::shared_ptr& position, bool print_average_values); diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index 1233df036..018c533b0 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -31,11 +31,52 @@ #include "kml_printer.h" #include +#include // for create_directories, exists +#include // for path, operator<< +#include // for filesystem #include #include using google::LogMessage; + +Kml_Printer::Kml_Printer(const std::string& base_path) +{ + positions_printed = false; + kml_base_path = base_path; + boost::filesystem::path full_path(boost::filesystem::current_path()); + const boost::filesystem::path p(kml_base_path); + if (!boost::filesystem::exists(p)) + { + std::string new_folder; + for (auto& folder : boost::filesystem::path(kml_base_path)) + { + new_folder += folder.string(); + boost::system::error_code ec; + if (!boost::filesystem::exists(new_folder)) + { + if (!boost::filesystem::create_directory(new_folder, ec)) + { + std::cout << "Could not create the " << new_folder << " folder." << std::endl; + kml_base_path = full_path.string(); + } + } + new_folder += boost::filesystem::path::preferred_separator; + } + } + else + { + kml_base_path = p.string(); + } + if (kml_base_path.compare(".") != 0) + { + std::cout << "KML files will be stored at " << kml_base_path << std::endl; + } + + kml_base_path = kml_base_path + boost::filesystem::path::preferred_separator; +} + + bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) { boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); @@ -83,6 +124,7 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) { kml_filename = filename + ".kml"; } + kml_filename = kml_base_path + kml_filename; kml_file.open(kml_filename.c_str()); if (kml_file.is_open()) @@ -178,12 +220,6 @@ bool Kml_Printer::close_file() } -Kml_Printer::Kml_Printer() -{ - positions_printed = false; -} - - Kml_Printer::~Kml_Printer() { close_file(); diff --git a/src/algorithms/PVT/libs/kml_printer.h b/src/algorithms/PVT/libs/kml_printer.h index 435943a6c..9aed7c02c 100644 --- a/src/algorithms/PVT/libs/kml_printer.h +++ b/src/algorithms/PVT/libs/kml_printer.h @@ -50,9 +50,10 @@ private: std::ofstream kml_file; bool positions_printed; std::string kml_filename; + std::string kml_base_path; public: - Kml_Printer(); + Kml_Printer(const std::string& base_path = std::string(".")); ~Kml_Printer(); bool set_headers(std::string filename, bool time_tag_name = true); bool print_position(const std::shared_ptr& position, bool print_average_values); diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index c9c1e8052..8c6d4311a 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -35,6 +35,9 @@ #include "nmea_printer.h" #include +#include // for create_directories, exists +#include // for path, operator<< +#include // for filesystem #include #include #include @@ -44,13 +47,51 @@ using google::LogMessage; -Nmea_Printer::Nmea_Printer(std::string filename, bool flag_nmea_tty_port, std::string nmea_dump_devname) +Nmea_Printer::Nmea_Printer(std::string filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_devname, const std::string& base_path) { - nmea_filename = filename; - nmea_file_descriptor.open(nmea_filename.c_str(), std::ios::out); - if (nmea_file_descriptor.is_open()) + nmea_base_path = base_path; + d_flag_nmea_output_file = flag_nmea_output_file; + if (d_flag_nmea_output_file == true) { - DLOG(INFO) << "NMEA printer writing on " << nmea_filename.c_str(); + boost::filesystem::path full_path(boost::filesystem::current_path()); + const boost::filesystem::path p(nmea_base_path); + if (!boost::filesystem::exists(p)) + { + std::string new_folder; + for (auto& folder : boost::filesystem::path(nmea_base_path)) + { + new_folder += folder.string(); + boost::system::error_code ec; + if (!boost::filesystem::exists(new_folder)) + { + if (!boost::filesystem::create_directory(new_folder, ec)) + { + std::cout << "Could not create the " << new_folder << " folder." << std::endl; + nmea_base_path = full_path.string(); + } + } + new_folder += boost::filesystem::path::preferred_separator; + } + } + else + { + nmea_base_path = p.string(); + } + + if ((nmea_base_path.compare(".") != 0) and (d_flag_nmea_output_file == true)) + { + std::cout << "NMEA files will be stored at " << nmea_base_path << std::endl; + } + + nmea_base_path = nmea_base_path + boost::filesystem::path::preferred_separator; + + nmea_filename = nmea_base_path + filename; + + nmea_file_descriptor.open(nmea_filename.c_str(), std::ios::out); + if (nmea_file_descriptor.is_open()) + { + DLOG(INFO) << "NMEA printer writing on " << nmea_filename.c_str(); + } } nmea_devname = nmea_dump_devname; @@ -94,13 +135,13 @@ int Nmea_Printer::init_serial(std::string serial_device) int64_t PARITY; fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY); - if (fd == -1) return fd; //failed to open TTY port + if (fd == -1) return fd; // failed to open TTY port if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O tcgetattr(fd, &options); // read serial port options BAUD = B9600; - //BAUD = B38400; + // BAUD = B38400; DATABITS = CS8; STOPBITS = 0; PARITYON = 0; @@ -108,7 +149,7 @@ int Nmea_Printer::init_serial(std::string serial_device) options.c_cflag = BAUD | DATABITS | STOPBITS | PARITYON | PARITY | CLOCAL | CREAD; // enable receiver, set 8 bit data, ignore control lines - //options.c_cflag |= (CLOCAL | CREAD | CS8); + // options.c_cflag |= (CLOCAL | CREAD | CS8); options.c_iflag = IGNPAR; // set the new port options @@ -139,34 +180,36 @@ bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr& pvt_dat // generate the NMEA sentences - //GPRMC + // GPRMC GPRMC = get_GPRMC(); - //GPGGA (Global Positioning System Fixed Data) + // GPGGA (Global Positioning System Fixed Data) GPGGA = get_GPGGA(); - //GPGSA + // GPGSA GPGSA = get_GPGSA(); - //GPGSV + // GPGSV GPGSV = get_GPGSV(); // write to log file - try + if (d_flag_nmea_output_file) { - //GPRMC - nmea_file_descriptor << GPRMC; - //GPGGA (Global Positioning System Fixed Data) - nmea_file_descriptor << GPGGA; - //GPGSA - nmea_file_descriptor << GPGSA; - //GPGSV - nmea_file_descriptor << GPGSV; - } - catch (const std::exception& ex) - { - DLOG(INFO) << "NMEA printer can not write on output file" << nmea_filename.c_str(); - ; + try + { + // GPRMC + nmea_file_descriptor << GPRMC; + // GPGGA (Global Positioning System Fixed Data) + nmea_file_descriptor << GPGGA; + // GPGSA + nmea_file_descriptor << GPGSA; + // GPGSV + nmea_file_descriptor << GPGSV; + } + catch (const std::exception& ex) + { + DLOG(INFO) << "NMEA printer can not write on output file" << nmea_filename.c_str(); + } } - //write to serial device + // write to serial device if (nmea_dev_descriptor != -1) { if (write(nmea_dev_descriptor, GPRMC.c_str(), GPRMC.length()) == -1) @@ -284,7 +327,7 @@ std::string Nmea_Printer::longitude_to_hm(double longitude) std::string Nmea_Printer::get_UTC_NMEA_time(boost::posix_time::ptime d_position_UTC_time) { - //UTC Time: hhmmss.sss + // UTC Time: hhmmss.sss std::stringstream sentence_str; boost::posix_time::time_duration td = d_position_UTC_time.time_of_day(); @@ -335,20 +378,19 @@ std::string Nmea_Printer::get_GPRMC() double speed_over_ground_knots = 0; double course_over_ground_deg = 0; - //boost::posix_time::ptime d_position_UTC_time=boost::posix_time::microsec_clock::universal_time(); + // boost::posix_time::ptime d_position_UTC_time=boost::posix_time::microsec_clock::universal_time(); std::stringstream sentence_str; - //GPRMC (RMC-Recommended,Minimum Specific GNSS Data) + // GPRMC (RMC-Recommended,Minimum Specific GNSS Data) std::string sentence_header; sentence_header = "$GPRMC,"; sentence_str << sentence_header; - //UTC Time: hhmmss.sss + // UTC Time: hhmmss.sss sentence_str << get_UTC_NMEA_time(d_PVT_data->get_position_UTC_time()); - //Status: A: data valid, V: data NOT valid - + // Status: A: data valid, V: data NOT valid if (valid_fix == true) { sentence_str << ",A"; @@ -373,13 +415,13 @@ std::string Nmea_Printer::get_GPRMC() sentence_str << "," << longitude_to_hm(d_PVT_data->get_longitude()); } - //Speed over ground (knots) + // Speed over ground (knots) sentence_str << ","; sentence_str.setf(std::ios::fixed, std::ios::floatfield); sentence_str.precision(2); sentence_str << speed_over_ground_knots; - //course over ground (degrees) + // course over ground (degrees) sentence_str << ","; sentence_str.setf(std::ios::fixed, std::ios::floatfield); sentence_str.precision(2); @@ -403,11 +445,11 @@ std::string Nmea_Printer::get_GPRMC() year_strs << std::dec << year; sentence_str << std::dec << year_strs.str().substr(2); - //Magnetic Variation (degrees) + // Magnetic Variation (degrees) // ToDo: Implement magnetic compass sentence_str << ","; - //Magnetic Variation (E or W) + // Magnetic Variation (E or W) // ToDo: Implement magnetic compass sentence_str << ","; @@ -429,7 +471,7 @@ std::string Nmea_Printer::get_GPRMC() std::string Nmea_Printer::get_GPGSA() { - //$GPGSA,A,3,07,02,26,27,09,04,15, , , , , ,1.8,1.0,1.5*33 + // $GPGSA,A,3,07,02,26,27,09,04,15, , , , , ,1.8,1.0,1.5*33 // GSA-GNSS DOP and Active Satellites bool valid_fix = d_PVT_data->is_valid_position(); int n_sats_used = d_PVT_data->get_num_valid_observations(); @@ -480,14 +522,14 @@ std::string Nmea_Printer::get_GPGSA() sentence_str.precision(1); sentence_str.fill('0'); sentence_str << pdop; - //HDOP + // HDOP sentence_str << ","; sentence_str.setf(std::ios::fixed, std::ios::floatfield); sentence_str.width(2); sentence_str.precision(1); sentence_str.fill('0'); sentence_str << hdop; - //VDOP + // VDOP sentence_str << ","; sentence_str.setf(std::ios::fixed, std::ios::floatfield); sentence_str.width(2); @@ -548,7 +590,7 @@ std::string Nmea_Printer::get_GPGSV() frame_str.fill('0'); frame_str << std::dec << n_sats_used; - //satellites info + // satellites info for (int j = 0; j < 4; j++) { // write satellite info @@ -595,13 +637,13 @@ std::string Nmea_Printer::get_GPGSV() sentence_str << frame_str.str(); } return sentence_str.str(); - //$GPGSV,2,1,07,07,79,048,42,02,51,062,43,26,36,256,42,27,27,138,42*71 + // $GPGSV,2,1,07,07,79,048,42,02,51,062,43,26,36,256,42,27,27,138,42*71 } std::string Nmea_Printer::get_GPGGA() { - //boost::posix_time::ptime d_position_UTC_time=boost::posix_time::microsec_clock::universal_time(); + // boost::posix_time::ptime d_position_UTC_time=boost::posix_time::microsec_clock::universal_time(); bool valid_fix = d_PVT_data->is_valid_position(); int n_channels = d_PVT_data->get_num_valid_observations(); //d_nchannels double hdop = d_PVT_data->get_hdop(); @@ -618,12 +660,12 @@ std::string Nmea_Printer::get_GPGGA() std::stringstream sentence_str; - //GPGGA (Global Positioning System Fixed Data) + // GPGGA (Global Positioning System Fixed Data) std::string sentence_header; sentence_header = "$GPGGA,"; sentence_str << sentence_header; - //UTC Time: hhmmss.sss + // UTC Time: hhmmss.sss sentence_str << get_UTC_NMEA_time(d_PVT_data->get_position_UTC_time()); if (d_PVT_data->is_averaging() == true) @@ -708,5 +750,5 @@ std::string Nmea_Printer::get_GPGGA() // end NMEA sentence sentence_str << "\r\n"; return sentence_str.str(); - //$GPGGA,104427.591,5920.7009,N,01803.2938,E,1,05,3.3,78.2,M,23.2,M,0.0,0000*4A + // $GPGGA,104427.591,5920.7009,N,01803.2938,E,1,05,3.3,78.2,M,23.2,M,0.0,0000*4A } diff --git a/src/algorithms/PVT/libs/nmea_printer.h b/src/algorithms/PVT/libs/nmea_printer.h index 318745e1c..b2f961756 100644 --- a/src/algorithms/PVT/libs/nmea_printer.h +++ b/src/algorithms/PVT/libs/nmea_printer.h @@ -53,7 +53,7 @@ public: /*! * \brief Default constructor. */ - Nmea_Printer(std::string filename, bool flag_nmea_tty_port, std::string nmea_dump_filename); + Nmea_Printer(std::string filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_filename, const std::string& base_path = "."); /*! * \brief Print NMEA PVT and satellite info to the initialized device @@ -66,7 +66,8 @@ public: ~Nmea_Printer(); private: - std::string nmea_filename; // String with the NMEA log filename + 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) @@ -82,6 +83,7 @@ private: std::string latitude_to_hm(double lat); char checkSum(std::string sentence); bool print_avg_pos; + bool d_flag_nmea_output_file; }; #endif diff --git a/src/algorithms/PVT/libs/pvt_conf.cc b/src/algorithms/PVT/libs/pvt_conf.cc new file mode 100644 index 000000000..c2f21dcf4 --- /dev/null +++ b/src/algorithms/PVT/libs/pvt_conf.cc @@ -0,0 +1,69 @@ +/*! + * \file pvt_conf.cc + * \brief Class that contains all the configuration parameters for a PVT block + * \author Carles Fernandez, 2018. cfernandez(at)cttc.es + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#include "pvt_conf.h" + +Pvt_Conf::Pvt_Conf() +{ + type_of_receiver = 0U; + output_rate_ms = 0; + display_rate_ms = 0; + + rinex_version = 0; + rinexobs_rate_ms = 0; + rinexnav_rate_ms = 0; + + dump = false; + + flag_nmea_tty_port = false; + + flag_rtcm_server = false; + flag_rtcm_tty_port = false; + rtcm_tcp_port = 0U; + rtcm_station_id = 0U; + + output_enabled = true; + rinex_output_enabled = true; + gpx_output_enabled = true; + geojson_output_enabled = true; + nmea_output_file_enabled = true; + kml_output_enabled = true; + xml_output_enabled = true; + rtcm_output_file_enabled = true; + + output_path = std::string("."); + rinex_output_path = std::string("."); + gpx_output_path = std::string("."); + geojson_output_path = std::string("."); + nmea_output_file_path = std::string("."); + kml_output_path = std::string("."); + xml_output_path = std::string("."); + rtcm_output_file_path = std::string("."); +} diff --git a/src/algorithms/PVT/libs/pvt_conf.h b/src/algorithms/PVT/libs/pvt_conf.h new file mode 100644 index 000000000..8f47d3765 --- /dev/null +++ b/src/algorithms/PVT/libs/pvt_conf.h @@ -0,0 +1,85 @@ +/*! + * \file pvt_conf.h + * \brief Class that contains all the configuration parameters for the PVT block + * \author Carles Fernandez, 2018. cfernandez(at)cttc.es + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#ifndef GNSS_SDR_PVT_CONF_H_ +#define GNSS_SDR_PVT_CONF_H_ + +#include +#include +#include +#include + +class Pvt_Conf +{ +public: + uint32_t type_of_receiver; + int32_t output_rate_ms; + int32_t display_rate_ms; + + int32_t rinex_version; + int32_t rinexobs_rate_ms; + int32_t rinexnav_rate_ms; + std::map rtcm_msg_rate_ms; + + bool dump; + 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; + + std::string output_path; + std::string rinex_output_path; + std::string gpx_output_path; + std::string geojson_output_path; + std::string nmea_output_file_path; + std::string kml_output_path; + std::string xml_output_path; + std::string rtcm_output_file_path; + + Pvt_Conf(); +}; + +#endif diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index c942779b7..9ac71aa2d 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -33,6 +33,9 @@ #include #include #include +#include // for create_directories, exists +#include // for path, operator<< +#include // for filesystem #include #include // for getlogin_r() #include // for min and max @@ -48,14 +51,44 @@ using google::LogMessage; -Rinex_Printer::Rinex_Printer(int32_t conf_version) +Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path) { - navfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_GPS_NAV"); - obsfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_OBS"); - sbsfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_SBAS"); - navGalfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_GAL_NAV"); - navMixfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_MIXED_NAV"); - navGlofilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_GLO_NAV"); + std::string base_rinex_path = base_path; + boost::filesystem::path full_path(boost::filesystem::current_path()); + const boost::filesystem::path p(base_rinex_path); + if (!boost::filesystem::exists(p)) + { + std::string new_folder; + for (auto& folder : boost::filesystem::path(base_rinex_path)) + { + new_folder += folder.string(); + boost::system::error_code ec; + if (!boost::filesystem::exists(new_folder)) + { + if (!boost::filesystem::create_directory(new_folder, ec)) + { + std::cout << "Could not create the " << new_folder << " folder." << std::endl; + base_rinex_path = full_path.string(); + } + } + new_folder += boost::filesystem::path::preferred_separator; + } + } + else + { + base_rinex_path = p.string(); + } + if (base_rinex_path.compare(".") != 0) + { + std::cout << "RINEX files will be stored at " << base_rinex_path << std::endl; + } + + navfilename = base_rinex_path + boost::filesystem::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GPS_NAV"); + obsfilename = base_rinex_path + boost::filesystem::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_OBS"); + sbsfilename = base_rinex_path + boost::filesystem::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_SBAS"); + navGalfilename = base_rinex_path + boost::filesystem::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GAL_NAV"); + navMixfilename = base_rinex_path + boost::filesystem::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_MIXED_NAV"); + navGlofilename = base_rinex_path + boost::filesystem::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GLO_NAV"); Rinex_Printer::navFile.open(navfilename, std::ios::out | std::ios::in | std::ios::app); Rinex_Printer::obsFile.open(obsfilename, std::ios::out | std::ios::in | std::ios::app); diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index 66017c2e9..9f4e21129 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -77,12 +77,12 @@ class Rinex_Printer { public: /*! - * \brief Default constructor. Creates GPS Navigation and Observables RINEX files and their headers + * \brief Default constructor. Creates GNSS Navigation and Observables RINEX files and their headers */ - Rinex_Printer(int version = 0); + Rinex_Printer(int version = 0, const std::string& base_path = "."); /*! - * \brief Default destructor. Closes GPS Navigation and Observables RINEX files + * \brief Default destructor. Closes GNSS Navigation and Observables RINEX files */ ~Rinex_Printer(); diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index 1603ca09d..7dd2d12de 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -33,6 +33,9 @@ #include "rtcm_printer.h" #include +#include // for create_directories, exists +#include // for path, operator<< +#include // for filesystem #include #include #include // for O_RDWR @@ -42,10 +45,45 @@ using google::LogMessage; -Rtcm_Printer::Rtcm_Printer(std::string filename, 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 time_tag_name) +Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_file_dump, 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 time_tag_name, const std::string& base_path) { boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); tm timeinfo = boost::posix_time::to_tm(pt); + d_rtcm_file_dump = flag_rtcm_file_dump; + rtcm_base_path = base_path; + if (d_rtcm_file_dump) + { + boost::filesystem::path full_path(boost::filesystem::current_path()); + const boost::filesystem::path p(rtcm_base_path); + if (!boost::filesystem::exists(p)) + { + std::string new_folder; + for (auto& folder : boost::filesystem::path(rtcm_base_path)) + { + new_folder += folder.string(); + boost::system::error_code ec; + if (!boost::filesystem::exists(new_folder)) + { + if (!boost::filesystem::create_directory(new_folder, ec)) + { + std::cout << "Could not create the " << new_folder << " folder." << std::endl; + rtcm_base_path = full_path.string(); + } + } + new_folder += boost::filesystem::path::preferred_separator; + } + } + else + { + rtcm_base_path = p.string(); + } + if (rtcm_base_path.compare(".") != 0) + { + std::cout << "RTCM binary file will be stored at " << rtcm_base_path << std::endl; + } + + rtcm_base_path = rtcm_base_path + boost::filesystem::path::preferred_separator; + } if (time_tag_name) { @@ -89,11 +127,14 @@ Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_server, bool fla { rtcm_filename = filename + ".rtcm"; } - - rtcm_file_descriptor.open(rtcm_filename.c_str(), std::ios::out); - if (rtcm_file_descriptor.is_open()) + rtcm_filename = rtcm_base_path + rtcm_filename; + if (d_rtcm_file_dump) { - DLOG(INFO) << "RTCM printer writing on " << rtcm_filename.c_str(); + rtcm_file_descriptor.open(rtcm_filename.c_str(), std::ios::out); + if (rtcm_file_descriptor.is_open()) + { + DLOG(INFO) << "RTCM printer writing on " << rtcm_filename.c_str(); + } } rtcm_devname = rtcm_dump_devname; @@ -341,14 +382,17 @@ void Rtcm_Printer::close_serial() bool Rtcm_Printer::Print_Message(const std::string& message) { //write to file - try + if (d_rtcm_file_dump) { - rtcm_file_descriptor << message << std::endl; - } - catch (const std::exception& ex) - { - DLOG(INFO) << "RTCM printer cannot write on the output file " << rtcm_filename.c_str(); - return false; + try + { + rtcm_file_descriptor << message << std::endl; + } + catch (const std::exception& ex) + { + DLOG(INFO) << "RTCM printer cannot write on the output file " << rtcm_filename.c_str(); + return false; + } } //write to serial device diff --git a/src/algorithms/PVT/libs/rtcm_printer.h b/src/algorithms/PVT/libs/rtcm_printer.h index 87a710812..bb34f7ea6 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.h +++ b/src/algorithms/PVT/libs/rtcm_printer.h @@ -48,7 +48,7 @@ public: /*! * \brief Default constructor. */ - Rtcm_Printer(std::string filename, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, std::string rtcm_dump_filename, bool time_tag_name = true); + Rtcm_Printer(std::string filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, std::string rtcm_dump_filename, bool time_tag_name = true, const std::string& base_path = "."); /*! * \brief Default destructor. @@ -142,7 +142,8 @@ 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_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; @@ -152,6 +153,7 @@ private: void close_serial(); std::shared_ptr rtcm; bool Print_Message(const std::string& message); + bool d_rtcm_file_dump; }; #endif diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc index a08b401c2..4e5c01fae 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc @@ -168,8 +168,9 @@ TEST_F(NmeaPrinterTest, PrintLine) pvt_solution->set_valid_position(true); + bool flag_nmea_output_file = true; ASSERT_NO_THROW({ - std::shared_ptr nmea_printer = std::make_shared(filename, false, ""); + std::shared_ptr nmea_printer = std::make_shared(filename, flag_nmea_output_file, false, ""); nmea_printer->Print_Nmea_Line(pvt_solution, false); }) << "Failure printing NMEA messages."; @@ -206,8 +207,9 @@ TEST_F(NmeaPrinterTest, PrintLineLessthan10min) pvt_solution->set_valid_position(true); + bool flag_nmea_output_file = true; ASSERT_NO_THROW({ - std::shared_ptr nmea_printer = std::make_shared(filename, false, ""); + std::shared_ptr nmea_printer = std::make_shared(filename, flag_nmea_output_file, false, ""); nmea_printer->Print_Nmea_Line(pvt_solution, false); }) << "Failure printing NMEA messages."; diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc index edc349e91..4f648e0b7 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc @@ -39,9 +39,10 @@ TEST(RtcmPrinterTest, Instantiate) bool flag_rtcm_tty_port = false; std::string rtcm_dump_devname = "/dev/pts/4"; bool flag_rtcm_server = false; + bool rtcm_file_output_enabled = false; unsigned short rtcm_tcp_port = 2101; unsigned short rtcm_station_id = 1234; - std::unique_ptr RTCM_printer(new Rtcm_Printer(filename, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_dump_devname)); + std::unique_ptr RTCM_printer(new Rtcm_Printer(filename, rtcm_file_output_enabled, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_dump_devname)); } @@ -49,12 +50,13 @@ TEST(RtcmPrinterTest, Run) { std::string filename = "test.rtcm"; bool flag_rtcm_tty_port = false; + bool rtcm_file_output_enabled = false; std::string rtcm_dump_devname = "/dev/pts/4"; bool flag_rtcm_server = false; unsigned short rtcm_tcp_port = 2101; unsigned short rtcm_station_id = 1234; - std::unique_ptr RTCM_printer(new Rtcm_Printer(filename, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_dump_devname)); + std::unique_ptr RTCM_printer(new Rtcm_Printer(filename, rtcm_file_output_enabled, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_dump_devname)); std::string reference_msg = "D300133ED7D30202980EDEEF34B4BD62AC0941986F33360B98"; From 19dca8742728bdbda232fca4ed09c66b9119b579 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 28 Oct 2018 02:02:28 +0200 Subject: [PATCH 021/143] Warn if output files cannot be written. --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 11 +++++------ src/algorithms/PVT/libs/geojson_printer.cc | 1 + src/algorithms/PVT/libs/gpx_printer.cc | 1 + src/algorithms/PVT/libs/kml_printer.cc | 1 + src/algorithms/PVT/libs/nmea_printer.cc | 4 ++++ src/algorithms/PVT/libs/rinex_printer.cc | 7 +++++++ src/algorithms/PVT/libs/rtcm_printer.cc | 4 ++++ 7 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 8bb5df354..3e604cd90 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -594,16 +594,16 @@ rtklib_pvt_cc::~rtklib_pvt_cc() } // Save GPS CNAV iono parameters - file_name = xml_base_path + "gps_iono.xml"; - if (d_ls_pvt->gps_iono.valid == true) + file_name = xml_base_path + "gps_cnav_iono.xml"; + if (d_ls_pvt->gps_cnav_iono.valid == true) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_iono_model", d_ls_pvt->gps_iono); - LOG(INFO) << "Saved GPS ionospheric model parameters"; + xml << boost::serialization::make_nvp("GNSS-SDR_cnav_iono_model", d_ls_pvt->gps_cnav_iono); + LOG(INFO) << "Saved GPS CNAV ionospheric model parameters"; } catch (std::exception& e) { @@ -612,10 +612,9 @@ rtklib_pvt_cc::~rtklib_pvt_cc() } else { - LOG(INFO) << "Failed to save GPS ionospheric model parameters, not valid data"; + LOG(INFO) << "Failed to save GPS CNAV ionospheric model parameters, not valid data"; } - // Save Galileo iono parameters file_name = xml_base_path + "gal_iono.xml"; if (d_ls_pvt->galileo_iono.ai0_5 != 0.0) diff --git a/src/algorithms/PVT/libs/geojson_printer.cc b/src/algorithms/PVT/libs/geojson_printer.cc index 335f5b54a..b79a4edae 100644 --- a/src/algorithms/PVT/libs/geojson_printer.cc +++ b/src/algorithms/PVT/libs/geojson_printer.cc @@ -159,6 +159,7 @@ bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name) } else { + std::cout << "File " << filename_ << " cannot be saved. Wrong permissions?" << std::endl; return false; } } diff --git a/src/algorithms/PVT/libs/gpx_printer.cc b/src/algorithms/PVT/libs/gpx_printer.cc index 3918c5702..f0b4b3ff3 100644 --- a/src/algorithms/PVT/libs/gpx_printer.cc +++ b/src/algorithms/PVT/libs/gpx_printer.cc @@ -149,6 +149,7 @@ bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name) } else { + std::cout << "File " << gpx_filename << " cannot be saved. Wrong permissions?" << std::endl; return false; } } diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index 018c533b0..4ebfcb970 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -161,6 +161,7 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) } else { + std::cout << "File " << kml_filename << " cannot be saved. Wrong permissions?" << std::endl; return false; } } diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index 8c6d4311a..1337526b9 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -92,6 +92,10 @@ Nmea_Printer::Nmea_Printer(std::string filename, bool flag_nmea_output_file, boo { DLOG(INFO) << "NMEA printer writing on " << nmea_filename.c_str(); } + else + { + std::cout << "File " << nmea_filename << " cannot be saved. Wrong permissions?" << std::endl; + } } nmea_devname = nmea_dump_devname; diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 9ac71aa2d..8aec5b3de 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -97,6 +97,13 @@ Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path) Rinex_Printer::navMixFile.open(navMixfilename, std::ios::out | std::ios::in | std::ios::app); Rinex_Printer::navGloFile.open(navGlofilename, std::ios::out | std::ios::in | std::ios::app); + if (!Rinex_Printer::navFile.is_open() or !Rinex_Printer::obsFile.is_open() or + !Rinex_Printer::sbsFile.is_open() or !Rinex_Printer::navGalFile.is_open() or + !Rinex_Printer::navMixFile.is_open() or !Rinex_Printer::navGloFile.is_open()) + { + std::cout << "RINEX files cannot be saved. Wrong permissions?" << std::endl; + } + // RINEX v3.02 codes satelliteSystem["GPS"] = "G"; satelliteSystem["GLONASS"] = "R"; diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index 7dd2d12de..400132e0c 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -135,6 +135,10 @@ Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_file_dump, bool { DLOG(INFO) << "RTCM printer writing on " << rtcm_filename.c_str(); } + else + { + std::cout << "File " << rtcm_filename << "cannot be saved. Wrong permissions?" << std::endl; + } } rtcm_devname = rtcm_dump_devname; From 5b3eb1299874c840848459b6545c8a6cdf5d79dc Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 28 Oct 2018 11:07:53 +0100 Subject: [PATCH 022/143] Implementation of new receiver telecommands standby and coldstart --- ...lileo_e1_pcps_8ms_ambiguous_acquisition.cc | 3 + ...alileo_e1_pcps_8ms_ambiguous_acquisition.h | 6 + .../galileo_e1_pcps_ambiguous_acquisition.cc | 4 + .../galileo_e1_pcps_ambiguous_acquisition.h | 5 + ...ileo_e1_pcps_ambiguous_acquisition_fpga.cc | 529 +++++++++--------- ...lileo_e1_pcps_ambiguous_acquisition_fpga.h | 5 + ...eo_e1_pcps_cccwsr_ambiguous_acquisition.cc | 4 + ...leo_e1_pcps_cccwsr_ambiguous_acquisition.h | 5 + ...e1_pcps_quicksync_ambiguous_acquisition.cc | 4 + ..._e1_pcps_quicksync_ambiguous_acquisition.h | 5 + ...ileo_e1_pcps_tong_ambiguous_acquisition.cc | 4 + ...lileo_e1_pcps_tong_ambiguous_acquisition.h | 5 + ...ileo_e5a_noncoherent_iq_acquisition_caf.cc | 4 + ...lileo_e5a_noncoherent_iq_acquisition_caf.h | 5 + .../adapters/galileo_e5a_pcps_acquisition.cc | 4 + .../adapters/galileo_e5a_pcps_acquisition.h | 5 + .../galileo_e5a_pcps_acquisition_fpga.cc | 176 +++--- .../galileo_e5a_pcps_acquisition_fpga.h | 5 + .../glonass_l1_ca_pcps_acquisition.cc | 4 + .../adapters/glonass_l1_ca_pcps_acquisition.h | 5 + .../glonass_l2_ca_pcps_acquisition.cc | 4 + .../adapters/glonass_l2_ca_pcps_acquisition.h | 5 + .../adapters/gps_l1_ca_pcps_acquisition.cc | 4 + .../adapters/gps_l1_ca_pcps_acquisition.h | 5 + ...gps_l1_ca_pcps_acquisition_fine_doppler.cc | 4 + .../gps_l1_ca_pcps_acquisition_fine_doppler.h | 5 + .../gps_l1_ca_pcps_acquisition_fpga.cc | 4 + .../gps_l1_ca_pcps_acquisition_fpga.h | 5 + .../gps_l1_ca_pcps_assisted_acquisition.cc | 4 + .../gps_l1_ca_pcps_assisted_acquisition.h | 5 + .../gps_l1_ca_pcps_opencl_acquisition.cc | 4 + .../gps_l1_ca_pcps_opencl_acquisition.h | 5 + .../gps_l1_ca_pcps_quicksync_acquisition.cc | 4 + .../gps_l1_ca_pcps_quicksync_acquisition.h | 5 + .../gps_l1_ca_pcps_tong_acquisition.cc | 4 + .../gps_l1_ca_pcps_tong_acquisition.h | 5 + .../adapters/gps_l2_m_pcps_acquisition.cc | 4 + .../adapters/gps_l2_m_pcps_acquisition.h | 5 + .../gps_l2_m_pcps_acquisition_fpga.cc | 210 +++---- .../adapters/gps_l2_m_pcps_acquisition_fpga.h | 5 + .../adapters/gps_l5i_pcps_acquisition.cc | 4 + .../adapters/gps_l5i_pcps_acquisition.h | 5 + .../adapters/gps_l5i_pcps_acquisition_fpga.cc | 306 +++++----- .../adapters/gps_l5i_pcps_acquisition_fpga.h | 5 + src/algorithms/channel/adapters/channel.cc | 13 + src/algorithms/channel/adapters/channel.h | 6 +- src/algorithms/channel/libs/channel_fsm.cc | 33 ++ src/algorithms/channel/libs/channel_fsm.h | 3 + .../galileo_e1_dll_pll_veml_tracking.cc | 4 + .../galileo_e1_dll_pll_veml_tracking.h | 4 + .../galileo_e1_dll_pll_veml_tracking_fpga.cc | 35 +- .../galileo_e1_dll_pll_veml_tracking_fpga.h | 7 +- .../galileo_e1_tcp_connector_tracking.cc | 4 + .../galileo_e1_tcp_connector_tracking.h | 4 + .../adapters/galileo_e5a_dll_pll_tracking.cc | 4 + .../adapters/galileo_e5a_dll_pll_tracking.h | 4 + .../galileo_e5a_dll_pll_tracking_fpga.cc | 109 ++-- .../galileo_e5a_dll_pll_tracking_fpga.h | 5 +- .../glonass_l1_ca_dll_pll_c_aid_tracking.cc | 4 + .../glonass_l1_ca_dll_pll_c_aid_tracking.h | 4 + .../glonass_l1_ca_dll_pll_tracking.cc | 4 + .../adapters/glonass_l1_ca_dll_pll_tracking.h | 4 + .../glonass_l2_ca_dll_pll_c_aid_tracking.cc | 4 + .../glonass_l2_ca_dll_pll_c_aid_tracking.h | 4 + .../glonass_l2_ca_dll_pll_tracking.cc | 4 + .../adapters/glonass_l2_ca_dll_pll_tracking.h | 4 + .../gps_l1_ca_dll_pll_c_aid_tracking.cc | 4 + .../gps_l1_ca_dll_pll_c_aid_tracking.h | 4 + .../adapters/gps_l1_ca_dll_pll_tracking.cc | 5 + .../adapters/gps_l1_ca_dll_pll_tracking.h | 5 + .../gps_l1_ca_dll_pll_tracking_fpga.cc | 38 +- .../gps_l1_ca_dll_pll_tracking_fpga.h | 17 +- .../gps_l1_ca_dll_pll_tracking_gpu.cc | 4 + .../adapters/gps_l1_ca_dll_pll_tracking_gpu.h | 5 + .../adapters/gps_l1_ca_kf_tracking.cc | 4 + .../tracking/adapters/gps_l1_ca_kf_tracking.h | 5 + .../gps_l1_ca_tcp_connector_tracking.cc | 4 + .../gps_l1_ca_tcp_connector_tracking.h | 4 + .../adapters/gps_l2_m_dll_pll_tracking.cc | 4 + .../adapters/gps_l2_m_dll_pll_tracking.h | 4 + .../gps_l2_m_dll_pll_tracking_fpga.cc | 54 +- .../adapters/gps_l2_m_dll_pll_tracking_fpga.h | 4 + .../adapters/gps_l5_dll_pll_tracking.cc | 4 + .../adapters/gps_l5_dll_pll_tracking.h | 4 + .../adapters/gps_l5_dll_pll_tracking_fpga.cc | 98 ++-- .../adapters/gps_l5_dll_pll_tracking_fpga.h | 4 + .../gnuradio_blocks/dll_pll_veml_tracking.cc | 6 + .../gnuradio_blocks/dll_pll_veml_tracking.h | 1 + .../dll_pll_veml_tracking_fpga.cc | 6 + .../dll_pll_veml_tracking_fpga.h | 35 +- src/core/interfaces/acquisition_interface.h | 1 + src/core/interfaces/channel_interface.h | 1 + src/core/interfaces/tracking_interface.h | 1 + src/core/receiver/gnss_flowgraph.cc | 191 ++++++- src/core/receiver/tcp_cmd_interface.cc | 60 +- src/core/receiver/tcp_cmd_interface.h | 4 +- 96 files changed, 1407 insertions(+), 844 deletions(-) diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc index 60d19ad08..0c451be34 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc @@ -40,6 +40,9 @@ using google::LogMessage; +void GalileoE1Pcps8msAmbiguousAcquisition::stop_acquisition() +{ +} GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h index 5658aa06c..d64c0f28b 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h @@ -122,6 +122,12 @@ public: * \brief Restart acquisition algorithm */ void reset() override; + + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + void set_state(int state __attribute__((unused))) override{}; private: diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc index 065da5193..74c2db439 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -42,6 +42,10 @@ using google::LogMessage; +void GalileoE1PcpsAmbiguousAcquisition::stop_acquisition() +{ +} + GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h index 7390758d1..657f03064 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h @@ -131,6 +131,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; pcps_acquisition_sptr acquisition_; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc index 73a38d257..deb7e77b5 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc @@ -39,9 +39,12 @@ #include - using google::LogMessage; +void GalileoE1PcpsAmbiguousAcquisitionFpga::stop_acquisition() +{ +} + GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) @@ -54,7 +57,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( DLOG(INFO) << "role " << role; -// item_type_ = configuration_->property(role + ".item_type", default_item_type); + // item_type_ = configuration_->property(role + ".item_type", default_item_type); long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); @@ -62,10 +65,10 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( //if_ = configuration_->property(role + ".if", 0); //acq_parameters.freq = if_; - // dump_ = configuration_->property(role + ".dump", false); - // acq_parameters.dump = dump_; - // blocking_ = configuration_->property(role + ".blocking", true); -// acq_parameters.blocking = blocking_; + // dump_ = configuration_->property(role + ".dump", false); + // acq_parameters.dump = dump_; + // blocking_ = configuration_->property(role + ".blocking", true); + // acq_parameters.blocking = blocking_; doppler_max_ = configuration_->property(role + ".doppler_max", 5000); if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; acq_parameters.doppler_max = doppler_max_; @@ -74,16 +77,16 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( unsigned int sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 4); acq_parameters.sampled_ms = sampled_ms; - // bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); - // acq_parameters.bit_transition_flag = bit_transition_flag_; - // use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions - // acq_parameters.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_; + // bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); + // acq_parameters.bit_transition_flag = bit_transition_flag_; + // use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions + // acq_parameters.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_; acquire_pilot_ = configuration_->property(role + ".acquire_pilot", false); //will be true in future versions - // max_dwells_ = configuration_->property(role + ".max_dwells", 1); - // acq_parameters.max_dwells = max_dwells_; - // dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); - // acq_parameters.dump_filename = dump_filename_; + // max_dwells_ = configuration_->property(role + ".max_dwells", 1); + // acq_parameters.max_dwells = max_dwells_; + // dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); + // acq_parameters.dump_filename = dump_filename_; //--- Find number of samples per spreading code (4 ms) ----------------- unsigned int code_length = static_cast(std::round(static_cast(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); //acq_parameters.samples_per_code = code_length_; @@ -91,10 +94,10 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( //acq_parameters.samples_per_ms = samples_per_ms; //unsigned int vector_length = sampled_ms * samples_per_ms; -// if (bit_transition_flag_) -// { -// vector_length_ *= 2; -// } + // if (bit_transition_flag_) + // { + // vector_length_ *= 2; + // } //printf("fs_in = %d\n", fs_in); //printf("Galileo_E1_B_CODE_LENGTH_CHIPS = %f\n", Galileo_E1_B_CODE_LENGTH_CHIPS); @@ -111,166 +114,163 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( std::string default_device_name = "/dev/uio0"; std::string device_name = configuration_->property(role + ".devicename", default_device_name); acq_parameters.device_name = device_name; - acq_parameters.samples_per_ms = nsamples_total/sampled_ms; + acq_parameters.samples_per_ms = nsamples_total / sampled_ms; acq_parameters.samples_per_code = nsamples_total; // compute all the GALILEO E1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT - std::complex* code = new std::complex[nsamples_total]; // buffer for the local code + std::complex* code = new std::complex[nsamples_total]; // buffer for the local code gr_complex* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E1_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32 - float max; // temporary maxima search + float max; // temporary maxima search //int tmp_re, tmp_im; for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++) { + //code_ = new gr_complex[vector_length_]; - //code_ = new gr_complex[vector_length_]; + bool cboc = false; // cboc is set to 0 when using the FPGA - bool cboc = false; // cboc is set to 0 when using the FPGA + //std::complex* code = new std::complex[code_length_]; - //std::complex* code = new std::complex[code_length_]; + if (acquire_pilot_ == true) + { + //printf("yes acquiring pilot!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1\n"); + //set local signal generator to Galileo E1 pilot component (1C) + char pilot_signal[3] = "1C"; + galileo_e1_code_gen_complex_sampled(code, pilot_signal, + cboc, PRN, fs_in, 0, false); + } + else + { + char data_signal[3] = "1B"; + galileo_e1_code_gen_complex_sampled(code, data_signal, + cboc, PRN, fs_in, 0, false); + } - if (acquire_pilot_ == true) - { - //printf("yes acquiring pilot!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1\n"); - //set local signal generator to Galileo E1 pilot component (1C) - char pilot_signal[3] = "1C"; - galileo_e1_code_gen_complex_sampled(code, pilot_signal, - cboc, PRN, fs_in, 0, false); - } - else - { - char data_signal[3] = "1B"; - galileo_e1_code_gen_complex_sampled(code, data_signal, - cboc, PRN, fs_in, 0, false); - } - -// for (unsigned int i = 0; i < sampled_ms / 4; i++) -// { -// //memcpy(&(code_[i * code_length_]), code, sizeof(gr_complex) * code_length_); -// memcpy(&(d_all_fft_codes_[i * code_length_]), code, sizeof(gr_complex) * code_length_); -// } + // for (unsigned int i = 0; i < sampled_ms / 4; i++) + // { + // //memcpy(&(code_[i * code_length_]), code, sizeof(gr_complex) * code_length_); + // memcpy(&(d_all_fft_codes_[i * code_length_]), code, sizeof(gr_complex) * code_length_); + // } -// // debug -// char filename[25]; -// FILE *fid; -// sprintf(filename,"gal_prn%d.txt", PRN); -// fid = fopen(filename, "w"); -// for (unsigned int kk=0;kk< nsamples_total; kk++) -// { -// fprintf(fid, "%f\n", code[kk].real()); -// fprintf(fid, "%f\n", code[kk].imag()); -// } -// fclose(fid); + // // debug + // char filename[25]; + // FILE *fid; + // sprintf(filename,"gal_prn%d.txt", PRN); + // fid = fopen(filename, "w"); + // for (unsigned int kk=0;kk< nsamples_total; kk++) + // { + // fprintf(fid, "%f\n", code[kk].real()); + // fprintf(fid, "%f\n", code[kk].imag()); + // } + // fclose(fid); -// // fill in zero padding - for (int s = code_length; s < nsamples_total; s++) - { - code[s] = std::complex(static_cast(0,0)); - //code[s] = 0; - } + // // fill in zero padding + for (int s = code_length; s < nsamples_total; s++) + { + code[s] = std::complex(static_cast(0, 0)); + //code[s] = 0; + } - memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer - fft_if->execute(); // Run the FFT of local code - volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values + memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer + fft_if->execute(); // Run the FFT of local code + volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values -// // debug -// char filename[25]; -// FILE *fid; -// sprintf(filename,"fft_gal_prn%d.txt", PRN); -// fid = fopen(filename, "w"); -// for (unsigned int kk=0;kk< nsamples_total; kk++) -// { -// fprintf(fid, "%f\n", fft_codes_padded[kk].real()); -// fprintf(fid, "%f\n", fft_codes_padded[kk].imag()); -// } -// fclose(fid); + // // debug + // char filename[25]; + // FILE *fid; + // sprintf(filename,"fft_gal_prn%d.txt", PRN); + // fid = fopen(filename, "w"); + // for (unsigned int kk=0;kk< nsamples_total; kk++) + // { + // fprintf(fid, "%f\n", fft_codes_padded[kk].real()); + // fprintf(fid, "%f\n", fft_codes_padded[kk].imag()); + // } + // fclose(fid); - // normalize the code - max = 0; // initialize maximum value - for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima - { - if (std::abs(fft_codes_padded[i].real()) > max) - { - max = std::abs(fft_codes_padded[i].real()); - } - if (std::abs(fft_codes_padded[i].imag()) > max) - { - max = std::abs(fft_codes_padded[i].imag()); - } - } - for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs - { - //d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(4096*fft_codes_padded[i].real() * (pow(2, 3) - 1) / max)), - // static_cast(floor(4096*fft_codes_padded[i].imag() * (pow(2, 3) - 1) / max))); -// d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(1024*fft_codes_padded[i].real() * (pow(2, 5) - 1) / max)), -// static_cast(floor(1024*fft_codes_padded[i].imag() * (pow(2, 5) - 1) / max))); - // d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(256*fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)), - // static_cast(floor(256*fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max))); -// d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(16*fft_codes_padded[i].real() * (pow(2, 11) - 1) / max)), -// static_cast(floor(16*fft_codes_padded[i].imag() * (pow(2, 11) - 1) / max))); - d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)), - static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max))); + // normalize the code + max = 0; // initialize maximum value + for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima + { + if (std::abs(fft_codes_padded[i].real()) > max) + { + max = std::abs(fft_codes_padded[i].real()); + } + if (std::abs(fft_codes_padded[i].imag()) > max) + { + max = std::abs(fft_codes_padded[i].imag()); + } + } + for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs + { + //d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(4096*fft_codes_padded[i].real() * (pow(2, 3) - 1) / max)), + // static_cast(floor(4096*fft_codes_padded[i].imag() * (pow(2, 3) - 1) / max))); + // d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(1024*fft_codes_padded[i].real() * (pow(2, 5) - 1) / max)), + // static_cast(floor(1024*fft_codes_padded[i].imag() * (pow(2, 5) - 1) / max))); + // d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(256*fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)), + // static_cast(floor(256*fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max))); + // d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(16*fft_codes_padded[i].real() * (pow(2, 11) - 1) / max)), + // static_cast(floor(16*fft_codes_padded[i].imag() * (pow(2, 11) - 1) / max))); + d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)), + static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max))); -// tmp_re = static_cast(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)); -// tmp_im = static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max)); - -// if (tmp_re > 127) -// { -// tmp_re = 127; -// } -// if (tmp_re < -128) -// { -// tmp_re = -128; -// } -// if (tmp_im > 127) -// { -// tmp_im = 127; -// } -// if (tmp_im < -128) -// { -// tmp_im = -128; -// } -// d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(tmp_re), static_cast(tmp_im)); -// - } - -// // debug -// char filename2[25]; -// FILE *fid2; -// sprintf(filename2,"fft_gal_prn%d_norm.txt", PRN); -// fid2 = fopen(filename2, "w"); -// for (unsigned int kk=0;kk< nsamples_total; kk++) -// { -// fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].real()); -// fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].imag()); -// } -// fclose(fid2); + // tmp_re = static_cast(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)); + // tmp_im = static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max)); + // if (tmp_re > 127) + // { + // tmp_re = 127; + // } + // if (tmp_re < -128) + // { + // tmp_re = -128; + // } + // if (tmp_im > 127) + // { + // tmp_im = 127; + // } + // if (tmp_im < -128) + // { + // tmp_im = -128; + // } + // d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(tmp_re), static_cast(tmp_im)); + // + } + // // debug + // char filename2[25]; + // FILE *fid2; + // sprintf(filename2,"fft_gal_prn%d_norm.txt", PRN); + // fid2 = fopen(filename2, "w"); + // for (unsigned int kk=0;kk< nsamples_total; kk++) + // { + // fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].real()); + // fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].imag()); + // } + // fclose(fid2); } -// for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++) -// { -// // debug -// char filename2[25]; -// FILE *fid2; -// sprintf(filename2,"fft_gal_prn%d_norm_last.txt", PRN); -// fid2 = fopen(filename2, "w"); -// for (unsigned int kk=0;kk< nsamples_total; kk++) -// { -// fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].real()); -// fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].imag()); -// } -// fclose(fid2); -// } + // for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++) + // { + // // debug + // char filename2[25]; + // FILE *fid2; + // sprintf(filename2,"fft_gal_prn%d_norm_last.txt", PRN); + // fid2 = fopen(filename2, "w"); + // for (unsigned int kk=0;kk< nsamples_total; kk++) + // { + // fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].real()); + // fprintf(fid2, "%d\n", d_all_fft_codes_[kk + nsamples_total * (PRN - 1)].imag()); + // } + // fclose(fid2); + // } //acq_parameters @@ -284,14 +284,14 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; -// stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); -// DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")"; + // stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); + // DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")"; -// if (item_type_.compare("cbyte") == 0) -// { -// cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); -// float_to_complex_ = gr::blocks::float_to_complex::make(); -// } + // if (item_type_.compare("cbyte") == 0) + // { + // cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); + // float_to_complex_ = gr::blocks::float_to_complex::make(); + // } channel_ = 0; //threshold_ = 0.0; @@ -325,22 +325,22 @@ void GalileoE1PcpsAmbiguousAcquisitionFpga::set_threshold(float threshold) // the .pfa parameter and the threshold calculation is only used for the CFAR algorithm. // We don't use the CFAR algorithm in the FPGA. Therefore the threshold is set as such. -// float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); -// -// if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); -// -// if (pfa == 0.0) -// { -// threshold_ = threshold; -// } -// else -// { -// threshold_ = calculate_threshold(pfa); -// } + // float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + // + // if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); + // + // if (pfa == 0.0) + // { + // threshold_ = threshold; + // } + // else + // { + // threshold_ = calculate_threshold(pfa); + // } DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold; acquisition_fpga_->set_threshold(threshold); -// acquisition_fpga_->set_threshold(threshold_); + // acquisition_fpga_->set_threshold(threshold_); //printf("top acq set threshold end\n"); } @@ -377,7 +377,7 @@ void GalileoE1PcpsAmbiguousAcquisitionFpga::set_gnss_synchro(Gnss_Synchro* gnss_ signed int GalileoE1PcpsAmbiguousAcquisitionFpga::mag() { - // printf("top acq mag start\n"); + // printf("top acq mag start\n"); return acquisition_fpga_->mag(); //printf("top acq mag end\n"); } @@ -385,60 +385,60 @@ signed int GalileoE1PcpsAmbiguousAcquisitionFpga::mag() void GalileoE1PcpsAmbiguousAcquisitionFpga::init() { - // printf("top acq init start\n"); + // printf("top acq init start\n"); acquisition_fpga_->init(); - // printf("top acq init end\n"); + // printf("top acq init end\n"); //set_local_code(); } void GalileoE1PcpsAmbiguousAcquisitionFpga::set_local_code() { - // printf("top acq set local code start\n"); -// bool cboc = configuration_->property( -// "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); -// -// std::complex* code = new std::complex[code_length_]; -// -// if (acquire_pilot_ == true) -// { -// //set local signal generator to Galileo E1 pilot component (1C) -// char pilot_signal[3] = "1C"; -// galileo_e1_code_gen_complex_sampled(code, pilot_signal, -// cboc, gnss_synchro_->PRN, fs_in_, 0, false); -// } -// else -// { -// galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, -// cboc, gnss_synchro_->PRN, fs_in_, 0, false); -// } -// -// -// for (unsigned int i = 0; i < sampled_ms_ / 4; i++) -// { -// memcpy(&(code_[i * code_length_]), code, sizeof(gr_complex) * code_length_); -// } + // printf("top acq set local code start\n"); + // bool cboc = configuration_->property( + // "Acquisition" + boost::lexical_cast(channel_) + ".cboc", false); + // + // std::complex* code = new std::complex[code_length_]; + // + // if (acquire_pilot_ == true) + // { + // //set local signal generator to Galileo E1 pilot component (1C) + // char pilot_signal[3] = "1C"; + // galileo_e1_code_gen_complex_sampled(code, pilot_signal, + // cboc, gnss_synchro_->PRN, fs_in_, 0, false); + // } + // else + // { + // galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, + // cboc, gnss_synchro_->PRN, fs_in_, 0, false); + // } + // + // + // for (unsigned int i = 0; i < sampled_ms_ / 4; i++) + // { + // memcpy(&(code_[i * code_length_]), code, sizeof(gr_complex) * code_length_); + // } //acquisition_fpga_->set_local_code(code_); acquisition_fpga_->set_local_code(); -// delete[] code; - // printf("top acq set local code end\n"); + // delete[] code; + // printf("top acq set local code end\n"); } void GalileoE1PcpsAmbiguousAcquisitionFpga::reset() { - // printf("top acq reset start\n"); + // printf("top acq reset start\n"); acquisition_fpga_->set_active(true); - // printf("top acq reset end\n"); + // printf("top acq reset end\n"); } void GalileoE1PcpsAmbiguousAcquisitionFpga::set_state(int state) { - // printf("top acq set state start\n"); + // printf("top acq set state start\n"); acquisition_fpga_->set_state(state); - // printf("top acq set state end\n"); + // printf("top acq set state end\n"); } @@ -465,26 +465,26 @@ void GalileoE1PcpsAmbiguousAcquisitionFpga::set_state(int state) void GalileoE1PcpsAmbiguousAcquisitionFpga::connect(gr::top_block_sptr top_block) { - // printf("top acq connect\n"); -// if (item_type_.compare("gr_complex") == 0) -// { -// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0); -// } -// else if (item_type_.compare("cshort") == 0) -// { -// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0); -// } -// else if (item_type_.compare("cbyte") == 0) -// { -// top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0); -// top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1); -// top_block->connect(float_to_complex_, 0, stream_to_vector_, 0); -// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0); -// } -// else -// { -// LOG(WARNING) << item_type_ << " unknown acquisition item type"; -// } + // printf("top acq connect\n"); + // if (item_type_.compare("gr_complex") == 0) + // { + // top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0); + // } + // else if (item_type_.compare("cshort") == 0) + // { + // top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0); + // } + // else if (item_type_.compare("cbyte") == 0) + // { + // top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0); + // top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1); + // top_block->connect(float_to_complex_, 0, stream_to_vector_, 0); + // top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0); + // } + // else + // { + // LOG(WARNING) << item_type_ << " unknown acquisition item type"; + // } // nothing to connect } @@ -492,61 +492,60 @@ void GalileoE1PcpsAmbiguousAcquisitionFpga::connect(gr::top_block_sptr top_block void GalileoE1PcpsAmbiguousAcquisitionFpga::disconnect(gr::top_block_sptr top_block) { -// if (item_type_.compare("gr_complex") == 0) -// { -// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0); -// } -// else if (item_type_.compare("cshort") == 0) -// { -// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0); -// } -// else if (item_type_.compare("cbyte") == 0) -// { -// // Since a byte-based acq implementation is not available, -// // we just convert cshorts to gr_complex -// top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); -// top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); -// top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0); -// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0); -// } -// else -// { -// LOG(WARNING) << item_type_ << " unknown acquisition item type"; -// } + // if (item_type_.compare("gr_complex") == 0) + // { + // top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0); + // } + // else if (item_type_.compare("cshort") == 0) + // { + // top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0); + // } + // else if (item_type_.compare("cbyte") == 0) + // { + // // Since a byte-based acq implementation is not available, + // // we just convert cshorts to gr_complex + // top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); + // top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); + // top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0); + // top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0); + // } + // else + // { + // LOG(WARNING) << item_type_ << " unknown acquisition item type"; + // } // nothing to disconnect - // printf("top acq disconnect\n"); + // printf("top acq disconnect\n"); } gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisitionFpga::get_left_block() { - // printf("top acq get left block start\n"); -// if (item_type_.compare("gr_complex") == 0) -// { -// return stream_to_vector_; -// } -// else if (item_type_.compare("cshort") == 0) -// { -// return stream_to_vector_; -// } -// else if (item_type_.compare("cbyte") == 0) -// { -// return cbyte_to_float_x2_; -// } -// else -// { -// LOG(WARNING) << item_type_ << " unknown acquisition item type"; - return nullptr; -// } - // printf("top acq get left block end\n"); + // printf("top acq get left block start\n"); + // if (item_type_.compare("gr_complex") == 0) + // { + // return stream_to_vector_; + // } + // else if (item_type_.compare("cshort") == 0) + // { + // return stream_to_vector_; + // } + // else if (item_type_.compare("cbyte") == 0) + // { + // return cbyte_to_float_x2_; + // } + // else + // { + // LOG(WARNING) << item_type_ << " unknown acquisition item type"; + return nullptr; + // } + // printf("top acq get left block end\n"); } gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisitionFpga::get_right_block() { - // printf("top acq get right block start\n"); + // printf("top acq get right block start\n"); return acquisition_fpga_; - // printf("top acq get right block end\n"); + // printf("top acq get right block end\n"); } - diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h index 6c975e30e..ebb326337 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h @@ -136,6 +136,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; //pcps_acquisition_sptr acquisition_; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc index 625c92396..46a3b1974 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc @@ -40,6 +40,10 @@ using google::LogMessage; +void GalileoE1PcpsCccwsrAmbiguousAcquisition::stop_acquisition() +{ +} + GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h index 54b5ee54e..47c19becb 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h @@ -125,6 +125,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; pcps_cccwsr_acquisition_cc_sptr acquisition_cc_; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc index 34c56ddf9..36ed925df 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc @@ -40,6 +40,10 @@ using google::LogMessage; +void GalileoE1PcpsQuickSyncAmbiguousAcquisition::stop_acquisition() +{ +} + GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcquisition( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h index 5bfa06ca2..1d7b25880 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h @@ -129,6 +129,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; pcps_quicksync_acquisition_cc_sptr acquisition_cc_; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc index 2e5bd5684..4d7038364 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc @@ -40,6 +40,10 @@ using google::LogMessage; +void GalileoE1PcpsTongAmbiguousAcquisition::stop_acquisition() +{ +} + GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h index a47a22329..8524fc8d1 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h @@ -128,6 +128,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; pcps_tong_acquisition_cc_sptr acquisition_cc_; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc index 78d95d36e..e24970d63 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc @@ -46,6 +46,10 @@ using google::LogMessage; +void GalileoE5aNoncoherentIQAcquisitionCaf::stop_acquisition() +{ +} + GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h index 823bdc1ff..6beed3472 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h @@ -131,6 +131,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr acquisition_cc_; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc index cd138e12e..623159d17 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc @@ -42,6 +42,10 @@ using google::LogMessage; +void GalileoE5aPcpsAcquisition::stop_acquisition() +{ +} + GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h index 344e8f5b6..49099cd42 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h @@ -122,6 +122,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: float calculate_threshold(float pfa); diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc index 2901081ac..710bd5237 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -39,15 +39,16 @@ #include - - - using google::LogMessage; +void GalileoE5aPcpsAcquisitionFpga::stop_acquisition() +{ +} + GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { - //printf("creating the E5A acquisition"); + //printf("creating the E5A acquisition"); pcpsconf_fpga_t acq_parameters; configuration_ = configuration; std::string default_item_type = "gr_complex"; @@ -100,7 +101,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf std::string default_device_name = "/dev/uio0"; std::string device_name = configuration_->property(role + ".devicename", default_device_name); acq_parameters.device_name = device_name; - acq_parameters.samples_per_ms = nsamples_total/sampled_ms; + acq_parameters.samples_per_ms = nsamples_total / sampled_ms; acq_parameters.samples_per_code = nsamples_total; //vector_length_ = code_length_ * sampled_ms_; @@ -108,10 +109,10 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf // compute all the GALILEO E5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT - std::complex* code = new std::complex[nsamples_total]; // buffer for the local code + std::complex* code = new std::complex[nsamples_total]; // buffer for the local code gr_complex* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E5a_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32 - float max; // temporary maxima search + float max; // temporary maxima search //printf("creating the E5A acquisition CONT"); //printf("nsamples_total = %d\n", nsamples_total); @@ -140,16 +141,16 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf // fill in zero padding for (int s = code_length; s < nsamples_total; s++) { - code[s] = std::complex(static_cast(0,0)); + code[s] = std::complex(static_cast(0, 0)); //code[s] = 0; } - memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer + memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer fft_if->execute(); // Run the FFT of local code volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values - max = 0; // initialize maximum value - for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima + max = 0; // initialize maximum value + for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima { if (std::abs(fft_codes_padded[i].real()) > max) { @@ -165,7 +166,6 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)), static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max))); } - } @@ -178,19 +178,19 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf //code_ = new gr_complex[vector_length_]; -// if (item_type_.compare("gr_complex") == 0) -// { -// item_size_ = sizeof(gr_complex); -// } -// else if (item_type_.compare("cshort") == 0) -// { -// item_size_ = sizeof(lv_16sc_t); -// } -// else -// { -// item_size_ = sizeof(gr_complex); -// LOG(WARNING) << item_type_ << " unknown acquisition item type"; -// } + // if (item_type_.compare("gr_complex") == 0) + // { + // item_size_ = sizeof(gr_complex); + // } + // else if (item_type_.compare("cshort") == 0) + // { + // item_size_ = sizeof(lv_16sc_t); + // } + // else + // { + // item_size_ = sizeof(gr_complex); + // LOG(WARNING) << item_type_ << " unknown acquisition item type"; + // } //acq_parameters.it_size = item_size_; //acq_parameters.samples_per_code = code_length_; //acq_parameters.samples_per_ms = code_length_; @@ -231,22 +231,22 @@ void GalileoE5aPcpsAcquisitionFpga::set_channel(unsigned int channel) void GalileoE5aPcpsAcquisitionFpga::set_threshold(float threshold) { -// float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); -// -// if (pfa == 0.0) -// { -// pfa = configuration_->property(role_ + ".pfa", 0.0); -// } -// -// if (pfa == 0.0) -// { -// threshold_ = threshold; -// } -// -// else -// { -// threshold_ = calculate_threshold(pfa); -// } + // float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + // + // if (pfa == 0.0) + // { + // pfa = configuration_->property(role_ + ".pfa", 0.0); + // } + // + // if (pfa == 0.0) + // { + // threshold_ = threshold; + // } + // + // else + // { + // threshold_ = calculate_threshold(pfa); + // } DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold; @@ -295,32 +295,32 @@ void GalileoE5aPcpsAcquisitionFpga::init() void GalileoE5aPcpsAcquisitionFpga::set_local_code() { -// gr_complex* code = new gr_complex[code_length_]; -// char signal_[3]; -// -// if (acq_iq_) -// { -// strcpy(signal_, "5X"); -// } -// else if (acq_pilot_) -// { -// strcpy(signal_, "5Q"); -// } -// else -// { -// strcpy(signal_, "5I"); -// } -// -// galileo_e5_a_code_gen_complex_sampled(code, signal_, gnss_synchro_->PRN, fs_in_, 0); -// -// for (unsigned int i = 0; i < sampled_ms_; i++) -// { -// memcpy(code_ + (i * code_length_), code, sizeof(gr_complex) * code_length_); -// } + // gr_complex* code = new gr_complex[code_length_]; + // char signal_[3]; + // + // if (acq_iq_) + // { + // strcpy(signal_, "5X"); + // } + // else if (acq_pilot_) + // { + // strcpy(signal_, "5Q"); + // } + // else + // { + // strcpy(signal_, "5I"); + // } + // + // galileo_e5_a_code_gen_complex_sampled(code, signal_, gnss_synchro_->PRN, fs_in_, 0); + // + // for (unsigned int i = 0; i < sampled_ms_; i++) + // { + // memcpy(code_ + (i * code_length_), code, sizeof(gr_complex) * code_length_); + // } //acquisition_->set_local_code(code_); acquisition_fpga_->set_local_code(); -// delete[] code; + // delete[] code; } @@ -359,35 +359,35 @@ void GalileoE5aPcpsAcquisitionFpga::set_state(int state) void GalileoE5aPcpsAcquisitionFpga::connect(gr::top_block_sptr top_block) { -// if (item_type_.compare("gr_complex") == 0) -// { -// top_block->connect(stream_to_vector_, 0, acquisition_, 0); -// } -// else if (item_type_.compare("cshort") == 0) -// { -// top_block->connect(stream_to_vector_, 0, acquisition_, 0); -// } -// else -// { -// LOG(WARNING) << item_type_ << " unknown acquisition item type"; -// } + // if (item_type_.compare("gr_complex") == 0) + // { + // top_block->connect(stream_to_vector_, 0, acquisition_, 0); + // } + // else if (item_type_.compare("cshort") == 0) + // { + // top_block->connect(stream_to_vector_, 0, acquisition_, 0); + // } + // else + // { + // LOG(WARNING) << item_type_ << " unknown acquisition item type"; + // } } void GalileoE5aPcpsAcquisitionFpga::disconnect(gr::top_block_sptr top_block) { -// if (item_type_.compare("gr_complex") == 0) -// { -// top_block->disconnect(stream_to_vector_, 0, acquisition_, 0); -// } -// else if (item_type_.compare("cshort") == 0) -// { -// top_block->disconnect(stream_to_vector_, 0, acquisition_, 0); -// } -// else -// { -// LOG(WARNING) << item_type_ << " unknown acquisition item type"; -// } + // if (item_type_.compare("gr_complex") == 0) + // { + // top_block->disconnect(stream_to_vector_, 0, acquisition_, 0); + // } + // else if (item_type_.compare("cshort") == 0) + // { + // top_block->disconnect(stream_to_vector_, 0, acquisition_, 0); + // } + // else + // { + // LOG(WARNING) << item_type_ << " unknown acquisition item type"; + // } } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h index 1bdca10cc..94b768438 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h @@ -124,6 +124,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: //float calculate_threshold(float pfa); diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc index 90cfc7014..5b3d1c531 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc @@ -43,6 +43,10 @@ using google::LogMessage; +void GlonassL1CaPcpsAcquisition::stop_acquisition() +{ +} + GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h index 6f4947917..1b519f91e 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h @@ -131,6 +131,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; pcps_acquisition_sptr acquisition_; diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc index 86052d6f2..06ef7aae6 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc @@ -42,6 +42,10 @@ using google::LogMessage; +void GlonassL2CaPcpsAcquisition::stop_acquisition() +{ +} + GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h index f25412d2b..b679f4c26 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h @@ -130,6 +130,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; pcps_acquisition_sptr acquisition_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc index b91223b06..e1b4857ad 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -45,6 +45,10 @@ using google::LogMessage; +void GpsL1CaPcpsAcquisition::stop_acquisition() +{ +} + GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h index 2a4126bd8..011bb96bf 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h @@ -135,6 +135,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; pcps_acquisition_sptr acquisition_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc index 68d67dac8..38bc04716 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc @@ -42,6 +42,10 @@ using google::LogMessage; +void GpsL1CaPcpsAcquisitionFineDoppler::stop_acquisition() +{ +} + GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h index 5fac62916..338ea683a 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h @@ -126,6 +126,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: pcps_acquisition_fine_doppler_cc_sptr acquisition_cc_; size_t item_size_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc index 383e098b3..f9778bfb8 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc @@ -48,6 +48,10 @@ using google::LogMessage; +void GpsL1CaPcpsAcquisitionFpga::stop_acquisition() +{ +} + GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h index 7e74f70e9..8f6d1f3ff 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h @@ -134,6 +134,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; pcps_acquisition_fpga_sptr acquisition_fpga_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc index 528a9a3f2..da1377ac2 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc @@ -42,6 +42,10 @@ using google::LogMessage; +void GpsL1CaPcpsAssistedAcquisition::stop_acquisition() +{ +} + GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h index 83218aac4..ca650bc77 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h @@ -122,6 +122,11 @@ public: void reset() override; void set_state(int state __attribute__((unused))) override{}; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: pcps_assisted_acquisition_cc_sptr acquisition_cc_; size_t item_size_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc index 7c5b84f63..1037a1778 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc @@ -40,6 +40,10 @@ using google::LogMessage; +void GpsL1CaPcpsOpenClAcquisition::stop_acquisition() +{ +} + GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h index 7d3e7b58e..0c6c21f49 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h @@ -124,6 +124,11 @@ public: void reset() override; void set_state(int state __attribute__((unused))) override{}; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; pcps_opencl_acquisition_cc_sptr acquisition_cc_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc index b25be59e0..888d44586 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc @@ -41,6 +41,10 @@ using google::LogMessage; +void GpsL1CaPcpsQuickSyncAcquisition::stop_acquisition() +{ +} + GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h index f38ee7055..c35f97370 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h @@ -130,6 +130,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; pcps_quicksync_acquisition_cc_sptr acquisition_cc_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc index e676d5d9c..5c55d802a 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc @@ -40,6 +40,10 @@ using google::LogMessage; +void GpsL1CaPcpsTongAcquisition::stop_acquisition() +{ +} + GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h index b09f6cde0..562d63e39 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h @@ -129,6 +129,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; pcps_tong_acquisition_cc_sptr acquisition_cc_; diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc index 806adad4e..b10104bd7 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -43,6 +43,10 @@ using google::LogMessage; +void GpsL2MPcpsAcquisition::stop_acquisition() +{ +} + GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h index f1e57b9b5..27c463cf3 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h @@ -133,6 +133,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; pcps_acquisition_sptr acquisition_; diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc index 733f3cea9..fc988724f 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc @@ -43,6 +43,10 @@ using google::LogMessage; +void GpsL2MPcpsAcquisitionFpga::stop_acquisition() +{ +} + GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) @@ -93,7 +97,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( std::string default_device_name = "/dev/uio0"; std::string device_name = configuration_->property(role + ".devicename", default_device_name); acq_parameters.device_name = device_name; - acq_parameters.samples_per_ms = nsamples_total/acq_parameters.sampled_ms; + acq_parameters.samples_per_ms = nsamples_total / acq_parameters.sampled_ms; //acq_parameters.samples_per_ms = static_cast(std::round(static_cast(fs_in_) * 0.001)); acq_parameters.samples_per_code = nsamples_total; @@ -111,10 +115,10 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( // fill in zero padding for (int s = code_length; s < nsamples_total; s++) { - code[s] = std::complex(static_cast(0,0)); + code[s] = std::complex(static_cast(0, 0)); //code[s] = 0; } - memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer + memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer fft_if->execute(); // Run the FFT of local code volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values max = 0; // initialize maximum value @@ -134,7 +138,6 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)), static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max))); } - } //acq_parameters @@ -153,26 +156,23 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( gnss_synchro_ = 0; + // vector_length_ = code_length_; + // + // if (bit_transition_flag_) + // { + // vector_length_ *= 2; + // } - - -// vector_length_ = code_length_; -// -// if (bit_transition_flag_) -// { -// vector_length_ *= 2; -// } - -// code_ = new gr_complex[vector_length_]; -// -// if (item_type_.compare("cshort") == 0) -// { -// item_size_ = sizeof(lv_16sc_t); -// } -// else -// { -// item_size_ = sizeof(gr_complex); -// } + // code_ = new gr_complex[vector_length_]; + // + // if (item_type_.compare("cshort") == 0) + // { + // item_size_ = sizeof(lv_16sc_t); + // } + // else + // { + // item_size_ = sizeof(gr_complex); + // } //acq_parameters.samples_per_ms = static_cast(std::round(static_cast(fs_in_) * 0.001)); //acq_parameters.samples_per_code = code_length_; //acq_parameters.it_size = item_size_; @@ -183,19 +183,19 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( //acquisition_ = pcps_make_acquisition(acq_parameters); DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; -// stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); -// DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")"; -// -// if (item_type_.compare("cbyte") == 0) -// { -// cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); -// float_to_complex_ = gr::blocks::float_to_complex::make(); -// } + // stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); + // DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")"; + // + // if (item_type_.compare("cbyte") == 0) + // { + // cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); + // float_to_complex_ = gr::blocks::float_to_complex::make(); + // } -// channel_ = 0; + // channel_ = 0; threshold_ = 0.0; -// doppler_step_ = 0; -// gnss_synchro_ = 0; + // doppler_step_ = 0; + // gnss_synchro_ = 0; } @@ -215,20 +215,20 @@ void GpsL2MPcpsAcquisitionFpga::set_channel(unsigned int channel) void GpsL2MPcpsAcquisitionFpga::set_threshold(float threshold) { -// float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); -// -// if (pfa == 0.0) -// { -// pfa = configuration_->property(role_ + ".pfa", 0.0); -// } -// if (pfa == 0.0) -// { -// threshold_ = threshold; -// } -// else -// { -// threshold_ = calculate_threshold(pfa); -// } + // float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + // + // if (pfa == 0.0) + // { + // pfa = configuration_->property(role_ + ".pfa", 0.0); + // } + // if (pfa == 0.0) + // { + // threshold_ = threshold; + // } + // else + // { + // threshold_ = calculate_threshold(pfa); + // } DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; @@ -317,25 +317,25 @@ void GpsL2MPcpsAcquisitionFpga::set_state(int state) void GpsL2MPcpsAcquisitionFpga::connect(gr::top_block_sptr top_block) { -// if (item_type_.compare("gr_complex") == 0) -// { -// top_block->connect(stream_to_vector_, 0, acquisition_, 0); -// } -// else if (item_type_.compare("cshort") == 0) -// { -// top_block->connect(stream_to_vector_, 0, acquisition_, 0); -// } -// else if (item_type_.compare("cbyte") == 0) -// { -// top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0); -// top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1); -// top_block->connect(float_to_complex_, 0, stream_to_vector_, 0); -// top_block->connect(stream_to_vector_, 0, acquisition_, 0); -// } -// else -// { -// LOG(WARNING) << item_type_ << " unknown acquisition item type"; -// } + // if (item_type_.compare("gr_complex") == 0) + // { + // top_block->connect(stream_to_vector_, 0, acquisition_, 0); + // } + // else if (item_type_.compare("cshort") == 0) + // { + // top_block->connect(stream_to_vector_, 0, acquisition_, 0); + // } + // else if (item_type_.compare("cbyte") == 0) + // { + // top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0); + // top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1); + // top_block->connect(float_to_complex_, 0, stream_to_vector_, 0); + // top_block->connect(stream_to_vector_, 0, acquisition_, 0); + // } + // else + // { + // LOG(WARNING) << item_type_ << " unknown acquisition item type"; + // } // nothing to connect } @@ -343,27 +343,27 @@ void GpsL2MPcpsAcquisitionFpga::connect(gr::top_block_sptr top_block) void GpsL2MPcpsAcquisitionFpga::disconnect(gr::top_block_sptr top_block) { -// if (item_type_.compare("gr_complex") == 0) -// { -// top_block->disconnect(stream_to_vector_, 0, acquisition_, 0); -// } -// else if (item_type_.compare("cshort") == 0) -// { -// top_block->disconnect(stream_to_vector_, 0, acquisition_, 0); -// } -// else if (item_type_.compare("cbyte") == 0) -// { -// // Since a byte-based acq implementation is not available, -// // we just convert cshorts to gr_complex -// top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); -// top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); -// top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0); -// top_block->disconnect(stream_to_vector_, 0, acquisition_, 0); -// } -// else -// { -// LOG(WARNING) << item_type_ << " unknown acquisition item type"; -// } + // if (item_type_.compare("gr_complex") == 0) + // { + // top_block->disconnect(stream_to_vector_, 0, acquisition_, 0); + // } + // else if (item_type_.compare("cshort") == 0) + // { + // top_block->disconnect(stream_to_vector_, 0, acquisition_, 0); + // } + // else if (item_type_.compare("cbyte") == 0) + // { + // // Since a byte-based acq implementation is not available, + // // we just convert cshorts to gr_complex + // top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); + // top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); + // top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0); + // top_block->disconnect(stream_to_vector_, 0, acquisition_, 0); + // } + // else + // { + // LOG(WARNING) << item_type_ << " unknown acquisition item type"; + // } // nothing to disconnect } @@ -371,23 +371,23 @@ void GpsL2MPcpsAcquisitionFpga::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GpsL2MPcpsAcquisitionFpga::get_left_block() { -// if (item_type_.compare("gr_complex") == 0) -// { -// return stream_to_vector_; -// } -// else if (item_type_.compare("cshort") == 0) -// { -// return stream_to_vector_; -// } -// else if (item_type_.compare("cbyte") == 0) -// { -// return cbyte_to_float_x2_; -// } -// else -// { -// LOG(WARNING) << item_type_ << " unknown acquisition item type"; -// return nullptr; -// } + // if (item_type_.compare("gr_complex") == 0) + // { + // return stream_to_vector_; + // } + // else if (item_type_.compare("cshort") == 0) + // { + // return stream_to_vector_; + // } + // else if (item_type_.compare("cbyte") == 0) + // { + // return cbyte_to_float_x2_; + // } + // else + // { + // LOG(WARNING) << item_type_ << " unknown acquisition item type"; + // return nullptr; + // } return nullptr; } diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h index 9f7912628..b9aba8787 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h @@ -134,6 +134,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; //pcps_acquisition_sptr acquisition_; diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc index a0b072a31..13ac34ec5 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc @@ -43,6 +43,10 @@ using google::LogMessage; +void GpsL5iPcpsAcquisition::stop_acquisition() +{ +} + GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h index 2b4d86eeb..3c4d2ad46 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h @@ -133,6 +133,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; pcps_acquisition_sptr acquisition_; diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc index 57e986d66..d03663d79 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc @@ -43,12 +43,16 @@ using google::LogMessage; +void GpsL5iPcpsAcquisitionFpga::stop_acquisition() +{ +} + GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { - //printf("L5 ACQ CLASS CREATED\n"); - pcpsconf_fpga_t acq_parameters; + //printf("L5 ACQ CLASS CREATED\n"); + pcpsconf_fpga_t acq_parameters; configuration_ = configuration; std::string default_item_type = "gr_complex"; std::string default_dump_filename = "./data/acquisition.dat"; @@ -110,48 +114,46 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( //printf("L5 ACQ CLASS MID 1 vector_length = %d\n", vector_length); - float max; // temporary maxima search + float max; // temporary maxima search for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) - { - //printf("L5 ACQ CLASS processing PRN = %d\n", PRN); - gps_l5i_code_gen_complex_sampled(code, PRN, fs_in); - //printf("L5 ACQ CLASS processing PRN = %d (cont) \n", PRN); - // fill in zero padding - for (int s = code_length; s < nsamples_total; s++) - { - code[s] = std::complex(static_cast(0,0)); - //code[s] = 0; - } - memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer - fft_if->execute(); // Run the FFT of local code - volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values + { + //printf("L5 ACQ CLASS processing PRN = %d\n", PRN); + gps_l5i_code_gen_complex_sampled(code, PRN, fs_in); + //printf("L5 ACQ CLASS processing PRN = %d (cont) \n", PRN); + // fill in zero padding + for (int s = code_length; s < nsamples_total; s++) + { + code[s] = std::complex(static_cast(0, 0)); + //code[s] = 0; + } + memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer + fft_if->execute(); // Run the FFT of local code + volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values - max = 0; // initialize maximum value - for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima - { - if (std::abs(fft_codes_padded[i].real()) > max) - { - max = std::abs(fft_codes_padded[i].real()); - } - if (std::abs(fft_codes_padded[i].imag()) > max) - { - max = std::abs(fft_codes_padded[i].imag()); - } - } - for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs - { - //d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(256*fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)), - // static_cast(floor(256*fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max))); - //d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(16*floor(fft_codes_padded[i].real() * (pow(2, 11) - 1) / max)), - // static_cast(16*floor(fft_codes_padded[i].imag() * (pow(2, 11) - 1) / max))); - //d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)), - // static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max))); - d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)), - static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max))); - } - - - } + max = 0; // initialize maximum value + for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima + { + if (std::abs(fft_codes_padded[i].real()) > max) + { + max = std::abs(fft_codes_padded[i].real()); + } + if (std::abs(fft_codes_padded[i].imag()) > max) + { + max = std::abs(fft_codes_padded[i].imag()); + } + } + for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs + { + //d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(256*fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)), + // static_cast(floor(256*fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max))); + //d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(16*floor(fft_codes_padded[i].real() * (pow(2, 11) - 1) / max)), + // static_cast(16*floor(fft_codes_padded[i].imag() * (pow(2, 11) - 1) / max))); + //d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)), + // static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max))); + d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(fft_codes_padded[i].real() * (pow(2, 15) - 1) / max)), + static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 15) - 1) / max))); + } + } //printf("L5 ACQ CLASS MID 2\n"); @@ -163,47 +165,47 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( delete[] code; delete fft_if; delete[] fft_codes_padded; -// vector_length_ = code_length_; -// -// if (bit_transition_flag_) -// { -// vector_length_ *= 2; -// } -// -// code_ = new gr_complex[vector_length_]; -// -// if (item_type_.compare("cshort") == 0) -// { -// item_size_ = sizeof(lv_16sc_t); -// } -// else -// { -// item_size_ = sizeof(gr_complex); -// } -// acq_parameters.samples_per_code = code_length_; -// acq_parameters.samples_per_ms = code_length_; -// acq_parameters.it_size = item_size_; + // vector_length_ = code_length_; + // + // if (bit_transition_flag_) + // { + // vector_length_ *= 2; + // } + // + // code_ = new gr_complex[vector_length_]; + // + // if (item_type_.compare("cshort") == 0) + // { + // item_size_ = sizeof(lv_16sc_t); + // } + // else + // { + // item_size_ = sizeof(gr_complex); + // } + // acq_parameters.samples_per_code = code_length_; + // acq_parameters.samples_per_ms = code_length_; + // acq_parameters.it_size = item_size_; //acq_parameters.sampled_ms = 1; -// acq_parameters.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4); -// acq_parameters.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0); -// acq_parameters.make_2_steps = configuration_->property(role + ".make_two_steps", false); -// acquisition_fpga_ = pcps_make_acquisition(acq_parameters); -// DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; + // acq_parameters.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4); + // acq_parameters.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0); + // acq_parameters.make_2_steps = configuration_->property(role + ".make_two_steps", false); + // acquisition_fpga_ = pcps_make_acquisition(acq_parameters); + // DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; -// stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); -// DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")"; -// -// if (item_type_.compare("cbyte") == 0) -// { -// cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); -// float_to_complex_ = gr::blocks::float_to_complex::make(); -// } + // stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); + // DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")"; + // + // if (item_type_.compare("cbyte") == 0) + // { + // cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); + // float_to_complex_ = gr::blocks::float_to_complex::make(); + // } channel_ = 0; -// threshold_ = 0.0; + // threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = 0; //printf("L5 ACQ CLASS FINISHED\n"); @@ -221,34 +223,32 @@ void GpsL5iPcpsAcquisitionFpga::set_channel(unsigned int channel) { channel_ = channel; acquisition_fpga_->set_channel(channel_); - } void GpsL5iPcpsAcquisitionFpga::set_threshold(float threshold) { -// float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); -// -// if (pfa == 0.0) -// { -// pfa = configuration_->property(role_ + ".pfa", 0.0); -// } -// if (pfa == 0.0) -// { -// threshold_ = threshold; -// } -// else -// { -// threshold_ = calculate_threshold(pfa); -// } + // float pfa = configuration_->property(role_ + boost::lexical_cast(channel_) + ".pfa", 0.0); + // + // if (pfa == 0.0) + // { + // pfa = configuration_->property(role_ + ".pfa", 0.0); + // } + // if (pfa == 0.0) + // { + // threshold_ = threshold; + // } + // else + // { + // threshold_ = calculate_threshold(pfa); + // } -// DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; + // DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; // the .pfa parameter and the threshold calculation is only used for the CFAR algorithm. // We don't use the CFAR algorithm in the FPGA. Therefore the threshold is set as such. DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold; acquisition_fpga_->set_threshold(threshold); - } @@ -277,18 +277,18 @@ void GpsL5iPcpsAcquisitionFpga::set_gnss_synchro(Gnss_Synchro* gnss_synchro) signed int GpsL5iPcpsAcquisitionFpga::mag() { - return acquisition_fpga_->mag(); + return acquisition_fpga_->mag(); } void GpsL5iPcpsAcquisitionFpga::init() { - acquisition_fpga_->init(); + acquisition_fpga_->init(); } void GpsL5iPcpsAcquisitionFpga::set_local_code() { - acquisition_fpga_->set_local_code(); + acquisition_fpga_->set_local_code(); } @@ -325,75 +325,75 @@ void GpsL5iPcpsAcquisitionFpga::set_state(int state) void GpsL5iPcpsAcquisitionFpga::connect(gr::top_block_sptr top_block) { -// if (item_type_.compare("gr_complex") == 0) -// { -// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0); -// } -// else if (item_type_.compare("cshort") == 0) -// { -// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0); -// } -// else if (item_type_.compare("cbyte") == 0) -// { -// top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0); -// top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1); -// top_block->connect(float_to_complex_, 0, stream_to_vector_, 0); -// top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0); -// } -// else -// { -// LOG(WARNING) << item_type_ << " unknown acquisition item type"; -// } + // if (item_type_.compare("gr_complex") == 0) + // { + // top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0); + // } + // else if (item_type_.compare("cshort") == 0) + // { + // top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0); + // } + // else if (item_type_.compare("cbyte") == 0) + // { + // top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0); + // top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1); + // top_block->connect(float_to_complex_, 0, stream_to_vector_, 0); + // top_block->connect(stream_to_vector_, 0, acquisition_fpga_, 0); + // } + // else + // { + // LOG(WARNING) << item_type_ << " unknown acquisition item type"; + // } // nothing to connect } void GpsL5iPcpsAcquisitionFpga::disconnect(gr::top_block_sptr top_block) { -// if (item_type_.compare("gr_complex") == 0) -// { -// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0); -// } -// else if (item_type_.compare("cshort") == 0) -// { -// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0); -// } -// else if (item_type_.compare("cbyte") == 0) -// { -// // Since a byte-based acq implementation is not available, -// // we just convert cshorts to gr_complex -// top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); -// top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); -// top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0); -// top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0); -// } -// else -// { -// LOG(WARNING) << item_type_ << " unknown acquisition item type"; -// } + // if (item_type_.compare("gr_complex") == 0) + // { + // top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0); + // } + // else if (item_type_.compare("cshort") == 0) + // { + // top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0); + // } + // else if (item_type_.compare("cbyte") == 0) + // { + // // Since a byte-based acq implementation is not available, + // // we just convert cshorts to gr_complex + // top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0); + // top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1); + // top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0); + // top_block->disconnect(stream_to_vector_, 0, acquisition_fpga_, 0); + // } + // else + // { + // LOG(WARNING) << item_type_ << " unknown acquisition item type"; + // } // nothing to disconnect } gr::basic_block_sptr GpsL5iPcpsAcquisitionFpga::get_left_block() { -// if (item_type_.compare("gr_complex") == 0) -// { -// return stream_to_vector_; -// } -// else if (item_type_.compare("cshort") == 0) -// { -// return stream_to_vector_; -// } -// else if (item_type_.compare("cbyte") == 0) -// { -// return cbyte_to_float_x2_; -// } -// else -// { -// LOG(WARNING) << item_type_ << " unknown acquisition item type"; -// return nullptr; -// } + // if (item_type_.compare("gr_complex") == 0) + // { + // return stream_to_vector_; + // } + // else if (item_type_.compare("cshort") == 0) + // { + // return stream_to_vector_; + // } + // else if (item_type_.compare("cbyte") == 0) + // { + // return cbyte_to_float_x2_; + // } + // else + // { + // LOG(WARNING) << item_type_ << " unknown acquisition item type"; + // return nullptr; + // } return nullptr; } diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h index f7115aaa2..af916d3d5 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h @@ -134,6 +134,11 @@ public: */ void set_state(int state) override; + /*! + * \brief Stop running acquisition + */ + void stop_acquisition() override; + private: ConfigurationInterface* configuration_; //pcps_acquisition_sptr acquisition_; diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index c16f25422..8e4a3120d 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -196,6 +196,19 @@ void Channel::set_signal(const Gnss_Signal& gnss_signal) } +void Channel::stop_channel() +{ + std::lock_guard lk(mx); + bool result = channel_fsm_->Event_stop_channel(); + if (!result) + { + LOG(WARNING) << "Invalid channel event"; + return; + } + DLOG(INFO) + << "Channel stop_channel()"; +} + void Channel::start_acquisition() { std::lock_guard lk(mx); diff --git a/src/algorithms/channel/adapters/channel.h b/src/algorithms/channel/adapters/channel.h index 780ee1ec2..3802ff107 100644 --- a/src/algorithms/channel/adapters/channel.h +++ b/src/algorithms/channel/adapters/channel.h @@ -73,21 +73,17 @@ public: gr::basic_block_sptr get_right_block() override; inline std::string role() override { return role_; } - //! Returns "Channel" inline std::string implementation() override { return implementation_; } - inline size_t item_size() override { return 0; } - inline Gnss_Signal get_signal() const override { return gnss_signal_; } - void start_acquisition() override; //!< Start the State Machine + void stop_channel() override; //!< Stop the State Machine void set_signal(const Gnss_Signal& gnss_signal_) override; //!< Sets the channel GNSS signal inline std::shared_ptr acquisition() { return acq_; } inline std::shared_ptr tracking() { return trk_; } inline std::shared_ptr telemetry() { return nav_; } - void msg_handler_events(pmt::pmt_t msg); private: diff --git a/src/algorithms/channel/libs/channel_fsm.cc b/src/algorithms/channel/libs/channel_fsm.cc index 4296ccf0d..5b212193a 100644 --- a/src/algorithms/channel/libs/channel_fsm.cc +++ b/src/algorithms/channel/libs/channel_fsm.cc @@ -52,6 +52,28 @@ ChannelFsm::ChannelFsm(std::shared_ptr acquisition) : acq_ } +bool ChannelFsm::Event_stop_channel() +{ + std::lock_guard lk(mx); + DLOG(INFO) << "CH = " << channel_ << ". Ev stop channel"; + switch (d_state) + { + case 0: //already in stanby + return true; + break; + case 1: //acquisition + d_state = 0; + stop_acquisition(); + break; + case 2: //tracking + d_state = 0; + stop_tracking(); + break; + default: + return true; + } +} + bool ChannelFsm::Event_start_acquisition() { std::lock_guard lk(mx); @@ -165,6 +187,17 @@ void ChannelFsm::set_channel(uint32_t channel) } +void ChannelFsm::stop_acquisition() +{ + acq_->stop_acquisition(); +} + +void ChannelFsm::stop_tracking() +{ + trk_->stop_tracking(); +} + + void ChannelFsm::start_acquisition() { acq_->reset(); diff --git a/src/algorithms/channel/libs/channel_fsm.h b/src/algorithms/channel/libs/channel_fsm.h index d1fe8e1bf..c2ee6c728 100644 --- a/src/algorithms/channel/libs/channel_fsm.h +++ b/src/algorithms/channel/libs/channel_fsm.h @@ -58,6 +58,7 @@ public: //FSM EVENTS bool Event_start_acquisition(); bool Event_valid_acquisition(); + bool Event_stop_channel(); bool Event_failed_acquisition_repeat(); bool Event_failed_acquisition_no_repeat(); bool Event_failed_tracking_standby(); @@ -65,6 +66,8 @@ public: private: void start_acquisition(); void start_tracking(); + void stop_acquisition(); + void stop_tracking(); void request_satellite(); void notify_stop_tracking(); diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc index 8a57fd975..336db4fff 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc @@ -45,6 +45,10 @@ using google::LogMessage; +void GalileoE1DllPllVemlTracking::stop_tracking() +{ +} + GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h index 7904b958d..f6193fde5 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h @@ -92,6 +92,10 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; private: dll_pll_veml_tracking_sptr tracking_; diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc index cd4b2f84b..e3210911b 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc @@ -46,12 +46,16 @@ using google::LogMessage; +void GalileoE1DllPllVemlTrackingFpga::stop_tracking() +{ +} + GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { //dllpllconf_t trk_param; - Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); + Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## std::string default_item_type = "gr_complex"; @@ -126,23 +130,23 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( unsigned int device_base = configuration->property(role + ".device_base", 1); trk_param_fpga.device_base = device_base; //unsigned int multicorr_type = configuration->property(role + ".multicorr_type", 1); - trk_param_fpga.multicorr_type = 1; // 0 -> 3 correlators, 1 -> 5 correlators + trk_param_fpga.multicorr_type = 1; // 0 -> 3 correlators, 1 -> 5 correlators //################# PRE-COMPUTE ALL THE CODES ################# unsigned int code_samples_per_chip = 2; - d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* code_samples_per_chip * Galileo_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); - float * ca_codes_f; - float * data_codes_f; + d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * Galileo_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); + float* ca_codes_f; + float* data_codes_f; if (trk_param_fpga.track_pilot) { - d_data_codes = static_cast(volk_gnsssdr_malloc((static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * Galileo_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); + d_data_codes = static_cast(volk_gnsssdr_malloc((static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * Galileo_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); } - ca_codes_f = static_cast(volk_gnsssdr_malloc(static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment())); + ca_codes_f = static_cast(volk_gnsssdr_malloc(static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment())); if (trk_param_fpga.track_pilot) { - data_codes_f = static_cast(volk_gnsssdr_malloc((static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment())); + data_codes_f = static_cast(volk_gnsssdr_malloc((static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment())); } //printf("pppppppp trk_param_fpga.track_pilot = %d\n", trk_param_fpga.track_pilot); @@ -159,12 +163,11 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( galileo_e1_code_gen_sinboc11_float(ca_codes_f, pilot_signal, PRN); galileo_e1_code_gen_sinboc11_float(data_codes_f, data_signal, PRN); - for (unsigned int s = 0; s < 2*Galileo_E1_B_CODE_LENGTH_CHIPS; s++) + for (unsigned int s = 0; s < 2 * Galileo_E1_B_CODE_LENGTH_CHIPS; s++) { - d_ca_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s] = static_cast(ca_codes_f[s]); - d_data_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s] = static_cast(data_codes_f[s]); + d_ca_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast(ca_codes_f[s]); + d_data_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast(data_codes_f[s]); //printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]); - } //printf("\n next \n"); //scanf ("%d",&kk); @@ -174,15 +177,14 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( //printf("no tracking pilot\n"); galileo_e1_code_gen_sinboc11_float(ca_codes_f, data_signal, PRN); - for (unsigned int s = 0; s < 2*Galileo_E1_B_CODE_LENGTH_CHIPS; s++) + for (unsigned int s = 0; s < 2 * Galileo_E1_B_CODE_LENGTH_CHIPS; s++) { - d_ca_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s] = static_cast(ca_codes_f[s]); + d_ca_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast(ca_codes_f[s]); //printf("%f %d | ", ca_codes_f[s], d_ca_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]); } //printf("\n next \n"); //scanf ("%d",&kk); } - } delete[] ca_codes_f; @@ -193,7 +195,7 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( trk_param_fpga.ca_codes = d_ca_codes; trk_param_fpga.data_codes = d_data_codes; trk_param_fpga.code_length_chips = Galileo_E1_B_CODE_LENGTH_CHIPS; - trk_param_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip + trk_param_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip //################# MAKE TRACKING GNURadio object ################### tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga); channel_ = 0; @@ -207,7 +209,6 @@ GalileoE1DllPllVemlTrackingFpga::~GalileoE1DllPllVemlTrackingFpga() if (d_track_pilot) { delete[] d_data_codes; - } } diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.h b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.h index 794e5596c..55d8127ee 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.h @@ -93,6 +93,12 @@ public: void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; + + private: //dll_pll_veml_tracking_sptr tracking_; dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc; @@ -104,7 +110,6 @@ private: int* d_ca_codes; int* d_data_codes; bool d_track_pilot; - }; diff --git a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc index 51e526173..5b21f41ee 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc @@ -44,6 +44,10 @@ using google::LogMessage; +void GalileoE1TcpConnectorTracking::stop_tracking() +{ +} + GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h index ae4b38220..8a75834d6 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h +++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h @@ -93,6 +93,10 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; private: galileo_e1_tcp_connector_tracking_cc_sptr tracking_; diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc index 00b37d7c1..d58e28e16 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc @@ -45,6 +45,10 @@ using google::LogMessage; +void GalileoE5aDllPllTracking::stop_tracking() +{ +} + GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h index 484754b23..c9444f503 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h @@ -91,6 +91,10 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; private: dll_pll_veml_tracking_sptr tracking_; diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc index 8be397a02..a003924f2 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc @@ -46,14 +46,18 @@ using google::LogMessage; +void GalileoE5aDllPllTrackingFpga::stop_tracking() +{ +} + GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( - ConfigurationInterface* configuration, std::string role, + ConfigurationInterface *configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { - //printf("creating the E5A tracking"); + //printf("creating the E5A tracking"); - Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); + Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## std::string default_item_type = "gr_complex"; @@ -126,7 +130,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( unsigned int device_base = configuration->property(role + ".device_base", 1); trk_param_fpga.device_base = device_base; //unsigned int multicorr_type = configuration->property(role + ".multicorr_type", 1); - trk_param_fpga.multicorr_type = 1; // 0 -> 3 correlators, 1 -> up to 5+1 correlators + trk_param_fpga.multicorr_type = 1; // 0 -> 3 correlators, 1 -> up to 5+1 correlators //################# PRE-COMPUTE ALL THE CODES ################# unsigned int code_samples_per_chip = 1; @@ -143,7 +147,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( } tracking_code = static_cast(volk_gnsssdr_malloc(code_samples_per_chip * code_length_chips * sizeof(float), volk_gnsssdr_get_alignment())); - d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(code_length_chips)* code_samples_per_chip * Galileo_E5a_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); + d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(code_length_chips) * code_samples_per_chip * Galileo_E5a_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); if (trk_param_fpga.track_pilot) { @@ -153,44 +157,36 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( for (unsigned int PRN = 1; PRN <= Galileo_E5a_NUMBER_OF_CODES; PRN++) { + //galileo_e5_a_code_gen_complex_primary(aux_code, PRN, const_cast(trk_param_fpga.signal.c_str())); + galileo_e5_a_code_gen_complex_primary(aux_code, PRN, const_cast(sig_)); + if (trk_param_fpga.track_pilot) + { + //d_secondary_code_string = const_cast(&Galileo_E5a_Q_SECONDARY_CODE[PRN - 1]); + for (unsigned int i = 0; i < code_length_chips; i++) + { + tracking_code[i] = aux_code[i].imag(); + data_code[i] = aux_code[i].real(); + } + for (unsigned int s = 0; s < code_length_chips; s++) + { + d_ca_codes[static_cast(code_length_chips) * (PRN - 1) + s] = static_cast(tracking_code[s]); + d_data_codes[static_cast(code_length_chips) * (PRN - 1) + s] = static_cast(data_code[s]); + //printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]); + } + } + else + { + for (unsigned int i = 0; i < code_length_chips; i++) + { + tracking_code[i] = aux_code[i].real(); + } - - - //galileo_e5_a_code_gen_complex_primary(aux_code, PRN, const_cast(trk_param_fpga.signal.c_str())); - galileo_e5_a_code_gen_complex_primary(aux_code, PRN, const_cast(sig_)); - if (trk_param_fpga.track_pilot) - { - //d_secondary_code_string = const_cast(&Galileo_E5a_Q_SECONDARY_CODE[PRN - 1]); - for (unsigned int i = 0; i < code_length_chips; i++) - { - tracking_code[i] = aux_code[i].imag(); - data_code[i] = aux_code[i].real(); - } - for (unsigned int s = 0; s < code_length_chips; s++) - { - d_ca_codes[static_cast(code_length_chips) * (PRN - 1) + s] = static_cast(tracking_code[s]); - d_data_codes[static_cast(code_length_chips) * (PRN - 1) + s] = static_cast(data_code[s]); - //printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]); - - } - - } - else - { - for (unsigned int i = 0; i < code_length_chips; i++) - { - tracking_code[i] = aux_code[i].real(); - } - - for (unsigned int s = 0; s < code_length_chips; s++) - { - d_ca_codes[static_cast(code_length_chips)* (PRN - 1) + s] = static_cast(tracking_code[s]); - //printf("%f %d | ", ca_codes_f[s], d_ca_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]); - } - - } - - + for (unsigned int s = 0; s < code_length_chips; s++) + { + d_ca_codes[static_cast(code_length_chips) * (PRN - 1) + s] = static_cast(tracking_code[s]); + //printf("%f %d | ", ca_codes_f[s], d_ca_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]); + } + } } volk_gnsssdr_free(aux_code); @@ -202,25 +198,23 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( trk_param_fpga.ca_codes = d_ca_codes; trk_param_fpga.data_codes = d_data_codes; trk_param_fpga.code_length_chips = code_length_chips; - trk_param_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip + trk_param_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip //################# MAKE TRACKING GNURadio object ################### tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga); -// if (item_type.compare("gr_complex") == 0) -// { -// item_size_ = sizeof(gr_complex); -// tracking_ = dll_pll_veml_make_tracking(trk_param_fpga); -// } -// else -// { -// item_size_ = sizeof(gr_complex); -// LOG(WARNING) << item_type << " unknown tracking item type."; -// } + // if (item_type.compare("gr_complex") == 0) + // { + // item_size_ = sizeof(gr_complex); + // tracking_ = dll_pll_veml_make_tracking(trk_param_fpga); + // } + // else + // { + // item_size_ = sizeof(gr_complex); + // LOG(WARNING) << item_type << " unknown tracking item type."; + // } channel_ = 0; //DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")"; DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")"; - - } @@ -230,7 +224,6 @@ GalileoE5aDllPllTrackingFpga::~GalileoE5aDllPllTrackingFpga() if (d_track_pilot) { delete[] d_data_codes; - } } @@ -247,14 +240,14 @@ void GalileoE5aDllPllTrackingFpga::start_tracking() */ void GalileoE5aDllPllTrackingFpga::set_channel(unsigned int channel) { - //printf("blabla channel = %d\n", channel); + //printf("blabla channel = %d\n", channel); channel_ = channel; //tracking_->set_channel(channel); tracking_fpga_sc->set_channel(channel); } -void GalileoE5aDllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void GalileoE5aDllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { //tracking_->set_gnss_synchro(p_gnss_synchro); tracking_fpga_sc->set_gnss_synchro(p_gnss_synchro); diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.h b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.h index 8dce1b428..45325d458 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.h @@ -91,6 +91,10 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; private: dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc; @@ -104,7 +108,6 @@ private: int* d_ca_codes; int* d_data_codes; bool d_track_pilot; - }; #endif /* GNSS_SDR_GALILEO_E5A_DLL_PLL_TRACKING_FPGA_H_ */ diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc index 16e212a9c..2287f53ba 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc @@ -46,6 +46,10 @@ using google::LogMessage; +void GlonassL1CaDllPllCAidTracking::stop_tracking() +{ +} + GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.h b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.h index 3f75715dc..26e1f0db9 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.h +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.h @@ -93,6 +93,10 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; private: glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc; diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc index c616595d5..eb5f35176 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc @@ -45,6 +45,10 @@ using google::LogMessage; +void GlonassL1CaDllPllTracking::stop_tracking() +{ +} + GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h index f752239d3..d5e1a4544 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h @@ -91,6 +91,10 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; private: glonass_l1_ca_dll_pll_tracking_cc_sptr tracking_; diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc index be2bb41d3..d4d0d0e98 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc @@ -44,6 +44,10 @@ using google::LogMessage; +void GlonassL2CaDllPllCAidTracking::stop_tracking() +{ +} + GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.h b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.h index bdd377b75..085cf73ac 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.h +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.h @@ -91,6 +91,10 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; private: glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc; diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc index 6d9a9f1ea..a6a49aa1c 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc @@ -43,6 +43,10 @@ using google::LogMessage; +void GlonassL2CaDllPllTracking::stop_tracking() +{ +} + GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.h b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.h index 66346bd71..1c2b715ed 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.h @@ -90,6 +90,10 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; private: glonass_l2_ca_dll_pll_tracking_cc_sptr tracking_; diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc index 9ce706ef3..c821d311d 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc @@ -45,6 +45,10 @@ using google::LogMessage; +void GpsL1CaDllPllCAidTracking::stop_tracking() +{ +} + GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h index 357a5a0c1..6b4dec2e5 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h @@ -92,6 +92,10 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; private: gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc; diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc index b9a8b2c6e..f674ff33e 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc @@ -45,6 +45,11 @@ using google::LogMessage; +void GpsL1CaDllPllTracking::stop_tracking() +{ + tracking_->stop_tracking(); +} + GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h index b85147b58..cbd4797f2 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h @@ -91,6 +91,11 @@ public: void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; + private: dll_pll_veml_tracking_sptr tracking_; size_t item_size_; diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc index 06d59e91f..3296dfc7d 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc @@ -48,14 +48,17 @@ using google::LogMessage; -GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) +void GpsL1CaDllPllTrackingFpga::stop_tracking() { - Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); +} + +GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) +{ + Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); DLOG(INFO) << "role " << role; - + //################# CONFIGURATION PARAMETERS ######################## //std::string default_item_type = "gr_complex"; //std::string item_type = configuration->property(role + ".item_type", default_item_type); @@ -130,23 +133,22 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( unsigned int device_base = configuration->property(role + ".device_base", 1); trk_param_fpga.device_base = device_base; //unsigned int multicorr_type = configuration->property(role + ".multicorr_type", 0); - trk_param_fpga.multicorr_type = 0; //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators + trk_param_fpga.multicorr_type = 0; //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators //################# PRE-COMPUTE ALL THE CODES ################# - d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS*NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment())); + d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment())); for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) - { - gps_l1_ca_code_gen_int(&d_ca_codes[(int(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)], PRN, 0); - } + { + gps_l1_ca_code_gen_int(&d_ca_codes[(int(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)], PRN, 0); + } trk_param_fpga.ca_codes = d_ca_codes; trk_param_fpga.code_length_chips = GPS_L1_CA_CODE_LENGTH_CHIPS; - trk_param_fpga.code_samples_per_chip = 1; // 1 sample per chip + trk_param_fpga.code_samples_per_chip = 1; // 1 sample per chip //################# MAKE TRACKING GNURadio object ################### tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga); channel_ = 0; DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")"; - } GpsL1CaDllPllTrackingFpga::~GpsL1CaDllPllTrackingFpga() @@ -175,14 +177,18 @@ void GpsL1CaDllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) void GpsL1CaDllPllTrackingFpga::connect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to connect } void GpsL1CaDllPllTrackingFpga::disconnect(gr::top_block_sptr top_block) { - if(top_block) { /* top_block is not null */}; + if (top_block) + { /* top_block is not null */ + }; //nothing to disconnect } @@ -197,5 +203,3 @@ gr::basic_block_sptr GpsL1CaDllPllTrackingFpga::get_right_block() { return tracking_fpga_sc; } - - diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.h index ea9c98423..80b998246 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.h @@ -53,9 +53,9 @@ class GpsL1CaDllPllTrackingFpga : public TrackingInterface { public: GpsL1CaDllPllTrackingFpga(ConfigurationInterface* configuration, - std::string role, - unsigned int in_streams, - unsigned int out_streams); + std::string role, + unsigned int in_streams, + unsigned int out_streams); virtual ~GpsL1CaDllPllTrackingFpga(); @@ -93,10 +93,13 @@ public: void start_tracking() override; - //void reset(void); - + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; + private: - dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc; + dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc; size_t item_size_; unsigned int channel_; std::string role_; @@ -105,4 +108,4 @@ private: int* d_ca_codes; }; -#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_H_ +#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_H_ diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc index 0cccd8e26..c82f228b5 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc @@ -44,6 +44,10 @@ using google::LogMessage; +void GpsL1CaDllPllTrackingGPU::stop_tracking() +{ +} + GpsL1CaDllPllTrackingGPU::GpsL1CaDllPllTrackingGPU( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h index 9c77f4743..794152bb8 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h @@ -91,6 +91,11 @@ public: void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; + private: gps_l1_ca_dll_pll_tracking_gpu_cc_sptr tracking_; size_t item_size_; diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc index 38b3e3cad..2c33723e6 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc @@ -47,6 +47,10 @@ using google::LogMessage; +void GpsL1CaKfTracking::stop_tracking() +{ +} + GpsL1CaKfTracking::GpsL1CaKfTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.h index e17831ffb..d8af76ce8 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.h @@ -93,6 +93,11 @@ public: void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; + private: gps_l1_ca_kf_tracking_cc_sptr tracking_; size_t item_size_; diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc index d0303867c..9e3cf4bfa 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc @@ -43,6 +43,10 @@ using google::LogMessage; +void GpsL1CaTcpConnectorTracking::stop_tracking() +{ +} + GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h index 75a986cfc..f2fb94b3a 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h @@ -91,6 +91,10 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; private: gps_l1_ca_tcp_connector_tracking_cc_sptr tracking_; diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc index 499427dfa..679a78cae 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc @@ -45,6 +45,10 @@ using google::LogMessage; +void GpsL2MDllPllTracking::stop_tracking() +{ +} + GpsL2MDllPllTracking::GpsL2MDllPllTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h index 68305ad6a..23835c405 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h @@ -90,6 +90,10 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; private: dll_pll_veml_tracking_sptr tracking_; diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc index 5cdf87185..19b9333b9 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc @@ -47,12 +47,16 @@ using google::LogMessage; +void GpsL2MDllPllTrackingFpga::stop_tracking() +{ +} + GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { //dllpllconf_t trk_param; - Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); + Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## //std::string default_item_type = "gr_complex"; @@ -115,43 +119,43 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( unsigned int device_base = configuration->property(role + ".device_base", 1); trk_param_fpga.device_base = device_base; //unsigned int multicorr_type = configuration->property(role + ".multicorr_type", 0); - trk_param_fpga.multicorr_type = 0; //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators + trk_param_fpga.multicorr_type = 0; //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators //d_tracking_code = static_cast(volk_gnsssdr_malloc(2 * static_cast(GPS_L2_M_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); - d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L2_M_CODE_LENGTH_CHIPS)* NUM_PRNs * sizeof(int), volk_gnsssdr_get_alignment())); - float* ca_codes_f = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L2_M_CODE_LENGTH_CHIPS)* sizeof(float), volk_gnsssdr_get_alignment())); + d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L2_M_CODE_LENGTH_CHIPS) * NUM_PRNs * sizeof(int), volk_gnsssdr_get_alignment())); + float* ca_codes_f = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L2_M_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); //################# PRE-COMPUTE ALL THE CODES ################# - d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L2_M_CODE_LENGTH_CHIPS*NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment())); + d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L2_M_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment())); for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) - { - //gps_l1_ca_code_gen_int(&d_ca_codes[(int(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)], PRN, 0); - gps_l2c_m_code_gen_float(ca_codes_f, PRN); - for (unsigned int s = 0; s < 2*static_cast(GPS_L2_M_CODE_LENGTH_CHIPS); s++) - { - d_ca_codes[static_cast(GPS_L2_M_CODE_LENGTH_CHIPS)* (PRN - 1) + s] = static_cast(ca_codes_f[s]); - } - } + { + //gps_l1_ca_code_gen_int(&d_ca_codes[(int(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)], PRN, 0); + gps_l2c_m_code_gen_float(ca_codes_f, PRN); + for (unsigned int s = 0; s < 2 * static_cast(GPS_L2_M_CODE_LENGTH_CHIPS); s++) + { + d_ca_codes[static_cast(GPS_L2_M_CODE_LENGTH_CHIPS) * (PRN - 1) + s] = static_cast(ca_codes_f[s]); + } + } delete[] ca_codes_f; trk_param_fpga.ca_codes = d_ca_codes; trk_param_fpga.code_length_chips = GPS_L2_M_CODE_LENGTH_CHIPS; - trk_param_fpga.code_samples_per_chip = 1; // 1 sample per chip + trk_param_fpga.code_samples_per_chip = 1; // 1 sample per chip //################# MAKE TRACKING GNURadio object ################### -// //################# MAKE TRACKING GNURadio object ################### -// if (item_type.compare("gr_complex") == 0) -// { -// item_size_ = sizeof(gr_complex); -// tracking_ = dll_pll_veml_make_tracking(trk_param); -// } -// else -// { -// item_size_ = sizeof(gr_complex); -// LOG(WARNING) << item_type << " unknown tracking item type."; -// } + // //################# MAKE TRACKING GNURadio object ################### + // if (item_type.compare("gr_complex") == 0) + // { + // item_size_ = sizeof(gr_complex); + // tracking_ = dll_pll_veml_make_tracking(trk_param); + // } + // else + // { + // item_size_ = sizeof(gr_complex); + // LOG(WARNING) << item_type << " unknown tracking item type."; + // } //################# MAKE TRACKING GNURadio object ################### tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga); diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.h b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.h index d4dde0713..2cde19cd7 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.h @@ -91,6 +91,10 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; private: //dll_pll_veml_tracking_sptr tracking_; diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc index 1775a7a89..4076dceeb 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc @@ -45,6 +45,10 @@ using google::LogMessage; +void GpsL5DllPllTracking::stop_tracking() +{ +} + GpsL5DllPllTracking::GpsL5DllPllTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h index 9cfbd58fa..59a8983fc 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h @@ -89,6 +89,10 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; private: dll_pll_veml_tracking_sptr tracking_; diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc index 0df38771c..1c09e38d9 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc @@ -47,13 +47,17 @@ using google::LogMessage; +void GpsL5DllPllTrackingFpga::stop_tracking() +{ +} + GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( - ConfigurationInterface* configuration, std::string role, + ConfigurationInterface *configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { - //printf("L5 TRK CLASS CREATED\n"); + //printf("L5 TRK CLASS CREATED\n"); //dllpllconf_t trk_param; - Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); + Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## //std::string default_item_type = "gr_complex"; @@ -126,7 +130,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( unsigned int device_base = configuration->property(role + ".device_base", 1); trk_param_fpga.device_base = device_base; //unsigned int multicorr_type = configuration->property(role + ".multicorr_type", 0); - trk_param_fpga.multicorr_type = 0; //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators + trk_param_fpga.multicorr_type = 0; //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators //################# PRE-COMPUTE ALL THE CODES ################# unsigned int code_samples_per_chip = 1; @@ -139,11 +143,11 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( tracking_code = static_cast(volk_gnsssdr_malloc(code_length_chips * sizeof(float), volk_gnsssdr_get_alignment())); if (trk_param_fpga.track_pilot) - { - data_code = static_cast(volk_gnsssdr_malloc(code_length_chips * sizeof(float), volk_gnsssdr_get_alignment())); - } + { + data_code = static_cast(volk_gnsssdr_malloc(code_length_chips * sizeof(float), volk_gnsssdr_get_alignment())); + } - d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(code_length_chips*NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment())); + d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(code_length_chips * NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment())); if (trk_param_fpga.track_pilot) { @@ -152,35 +156,31 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( //printf("start \n"); for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) - { - - if (track_pilot) - { - - gps_l5q_code_gen_float(tracking_code, PRN); - gps_l5i_code_gen_float(data_code, PRN); + { + if (track_pilot) + { + gps_l5q_code_gen_float(tracking_code, PRN); + gps_l5i_code_gen_float(data_code, PRN); - for (unsigned int s = 0; s < code_length_chips; s++) - { - d_ca_codes[static_cast(code_length_chips)* (PRN - 1) + s] = static_cast(tracking_code[s]); - d_data_codes[static_cast(code_length_chips)* (PRN - 1) + s] = static_cast(data_code[s]); - //printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]); + for (unsigned int s = 0; s < code_length_chips; s++) + { + d_ca_codes[static_cast(code_length_chips) * (PRN - 1) + s] = static_cast(tracking_code[s]); + d_data_codes[static_cast(code_length_chips) * (PRN - 1) + s] = static_cast(data_code[s]); + //printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]); + } + } - } - } - - else - { - - gps_l5i_code_gen_float(tracking_code, PRN); - for (unsigned int s = 0; s < code_length_chips; s++) - { - d_ca_codes[static_cast(code_length_chips) * (PRN - 1) + s] = static_cast(data_code[s]); - //printf("%f %d | ", ca_codes_f[s], d_ca_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]); - } - } - } + else + { + gps_l5i_code_gen_float(tracking_code, PRN); + for (unsigned int s = 0; s < code_length_chips; s++) + { + d_ca_codes[static_cast(code_length_chips) * (PRN - 1) + s] = static_cast(data_code[s]); + //printf("%f %d | ", ca_codes_f[s], d_ca_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]); + } + } + } //printf("end \n"); @@ -192,18 +192,18 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( trk_param_fpga.ca_codes = d_ca_codes; trk_param_fpga.data_codes = d_data_codes; trk_param_fpga.code_length_chips = code_length_chips; - trk_param_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip + trk_param_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip //################# MAKE TRACKING GNURadio object ################### -// if (item_type.compare("gr_complex") == 0) -// { -// item_size_ = sizeof(gr_complex); -// tracking_ = dll_pll_veml_make_tracking(trk_param_fpga); -// } -// else -// { -// item_size_ = sizeof(gr_complex); -// LOG(WARNING) << item_type << " unknown tracking item type."; -// } + // if (item_type.compare("gr_complex") == 0) + // { + // item_size_ = sizeof(gr_complex); + // tracking_ = dll_pll_veml_make_tracking(trk_param_fpga); + // } + // else + // { + // item_size_ = sizeof(gr_complex); + // LOG(WARNING) << item_type << " unknown tracking item type."; + // } //printf("call \n"); tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga); //printf("end2 \n"); @@ -214,19 +214,17 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( GpsL5DllPllTrackingFpga::~GpsL5DllPllTrackingFpga() { - delete[] d_ca_codes; if (d_track_pilot) { delete[] d_data_codes; - } } void GpsL5DllPllTrackingFpga::start_tracking() { - tracking_fpga_sc->start_tracking(); + tracking_fpga_sc->start_tracking(); } @@ -240,9 +238,9 @@ void GpsL5DllPllTrackingFpga::set_channel(unsigned int channel) } -void GpsL5DllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void GpsL5DllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { - tracking_fpga_sc->set_gnss_synchro(p_gnss_synchro); + tracking_fpga_sc->set_gnss_synchro(p_gnss_synchro); } diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.h b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.h index 6cb3bc170..64043fb70 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.h @@ -89,6 +89,10 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! + * \brief Stop running tracking + */ + void stop_tracking() override; private: //dll_pll_veml_tracking_sptr tracking_; diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 95cf911f4..e8709f3af 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -1324,6 +1324,12 @@ void dll_pll_veml_tracking::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) } +void dll_pll_veml_tracking::stop_tracking() +{ + gr::thread::scoped_lock l(d_setlock); + d_state = 0; +} + int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { 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 226a540c8..f6a72de68 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -61,6 +61,7 @@ public: void set_channel(uint32_t channel); void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro); void start_tracking(); + void stop_tracking(); int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index d4b97974e..694e09237 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -1214,10 +1214,16 @@ void dll_pll_veml_tracking_fpga::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) d_acquisition_gnss_synchro = p_gnss_synchro; } +void dll_pll_veml_tracking_fpga::stop_tracking() +{ + gr::thread::scoped_lock l(d_setlock); + d_state = 0; +} int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { + gr::thread::scoped_lock l(d_setlock); // Block input data and block output stream pointers Gnss_Synchro **out = reinterpret_cast(&output_items[0]); 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 47090681b..ecf61c19d 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 @@ -52,44 +52,11 @@ #include #include "fpga_multicorrelator.h" -//typedef struct -//{ -// /* DLL/PLL tracking configuration */ -// double fs_in; -// uint32_t vector_length; -// bool dump; -// std::string dump_filename; -// float pll_bw_hz; -// float dll_bw_hz; -// float pll_bw_narrow_hz; -// float dll_bw_narrow_hz; -// float early_late_space_chips; -// float very_early_late_space_chips; -// float early_late_space_narrow_chips; -// float very_early_late_space_narrow_chips; -// int32_t extend_correlation_symbols; -// int32_t cn0_samples; -// int32_t cn0_min; -// int32_t max_lock_fail; -// double carrier_lock_th; -// bool track_pilot; -// char system; -// char signal[3]; -// std::string device_name; -// uint32_t device_base; -// uint32_t multicorr_type; -// uint32_t code_length_chips; -// uint32_t code_samples_per_chip; -// int* ca_codes; -// int* data_codes; -//} dllpllconf_fpga_t; - class dll_pll_veml_tracking_fpga; typedef boost::shared_ptr dll_pll_veml_tracking_fpga_sptr; -//dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(const dllpllconf_fpga_t &conf_); dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(const Dll_Pll_Conf_Fpga &conf_); @@ -104,7 +71,7 @@ public: void set_channel(uint32_t channel); void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro); void start_tracking(); - + void stop_tracking(); int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/src/core/interfaces/acquisition_interface.h b/src/core/interfaces/acquisition_interface.h index dcf140a5f..d76e79bfc 100644 --- a/src/core/interfaces/acquisition_interface.h +++ b/src/core/interfaces/acquisition_interface.h @@ -64,6 +64,7 @@ public: virtual void set_state(int state) = 0; virtual signed int mag() = 0; virtual void reset() = 0; + virtual void stop_acquisition() = 0; }; #endif /* GNSS_SDR_ACQUISITION_INTERFACE */ diff --git a/src/core/interfaces/channel_interface.h b/src/core/interfaces/channel_interface.h index 48232c674..db449941c 100644 --- a/src/core/interfaces/channel_interface.h +++ b/src/core/interfaces/channel_interface.h @@ -53,6 +53,7 @@ class ChannelInterface : public GNSSBlockInterface public: virtual Gnss_Signal get_signal() const = 0; virtual void start_acquisition() = 0; + virtual void stop_channel() = 0; virtual void set_signal(const Gnss_Signal&) = 0; }; diff --git a/src/core/interfaces/tracking_interface.h b/src/core/interfaces/tracking_interface.h index 010036d72..da2b3c41b 100644 --- a/src/core/interfaces/tracking_interface.h +++ b/src/core/interfaces/tracking_interface.h @@ -56,6 +56,7 @@ class TrackingInterface : public GNSSBlockInterface { public: virtual void start_tracking() = 0; + virtual void stop_tracking() = 0; virtual void set_gnss_synchro(Gnss_Synchro* gnss_synchro) = 0; virtual void set_channel(unsigned int channel) = 0; }; diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index fafefa155..dbeabf004 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -5,6 +5,7 @@ * Luis Esteve, 2012. luis(at)epsilon-formacion.com * Carles Fernandez-Prades, 2014. cfernandez(at)cttc.es * Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com + * Javier Arribas, 2018. javiarribas(at)gmail.com * * ------------------------------------------------------------------------- * @@ -811,21 +812,40 @@ bool GNSSFlowgraph::send_telemetry_msg(pmt::pmt_t msg) /* * Applies an action to the flow graph * - * \param[in] who Who generated the action - * \param[in] what What is the action 0: acquisition failed + * \param[in] who Who generated the action: + * -> 0-199 are the channels IDs + * -> 200 is the control_thread dispatched by the control_thread apply_action + * -> 300 is the telecommand system (TC) for receiver control + * -> 400 - 599 is the TC channel control for channels 0-199 + * \param[in] what What is the action: + * --- actions from channels --- + * -> 0 acquisition failed + * -> 1 acquisition succesfull + * -> 2 tracking lost + * --- actions from TC receiver control --- + * -> 10 TC request standby mode + * -> 11 TC request coldstart + * -> 12 TC request hotstart + * -> 13 TC request warmstart + * --- actions from TC channel control --- + * -> 20 stop channel + * -> 21 start channel */ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) { std::lock_guard lock(signal_list_mutex); DLOG(INFO) << "Received " << what << " from " << who << ". Number of applied actions = " << applied_actions_; unsigned int sat = 0; - try + if (who < 200) { - sat = configuration_->property("Channel" + std::to_string(who) + ".satellite", 0); - } - catch (const std::exception& e) - { - LOG(WARNING) << e.what(); + try + { + sat = configuration_->property("Channel" + std::to_string(who) + ".satellite", 0); + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } switch (what) { @@ -1026,7 +1046,162 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) } } break; + case 10: //request stanby mode + LOG(INFO) << "TC request stanby mode"; + for (size_t n = 0; n < channels_.size(); n++) + { + if (channels_state_[n] == 1 or channels_state_[n] == 2) //channel in acquisition or in tracking + { + //recover the satellite assigned + Gnss_Signal gs = channels_[n]->get_signal(); + switch (mapStringValues_[gs.get_signal_str()]) + { + case evGPS_1C: + available_GPS_1C_signals_.remove(gs); + available_GPS_1C_signals_.push_back(gs); + break; + + case evGPS_2S: + available_GPS_2S_signals_.remove(gs); + available_GPS_2S_signals_.push_back(gs); + break; + + case evGPS_L5: + available_GPS_L5_signals_.remove(gs); + available_GPS_L5_signals_.push_back(gs); + break; + + case evGAL_1B: + available_GAL_1B_signals_.remove(gs); + available_GAL_1B_signals_.push_back(gs); + break; + + case evGAL_5X: + available_GAL_5X_signals_.remove(gs); + available_GAL_5X_signals_.push_back(gs); + break; + + case evGLO_1G: + available_GLO_1G_signals_.remove(gs); + available_GLO_1G_signals_.push_back(gs); + break; + + case evGLO_2G: + available_GLO_2G_signals_.remove(gs); + available_GLO_2G_signals_.push_back(gs); + break; + + default: + LOG(ERROR) << "This should not happen :-("; + break; + } + channels_[n]->stop_channel(); //stop the acquisition or tracking operation + channels_state_[n] = 0; + } + } + acq_channels_count_ = 0; //all channels are in stanby now + break; + case 11: //request coldstart mode + LOG(INFO) << "TC request coldstart"; + //todo: delete all ephemeris and almanac information from maps (also the PVT map queue) + //todo: reorder the satellite queues to the receiver default startup order. + //This is required to allow repeatability. Otherwise the satellite search order will depend on the last tracked satellites + + //start again the satellite acquisitions + for (unsigned int i = 0; i < channels_count_; i++) + { + unsigned int ch_index = (who + i + 1) % channels_count_; + unsigned int sat_ = 0; + try + { + sat_ = configuration_->property("Channel" + std::to_string(ch_index) + ".satellite", 0); + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } + if ((acq_channels_count_ < max_acq_channels_) && (channels_state_[ch_index] == 0)) + { + channels_state_[ch_index] = 1; + if (sat_ == 0) + { + channels_[ch_index]->set_signal(search_next_signal(channels_[ch_index]->get_signal().get_signal_str(), true)); + } + acq_channels_count_++; + DLOG(INFO) << "Channel " << ch_index << " Starting acquisition " << channels_[ch_index]->get_signal().get_satellite() << ", Signal " << channels_[ch_index]->get_signal().get_signal_str(); + channels_[ch_index]->start_acquisition(); + } + DLOG(INFO) << "Channel " << ch_index << " in state " << channels_state_[ch_index]; + } + break; + case 12: //request hotstart mode + LOG(INFO) << "TC request hotstart"; + //todo: call here the function that computes the set of visible satellites and its elevation + //for the date and time specified by the hotstart command and the last available PVT + //todo: reorder the satellite queue to acquire first those visible satellites + //start again the satellite acquisitions + for (unsigned int i = 0; i < channels_count_; i++) + { + unsigned int ch_index = (who + i + 1) % channels_count_; + unsigned int sat_ = 0; + try + { + sat_ = configuration_->property("Channel" + std::to_string(ch_index) + ".satellite", 0); + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } + if ((acq_channels_count_ < max_acq_channels_) && (channels_state_[ch_index] == 0)) + { + channels_state_[ch_index] = 1; + if (sat_ == 0) + { + channels_[ch_index]->set_signal(search_next_signal(channels_[ch_index]->get_signal().get_signal_str(), true)); + } + acq_channels_count_++; + DLOG(INFO) << "Channel " << ch_index << " Starting acquisition " << channels_[ch_index]->get_signal().get_satellite() << ", Signal " << channels_[ch_index]->get_signal().get_signal_str(); + channels_[ch_index]->start_acquisition(); + } + DLOG(INFO) << "Channel " << ch_index << " in state " << channels_state_[ch_index]; + } + break; + case 13: //request warmstart mode + LOG(INFO) << "TC request warmstart"; + //todo: delete all ephemeris and almanac information from maps (also the PVT map queue) + //todo: load the ephemeris and the almanac from XML files (receiver assistance) + //todo: call here the function that computes the set of visible satellites and its elevation + //for the date and time specified by the warmstart command and the assisted position + //todo: reorder the satellite queue to acquire first those visible satellites + + //start again the satellite acquisitions + for (unsigned int i = 0; i < channels_count_; i++) + { + unsigned int ch_index = (who + i + 1) % channels_count_; + unsigned int sat_ = 0; + try + { + sat_ = configuration_->property("Channel" + std::to_string(ch_index) + ".satellite", 0); + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } + if ((acq_channels_count_ < max_acq_channels_) && (channels_state_[ch_index] == 0)) + { + channels_state_[ch_index] = 1; + if (sat_ == 0) + { + channels_[ch_index]->set_signal(search_next_signal(channels_[ch_index]->get_signal().get_signal_str(), true)); + } + acq_channels_count_++; + DLOG(INFO) << "Channel " << ch_index << " Starting acquisition " << channels_[ch_index]->get_signal().get_satellite() << ", Signal " << channels_[ch_index]->get_signal().get_signal_str(); + channels_[ch_index]->start_acquisition(); + } + DLOG(INFO) << "Channel " << ch_index << " in state " << channels_state_[ch_index]; + } + break; default: break; } diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index c59b96224..175d96859 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -51,31 +51,63 @@ std::string TcpCmdInterface::reset(const std::vector &commandLine) return response; } -std::string TcpCmdInterface::stop(const std::vector &commandLine) +std::string TcpCmdInterface::standby(const std::vector &commandLine) { std::string response; - response = "Not implemented\n"; + std::unique_ptr cmf(new ControlMessageFactory()); + if (control_queue_ != nullptr) + { + control_queue_->handle(cmf->GetQueueMessage(300, 10)); //send the standby message (who=300,what=10) + response = "OK\n"; + } + else + { + response = "ERROR\n"; + } return response; } std::string TcpCmdInterface::status(const std::vector &commandLine) { std::string response; + //todo: implement the receiver status report response = "Not implemented\n"; return response; } -std::string TcpCmdInterface::assistedstart(const std::vector &commandLine) +std::string TcpCmdInterface::hotstart(const std::vector &commandLine) { std::string response; - response = "Not implemented\n"; + //todo: read and parse the command line parameter: dd/mm/yyyy HH:MM:SS + //todo: store it in a member variable + std::unique_ptr cmf(new ControlMessageFactory()); + if (control_queue_ != nullptr) + { + control_queue_->handle(cmf->GetQueueMessage(300, 12)); //send the standby message (who=300,what=12) + response = "OK\n"; + } + else + { + response = "ERROR\n"; + } return response; } std::string TcpCmdInterface::warmstart(const std::vector &commandLine) { std::string response; - response = "Not implemented\n"; + //todo: read and parse the command line parameter: dd/mm/yyyy HH:MM:SS + //todo: store it in a member variable + std::unique_ptr cmf(new ControlMessageFactory()); + if (control_queue_ != nullptr) + { + control_queue_->handle(cmf->GetQueueMessage(300, 13)); //send the standby message (who=300,what=13) + response = "OK\n"; + } + else + { + response = "ERROR\n"; + } return response; } @@ -83,13 +115,23 @@ std::string TcpCmdInterface::warmstart(const std::vector &commandLi std::string TcpCmdInterface::coldstart(const std::vector &commandLine) { std::string response; - response = "Not implemented\n"; + std::unique_ptr cmf(new ControlMessageFactory()); + if (control_queue_ != nullptr) + { + control_queue_->handle(cmf->GetQueueMessage(300, 11)); //send the standby message (who=300,what=11) + response = "OK\n"; + } + else + { + response = "ERROR\n"; + } return response; } std::string TcpCmdInterface::set_ch_satellite(const std::vector &commandLine) { std::string response; + //todo: implement the set satellite command response = "Not implemented\n"; return response; } @@ -98,9 +140,9 @@ std::string TcpCmdInterface::set_ch_satellite(const std::vector &co void TcpCmdInterface::register_functions() { functions["status"] = std::bind(&TcpCmdInterface::status, this, std::placeholders::_1); - functions["stop"] = std::bind(&TcpCmdInterface::stop, this, std::placeholders::_1); + functions["standby"] = std::bind(&TcpCmdInterface::standby, this, std::placeholders::_1); functions["reset"] = std::bind(&TcpCmdInterface::reset, this, std::placeholders::_1); - functions["assistedstart"] = std::bind(&TcpCmdInterface::assistedstart, this, std::placeholders::_1); + functions["hotstart"] = std::bind(&TcpCmdInterface::hotstart, this, std::placeholders::_1); functions["warmstart"] = std::bind(&TcpCmdInterface::warmstart, this, std::placeholders::_1); functions["coldstart"] = std::bind(&TcpCmdInterface::coldstart, this, std::placeholders::_1); functions["set_ch_satellite"] = std::bind(&TcpCmdInterface::set_ch_satellite, this, std::placeholders::_1); @@ -168,6 +210,8 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) if (cmd_vector.at(0).compare("exit") == 0) { error = boost::asio::error::eof; + //send cmd response + socket.write_some(boost::asio::buffer("OK\n"), not_throw); } else { diff --git a/src/core/receiver/tcp_cmd_interface.h b/src/core/receiver/tcp_cmd_interface.h index a6a9c297c..6071e32bd 100644 --- a/src/core/receiver/tcp_cmd_interface.h +++ b/src/core/receiver/tcp_cmd_interface.h @@ -58,8 +58,8 @@ private: functions; std::string status(const std::vector &commandLine); std::string reset(const std::vector &commandLine); - std::string stop(const std::vector &commandLine); - std::string assistedstart(const std::vector &commandLine); + std::string standby(const std::vector &commandLine); + std::string hotstart(const std::vector &commandLine); std::string warmstart(const std::vector &commandLine); std::string coldstart(const std::vector &commandLine); std::string set_ch_satellite(const std::vector &commandLine); From 715f32f0eeb64ec1cc16087fa2539fd8a5144fc7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Oct 2018 00:47:12 +0100 Subject: [PATCH 023/143] Improve tracking dump saving Dump files can now be saved anywhere, including absolute paths. If directories do not exist, they will be created. Added new dump_mat to deactivate generation of .mat files --- src/algorithms/libs/CMakeLists.txt | 8 +- .../libs/gnss_sdr_create_directory.cc | 87 +++++++++++++++++++ .../libs/gnss_sdr_create_directory.h | 38 ++++++++ .../galileo_e1_dll_pll_veml_tracking.cc | 8 +- .../galileo_e1_dll_pll_veml_tracking_fpga.cc | 8 +- .../adapters/galileo_e5a_dll_pll_tracking.cc | 8 +- .../galileo_e5a_dll_pll_tracking_fpga.cc | 8 +- .../adapters/gps_l1_ca_dll_pll_tracking.cc | 8 +- .../gps_l1_ca_dll_pll_tracking_fpga.cc | 8 +- .../adapters/gps_l2_m_dll_pll_tracking.cc | 8 +- .../gps_l2_m_dll_pll_tracking_fpga.cc | 8 +- .../adapters/gps_l5_dll_pll_tracking.cc | 8 +- .../adapters/gps_l5_dll_pll_tracking_fpga.cc | 8 +- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 75 ++++++++++++---- .../gnuradio_blocks/dll_pll_veml_tracking.h | 3 + .../dll_pll_veml_tracking_fpga.cc | 73 ++++++++++++---- .../dll_pll_veml_tracking_fpga.h | 3 + src/algorithms/tracking/libs/dll_pll_conf.cc | 3 +- src/algorithms/tracking/libs/dll_pll_conf.h | 2 +- .../tracking/libs/dll_pll_conf_fpga.cc | 31 +------ .../tracking/libs/dll_pll_conf_fpga.h | 25 +----- 21 files changed, 308 insertions(+), 120 deletions(-) create mode 100644 src/algorithms/libs/gnss_sdr_create_directory.cc create mode 100644 src/algorithms/libs/gnss_sdr_create_directory.h diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index ab7af677e..18dd400b0 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -38,6 +38,7 @@ set(GNSS_SPLIBS_SOURCES conjugate_cc.cc conjugate_sc.cc conjugate_ic.cc + gnss_sdr_create_directory.cc ) set(GNSS_SPLIBS_HEADERS @@ -60,6 +61,7 @@ set(GNSS_SPLIBS_HEADERS conjugate_cc.h conjugate_sc.h conjugate_ic.h + gnss_sdr_create_directory.h gnss_circular_deque.h ) @@ -74,7 +76,7 @@ if(ENABLE_FPGA) gnss_sdr_time_counter.h gnss_sdr_fpga_sample_counter.h ) - + endif(ENABLE_FPGA) if(OPENCL_FOUND) @@ -83,12 +85,12 @@ if(OPENCL_FOUND) opencl/fft_setup.cc # Needs OpenCL opencl/fft_kernelstring.cc # Needs OpenCL ) - + set(GNSS_SPLIBS_HEADERS ${GNSS_SPLIBS_HEADERS} opencl/fft_execute.h # Needs OpenCL opencl/fft_setup.h # Needs OpenCL opencl/fft_kernelstring.h # Needs OpenCL - ) + ) endif(OPENCL_FOUND) include_directories( diff --git a/src/algorithms/libs/gnss_sdr_create_directory.cc b/src/algorithms/libs/gnss_sdr_create_directory.cc new file mode 100644 index 000000000..3a880143b --- /dev/null +++ b/src/algorithms/libs/gnss_sdr_create_directory.cc @@ -0,0 +1,87 @@ +/*! + * \file gnss_sdr_create_directory.cc + * \brief Create a directory + * \author Carles Fernandez-Prades, 2018. cfernandez(at)cttc.es + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + + +#include "gnss_sdr_create_directory.h" +#include // for create_directories, exists +#include // for path, operator<< +#include // for filesystem +#include + + +bool gnss_sdr_create_directory(const std::string& foldername) +{ + std::string new_folder; + for (auto& folder : boost::filesystem::path(foldername)) + { + new_folder += folder.string(); + boost::system::error_code ec; + if (!boost::filesystem::exists(new_folder)) + { + try + { + if (!boost::filesystem::create_directory(new_folder, ec)) + { + return false; + } + } + catch (std::exception& e) + { + return false; + } + } + new_folder += boost::filesystem::path::preferred_separator; + } + + // Check if we have writing permissions + std::string test_file = foldername + "/test_file.txt"; + std::ofstream os_test_file; + os_test_file.open(test_file.c_str(), std::ios::out | std::ios::binary); + + if (os_test_file.is_open()) + { + boost::system::error_code ec; + os_test_file.close(); + try + { + boost::filesystem::remove(test_file, ec); + } + catch (std::exception& e) + { + return false; + } + return true; + } + else + { + os_test_file.close(); + return false; + } +} diff --git a/src/algorithms/libs/gnss_sdr_create_directory.h b/src/algorithms/libs/gnss_sdr_create_directory.h new file mode 100644 index 000000000..23de7ec14 --- /dev/null +++ b/src/algorithms/libs/gnss_sdr_create_directory.h @@ -0,0 +1,38 @@ +/*! + * \file gnss_sdr_create_directory.h + * \brief Create a directory + * \author Carles Fernandez-Prades, 2018. cfernandez(at)cttc.es + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * GNSS-SDR is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GNSS-SDR is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNSS-SDR. If not, see . + * + * ------------------------------------------------------------------------- + */ + +#ifndef GNSS_SDR_GNSS_SDR_CREATE_DIRECTORY_H_ +#define GNSS_SDR_GNSS_SDR_CREATE_DIRECTORY_H_ + +#include + +bool gnss_sdr_create_directory(const std::string& foldername); + +#endif diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc index 336db4fff..bb1ff89cd 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc @@ -63,6 +63,11 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( trk_param.fs_in = fs_in; bool dump = configuration->property(role + ".dump", false); trk_param.dump = dump; + std::string default_dump_filename = "./track_ch"; + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + trk_param.dump_filename = dump_filename; + bool dump_mat = configuration->property(role + ".dump_mat", true); + trk_param.dump_mat = dump_mat; trk_param.high_dyn = configuration->property(role + ".high_dyn", false); if (configuration->property(role + ".smoother_length", 10) < 1) { @@ -109,9 +114,6 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( } trk_param.track_pilot = track_pilot; trk_param.extend_correlation_symbols = extend_correlation_symbols; - std::string default_dump_filename = "./track_ch"; - std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - trk_param.dump_filename = dump_filename; int vector_length = std::round(fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); trk_param.vector_length = vector_length; trk_param.system = 'E'; diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc index e3210911b..179e19f3c 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc @@ -65,6 +65,11 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( trk_param_fpga.fs_in = fs_in; bool dump = configuration->property(role + ".dump", false); trk_param_fpga.dump = dump; + std::string default_dump_filename = "./track_ch"; + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + trk_param_fpga.dump_filename = dump_filename; + bool dump_mat = configuration->property(role + ".dump_mat", true); + trk_param_fpga.dump_mat = dump_mat; float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 5.0); if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); trk_param_fpga.pll_bw_hz = pll_bw_hz; @@ -102,9 +107,6 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( trk_param_fpga.track_pilot = track_pilot; d_track_pilot = track_pilot; trk_param_fpga.extend_correlation_symbols = extend_correlation_symbols; - std::string default_dump_filename = "./track_ch"; - std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - trk_param_fpga.dump_filename = dump_filename; int vector_length = std::round(fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); trk_param_fpga.vector_length = vector_length; trk_param_fpga.system = 'E'; diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc index d58e28e16..c3a8244e2 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc @@ -63,6 +63,11 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( trk_param.fs_in = fs_in; bool dump = configuration->property(role + ".dump", false); trk_param.dump = dump; + std::string default_dump_filename = "./track_ch"; + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + trk_param.dump_filename = dump_filename; + bool dump_mat = configuration->property(role + ".dump_mat", true); + trk_param.dump_mat = dump_mat; trk_param.high_dyn = configuration->property(role + ".high_dyn", false); if (configuration->property(role + ".smoother_length", 10) < 1) { @@ -85,9 +90,6 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( trk_param.dll_bw_narrow_hz = dll_bw_narrow_hz; float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); trk_param.early_late_space_chips = early_late_space_chips; - std::string default_dump_filename = "./track_ch"; - std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - trk_param.dump_filename = dump_filename; int vector_length = std::round(fs_in / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS)); trk_param.vector_length = vector_length; int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc index a003924f2..d4fa38d2f 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc @@ -67,6 +67,11 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( trk_param_fpga.fs_in = fs_in; bool dump = configuration->property(role + ".dump", false); trk_param_fpga.dump = dump; + std::string default_dump_filename = "./track_ch"; + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + trk_param_fpga.dump_filename = dump_filename; + bool dump_mat = configuration->property(role + ".dump_mat", true); + trk_param_fpga.dump_mat = dump_mat; float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 20.0); if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); trk_param_fpga.pll_bw_hz = pll_bw_hz; @@ -79,9 +84,6 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( trk_param_fpga.dll_bw_narrow_hz = dll_bw_narrow_hz; float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); trk_param_fpga.early_late_space_chips = early_late_space_chips; - std::string default_dump_filename = "./track_ch"; - std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - trk_param_fpga.dump_filename = dump_filename; int vector_length = std::round(fs_in / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS)); trk_param_fpga.vector_length = vector_length; int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc index f674ff33e..b0fff7263 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc @@ -74,6 +74,11 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( } bool dump = configuration->property(role + ".dump", false); trk_param.dump = dump; + std::string default_dump_filename = "./track_ch"; + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + trk_param.dump_filename = dump_filename; + bool dump_mat = configuration->property(role + ".dump_mat", true); + trk_param.dump_mat = dump_mat; float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); trk_param.pll_bw_hz = pll_bw_hz; @@ -88,9 +93,6 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( trk_param.early_late_space_chips = early_late_space_chips; float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.5); trk_param.early_late_space_narrow_chips = early_late_space_narrow_chips; - std::string default_dump_filename = "./track_ch"; - std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - trk_param.dump_filename = dump_filename; int vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); trk_param.vector_length = vector_length; int symbols_extended_correlator = configuration->property(role + ".extend_correlation_symbols", 1); diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc index 3296dfc7d..37f946e9f 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc @@ -67,6 +67,11 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( trk_param_fpga.fs_in = fs_in; bool dump = configuration->property(role + ".dump", false); trk_param_fpga.dump = dump; + std::string default_dump_filename = "./track_ch"; + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + trk_param_fpga.dump_filename = dump_filename; + bool dump_mat = configuration->property(role + ".dump_mat", true); + trk_param_fpga.dump_mat = dump_mat; float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); trk_param_fpga.pll_bw_hz = pll_bw_hz; @@ -81,9 +86,6 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( trk_param_fpga.early_late_space_chips = early_late_space_chips; float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.5); trk_param_fpga.early_late_space_narrow_chips = early_late_space_narrow_chips; - std::string default_dump_filename = "./track_ch"; - std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - trk_param_fpga.dump_filename = dump_filename; int vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); trk_param_fpga.vector_length = vector_length; int symbols_extended_correlator = configuration->property(role + ".extend_correlation_symbols", 1); diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc index 679a78cae..f4bb44321 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc @@ -63,6 +63,11 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( trk_param.fs_in = fs_in; bool dump = configuration->property(role + ".dump", false); trk_param.dump = dump; + std::string default_dump_filename = "./track_ch"; + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + trk_param.dump_filename = dump_filename; + bool dump_mat = configuration->property(role + ".dump_mat", true); + trk_param.dump_mat = dump_mat; float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 2.0); if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); trk_param.pll_bw_hz = pll_bw_hz; @@ -72,9 +77,6 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); trk_param.early_late_space_chips = early_late_space_chips; trk_param.early_late_space_narrow_chips = 0.0; - std::string default_dump_filename = "./track_ch"; - std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - trk_param.dump_filename = dump_filename; int vector_length = std::round(static_cast(fs_in) / (static_cast(GPS_L2_M_CODE_RATE_HZ) / static_cast(GPS_L2_M_CODE_LENGTH_CHIPS))); trk_param.vector_length = vector_length; int symbols_extended_correlator = configuration->property(role + ".extend_correlation_symbols", 1); diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc index 19b9333b9..f10d876dc 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc @@ -66,6 +66,11 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( trk_param_fpga.fs_in = fs_in; bool dump = configuration->property(role + ".dump", false); trk_param_fpga.dump = dump; + std::string default_dump_filename = "./track_ch"; + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + trk_param_fpga.dump_filename = dump_filename; + bool dump_mat = configuration->property(role + ".dump_mat", true); + trk_param_fpga.dump_mat = dump_mat; float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 2.0); if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); trk_param_fpga.pll_bw_hz = pll_bw_hz; @@ -75,9 +80,6 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); trk_param_fpga.early_late_space_chips = early_late_space_chips; trk_param_fpga.early_late_space_narrow_chips = 0.0; - std::string default_dump_filename = "./track_ch"; - std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - trk_param_fpga.dump_filename = dump_filename; int vector_length = std::round(static_cast(fs_in) / (static_cast(GPS_L2_M_CODE_RATE_HZ) / static_cast(GPS_L2_M_CODE_LENGTH_CHIPS))); trk_param_fpga.vector_length = vector_length; int symbols_extended_correlator = configuration->property(role + ".extend_correlation_symbols", 1); diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc index 4076dceeb..9954777ec 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc @@ -63,6 +63,11 @@ GpsL5DllPllTracking::GpsL5DllPllTracking( trk_param.fs_in = fs_in; bool dump = configuration->property(role + ".dump", false); trk_param.dump = dump; + std::string default_dump_filename = "./track_ch"; + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + trk_param.dump_filename = dump_filename; + bool dump_mat = configuration->property(role + ".dump_mat", true); + trk_param.dump_mat = dump_mat; trk_param.high_dyn = configuration->property(role + ".high_dyn", false); if (configuration->property(role + ".smoother_length", 10) < 1) { @@ -85,9 +90,6 @@ GpsL5DllPllTracking::GpsL5DllPllTracking( trk_param.dll_bw_narrow_hz = dll_bw_narrow_hz; float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); trk_param.early_late_space_chips = early_late_space_chips; - std::string default_dump_filename = "./track_ch"; - std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - trk_param.dump_filename = dump_filename; int vector_length = std::round(static_cast(fs_in) / (static_cast(GPS_L5i_CODE_RATE_HZ) / static_cast(GPS_L5i_CODE_LENGTH_CHIPS))); trk_param.vector_length = vector_length; int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc index 1c09e38d9..bbc5c17bb 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc @@ -67,6 +67,11 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( trk_param_fpga.fs_in = fs_in; bool dump = configuration->property(role + ".dump", false); trk_param_fpga.dump = dump; + std::string default_dump_filename = "./track_ch"; + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + trk_param_fpga.dump_filename = dump_filename; + bool dump_mat = configuration->property(role + ".dump_mat", true); + trk_param_fpga.dump_mat = dump_mat; float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); trk_param_fpga.pll_bw_hz = pll_bw_hz; @@ -79,9 +84,6 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( trk_param_fpga.dll_bw_narrow_hz = dll_bw_narrow_hz; float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); trk_param_fpga.early_late_space_chips = early_late_space_chips; - std::string default_dump_filename = "./track_ch"; - std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - trk_param_fpga.dump_filename = dump_filename; int vector_length = std::round(static_cast(fs_in) / (static_cast(GPS_L5i_CODE_RATE_HZ) / static_cast(GPS_L5i_CODE_LENGTH_CHIPS))); trk_param_fpga.vector_length = vector_length; int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index e8709f3af..5401fae93 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -49,6 +49,7 @@ #include "gps_l2c_signal.h" #include "GPS_L5.h" #include "gps_l5_signal.h" +#include "gnss_sdr_create_directory.h" #include #include #include @@ -415,6 +416,42 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl d_carr_ph_history.resize(1); d_code_ph_history.resize(1); } + + d_dump = trk_parameters.dump; + d_dump_mat = trk_parameters.dump_mat and d_dump; + if (d_dump) + { + d_dump_filename = trk_parameters.dump_filename; + std::string dump_path; + // Get path + if (d_dump_filename.find_last_of("/") != std::string::npos) + { + std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1); + dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/")); + d_dump_filename = dump_filename_; + } + else + { + dump_path = std::string("."); + } + if (d_dump_filename.empty()) + { + d_dump_filename = "trk_channel_"; + } + // remove extension if any + if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos) + { + d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of(".")); + } + + d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename; + // create directory + if (!gnss_sdr_create_directory(dump_path)) + { + std::cerr << "GNSS-SDR cannot create dump files for the tracking block. Wrong permissions?" << std::endl; + d_dump = false; + } + } } @@ -592,17 +629,9 @@ dll_pll_veml_tracking::~dll_pll_veml_tracking() LOG(WARNING) << "Exception in destructor " << ex.what(); } } - if (trk_parameters.dump) + if (d_dump_mat) { - if (d_channel == 0) - { - std::cout << "Writing .mat files ..."; - } save_matfile(); - if (d_channel == 0) - { - std::cout << " done." << std::endl; - } } try { @@ -928,7 +957,7 @@ void dll_pll_veml_tracking::save_correlation_results() void dll_pll_veml_tracking::log_data(bool integrating) { - if (trk_parameters.dump) + if (d_dump) { // Dump results to file float prompt_I; @@ -1060,10 +1089,16 @@ int32_t dll_pll_veml_tracking::save_matfile() int32_t epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars + sizeof(float) * number_of_float_vars + sizeof(uint32_t); std::ifstream dump_file; + std::string dump_filename_ = d_dump_filename; + // add channel number to the filename + dump_filename_.append(boost::lexical_cast(d_channel)); + // add extension + dump_filename_.append(".dat"); + std::cout << "Generating .mat file for " << dump_filename_ << std::endl; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try { - dump_file.open(trk_parameters.dump_filename.c_str(), std::ios::binary | std::ios::ate); + dump_file.open(dump_filename_.c_str(), std::ios::binary | std::ios::ate); } catch (const std::ifstream::failure &e) { @@ -1168,7 +1203,7 @@ int32_t dll_pll_veml_tracking::save_matfile() // WRITE MAT FILE mat_t *matfp; matvar_t *matvar; - std::string filename = trk_parameters.dump_filename; + std::string filename = dump_filename_; filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); @@ -1296,17 +1331,23 @@ void dll_pll_veml_tracking::set_channel(uint32_t channel) d_channel = channel; LOG(INFO) << "Tracking Channel set to " << d_channel; // ############# ENABLE DATA FILE LOG ################# - if (trk_parameters.dump) + if (d_dump) { + std::string dump_filename_ = d_dump_filename; + // add channel number to the filename + dump_filename_.append(boost::lexical_cast(d_channel)); + // add extension + dump_filename_.append(".dat"); + if (!d_dump_file.is_open()) { try { - trk_parameters.dump_filename.append(boost::lexical_cast(d_channel)); - trk_parameters.dump_filename.append(".dat"); + //trk_parameters.dump_filename.append(boost::lexical_cast(d_channel)); + //trk_parameters.dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(trk_parameters.dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << trk_parameters.dump_filename.c_str(); + d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str(); } catch (const std::ifstream::failure &e) { 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 f6a72de68..37997bb84 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -196,6 +196,9 @@ private: // file dump std::ofstream d_dump_file; + std::string d_dump_filename; + bool d_dump; + bool d_dump_mat; }; #endif // GNSS_SDR_DLL_PLL_VEML_TRACKING_H diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index 694e09237..71d8cfc5a 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -47,6 +47,7 @@ #include "gps_l2c_signal.h" #include "GPS_L5.h" #include "gps_l5_signal.h" +#include "gnss_sdr_create_directory.h" #include #include #include @@ -420,6 +421,42 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & multicorrelator_fpga->set_output_vectors(d_correlator_outs, d_Prompt_Data); d_pull_in = 0; + + d_dump = trk_parameters.dump; + d_dump_mat = trk_parameters.dump_mat and d_dump; + if (d_dump) + { + d_dump_filename = trk_parameters.dump_filename; + std::string dump_path; + if (d_dump_filename.find_last_of("/") != std::string::npos) + { + std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1); + dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/")); + d_dump_filename = dump_filename_; + } + else + { + dump_path = std::string("."); + } + if (d_dump_filename.empty()) + { + d_dump_filename = "trk_channel_"; + } + // remove extension if any + if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos) + { + d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of(".")); + } + + d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename; + + // create directory + if (!gnss_sdr_create_directory(dump_path)) + { + std::cerr << "GNSS-SDR cannot create dump files for the tracking block. Wrong permissions?" << std::endl; + d_dump = false; + }; + } } @@ -583,17 +620,9 @@ dll_pll_veml_tracking_fpga::~dll_pll_veml_tracking_fpga() LOG(WARNING) << "Exception in destructor " << ex.what(); } } - if (trk_parameters.dump) + if (d_dump_mat) { - if (d_channel == 0) - { - std::cout << "Writing .mat files ..."; - } save_matfile(); - if (d_channel == 0) - { - std::cout << " done." << std::endl; - } } try { @@ -842,7 +871,7 @@ void dll_pll_veml_tracking_fpga::save_correlation_results() void dll_pll_veml_tracking_fpga::log_data(bool integrating) { - if (trk_parameters.dump) + if (d_dump) { // Dump results to file float prompt_I; @@ -968,10 +997,16 @@ int32_t dll_pll_veml_tracking_fpga::save_matfile() int32_t epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars + sizeof(float) * number_of_float_vars + sizeof(uint32_t); std::ifstream dump_file; + std::string dump_filename_ = d_dump_filename; + // add channel number to the filename + dump_filename_.append(boost::lexical_cast(d_channel)); + // add extension + dump_filename_.append(".dat"); + std::cout << "Generating .mat file for " << dump_filename_ << std::endl; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try { - dump_file.open(trk_parameters.dump_filename.c_str(), std::ios::binary | std::ios::ate); + dump_file.open(dump_filename_.c_str(), std::ios::binary | std::ios::ate); } catch (const std::ifstream::failure &e) { @@ -1070,7 +1105,7 @@ int32_t dll_pll_veml_tracking_fpga::save_matfile() // WRITE MAT FILE mat_t *matfp; matvar_t *matvar; - std::string filename = trk_parameters.dump_filename; + std::string filename = dump_filename_; filename.erase(filename.length() - 4, 4); filename.append(".mat"); matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); @@ -1188,17 +1223,21 @@ void dll_pll_veml_tracking_fpga::set_channel(uint32_t channel) multicorrelator_fpga->set_channel(d_channel); LOG(INFO) << "Tracking Channel set to " << d_channel; // ############# ENABLE DATA FILE LOG ################# - if (trk_parameters.dump) + if (d_dump) { + std::string dump_filename_ = d_dump_filename; + // add channel number to the filename + dump_filename_.append(boost::lexical_cast(d_channel)); + // add extension + dump_filename_.append(".dat"); + if (!d_dump_file.is_open()) { try { - trk_parameters.dump_filename.append(boost::lexical_cast(d_channel)); - trk_parameters.dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(trk_parameters.dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << trk_parameters.dump_filename.c_str(); + d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str(); } catch (const std::ifstream::failure &e) { 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 ecf61c19d..91e34d400 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 @@ -195,6 +195,9 @@ private: // file dump std::ofstream d_dump_file; + std::string d_dump_filename; + bool d_dump; + bool d_dump_mat; // extra int32_t d_correlation_length_samples; diff --git a/src/algorithms/tracking/libs/dll_pll_conf.cc b/src/algorithms/tracking/libs/dll_pll_conf.cc index c4b310c3d..77c0b48a3 100644 --- a/src/algorithms/tracking/libs/dll_pll_conf.cc +++ b/src/algorithms/tracking/libs/dll_pll_conf.cc @@ -41,7 +41,8 @@ Dll_Pll_Conf::Dll_Pll_Conf() fs_in = 0.0; vector_length = 0U; dump = false; - dump_filename = "./dll_pll_dump.dat"; + dump_mat = true; + dump_filename = std::string("./dll_pll_dump.dat"); pll_pull_in_bw_hz = 50.0; dll_pull_in_bw_hz = 3.0; pll_bw_hz = 35.0; diff --git a/src/algorithms/tracking/libs/dll_pll_conf.h b/src/algorithms/tracking/libs/dll_pll_conf.h index 042ee46b6..0fbf07cc3 100644 --- a/src/algorithms/tracking/libs/dll_pll_conf.h +++ b/src/algorithms/tracking/libs/dll_pll_conf.h @@ -38,12 +38,12 @@ class Dll_Pll_Conf { -private: public: /* DLL/PLL tracking configuration */ double fs_in; uint32_t vector_length; bool dump; + bool dump_mat; std::string dump_filename; float pll_pull_in_bw_hz; float dll_pull_in_bw_hz; diff --git a/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc b/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc index 7f89ecaa9..87b66a911 100644 --- a/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc +++ b/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc @@ -35,35 +35,12 @@ Dll_Pll_Conf_Fpga::Dll_Pll_Conf_Fpga() { - // /* DLL/PLL tracking configuration */ - // fs_in = 0.0; - // vector_length = 0; - // dump = false; - // dump_filename = "./dll_pll_dump.dat"; - // pll_bw_hz = 40.0; - // dll_bw_hz = 2.0; - // pll_bw_narrow_hz = 5.0; - // dll_bw_narrow_hz = 0.75; - // early_late_space_chips = 0.5; - // very_early_late_space_chips = 0.5; - // early_late_space_narrow_chips = 0.1; - // very_early_late_space_narrow_chips = 0.1; - // extend_correlation_symbols = 5; - // cn0_samples = 20; - // carrier_lock_det_mav_samples = 20; - // cn0_min = 25; - // max_lock_fail = 50; - // carrier_lock_th = 0.85; - // track_pilot = false; - // system = 'G'; - // char sig_[3] = "1C"; - // std::memcpy(signal, sig_, 3); - /* DLL/PLL tracking configuration */ fs_in = 0.0; vector_length = 0U; dump = false; - dump_filename = "./dll_pll_dump.dat"; + dump_mat = true; + dump_filename = std::string("./dll_pll_dump.dat"); pll_bw_hz = 40.0; dll_bw_hz = 2.0; pll_bw_narrow_hz = 5.0; @@ -86,6 +63,6 @@ Dll_Pll_Conf_Fpga::Dll_Pll_Conf_Fpga() multicorr_type = 0U; code_length_chips = 0U; code_samples_per_chip = 0U; - //int32_t* ca_codes; - //int32_t* data_codes; + ca_codes = nullptr; + data_codes = nullptr; } diff --git a/src/algorithms/tracking/libs/dll_pll_conf_fpga.h b/src/algorithms/tracking/libs/dll_pll_conf_fpga.h index c00c1a2f2..8fd81fb36 100644 --- a/src/algorithms/tracking/libs/dll_pll_conf_fpga.h +++ b/src/algorithms/tracking/libs/dll_pll_conf_fpga.h @@ -38,35 +38,12 @@ class Dll_Pll_Conf_Fpga { -private: public: - // /* DLL/PLL tracking configuration */ - // double fs_in; - // uint32_t vector_length; - // bool dump; - // std::string dump_filename; - // float pll_bw_hz; - // float dll_bw_hz; - // float pll_bw_narrow_hz; - // float dll_bw_narrow_hz; - // float early_late_space_chips; - // float very_early_late_space_chips; - // float early_late_space_narrow_chips; - // float very_early_late_space_narrow_chips; - // int32_t extend_correlation_symbols; - // int32_t cn0_samples; - // int32_t carrier_lock_det_mav_samples; - // int32_t cn0_min; - // int32_t max_lock_fail; - // double carrier_lock_th; - // bool track_pilot; - // char system; - // char signal[3]; - /* DLL/PLL tracking configuration */ double fs_in; uint32_t vector_length; bool dump; + bool dump_mat; std::string dump_filename; float pll_bw_hz; float dll_bw_hz; From 1f6ae8ea16f1f895981868810f101f40fc7975bf Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Oct 2018 00:48:59 +0100 Subject: [PATCH 024/143] Fix doxygen documentation --- .../gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc | 2 +- .../gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc | 2 +- .../tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc index 2415b4a43..2689e382f 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -1,5 +1,5 @@ /*! - * \file glonass_l1_ca_dll_pll_c_aid_tracking_cc.h + * \file glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc * \brief Implementation of a code DLL + carrier PLL tracking block * \author Gabriel Araujo, 2017. gabriel.araujo.5000(at)gmail.com * \author Luis Esteve, 2017. luis(at)epsilon-formacion.com diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc index fca20580e..19c5cca3e 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc @@ -1,5 +1,5 @@ /*! - * \file glonass_l2_ca_dll_pll_c_aid_tracking_cc.h + * \file glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc * \brief Implementation of a code DLL + carrier PLL tracking block * \author Damian Miralles, 2018. dmiralles2009(at)gmail.com * diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h index da293dc47..7f714500e 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h @@ -1,5 +1,5 @@ /*! - * \file gps_l1_ca_kf_tracking_cc.cc + * \file gps_l1_ca_kf_tracking_cc.h * \brief Interface of a processing block of a DLL + Kalman carrier * tracking loop for GPS L1 C/A signals * \author Javier Arribas, 2018. jarribas(at)cttc.es From f2468e9e17c1ec07efe20d55eaace1a19b95945a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Oct 2018 02:18:32 +0100 Subject: [PATCH 025/143] Improve saving of observables dump: let the user to specify a full path and to deactivate generation of .mat files with dump_mat=false --- .../adapters/hybrid_observables.cc | 9 +-- .../observables/adapters/hybrid_observables.h | 1 + .../gnuradio_blocks/CMakeLists.txt | 4 +- .../gnuradio_blocks/hybrid_observables_cc.cc | 68 +++++++++++++------ .../gnuradio_blocks/hybrid_observables_cc.h | 7 +- 5 files changed, 60 insertions(+), 29 deletions(-) diff --git a/src/algorithms/observables/adapters/hybrid_observables.cc b/src/algorithms/observables/adapters/hybrid_observables.cc index 4313edfee..cf03f2d2c 100644 --- a/src/algorithms/observables/adapters/hybrid_observables.cc +++ b/src/algorithms/observables/adapters/hybrid_observables.cc @@ -38,21 +38,22 @@ using google::LogMessage; HybridObservables::HybridObservables(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { std::string default_dump_filename = "./observables.dat"; DLOG(INFO) << "role " << role; dump_ = configuration->property(role + ".dump", false); + dump_mat_ = configuration->property(role + ".dump_mat", true); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); - observables_ = hybrid_make_observables_cc(in_streams_, out_streams_, dump_, dump_filename_); + observables_ = hybrid_make_observables_cc(in_streams_, out_streams_, dump_, dump_mat_, dump_filename_); DLOG(INFO) << "Observables block ID (" << observables_->unique_id() << ")"; } HybridObservables::~HybridObservables() -{} +{ +} void HybridObservables::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/observables/adapters/hybrid_observables.h b/src/algorithms/observables/adapters/hybrid_observables.h index 57883374a..1beb968fa 100644 --- a/src/algorithms/observables/adapters/hybrid_observables.h +++ b/src/algorithms/observables/adapters/hybrid_observables.h @@ -83,6 +83,7 @@ public: private: hybrid_observables_cc_sptr observables_; bool dump_; + bool dump_mat_; std::string dump_filename_; std::string role_; unsigned int in_streams_; diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index d42409de6..82c5bc243 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -16,11 +16,11 @@ # along with GNSS-SDR. If not, see . # -set(OBS_GR_BLOCKS_SOURCES +set(OBS_GR_BLOCKS_SOURCES hybrid_observables_cc.cc ) -set(OBS_GR_BLOCKS_HEADERS +set(OBS_GR_BLOCKS_HEADERS hybrid_observables_cc.h ) diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc index 81d385cf5..f9ed992b8 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc @@ -32,6 +32,7 @@ #include "hybrid_observables_cc.h" #include "display.h" #include "GPS_L1_CA.h" +#include "gnss_sdr_create_directory.h" #include #include #include @@ -45,42 +46,70 @@ using google::LogMessage; -hybrid_observables_cc_sptr hybrid_make_observables_cc(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, std::string dump_filename) +hybrid_observables_cc_sptr hybrid_make_observables_cc(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, bool dump_mat, std::string dump_filename) { - return hybrid_observables_cc_sptr(new hybrid_observables_cc(nchannels_in, nchannels_out, dump, dump_filename)); + return hybrid_observables_cc_sptr(new hybrid_observables_cc(nchannels_in, nchannels_out, dump, dump_mat, dump_filename)); } hybrid_observables_cc::hybrid_observables_cc(uint32_t nchannels_in, uint32_t nchannels_out, bool dump, + bool dump_mat, std::string dump_filename) : gr::block("hybrid_observables_cc", gr::io_signature::make(nchannels_in, nchannels_in, sizeof(Gnss_Synchro)), gr::io_signature::make(nchannels_out, nchannels_out, sizeof(Gnss_Synchro))) { d_dump = dump; + d_dump_mat = dump_mat and d_dump; + d_dump_filename = dump_filename; d_nchannels_out = nchannels_out; d_nchannels_in = nchannels_in; - d_dump_filename = dump_filename; T_rx_clock_step_samples = 0U; d_gnss_synchro_history = new Gnss_circular_deque(500, d_nchannels_out); // ############# ENABLE DATA FILE LOG ################# if (d_dump) { - if (!d_dump_file.is_open()) + std::string dump_path; + // Get path + if (d_dump_filename.find_last_of("/") != std::string::npos) { - try - { - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Observables dump enabled Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "Exception opening observables dump file " << e.what(); - d_dump = false; - } + std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1); + dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/")); + d_dump_filename = dump_filename_; + } + else + { + dump_path = std::string("."); + } + if (d_dump_filename.empty()) + { + d_dump_filename = "observables.dat"; + } + // remove extension if any + if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos) + { + d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of(".")); + } + d_dump_filename.append(".dat"); + d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename; + // create directory + if (!gnss_sdr_create_directory(dump_path)) + { + std::cerr << "GNSS-SDR cannot create dump file for the Observables block. Wrong permissions?" << std::endl; + d_dump = false; + } + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + try + { + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Observables dump enabled Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "Exception opening observables dump file " << e.what(); + d_dump = false; } } T_rx_TOW_ms = 0U; @@ -107,11 +136,9 @@ hybrid_observables_cc::~hybrid_observables_cc() LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what(); } } - if (d_dump) + if (d_dump_mat) { - std::cout << "Writing observables .mat files ..."; save_matfile(); - std::cout << " done." << std::endl; } } @@ -119,14 +146,16 @@ hybrid_observables_cc::~hybrid_observables_cc() int32_t hybrid_observables_cc::save_matfile() { // READ DUMP FILE + std::string dump_filename = d_dump_filename; std::ifstream::pos_type size; int32_t number_of_double_vars = 7; int32_t epoch_size_bytes = sizeof(double) * number_of_double_vars * d_nchannels_out; std::ifstream dump_file; + std::cout << "Generating .mat file for " << dump_filename << std::endl; dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); try { - dump_file.open(d_dump_filename.c_str(), std::ios::binary | std::ios::ate); + dump_file.open(dump_filename.c_str(), std::ios::binary | std::ios::ate); } catch (const std::ifstream::failure &e) { @@ -553,7 +582,6 @@ int hybrid_observables_cc::general_work(int noutput_items __attribute__((unused) { out[n][0] = epoch_data.at(n); } - if (d_dump) { // MULTIPLEXED FILE RECORDING - Record results to file diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h index 0eed5da1b..033da7a25 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h @@ -48,7 +48,7 @@ class hybrid_observables_cc; typedef boost::shared_ptr hybrid_observables_cc_sptr; hybrid_observables_cc_sptr -hybrid_make_observables_cc(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, std::string dump_filename); +hybrid_make_observables_cc(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, bool dump_mat, std::string dump_filename); /*! * \brief This class implements a block that computes observables @@ -63,8 +63,8 @@ public: private: friend hybrid_observables_cc_sptr - hybrid_make_observables_cc(uint32_t nchannels_in, uint32_t nchannels_out, bool dump, std::string dump_filename); - hybrid_observables_cc(uint32_t nchannels_in, uint32_t nchannels_out, bool dump, std::string dump_filename); + hybrid_make_observables_cc(uint32_t nchannels_in, uint32_t nchannels_out, bool dump, bool dump_mat, std::string dump_filename); + hybrid_observables_cc(uint32_t nchannels_in, uint32_t nchannels_out, bool dump, bool dump_mat, std::string dump_filename); bool interpolate_data(Gnss_Synchro& out, const uint32_t& ch, const double& ti); bool interp_trk_obs(Gnss_Synchro& interpolated_obs, const uint32_t& ch, const uint64_t& rx_clock); double compute_T_rx_s(const Gnss_Synchro& a); @@ -82,6 +82,7 @@ private: uint32_t T_rx_TOW_ms; uint32_t T_rx_TOW_offset_ms; bool d_dump; + bool d_dump_mat; uint32_t d_nchannels_in; uint32_t d_nchannels_out; std::string d_dump_filename; From daa08cc4c61f6a63513c7dfafa5d8b87110617ef Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Oct 2018 03:02:55 +0100 Subject: [PATCH 026/143] Add missing path --- .../observables/gnuradio_blocks/hybrid_observables_cc.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc index f9ed992b8..ffd395462 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc @@ -33,6 +33,7 @@ #include "display.h" #include "GPS_L1_CA.h" #include "gnss_sdr_create_directory.h" +#include #include #include #include From 49ab6e425d26236cb7f2a37d481b0b046b48e336 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Oct 2018 10:49:30 +0100 Subject: [PATCH 027/143] Fix DOP computation for all signals --- src/algorithms/PVT/libs/rtklib_solver.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 4d43c18b4..9159407fd 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -493,7 +493,7 @@ bool rtklib_solver::get_PVT(const std::map& gnss_observables_ unsigned int used_sats = 0; for (unsigned int i = 0; i < MAXSAT; i++) { - if (rtk_.ssat[i].vsat[0] == 1) used_sats++; + if (rtk_.ssat[i].vs == 1) used_sats++; } std::vector azel; @@ -501,7 +501,7 @@ bool rtklib_solver::get_PVT(const std::map& gnss_observables_ unsigned int index_aux = 0; for (unsigned int i = 0; i < MAXSAT; i++) { - if (rtk_.ssat[i].vsat[0] == 1) + if (rtk_.ssat[i].vs == 1) { azel[2 * index_aux] = rtk_.ssat[i].azel[0]; azel[2 * index_aux + 1] = rtk_.ssat[i].azel[1]; From 902c90ef44794a9a08edd5e6c2feb9389c8f0b94 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Oct 2018 11:41:15 +0100 Subject: [PATCH 028/143] Allow to save the PVT dump file anywhere --- .../PVT/gnuradio_blocks/CMakeLists.txt | 1 + .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 40 +++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt index 72ce3f436..adaac0125 100644 --- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt @@ -36,6 +36,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/core/receiver ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib + ${CMAKE_SOURCE_DIR}/src/algorithms/libs ${ARMADILLO_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 3e604cd90..34fa61800 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -33,10 +33,12 @@ #include "galileo_almanac_helper.h" #include "pvt_conf.h" #include "display.h" +#include "gnss_sdr_create_directory.h" #include #include #include #include +#include #include #include #include @@ -247,9 +249,43 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, d_output_rate_ms = conf_.output_rate_ms; d_display_rate_ms = conf_.display_rate_ms; d_dump = conf_.dump; - d_nchannels = nchannels; d_dump_filename = conf_.dump_filename; std::string dump_ls_pvt_filename = conf_.dump_filename; + if (d_dump) + { + std::string dump_path; + // Get path + if (d_dump_filename.find_last_of("/") != std::string::npos) + { + std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1); + dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/")); + d_dump_filename = dump_filename_; + } + else + { + dump_path = std::string("."); + } + if (d_dump_filename.empty()) + { + d_dump_filename = "pvt"; + } + // remove extension if any + if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos) + { + d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of(".")); + } + dump_ls_pvt_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename; + dump_ls_pvt_filename.append(".dat"); + // create directory + if (!gnss_sdr_create_directory(dump_path)) + { + std::cerr << "GNSS-SDR cannot create dump file for the PVT block. Wrong permissions?" << std::endl; + d_dump = false; + } + } + + d_nchannels = nchannels; + type_of_rx = conf_.type_of_receiver; // GPS Ephemeris data message port in @@ -412,8 +448,6 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, xml_base_path = xml_base_path + boost::filesystem::path::preferred_separator; } - dump_ls_pvt_filename.append("_pvt.dat"); - d_ls_pvt = std::make_shared(static_cast(nchannels), dump_ls_pvt_filename, d_dump, rtk); d_ls_pvt->set_averaging_depth(1); From 1269be3a7264600e4660d5e12fa3b3461974eb95 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Oct 2018 12:04:59 +0100 Subject: [PATCH 029/143] Allow to save Acq dump anywhere --- .../gnuradio_blocks/CMakeLists.txt | 5 +- .../gnuradio_blocks/pcps_acquisition.cc | 53 +++++++++++++++---- .../gnuradio_blocks/pcps_acquisition.h | 2 + .../pcps_acquisition_fine_doppler_cc.cc | 34 ++++++++++++ 4 files changed, 83 insertions(+), 11 deletions(-) diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index 327b1a927..bd1800d35 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -37,13 +37,13 @@ set(ACQ_GR_BLOCKS_HEADERS pcps_quicksync_acquisition_cc.h galileo_pcps_8ms_acquisition_cc.h galileo_e5a_noncoherent_iq_acquisition_caf_cc.h -) +) if(ENABLE_FPGA) set(ACQ_GR_BLOCKS_SOURCES ${ACQ_GR_BLOCKS_SOURCES} pcps_acquisition_fpga.cc) set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_acquisition_fpga.h) endif(ENABLE_FPGA) - + if(OPENCL_FOUND) set(ACQ_GR_BLOCKS_SOURCES ${ACQ_GR_BLOCKS_SOURCES} pcps_opencl_acquisition_cc.cc) set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_opencl_acquisition_cc.h) @@ -56,6 +56,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/core/receiver ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${Boost_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS} ${ARMADILLO_INCLUDE_DIRS} diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 034cbbd10..1bb4b39a7 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -36,6 +36,8 @@ #include "pcps_acquisition.h" #include "GPS_L1_CA.h" // for GPS_TWO_PI #include "GLONASS_L1_L2_CA.h" // for GLONASS_TWO_PI" +#include "gnss_sdr_create_directory.h" +#include #include #include #include @@ -136,8 +138,7 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu narrow_grid_ = arma::fmat(); d_step_two = false; d_num_doppler_bins_step2 = acq_parameters.num_doppler_bins_step2; - d_dump_number = 0LL; - d_dump_channel = acq_parameters.dump_channel; + d_samplesPerChip = acq_parameters.samples_per_chip; d_buffer_count = 0U; // todo: CFAR statistic not available for non-coherent integration @@ -149,9 +150,43 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu { d_use_CFAR_algorithm_flag = false; } + d_dump_number = 0LL; + d_dump_channel = acq_parameters.dump_channel; + d_dump = acq_parameters.dump; + d_dump_filename = acq_parameters.dump_filename; + if (d_dump) + { + std::string dump_path; + // Get path + if (d_dump_filename.find_last_of("/") != std::string::npos) + { + std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1); + dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/")); + d_dump_filename = dump_filename_; + } + else + { + dump_path = std::string("."); + } + if (d_dump_filename.empty()) + { + d_dump_filename = "acquisition"; + } + // remove extension if any + if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos) + { + d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of(".")); + } + d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename; + // create directory + if (!gnss_sdr_create_directory(dump_path)) + { + std::cerr << "GNSS-SDR cannot create dump file for the Acquisition block. Wrong permissions?" << std::endl; + d_dump = false; + } + } } - pcps_acquisition::~pcps_acquisition() { if (d_num_doppler_bins > 0) @@ -303,7 +338,7 @@ void pcps_acquisition::init() d_worker_active = false; - if (acq_parameters.dump) + if (d_dump) { uint32_t effective_fft_size = (acq_parameters.bit_transition_flag ? (d_fft_size / 2) : d_fft_size); grid_ = arma::fmat(effective_fft_size, d_num_doppler_bins, arma::fill::zeros); @@ -396,7 +431,7 @@ void pcps_acquisition::send_negative_acquisition() void pcps_acquisition::dump_results(int32_t effective_fft_size) { d_dump_number++; - std::string filename = acq_parameters.dump_filename; + std::string filename = d_dump_filename; filename.append("_"); filename.append(1, d_gnss_synchro->System); filename.append("_"); @@ -414,7 +449,7 @@ void pcps_acquisition::dump_results(int32_t effective_fft_size) if (matfp == NULL) { std::cout << "Unable to create or open Acquisition dump file" << std::endl; - acq_parameters.dump = false; + //acq_parameters.dump = false; } else { @@ -669,7 +704,7 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count) volk_32f_x2_add_32f(d_magnitude_grid[doppler_index], d_magnitude_grid[doppler_index], d_tmp_buffer, effective_fft_size); } // Record results to file if required - if (acq_parameters.dump and d_channel == d_dump_channel) + if (d_dump and d_channel == d_dump_channel) { memcpy(grid_.colptr(doppler_index), d_magnitude_grid[doppler_index], sizeof(float) * effective_fft_size); } @@ -716,7 +751,7 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count) volk_32f_x2_add_32f(d_magnitude_grid[doppler_index], d_magnitude_grid[doppler_index], d_tmp_buffer, effective_fft_size); } // Record results to file if required - if (acq_parameters.dump and d_channel == d_dump_channel) + if (d_dump and d_channel == d_dump_channel) { memcpy(narrow_grid_.colptr(doppler_index), d_magnitude_grid[doppler_index], sizeof(float) * effective_fft_size); } @@ -816,7 +851,7 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count) if ((d_num_noncoherent_integrations_counter == acq_parameters.max_dwells) or (d_positive_acq == 1)) { // Record results to file if required - if (acq_parameters.dump and d_channel == d_dump_channel) + if (d_dump and d_channel == d_dump_channel) { pcps_acquisition::dump_results(effective_fft_size); } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h index c97daef96..4e46d049b 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h @@ -138,6 +138,8 @@ private: int64_t d_dump_number; uint32_t d_dump_channel; uint32_t d_buffer_count; + bool d_dump; + std::string d_dump_filename; public: ~pcps_acquisition(); diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc index a056436a5..894b6ef20 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc @@ -34,6 +34,8 @@ #include "gps_sdr_signal_processing.h" #include "control_message_factory.h" #include "GPS_L1_CA.h" +#include "gnss_sdr_create_directory.h" +#include #include #include #include @@ -85,6 +87,38 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con d_dump = conf_.dump; d_dump_filename = conf_.dump_filename; + if (d_dump) + { + std::string dump_path; + // Get path + if (d_dump_filename.find_last_of("/") != std::string::npos) + { + std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1); + dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/")); + d_dump_filename = dump_filename_; + } + else + { + dump_path = std::string("."); + } + if (d_dump_filename.empty()) + { + d_dump_filename = "acquisition"; + } + // remove extension if any + if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos) + { + d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of(".")); + } + d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename; + // create directory + if (!gnss_sdr_create_directory(dump_path)) + { + std::cerr << "GNSS-SDR cannot create dump file for the Acquisition block. Wrong permissions?" << std::endl; + d_dump = false; + } + } + d_n_samples_in_buffer = 0; d_threshold = 0; d_num_doppler_points = 0; From a970ef659001a3d9f6c717ce398c9ae644eb213e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Oct 2018 20:11:26 +0100 Subject: [PATCH 030/143] Fix default name of PVT dump file --- src/tests/system-tests/libs/position_test_flags.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/system-tests/libs/position_test_flags.h b/src/tests/system-tests/libs/position_test_flags.h index f6575c6d3..a0e3d6197 100644 --- a/src/tests/system-tests/libs/position_test_flags.h +++ b/src/tests/system-tests/libs/position_test_flags.h @@ -41,7 +41,7 @@ DEFINE_bool(use_pvt_solver_dump, false, "Use PVT solver binary dump or fall back DEFINE_bool(use_ref_motion_file, false, "Enable or disable the use of a reference file containing the true receiver position, velocity and acceleration."); DEFINE_int32(ref_motion_file_type, 1, "Type of reference motion file: 1- Spirent CSV motion file"); DEFINE_string(ref_motion_filename, std::string("motion.csv"), "Path and filename for the reference motion file"); -DEFINE_string(pvt_solver_dump_filename, std::string("PVT_pvt.dat"), "Path and filename for the PVT solver binary dump file"); +DEFINE_string(pvt_solver_dump_filename, std::string("PVT.dat"), "Path and filename for the PVT solver binary dump file"); DEFINE_double(static_2D_error_m, 2.0, "Static scenario 2D (East, North) positioning error threshold [meters]"); DEFINE_double(static_3D_error_m, 5.0, "Static scenario 3D (East, North, Up) positioning error threshold [meters]"); DEFINE_double(accuracy_CEP, 2.0, "Static scenario 2D (East, North) accuracy Circular Error Position (CEP) threshold [meters]"); From 29b0212c40dd7440252fdcbe2734774ba900b976 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Oct 2018 21:09:34 +0100 Subject: [PATCH 031/143] Uniformize Acqusition dump basename to ./acquisition_XXX.mat --- .../adapters/galileo_e1_pcps_ambiguous_acquisition.cc | 2 +- .../adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc | 2 +- .../acquisition/adapters/galileo_e5a_pcps_acquisition.cc | 2 +- .../acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc | 2 +- .../acquisition/adapters/gps_l1_ca_pcps_acquisition.cc | 2 +- .../adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc | 2 +- .../acquisition/adapters/gps_l2_m_pcps_acquisition.cc | 2 +- .../acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc | 2 +- src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc | 2 +- .../acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc index 74c2db439..7efab9681 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -53,7 +53,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( Acq_Conf acq_parameters; configuration_ = configuration; std::string default_item_type = "gr_complex"; - std::string default_dump_filename = "./data/acquisition.dat"; + std::string default_dump_filename = "./acquisition.mat"; DLOG(INFO) << "role " << role; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc index deb7e77b5..041039147 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc @@ -53,7 +53,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( pcpsconf_fpga_t acq_parameters; configuration_ = configuration; std::string default_item_type = "gr_complex"; - std::string default_dump_filename = "./data/acquisition.dat"; + std::string default_dump_filename = "./acquisition.mat"; DLOG(INFO) << "role " << role; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc index 623159d17..2bd081e3e 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc @@ -52,7 +52,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; std::string default_item_type = "gr_complex"; - std::string default_dump_filename = "../data/acquisition.dat"; + std::string default_dump_filename = "./acquisition.mat"; DLOG(INFO) << "Role " << role; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc index 710bd5237..30f2195b9 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -52,7 +52,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf pcpsconf_fpga_t acq_parameters; configuration_ = configuration; std::string default_item_type = "gr_complex"; - std::string default_dump_filename = "../data/acquisition.dat"; + std::string default_dump_filename = "./acquisition.mat"; DLOG(INFO) << "Role " << role; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc index e1b4857ad..30d7aa42d 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -56,7 +56,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; std::string default_item_type = "gr_complex"; - std::string default_dump_filename = "./data/acquisition.dat"; + std::string default_dump_filename = "./acquisition.mat"; DLOG(INFO) << "role " << role; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc index 38bc04716..dd69ed24f 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc @@ -51,7 +51,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { std::string default_item_type = "gr_complex"; - std::string default_dump_filename = "./data/acquisition.dat"; + std::string default_dump_filename = "./acquisition.mat"; DLOG(INFO) << "role " << role; Acq_Conf acq_parameters = Acq_Conf(); diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc index b10104bd7..32b426777 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -54,7 +54,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; std::string default_item_type = "gr_complex"; - std::string default_dump_filename = "./data/acquisition.dat"; + std::string default_dump_filename = "./acquisition.mat"; LOG(INFO) << "role " << role; diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc index fc988724f..db53d3815 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc @@ -55,7 +55,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( pcpsconf_fpga_t acq_parameters; configuration_ = configuration; std::string default_item_type = "gr_complex"; - std::string default_dump_filename = "./data/acquisition.dat"; + std::string default_dump_filename = "./acquisition.mat"; LOG(INFO) << "role " << role; diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc index 13ac34ec5..36d6e4f7a 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc @@ -54,7 +54,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; std::string default_item_type = "gr_complex"; - std::string default_dump_filename = "./data/acquisition.dat"; + std::string default_dump_filename = "./acquisition.mat"; LOG(INFO) << "role " << role; diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc index d03663d79..124999dc9 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc @@ -55,7 +55,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( pcpsconf_fpga_t acq_parameters; configuration_ = configuration; std::string default_item_type = "gr_complex"; - std::string default_dump_filename = "./data/acquisition.dat"; + std::string default_dump_filename = "./acquisition.mat"; LOG(INFO) << "role " << role; From 7d045baa905ee8fed1964c53f68924d6cc8156b5 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 31 Oct 2018 10:47:09 +0100 Subject: [PATCH 032/143] Fix name of saved file --- src/utils/reproducibility/ieee-access18/plot_dump.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/reproducibility/ieee-access18/plot_dump.m b/src/utils/reproducibility/ieee-access18/plot_dump.m index 5865235ff..11aaba424 100644 --- a/src/utils/reproducibility/ieee-access18/plot_dump.m +++ b/src/utils/reproducibility/ieee-access18/plot_dump.m @@ -62,8 +62,8 @@ ylabel('Navigation data bits','fontname','Times','fontsize', fontsize) grid on -fileID = fopen('data/access18_pvt.dat', 'r'); -dinfo = dir('data/access18_pvt.dat'); +fileID = fopen('data/access18.dat', 'r'); +dinfo = dir('data/access18.dat'); filesize = dinfo.bytes; aux = 1; while ne(ftell(fileID), filesize) From 257099fee1a5569428c00ce30f016034f4a8c621 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 31 Oct 2018 11:06:48 +0100 Subject: [PATCH 033/143] Fix warning --- .../observables/hybrid_observables_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc index d3f232a50..9422e144a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc @@ -1836,9 +1836,9 @@ TEST_F(HybridObservablesTest, ValidationOfResults) if (FLAGS_duplicated_satellites_test) { //special test mode for duplicated satellites - std::vector prn_pairs; + std::vector prn_pairs; std::stringstream ss(FLAGS_duplicated_satellites_prns); - int i; + unsigned int i; while (ss >> i) { prn_pairs.push_back(i); From 39a062ca008370ba33a6780dd96aa179afba25d4 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 31 Oct 2018 14:56:59 +0100 Subject: [PATCH 034/143] Save PVT dump also in .mat. New parameter dump_mat can disable this feature --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 1 + .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 3 +- .../PVT/gnuradio_blocks/rtklib_pvt_cc.h | 1 + src/algorithms/PVT/libs/pvt_conf.cc | 1 + src/algorithms/PVT/libs/pvt_conf.h | 1 + src/algorithms/PVT/libs/rtklib_solver.cc | 367 ++++++++++++++++-- src/algorithms/PVT/libs/rtklib_solver.h | 4 +- .../pvt/nmea_printer_test.cc | 4 +- .../pvt/rtklib_solver_test.cc | 3 +- 9 files changed, 347 insertions(+), 38 deletions(-) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 65152bf8d..1fdaca521 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -64,6 +64,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, DLOG(INFO) << "role " << role; pvt_output_parameters.dump = configuration->property(role + ".dump", false); pvt_output_parameters.dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + pvt_output_parameters.dump_mat = configuration->property(role + ".dump_mat", true); // output rate pvt_output_parameters.output_rate_ms = configuration->property(role + ".output_rate_ms", 500); diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 34fa61800..970850059 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -249,6 +249,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, d_output_rate_ms = conf_.output_rate_ms; d_display_rate_ms = conf_.display_rate_ms; d_dump = conf_.dump; + d_dump_mat = conf_.dump_mat and d_dump; d_dump_filename = conf_.dump_filename; std::string dump_ls_pvt_filename = conf_.dump_filename; if (d_dump) @@ -448,7 +449,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, xml_base_path = xml_base_path + boost::filesystem::path::preferred_separator; } - d_ls_pvt = std::make_shared(static_cast(nchannels), dump_ls_pvt_filename, d_dump, rtk); + d_ls_pvt = std::make_shared(static_cast(nchannels), dump_ls_pvt_filename, d_dump, d_dump_mat, rtk); d_ls_pvt->set_averaging_depth(1); d_rx_time = 0.0; diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index 45ba07461..38db64a1b 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -72,6 +72,7 @@ private: void msg_handler_telemetry(pmt::pmt_t msg); bool d_dump; + bool d_dump_mat; bool b_rinex_output_enabled; bool b_rinex_header_written; bool b_rinex_header_updated; diff --git a/src/algorithms/PVT/libs/pvt_conf.cc b/src/algorithms/PVT/libs/pvt_conf.cc index c2f21dcf4..0f528f438 100644 --- a/src/algorithms/PVT/libs/pvt_conf.cc +++ b/src/algorithms/PVT/libs/pvt_conf.cc @@ -41,6 +41,7 @@ Pvt_Conf::Pvt_Conf() rinexnav_rate_ms = 0; dump = false; + dump_mat = true; flag_nmea_tty_port = false; diff --git a/src/algorithms/PVT/libs/pvt_conf.h b/src/algorithms/PVT/libs/pvt_conf.h index 8f47d3765..1719863e1 100644 --- a/src/algorithms/PVT/libs/pvt_conf.h +++ b/src/algorithms/PVT/libs/pvt_conf.h @@ -49,6 +49,7 @@ public: std::map rtcm_msg_rate_ms; bool dump; + bool dump_mat; std::string dump_filename; bool flag_nmea_tty_port; diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 9159407fd..12d316196 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -56,17 +56,19 @@ #include "GPS_L1_CA.h" #include "Galileo_E1.h" #include "GLONASS_L1_L2_CA.h" +#include #include using google::LogMessage; -rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, rtk_t& rtk) +rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, rtk_t &rtk) { // init empty ephemeris for all the available GNSS channels d_nchannels = nchannels; d_dump_filename = dump_filename; d_flag_dump_enabled = flag_dump_to_file; + d_flag_dump_mat_enabled = flag_dump_to_mat; count_valid_position = 0; this->set_averaging_flag(false); rtk_ = rtk; @@ -84,7 +86,7 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "PVT lib dump enabled Log file: " << d_dump_filename.c_str(); } - catch (const std::ifstream::failure& e) + catch (const std::ifstream::failure &e) { LOG(WARNING) << "Exception opening RTKLIB dump file " << e.what(); } @@ -92,6 +94,301 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag } } +bool rtklib_solver::save_matfile() +{ + // READ DUMP FILE + std::string dump_filename = d_dump_filename; + std::ifstream::pos_type size; + int32_t number_of_double_vars = 21; + int32_t number_of_uint32_vars = 2; + int32_t number_of_uint8_vars = 3; + int32_t number_of_float_vars = 2; + int32_t epoch_size_bytes = sizeof(double) * number_of_double_vars + + sizeof(uint32_t) * number_of_uint32_vars + + sizeof(uint8_t) * number_of_uint8_vars + + sizeof(float) * number_of_float_vars; + std::ifstream dump_file; + std::cout << "Generating .mat file for " << dump_filename << std::endl; + dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + try + { + dump_file.open(dump_filename.c_str(), std::ios::binary | std::ios::ate); + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem opening dump file:" << e.what() << std::endl; + return false; + } + // count number of epochs and rewind + int64_t num_epoch = 0LL; + if (dump_file.is_open()) + { + size = dump_file.tellg(); + num_epoch = static_cast(size) / static_cast(epoch_size_bytes); + dump_file.seekg(0, std::ios::beg); + } + else + { + return false; + } + + uint32_t *TOW_at_current_symbol_ms = new uint32_t[num_epoch]; + uint32_t *week = new uint32_t[num_epoch]; + double *RX_time = new double[num_epoch]; + double *user_clk_offset = new double[num_epoch]; + double *pos_x = new double[num_epoch]; + double *pos_y = new double[num_epoch]; + double *pos_z = new double[num_epoch]; + double *vel_x = new double[num_epoch]; + double *vel_y = new double[num_epoch]; + double *vel_z = new double[num_epoch]; + double *cov_xx = new double[num_epoch]; + double *cov_yy = new double[num_epoch]; + double *cov_zz = new double[num_epoch]; + double *cov_xy = new double[num_epoch]; + double *cov_yz = new double[num_epoch]; + double *cov_zx = new double[num_epoch]; + double *latitude = new double[num_epoch]; + double *longitude = new double[num_epoch]; + double *height = new double[num_epoch]; + uint8_t *valid_sats = new uint8_t[num_epoch]; + uint8_t *solution_status = new uint8_t[num_epoch]; + uint8_t *solution_type = new uint8_t[num_epoch]; + float *AR_ratio_factor = new float[num_epoch]; + float *AR_ratio_threshold = new float[num_epoch]; + double *gdop = new double[num_epoch]; + double *pdop = new double[num_epoch]; + double *hdop = new double[num_epoch]; + double *vdop = new double[num_epoch]; + + try + { + if (dump_file.is_open()) + { + for (int64_t i = 0; i < num_epoch; i++) + { + dump_file.read(reinterpret_cast(&TOW_at_current_symbol_ms[i]), sizeof(uint32_t)); + dump_file.read(reinterpret_cast(&week[i]), sizeof(uint32_t)); + dump_file.read(reinterpret_cast(&RX_time[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&user_clk_offset[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&pos_x[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&pos_y[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&pos_z[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&vel_x[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&vel_y[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&vel_z[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&cov_xx[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&cov_yy[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&cov_zz[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&cov_xy[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&cov_yz[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&cov_zx[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&latitude[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&longitude[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&height[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&valid_sats[i]), sizeof(uint8_t)); + dump_file.read(reinterpret_cast(&solution_status[i]), sizeof(uint8_t)); + dump_file.read(reinterpret_cast(&solution_type[i]), sizeof(uint8_t)); + dump_file.read(reinterpret_cast(&AR_ratio_factor[i]), sizeof(float)); + dump_file.read(reinterpret_cast(&AR_ratio_threshold[i]), sizeof(float)); + dump_file.read(reinterpret_cast(&gdop[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&pdop[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&hdop[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&vdop[i]), sizeof(double)); + } + } + dump_file.close(); + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem reading dump file:" << e.what() << std::endl; + delete[] TOW_at_current_symbol_ms; + delete[] week; + delete[] RX_time; + delete[] user_clk_offset; + delete[] pos_x; + delete[] pos_y; + delete[] pos_z; + delete[] vel_x; + delete[] vel_y; + delete[] vel_z; + delete[] cov_xx; + delete[] cov_yy; + delete[] cov_zz; + delete[] cov_xy; + delete[] cov_yz; + delete[] cov_zx; + delete[] latitude; + delete[] longitude; + delete[] height; + delete[] valid_sats; + delete[] solution_status; + delete[] solution_type; + delete[] AR_ratio_factor; + delete[] AR_ratio_threshold; + delete[] gdop; + delete[] pdop; + delete[] hdop; + delete[] vdop; + + return false; + } + + // WRITE MAT FILE + mat_t *matfp; + matvar_t *matvar; + std::string filename = dump_filename; + filename.erase(filename.length() - 4, 4); + filename.append(".mat"); + matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != NULL) + { + size_t dims[2] = {1, static_cast(num_epoch)}; + matvar = Mat_VarCreate("TOW_at_current_symbol_ms", MAT_C_UINT32, MAT_T_UINT32, 2, dims, TOW_at_current_symbol_ms, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("week", MAT_C_UINT32, MAT_T_UINT32, 2, dims, week, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("RX_time", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, RX_time, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("user_clk_offset", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, user_clk_offset, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("pos_x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, pos_x, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("pos_y", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, pos_y, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("pos_z", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, pos_z, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("vel_x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, vel_x, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("vel_y", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, vel_y, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("vel_z", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, vel_z, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("cov_xx", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, cov_xx, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("cov_yy", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, cov_yy, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("cov_zz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, cov_zz, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("cov_xy", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, cov_xy, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("cov_yz", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, cov_yz, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("cov_zx", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, cov_zx, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("latitude", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, latitude, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("longitude", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, longitude, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("height", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, height, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("valid_sats", MAT_C_UINT8, MAT_T_UINT8, 2, dims, valid_sats, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("solution_status", MAT_C_UINT8, MAT_T_UINT8, 2, dims, solution_status, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("solution_type", MAT_C_UINT8, MAT_T_UINT8, 2, dims, solution_type, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("AR_ratio_factor", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, AR_ratio_factor, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("AR_ratio_threshold", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, AR_ratio_threshold, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("gdop", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, gdop, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("pdop", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, pdop, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("hdop", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, hdop, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("vdop", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, vdop, 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + } + + Mat_Close(matfp); + delete[] TOW_at_current_symbol_ms; + delete[] week; + delete[] RX_time; + delete[] user_clk_offset; + delete[] pos_x; + delete[] pos_y; + delete[] pos_z; + delete[] vel_x; + delete[] vel_y; + delete[] vel_z; + delete[] cov_xx; + delete[] cov_yy; + delete[] cov_zz; + delete[] cov_xy; + delete[] cov_yz; + delete[] cov_zx; + delete[] latitude; + delete[] longitude; + delete[] height; + delete[] valid_sats; + delete[] solution_status; + delete[] solution_type; + delete[] AR_ratio_factor; + delete[] AR_ratio_threshold; + delete[] gdop; + delete[] pdop; + delete[] hdop; + delete[] vdop; + + return true; +} rtklib_solver::~rtklib_solver() { @@ -101,11 +398,15 @@ rtklib_solver::~rtklib_solver() { d_dump_file.close(); } - catch (const std::exception& ex) + catch (const std::exception &ex) { LOG(WARNING) << "Exception in destructor closing the RTKLIB dump file " << ex.what(); } } + if (d_flag_dump_mat_enabled) + { + save_matfile(); + } } @@ -133,7 +434,7 @@ double rtklib_solver::get_vdop() const } -bool rtklib_solver::get_PVT(const std::map& gnss_observables_map, bool flag_averaging) +bool rtklib_solver::get_PVT(const std::map &gnss_observables_map, bool flag_averaging) { std::map::const_iterator gnss_observables_iter; std::map::const_iterator galileo_ephemeris_iter; @@ -559,73 +860,73 @@ bool rtklib_solver::get_PVT(const std::map& gnss_observables_ uint32_t tmp_uint32; // TOW tmp_uint32 = gnss_observables_map.begin()->second.TOW_at_current_symbol_ms; - d_dump_file.write(reinterpret_cast(&tmp_uint32), sizeof(uint32_t)); + d_dump_file.write(reinterpret_cast(&tmp_uint32), sizeof(uint32_t)); // WEEK tmp_uint32 = adjgpsweek(nav_data.eph[0].week); - d_dump_file.write(reinterpret_cast(&tmp_uint32), sizeof(uint32_t)); + d_dump_file.write(reinterpret_cast(&tmp_uint32), sizeof(uint32_t)); // PVT GPS time tmp_double = gnss_observables_map.begin()->second.RX_time; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // User clock offset [s] tmp_double = rx_position_and_time(3); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // ECEF POS X,Y,X [m] + ECEF VEL X,Y,X [m/s] (6 x double) tmp_double = pvt_sol.rr[0]; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = pvt_sol.rr[1]; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = pvt_sol.rr[2]; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = pvt_sol.rr[3]; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = pvt_sol.rr[4]; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = pvt_sol.rr[5]; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // position variance/covariance (m^2) {c_xx,c_yy,c_zz,c_xy,c_yz,c_zx} (6 x double) tmp_double = pvt_sol.qr[0]; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = pvt_sol.qr[1]; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = pvt_sol.qr[2]; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = pvt_sol.qr[3]; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = pvt_sol.qr[4]; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_double = pvt_sol.qr[5]; - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // GEO user position Latitude [deg] tmp_double = get_latitude(); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // GEO user position Longitude [deg] tmp_double = get_longitude(); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // GEO user position Height [m] tmp_double = get_height(); - d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); // NUMBER OF VALID SATS - d_dump_file.write(reinterpret_cast(&pvt_sol.ns), sizeof(uint8_t)); + d_dump_file.write(reinterpret_cast(&pvt_sol.ns), sizeof(uint8_t)); // RTKLIB solution status - d_dump_file.write(reinterpret_cast(&pvt_sol.stat), sizeof(uint8_t)); + d_dump_file.write(reinterpret_cast(&pvt_sol.stat), sizeof(uint8_t)); // RTKLIB solution type (0:xyz-ecef,1:enu-baseline) - d_dump_file.write(reinterpret_cast(&pvt_sol.type), sizeof(uint8_t)); + d_dump_file.write(reinterpret_cast(&pvt_sol.type), sizeof(uint8_t)); // AR ratio factor for validation - d_dump_file.write(reinterpret_cast(&pvt_sol.ratio), sizeof(float)); + d_dump_file.write(reinterpret_cast(&pvt_sol.ratio), sizeof(float)); // AR ratio threshold for validation - d_dump_file.write(reinterpret_cast(&pvt_sol.thres), sizeof(float)); + d_dump_file.write(reinterpret_cast(&pvt_sol.thres), sizeof(float)); // GDOP / PDOP/ HDOP/ VDOP - d_dump_file.write(reinterpret_cast(&dop_[0]), sizeof(double)); - d_dump_file.write(reinterpret_cast(&dop_[1]), sizeof(double)); - d_dump_file.write(reinterpret_cast(&dop_[2]), sizeof(double)); - d_dump_file.write(reinterpret_cast(&dop_[3]), sizeof(double)); + d_dump_file.write(reinterpret_cast(&dop_[0]), sizeof(double)); + d_dump_file.write(reinterpret_cast(&dop_[1]), sizeof(double)); + d_dump_file.write(reinterpret_cast(&dop_[2]), sizeof(double)); + d_dump_file.write(reinterpret_cast(&dop_[3]), sizeof(double)); } - catch (const std::ifstream::failure& e) + catch (const std::ifstream::failure &e) { LOG(WARNING) << "Exception writing RTKLIB dump file " << e.what(); } diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 3bd054954..b584c4826 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -77,14 +77,16 @@ private: rtk_t rtk_; std::string d_dump_filename; std::ofstream d_dump_file; + bool save_matfile(); bool d_flag_dump_enabled; + bool d_flag_dump_mat_enabled; int d_nchannels; // Number of available channels for positioning double dop_[4]; public: sol_t pvt_sol; - rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, rtk_t& rtk); + rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, rtk_t& rtk); ~rtklib_solver(); bool get_PVT(const std::map& gnss_observables_map, bool flag_averaging); diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc index 4e5c01fae..535cca464 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc @@ -157,7 +157,7 @@ void NmeaPrinterTest::conf() TEST_F(NmeaPrinterTest, PrintLine) { std::string filename("nmea_test.nmea"); - std::shared_ptr pvt_solution = std::make_shared(12, "filename", false, rtk); + std::shared_ptr pvt_solution = std::make_shared(12, "filename", false, false, rtk); boost::posix_time::ptime pt(boost::gregorian::date(1994, boost::date_time::Nov, 19), boost::posix_time::hours(22) + boost::posix_time::minutes(54) + boost::posix_time::seconds(46)); // example from http://aprs.gids.nl/nmea/#rmc @@ -196,7 +196,7 @@ TEST_F(NmeaPrinterTest, PrintLine) TEST_F(NmeaPrinterTest, PrintLineLessthan10min) { std::string filename("nmea_test.nmea"); - std::shared_ptr pvt_solution = std::make_shared(12, "filename", false, rtk); + std::shared_ptr pvt_solution = std::make_shared(12, "filename", false, false, rtk); boost::posix_time::ptime pt(boost::gregorian::date(1994, boost::date_time::Nov, 19), boost::posix_time::hours(22) + boost::posix_time::minutes(54) + boost::posix_time::seconds(46)); // example from http://aprs.gids.nl/nmea/#rmc diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc index 22615cc2a..fe0c81ab6 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc @@ -330,9 +330,10 @@ TEST(RTKLibSolverTest, test1) int nchannels = 8; std::string dump_filename = ".rtklib_solver_dump.dat"; bool flag_dump_to_file = false; + bool save_to_mat = false; rtk_t rtk = configure_rtklib_options(); - std::unique_ptr d_ls_pvt(new rtklib_solver(nchannels, dump_filename, flag_dump_to_file, rtk)); + std::unique_ptr d_ls_pvt(new rtklib_solver(nchannels, dump_filename, flag_dump_to_file, save_to_mat, rtk)); d_ls_pvt->set_averaging_depth(1); // load ephemeris From e5122198ae4c83d7bd1688c002271550a78cca5e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 31 Oct 2018 16:17:11 +0100 Subject: [PATCH 035/143] Fix error reading eccentricity from the almanac --- src/core/libs/gnss_sdr_supl_client.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index dae736999..b95221856 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -268,7 +268,7 @@ void gnss_sdr_supl_client::read_supl_data() gps_almanac_iterator->second.d_sqrt_A = static_cast(a->A_sqrt) * pow(2.0, -11); gps_almanac_iterator->second.d_OMEGA_DOT = static_cast(a->OMEGA_dot) * pow(2.0, -38); gps_almanac_iterator->second.d_Toa = static_cast(a->toa) * pow(2.0, 12); - gps_almanac_iterator->second.d_e_eccentricity = static_cast(a->toa) * pow(2.0, -21); + gps_almanac_iterator->second.d_e_eccentricity = static_cast(a->e) * pow(2.0, -21); gps_almanac_iterator->second.d_M_0 = static_cast(a->M0) * pow(2.0, -23); } } From 0e2eb0b7417d46c840bcbce406ed08c3aabb086b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 31 Oct 2018 16:18:06 +0100 Subject: [PATCH 036/143] Adding missing parameters in GPS almanac class --- src/core/system_parameters/gps_almanac.cc | 2 ++ src/core/system_parameters/gps_almanac.h | 26 +++++++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/core/system_parameters/gps_almanac.cc b/src/core/system_parameters/gps_almanac.cc index acf7068b0..c2776dcce 100644 --- a/src/core/system_parameters/gps_almanac.cc +++ b/src/core/system_parameters/gps_almanac.cc @@ -37,6 +37,7 @@ Gps_Almanac::Gps_Almanac() i_satellite_PRN = 0U; d_Delta_i = 0.0; d_Toa = 0.0; + i_WNa = 0; d_M_0 = 0.0; d_e_eccentricity = 0.0; d_sqrt_A = 0.0; @@ -44,6 +45,7 @@ Gps_Almanac::Gps_Almanac() d_OMEGA = 0.0; d_OMEGA_DOT = 0.0; i_SV_health = 0; + i_AS_status = 0; d_A_f0 = 0.0; d_A_f1 = 0.0; } diff --git a/src/core/system_parameters/gps_almanac.h b/src/core/system_parameters/gps_almanac.h index d3628059e..57288d3db 100644 --- a/src/core/system_parameters/gps_almanac.h +++ b/src/core/system_parameters/gps_almanac.h @@ -44,17 +44,19 @@ class Gps_Almanac { public: uint32_t i_satellite_PRN; //!< SV PRN NUMBER - double d_Delta_i; - double d_Toa; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_e_eccentricity; //!< Eccentricity [dimensionless] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] - int32_t i_SV_health; // SV Health - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] + double d_Delta_i; //!< Inclination Angle at Reference Time (relative to i_0 = 0.30 semi-circles) + double d_Toa; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] + int32_t i_WNa; //!< Almanac week number + double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] + double d_e_eccentricity; //!< Eccentricity [dimensionless] + double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_OMEGA; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] + int32_t i_SV_health; //!< SV Health + int32_t i_AS_status; //!< Anti-Spoofing Flags and SV Configuration + double d_A_f0; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] /*! * Default constructor @@ -71,6 +73,7 @@ public: ar& BOOST_SERIALIZATION_NVP(i_satellite_PRN); ar& BOOST_SERIALIZATION_NVP(d_Delta_i); ar& BOOST_SERIALIZATION_NVP(d_Toa); + ar& BOOST_SERIALIZATION_NVP(i_WNa); ar& BOOST_SERIALIZATION_NVP(d_M_0); ar& BOOST_SERIALIZATION_NVP(d_e_eccentricity); ar& BOOST_SERIALIZATION_NVP(d_sqrt_A); @@ -78,6 +81,7 @@ public: ar& BOOST_SERIALIZATION_NVP(d_OMEGA); ar& BOOST_SERIALIZATION_NVP(d_OMEGA_DOT); ar& BOOST_SERIALIZATION_NVP(i_SV_health); + ar& BOOST_SERIALIZATION_NVP(i_AS_status); ar& BOOST_SERIALIZATION_NVP(d_A_f0); ar& BOOST_SERIALIZATION_NVP(d_A_f1); } From 2643af39348d996b29a333967ecbfe7fa8ba6f4c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 31 Oct 2018 16:41:09 +0100 Subject: [PATCH 037/143] Add Week Number and AS_status to GPS almanac --- docs/xml-schemas/gps_almanac_map.xsd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/xml-schemas/gps_almanac_map.xsd b/docs/xml-schemas/gps_almanac_map.xsd index 818dc49c3..5e96b4af1 100644 --- a/docs/xml-schemas/gps_almanac_map.xsd +++ b/docs/xml-schemas/gps_almanac_map.xsd @@ -17,6 +17,7 @@ + @@ -24,6 +25,7 @@ + From 14d24c394871d43dca0890eab2e408cd444c36c0 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 31 Oct 2018 20:02:16 +0100 Subject: [PATCH 038/143] Fix build if matio was built on-the-fly --- src/algorithms/PVT/libs/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index 31eaa70f7..6807e9602 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -59,6 +59,7 @@ include_directories( ${ARMADILLO_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} + ${MATIO_INCLUDE_DIRS} ) list(SORT PVT_LIB_HEADERS) @@ -66,7 +67,12 @@ list(SORT PVT_LIB_SOURCES) add_library(pvt_lib ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS}) source_group(Headers FILES ${PVT_LIB_HEADERS}) -add_dependencies(pvt_lib rtklib_lib armadillo-${armadillo_RELEASE} glog-${glog_RELEASE}) + +if(MATIO_FOUND) + add_dependencies(pvt_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE}) +else(MATIO_FOUND) + add_dependencies(pvt_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} matio-${GNSSSDR_MATIO_LOCAL_VERSION}) +endif(MATIO_FOUND) target_link_libraries( pvt_lib @@ -77,4 +83,5 @@ target_link_libraries( ${ARMADILLO_LIBRARIES} ${BLAS} ${LAPACK} + ${MATIO_LIBRARIES} ) From f5191c52e639f6f06d9e0fd7e76e8152f2af1e63 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 31 Oct 2018 20:05:39 +0100 Subject: [PATCH 039/143] Improve flag descriptions --- src/tests/system-tests/libs/position_test_flags.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/system-tests/libs/position_test_flags.h b/src/tests/system-tests/libs/position_test_flags.h index a0e3d6197..cf33c344f 100644 --- a/src/tests/system-tests/libs/position_test_flags.h +++ b/src/tests/system-tests/libs/position_test_flags.h @@ -47,5 +47,5 @@ DEFINE_double(static_3D_error_m, 5.0, "Static scenario 3D (East, North, Up) posi DEFINE_double(accuracy_CEP, 2.0, "Static scenario 2D (East, North) accuracy Circular Error Position (CEP) threshold [meters]"); DEFINE_double(precision_SEP, 10.0, "Static scenario 3D (East, North, Up) precision Spherical Error Position (SEP) threshold [meters]"); DEFINE_double(dynamic_3D_position_RMSE, 10.0, "Dynamic scenario 3D (ECEF) accuracy RMSE threshold [meters]"); -DEFINE_double(dynamic_3D_velocity_RMSE, 5.0, "Dynamic scenario 3D (ECEF) accuracy RMSE threshold [meters/second]"); +DEFINE_double(dynamic_3D_velocity_RMSE, 5.0, "Dynamic scenario 3D (ECEF) velocity accuracy RMSE threshold [meters/second]"); #endif From 247c8cc6f3632a526658228e6e80a1c25706d14f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 1 Nov 2018 17:50:06 +0100 Subject: [PATCH 040/143] Enable RINEX printer for more combinations of signals --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 25 +- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 132 +- src/algorithms/PVT/libs/rinex_printer.cc | 1732 ++++++++++++++++- src/algorithms/PVT/libs/rinex_printer.h | 38 +- 4 files changed, 1845 insertions(+), 82 deletions(-) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 1fdaca521..74b2f4c5d 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -179,24 +179,20 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, int glo_1G_count = configuration->property("Channels_1G.count", 0); int glo_2G_count = configuration->property("Channels_2G.count", 0); - //unsigned int type_of_receiver = 0; - - // *******************WARNING!!!!!!!*********** - // GPS L5 only configurable for single frequency, single system at the moment!!!!!! - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 1; + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 1; // L1 if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 2; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 3; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 4; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 5; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 3; // L5 + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 4; // E1 + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 5; // E5a if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 6; if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 7; - //if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 8; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 9; + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 8; // L1+L5 + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 9; // L1+E1 if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 10; if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 11; if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 12; - //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 13; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 13; // L5+E5a if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 14; if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 15; //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 16; @@ -215,11 +211,14 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 29; if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 30; if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 31; - //RTKLIB PVT solver options + + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 32; // L1+E1+L5+E5a + + // RTKLIB PVT solver options // Settings 1 int positioning_mode = -1; std::string default_pos_mode("Single"); - std::string positioning_mode_str = configuration->property(role + ".positioning_mode", default_pos_mode); /* (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h */ + std::string positioning_mode_str = configuration->property(role + ".positioning_mode", default_pos_mode); // (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h if (positioning_mode_str.compare("Single") == 0) positioning_mode = PMODE_SINGLE; if (positioning_mode_str.compare("Static") == 0) positioning_mode = PMODE_STATIC; if (positioning_mode_str.compare("Kinematic") == 0) positioning_mode = PMODE_KINEMA; diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 970850059..d6f044e08 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -1092,7 +1092,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { - rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time); + std::string signal("2S"); + rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model); b_rinex_header_written = true; // do not write header anymore } @@ -1101,7 +1102,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { - rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time); + std::string signal("L5"); + rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model); b_rinex_header_written = true; // do not write header anymore } @@ -1139,12 +1141,22 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { - rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time); + std::string signal("1C 2S"); + rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, signal); + rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); + b_rinex_header_written = true; // do not write header anymore + } + } + if (type_of_rx == 8) // GPS L1 + GPS L5 + { + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + { + std::string signal("1C L5"); + rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); b_rinex_header_written = true; // do not write header anymore } } - if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B { if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) @@ -1175,6 +1187,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item b_rinex_header_written = true; // do not write header anymore } } + if (type_of_rx == 13) // L5+E5a + { + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + { + std::string gal_signal("5X"); + std::string gps_signal("L5"); + rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal); + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + b_rinex_header_written = true; // do not write header anymore + } + } if (type_of_rx == 14) // Galileo E1B + Galileo E5a { if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) @@ -1265,7 +1288,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { std::string glo_signal("2G"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); @@ -1281,7 +1304,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { std::string glo_signal("2G"); std::string gal_signal("1B"); @@ -1292,7 +1315,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { std::string glo_signal("2G"); rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); @@ -1300,6 +1323,20 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item b_rinex_header_written = true; // do not write header anymore } } + + if (type_of_rx == 32) // L1+E1+L5+E5a + { + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && + (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) && + (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) + { + std::string gal_signal("1B 5X"); + std::string gps_signal("1C L5"); + rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal); + rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + b_rinex_header_written = true; // do not write header anymore + } + } } @@ -1327,10 +1364,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); } + if (type_of_rx == 8) // L1+L5 + { + rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); + } if ((type_of_rx == 9) or (type_of_rx == 10) or (type_of_rx == 11)) // GPS L1 C/A + Galileo { rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->galileo_ephemeris_map); } + if (type_of_rx == 13) // L5+E5a + { + rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->galileo_ephemeris_map); + } if ((type_of_rx == 14) or (type_of_rx == 15)) // Galileo E1B + Galileo E5a { rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map); @@ -1375,6 +1420,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); } + if (type_of_rx == 32) // L1+E1+L5+E5a + { + rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->galileo_ephemeris_map); + } } galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); @@ -1475,6 +1524,27 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item b_rinex_header_updated = true; } } + if (type_of_rx == 8) // L1+L5 + { + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) + { + rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated and ((d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) or (d_ls_pvt->gps_utc_model.d_A0 != 0))) + { + if (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono); + } + else + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono); + } + b_rinex_header_updated = true; + } + } if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B { if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())) @@ -1488,6 +1558,19 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item b_rinex_header_updated = true; } } + if (type_of_rx == 13) // L5+E5a + { + if ((gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())) + { + rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated && (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) && (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + b_rinex_header_updated = true; // do not write header anymore + } + } if (type_of_rx == 14) // Galileo E1B + Galileo E5a { if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) @@ -1611,7 +1694,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated && (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) { rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); @@ -1620,17 +1703,38 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated && (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)) { rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } } + if (type_of_rx == 32) // L1+E1+L5+E5a + { + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())) + { + rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated and ((d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) or (d_ls_pvt->gps_utc_model.d_A0 != 0)) and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + { + if (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + } + else + { + rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + } + b_rinex_header_updated = true; // do not write header anymore + } + } } } } @@ -1693,7 +1797,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); std::map::const_iterator gps_cnav_ephemeris_iter; gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2086,7 +2190,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); std::map::const_iterator gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2139,12 +2243,12 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item i++; } - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end() && (d_rtcm_MT1077_rate_ms != 0)) + if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end() and (d_rtcm_MT1077_rate_ms != 0)) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end() && (d_rtcm_MT1097_rate_ms != 0)) + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end() and (d_rtcm_MT1097_rate_ms != 0)) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 8aec5b3de..67fb12ea3 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -517,6 +517,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M out << line << std::endl; } + void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac) { if (glonass_gnav_almanac.i_satellite_freq_channel) @@ -1101,6 +1102,138 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion } +void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& iono, const Gps_CNAV_Utc_Model& utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model) +{ + std::string line; + + // -------- Line 1 + line = std::string(5, ' '); + line += stringVersion; + line += std::string(11, ' '); + line += std::string("N: GNSS NAV DATA"); + line += std::string(4, ' '); + line += std::string("M: MIXED"); + line += std::string(12, ' '); + line += std::string("RINEX VERSION / TYPE"); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line 2 + line.clear(); + line += Rinex_Printer::getLocalTime(); + line += std::string("PGM / RUN BY / DATE"); + line += std::string(1, ' '); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line COMMENT + line.clear(); + line += Rinex_Printer::leftJustify("GNSS NAVIGATION MESSAGE FILE GENERATED BY GNSS-SDR", 60); + line += Rinex_Printer::leftJustify("COMMENT", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line COMMENT + line.clear(); + std::string gnss_sdr_version(GNSS_SDR_VERSION); + line += "GNSS-SDR VERSION "; + line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); + line += Rinex_Printer::leftJustify("COMMENT", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line COMMENT + line.clear(); + line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); + line += Rinex_Printer::leftJustify("COMMENT", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line ionospheric info 1 + line.clear(); + line += std::string("GAL "); + line += std::string(1, ' '); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_iono.ai0_5, 10, 2), 12); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_iono.ai1_5, 10, 2), 12); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_iono.ai2_5, 10, 2), 12); + double zero = 0.0; + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(zero, 10, 2), 12); + line += std::string(7, ' '); + line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line ionospheric info 2 + line.clear(); + line += std::string("GPSA"); + line += std::string(1, ' '); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha0, 10, 2), 12); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha1, 10, 2), 12); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha2, 10, 2), 12); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha3, 10, 2), 12); + line += std::string(7, ' '); + line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line ionospheric info 3 + line.clear(); + line += std::string("GPSB"); + line += std::string(1, ' '); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta0, 10, 2), 12); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta1, 10, 2), 12); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta2, 10, 2), 12); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta3, 10, 2), 12); + line += std::string(7, ' '); + line += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line system time correction + line.clear(); + line += std::string("GAUT"); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A0_6, 16, 2), 18); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A1_6, 15, 2), 16); + line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t0t_6), 7); + line += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WNot_6), 5); + line += std::string(10, ' '); + line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line system time correction 2 + line.clear(); + line += std::string("GPUT"); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 7); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 5); // valid until 2019 + line += std::string(10, ' '); + line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line 6 leap seconds + // For leap second information, see http://www.endruntechnologies.com/leap.htm + line.clear(); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line += std::string(36, ' '); + line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- End of Header + line.clear(); + line += std::string(60, ' '); + line += Rinex_Printer::leftJustify("END OF HEADER", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; +} + + void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, const Gps_Utc_Model& utc_model) { std::string line; @@ -1933,6 +2066,135 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Mode } +void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Model& utc_model, const Gps_CNAV_Iono& iono, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model) +{ + std::vector data; + std::string line_aux; + + int64_t pos = out.tellp(); + out.seekp(0); + data.clear(); + + bool no_more_finds = false; + std::string line_str; + + while (!out.eof()) + { + std::getline(out, line_str); + + if (!no_more_finds) + { + line_aux.clear(); + if ((line_str.find("GAL", 0) != std::string::npos) && (line_str.find("IONOSPHERIC CORR", 59) != std::string::npos)) + { + line_aux += std::string("GAL "); + line_aux += std::string(1, ' '); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_iono.ai0_5, 10, 2), 12); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_iono.ai1_5, 10, 2), 12); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_iono.ai2_5, 10, 2), 12); + double zero = 0.0; + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(zero, 10, 2), 12); + line_aux += std::string(7, ' '); + line_aux += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); + data.push_back(line_aux); + } + else if ((line_str.find("GPSA", 0) != std::string::npos) && (line_str.find("IONOSPHERIC CORR", 59) != std::string::npos)) + { + line_aux += std::string("GPSA"); + line_aux += std::string(1, ' '); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha0, 10, 2), 12); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha1, 10, 2), 12); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha2, 10, 2), 12); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_alpha3, 10, 2), 12); + line_aux += std::string(7, ' '); + line_aux += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); + data.push_back(line_aux); + } + else if ((line_str.find("GPSB", 0) != std::string::npos) && (line_str.find("IONOSPHERIC CORR", 59) != std::string::npos)) + { + line_aux += std::string("GPSB"); + line_aux += std::string(1, ' '); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta0, 10, 2), 12); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta1, 10, 2), 12); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta2, 10, 2), 12); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(iono.d_beta3, 10, 2), 12); + line_aux += std::string(7, ' '); + line_aux += Rinex_Printer::leftJustify("IONOSPHERIC CORR", 20); + data.push_back(line_aux); + } + + else if ((line_str.find("GAUT", 0) != std::string::npos) && (line_str.find("TIME SYSTEM CORR", 59) != std::string::npos)) + { + line_aux += std::string("GAUT"); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A0_6, 16, 2), 18); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A1_6, 15, 2), 16); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t0t_6), 7); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WNot_6), 5); + line_aux += std::string(10, ' '); + line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); + data.push_back(line_aux); + } + else if ((line_str.find("GPGA", 0) != std::string::npos) && (line_str.find("TIME SYSTEM CORR", 59) != std::string::npos)) + { + line_aux += std::string("GPGA"); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_0G_10, 16, 2), 18); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_utc_model.A_1G_10, 15, 2), 16); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.t_0G_10), 7); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(galileo_utc_model.WN_0G_10), 5); + line_aux += std::string(10, ' '); + line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); + data.push_back(line_aux); + } + else if (line_str.find("GPUT", 0) != std::string::npos) + { + line_aux += std::string("GPUT"); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); + line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_t_OT), 7); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_T + 1024), 5); // valid until 2019 + line_aux += std::string(10, ' '); + line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); + data.push_back(line_aux); + } + else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) + { + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_WN_LSF), 6); + line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.i_DN), 6); + line_aux += std::string(36, ' '); + line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20); + data.push_back(line_aux); + } + else if (line_str.find("END OF HEADER", 59) != std::string::npos) + { + data.push_back(line_str); + no_more_finds = true; + } + else + { + data.push_back(line_str); + } + } + else + { + data.push_back(line_str); + } + } + out.close(); + out.open(navfilename, std::ios::out | std::ios::trunc); + out.seekp(0); + for (int32_t i = 0; i < static_cast(data.size()) - 1; i++) + { + out << data[i] << std::endl; + } + out.close(); + out.open(navfilename, std::ios::out | std::ios::app); + out.seekp(pos); + std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info." << std::endl; +} + + void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model) { std::vector data; @@ -3235,6 +3497,15 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map& gps_cnav_eph_map, const std::map& galileo_eph_map) +{ + version = 3; + stringVersion = "3.02"; + Rinex_Printer::log_rinex_nav(out, gps_cnav_eph_map); + Rinex_Printer::log_rinex_nav(out, galileo_eph_map); +} + + void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map& gps_eph_map, const std::map& glonass_gnav_eph_map) { Rinex_Printer::log_rinex_nav(out, gps_eph_map); @@ -4836,7 +5107,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph } -void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& eph, const double d_TOW_first_observation) +void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& eph, const double d_TOW_first_observation, const std::string gps_bands) { std::string line; @@ -4974,30 +5245,66 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris // -------- SYS / OBS TYPES // one line per available system line.clear(); + uint32_t number_of_observations_gps = 0; + std::string signal_("2S"); + std::size_t found_2S = gps_bands.find(signal_); + if (found_2S != std::string::npos) + { + number_of_observations_gps = number_of_observations_gps + 4; + } + signal_ = "L5"; + std::size_t found_L5 = gps_bands.find(signal_); + if (found_L5 != std::string::npos) + { + number_of_observations_gps = number_of_observations_gps + 4; + } line += satelliteSystem["GPS"]; line += std::string(2, ' '); std::stringstream strm; - numberTypesObservations = 4; + numberTypesObservations = number_of_observations_gps; strm << numberTypesObservations; line += Rinex_Printer::rightJustify(strm.str(), 3); // per type of observation - // GPS L2 PSEUDORANGE - line += std::string(1, ' '); - line += observationType["PSEUDORANGE"]; - line += observationCode["GPS_L2_L2CM"]; - // GPS L2 PHASE - line += std::string(1, ' '); - line += observationType["CARRIER_PHASE"]; - line += observationCode["GPS_L2_L2CM"]; - // GPS DOPPLER L2 - line += std::string(1, ' '); - line += observationType["DOPPLER"]; - line += observationCode["GPS_L2_L2CM"]; - // GPS L2 SIGNAL STRENGTH - line += std::string(1, ' '); - line += observationType["SIGNAL_STRENGTH"]; - line += observationCode["GPS_L2_L2CM"]; + if (found_2S != std::string::npos) + { + // GPS L2 PSEUDORANGE + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GPS_L2_L2CM"]; + // GPS L2 PHASE + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GPS_L2_L2CM"]; + // GPS DOPPLER L2 + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GPS_L2_L2CM"]; + // GPS L2 SIGNAL STRENGTH + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GPS_L2_L2CM"]; + } + + if (found_L5 != std::string::npos) + { + // GPS L5 PSEUDORANGE + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GPS_L5_Q"]; + // GPS L5 PHASE + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GPS_L5_Q"]; + // GPS DOPPLER L5 + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GPS_L5_Q"]; + // GPS L5 SIGNAL STRENGTH + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GPS_L5_Q"]; + } line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); @@ -5045,7 +5352,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris } -void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, const double d_TOW_first_observation) +void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, const double d_TOW_first_observation, const std::string gps_bands) { if (eph_cnav.d_i_0) { @@ -5186,46 +5493,90 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph // -------- SYS / OBS TYPES // one line per available system line.clear(); + uint32_t number_of_observations_gps = 0; + std::string signal_("1C"); + std::size_t found_1C = gps_bands.find(signal_); + if (found_1C != std::string::npos) + { + number_of_observations_gps = number_of_observations_gps + 4; + } + signal_ = "2S"; + std::size_t found_2S = gps_bands.find(signal_); + if (found_2S != std::string::npos) + { + number_of_observations_gps = number_of_observations_gps + 4; + } + signal_ = "L5"; + std::size_t found_L5 = gps_bands.find(signal_); + if (found_L5 != std::string::npos) + { + number_of_observations_gps = number_of_observations_gps + 4; + } line += satelliteSystem["GPS"]; line += std::string(2, ' '); std::stringstream strm; - numberTypesObservations = 8; + numberTypesObservations = number_of_observations_gps; strm << numberTypesObservations; line += Rinex_Printer::rightJustify(strm.str(), 3); // per type of observation - // GPS L1 PSEUDORANGE - line += std::string(1, ' '); - line += observationType["PSEUDORANGE"]; - line += observationCode["GPS_L1_CA"]; - // GPS L1 PHASE - line += std::string(1, ' '); - line += observationType["CARRIER_PHASE"]; - line += observationCode["GPS_L1_CA"]; - // GPS DOPPLER L1 - line += std::string(1, ' '); - line += observationType["DOPPLER"]; - line += observationCode["GPS_L1_CA"]; - // GPS L1 CA SIGNAL STRENGTH - line += std::string(1, ' '); - line += observationType["SIGNAL_STRENGTH"]; - line += observationCode["GPS_L1_CA"]; - // GPS L2 PSEUDORANGE - line += std::string(1, ' '); - line += observationType["PSEUDORANGE"]; - line += observationCode["GPS_L2_L2CM"]; - // GPS L2 PHASE - line += std::string(1, ' '); - line += observationType["CARRIER_PHASE"]; - line += observationCode["GPS_L2_L2CM"]; - // GPS DOPPLER L2 - line += std::string(1, ' '); - line += observationType["DOPPLER"]; - line += observationCode["GPS_L2_L2CM"]; - // GPS L2 SIGNAL STRENGTH - line += std::string(1, ' '); - line += observationType["SIGNAL_STRENGTH"]; - line += observationCode["GPS_L2_L2CM"]; + if (found_1C != std::string::npos) + { + // GPS L1 PSEUDORANGE + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GPS_L1_CA"]; + // GPS L1 PHASE + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GPS_L1_CA"]; + // GPS DOPPLER L1 + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GPS_L1_CA"]; + // GPS L1 CA SIGNAL STRENGTH + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GPS_L1_CA"]; + } + if (found_2S != std::string::npos) + { + // GPS L2 PSEUDORANGE + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GPS_L2_L2CM"]; + // GPS L2 PHASE + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GPS_L2_L2CM"]; + // GPS DOPPLER L2 + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GPS_L2_L2CM"]; + // GPS L2 SIGNAL STRENGTH + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GPS_L2_L2CM"]; + } + if (found_L5 != std::string::npos) + { + // GPS L5 PSEUDORANGE + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GPS_L5_Q"]; + // GPS L5 PHASE + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GPS_L5_Q"]; + // GPS DOPPLER L5 + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GPS_L5_Q"]; + // GPS L5 SIGNAL STRENGTH + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GPS_L5_Q"]; + } line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); @@ -5273,6 +5624,661 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph } +void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& eph_cnav, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string gps_bands, const std::string galileo_bands) +{ + std::string line; + version = 3; + + // -------- Line 1 + line = std::string(5, ' '); + line += "3.02"; + line += std::string(11, ' '); + line += Rinex_Printer::leftJustify("OBSERVATION DATA", 20); + line += satelliteSystem["Mixed"]; + line += std::string(19, ' '); + line += std::string("RINEX VERSION / TYPE"); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line 2 + line.clear(); + line += Rinex_Printer::leftJustify("G = GPS R = GLONASS E = GALILEO S = GEO M = MIXED", 60); + line += Rinex_Printer::leftJustify("COMMENT", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line 3 + line.clear(); + line += Rinex_Printer::getLocalTime(); + line += std::string("PGM / RUN BY / DATE"); + line += std::string(1, ' '); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line COMMENT + line.clear(); + line += Rinex_Printer::leftJustify("MIXED (GPS/GALILEO) OBSERVATION DATA FILE GENERATED BY GNSS-SDR", 60); + line += Rinex_Printer::leftJustify("COMMENT", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line COMMENT + line.clear(); + std::string gnss_sdr_version(GNSS_SDR_VERSION); + line += "GNSS-SDR VERSION "; + line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); + line += Rinex_Printer::leftJustify("COMMENT", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line COMMENT + line.clear(); + line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); + line += Rinex_Printer::leftJustify("COMMENT", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line MARKER NAME + line.clear(); + line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, + line += Rinex_Printer::leftJustify("MARKER NAME", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line MARKER TYPE + //line.clear(); + //line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property + //line += std::string(40, ' '); + //line += Rinex_Printer::leftJustify("MARKER TYPE", 20); + //Rinex_Printer::lengthCheck(line); + //out << line << std::endl; + + // -------- Line OBSERVER / AGENCY + line.clear(); + std::string username; + char c_username[20] = {0}; + int32_t nGet = getlogin_r(c_username, sizeof(c_username) - 1); + if (nGet == 0) + { + username = c_username; + } + else + { + username = "UNKNOWN USER"; + } + line += leftJustify(username, 20); + line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property + line += Rinex_Printer::leftJustify("OBSERVER / AGENCY", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line REC / TYPE VERS + line.clear(); + line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property + line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property + //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property + if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); + line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); + lengthCheck(line); + out << line << std::endl; + + // -------- ANTENNA TYPE + line.clear(); + line += Rinex_Printer::leftJustify("Antenna number", 20); // add flag and property + line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property + line += std::string(20, ' '); + line += Rinex_Printer::leftJustify("ANT # / TYPE", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- APPROX POSITION (optional for moving platforms) + // put here real data! + double antena_x = 0.0; + double antena_y = 0.0; + double antena_z = 0.0; + line.clear(); + line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_x, 4), 14); + line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_y, 4), 14); + line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_z, 4), 14); + line += std::string(18, ' '); + line += Rinex_Printer::leftJustify("APPROX POSITION XYZ", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- ANTENNA: DELTA H/E/N + // put here real data! + double antena_h = 0.0; + double antena_e = 0.0; + double antena_n = 0.0; + line.clear(); + line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_h, 4), 14); + line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_e, 4), 14); + line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_n, 4), 14); + line += std::string(18, ' '); + line += Rinex_Printer::leftJustify("ANTENNA: DELTA H/E/N", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- SYS / OBS TYPES + // one line per available system + line.clear(); + uint32_t number_of_observations_gps = 0; + std::string signal_("1C"); + std::size_t found_1C = gps_bands.find(signal_); + if (found_1C != std::string::npos) + { + number_of_observations_gps = number_of_observations_gps + 4; + } + signal_ = "2S"; + std::size_t found_2S = gps_bands.find(signal_); + if (found_2S != std::string::npos) + { + number_of_observations_gps = number_of_observations_gps + 4; + } + signal_ = "L5"; + std::size_t found_L5 = gps_bands.find(signal_); + if (found_L5 != std::string::npos) + { + number_of_observations_gps = number_of_observations_gps + 4; + } + line += satelliteSystem["GPS"]; + line += std::string(2, ' '); + std::stringstream strm; + numberTypesObservations = number_of_observations_gps; + strm << numberTypesObservations; + line += Rinex_Printer::rightJustify(strm.str(), 3); + // per type of observation + if (found_1C != std::string::npos) + { + // GPS L1 PSEUDORANGE + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GPS_L1_CA"]; + // GPS L1 PHASE + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GPS_L1_CA"]; + // GPS DOPPLER L1 + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GPS_L1_CA"]; + // GPS L1 CA SIGNAL STRENGTH + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GPS_L1_CA"]; + } + if (found_2S != std::string::npos) + { + // GPS L2 PSEUDORANGE + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GPS_L2_L2CM"]; + // GPS L2 PHASE + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GPS_L2_L2CM"]; + // GPS DOPPLER L2 + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GPS_L2_L2CM"]; + // GPS L2 SIGNAL STRENGTH + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GPS_L2_L2CM"]; + } + if (found_L5 != std::string::npos) + { + // GPS L5 PSEUDORANGE + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GPS_L5_Q"]; + // GPS L5 PHASE + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GPS_L5_Q"]; + // GPS DOPPLER L5 + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GPS_L5_Q"]; + // GPS L5 SIGNAL STRENGTH + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GPS_L5_Q"]; + } + line += std::string(60 - line.size(), ' '); + line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + line.clear(); + uint32_t number_of_observations_gal = 0; + signal_ = "1B"; + std::size_t found_1B = galileo_bands.find(signal_); + if (found_1B != std::string::npos) + { + number_of_observations_gal = number_of_observations_gal + 4; + } + signal_ = "5X"; + std::size_t found_5X = galileo_bands.find(signal_); + if (found_5X != std::string::npos) + { + number_of_observations_gal = number_of_observations_gal + 4; + } + signal_ = "7X"; + std::size_t found_7X = galileo_bands.find(signal_); + if (found_7X != std::string::npos) + { + number_of_observations_gal = number_of_observations_gal + 4; + } + line += satelliteSystem["Galileo"]; + line += std::string(2, ' '); + line += Rinex_Printer::rightJustify(std::to_string(number_of_observations_gal), 3); + if (found_1B != std::string::npos) + { + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GALILEO_E1_B"]; + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GALILEO_E1_B"]; + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GALILEO_E1_B"]; + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GALILEO_E1_B"]; + } + if (found_5X != std::string::npos) + { + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GALILEO_E5a_IQ"]; + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GALILEO_E5a_IQ"]; + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GALILEO_E5a_IQ"]; + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GALILEO_E5a_IQ"]; + } + if (found_7X != std::string::npos) + { + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GALILEO_E5b_IQ"]; + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GALILEO_E5b_IQ"]; + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GALILEO_E5b_IQ"]; + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GALILEO_E5b_IQ"]; + } + line += std::string(60 - line.size(), ' '); + line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Signal Strength units + line.clear(); + line += Rinex_Printer::leftJustify("DBHZ", 20); + line += std::string(40, ' '); + line += Rinex_Printer::leftJustify("SIGNAL STRENGTH UNIT", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- TIME OF FIRST OBS + line.clear(); + boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(gps_eph, d_TOW_first_observation); + std::string timestring = boost::posix_time::to_iso_string(p_gps_time); + std::string year(timestring, 0, 4); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); + double gps_t = d_TOW_first_observation; + double seconds = fmod(gps_t, 60); + line += Rinex_Printer::rightJustify(year, 6); + line += Rinex_Printer::rightJustify(month, 6); + line += Rinex_Printer::rightJustify(day, 6); + line += Rinex_Printer::rightJustify(hour, 6); + line += Rinex_Printer::rightJustify(minutes, 6); + line += Rinex_Printer::rightJustify(asString(seconds, 7), 13); + line += Rinex_Printer::rightJustify(std::string("GPS"), 8); + line += std::string(9, ' '); + line += Rinex_Printer::leftJustify("TIME OF FIRST OBS", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- end of header + line.clear(); + line += std::string(60, ' '); + line += Rinex_Printer::leftJustify("END OF HEADER", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; +} + + +void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& eph_cnav, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string gps_bands, const std::string galileo_bands) +{ + std::string line; + version = 3; + + // -------- Line 1 + line = std::string(5, ' '); + line += "3.02"; + line += std::string(11, ' '); + line += Rinex_Printer::leftJustify("OBSERVATION DATA", 20); + line += satelliteSystem["Mixed"]; + line += std::string(19, ' '); + line += std::string("RINEX VERSION / TYPE"); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line 2 + line.clear(); + line += Rinex_Printer::leftJustify("G = GPS R = GLONASS E = GALILEO S = GEO M = MIXED", 60); + line += Rinex_Printer::leftJustify("COMMENT", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line 3 + line.clear(); + line += Rinex_Printer::getLocalTime(); + line += std::string("PGM / RUN BY / DATE"); + line += std::string(1, ' '); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line COMMENT + line.clear(); + line += Rinex_Printer::leftJustify("MIXED (GPS/GALILEO) OBSERVATION DATA FILE GENERATED BY GNSS-SDR", 60); + line += Rinex_Printer::leftJustify("COMMENT", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line COMMENT + line.clear(); + std::string gnss_sdr_version(GNSS_SDR_VERSION); + line += "GNSS-SDR VERSION "; + line += Rinex_Printer::leftJustify(gnss_sdr_version, 43); + line += Rinex_Printer::leftJustify("COMMENT", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line COMMENT + line.clear(); + line += Rinex_Printer::leftJustify("See https://gnss-sdr.org", 60); + line += Rinex_Printer::leftJustify("COMMENT", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line MARKER NAME + line.clear(); + line += Rinex_Printer::leftJustify("DEFAULT MARKER NAME", 60); // put a flag or a property, + line += Rinex_Printer::leftJustify("MARKER NAME", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line MARKER TYPE + //line.clear(); + //line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property + //line += std::string(40, ' '); + //line += Rinex_Printer::leftJustify("MARKER TYPE", 20); + //Rinex_Printer::lengthCheck(line); + //out << line << std::endl; + + // -------- Line OBSERVER / AGENCY + line.clear(); + std::string username; + char c_username[20] = {0}; + int32_t nGet = getlogin_r(c_username, sizeof(c_username) - 1); + if (nGet == 0) + { + username = c_username; + } + else + { + username = "UNKNOWN USER"; + } + line += leftJustify(username, 20); + line += Rinex_Printer::leftJustify("CTTC", 40); // add flag and property + line += Rinex_Printer::leftJustify("OBSERVER / AGENCY", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Line REC / TYPE VERS + line.clear(); + line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property + line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property + //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property + if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); + line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); + lengthCheck(line); + out << line << std::endl; + + // -------- ANTENNA TYPE + line.clear(); + line += Rinex_Printer::leftJustify("Antenna number", 20); // add flag and property + line += Rinex_Printer::leftJustify("Antenna type", 20); // add flag and property + line += std::string(20, ' '); + line += Rinex_Printer::leftJustify("ANT # / TYPE", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- APPROX POSITION (optional for moving platforms) + // put here real data! + double antena_x = 0.0; + double antena_y = 0.0; + double antena_z = 0.0; + line.clear(); + line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_x, 4), 14); + line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_y, 4), 14); + line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_z, 4), 14); + line += std::string(18, ' '); + line += Rinex_Printer::leftJustify("APPROX POSITION XYZ", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- ANTENNA: DELTA H/E/N + // put here real data! + double antena_h = 0.0; + double antena_e = 0.0; + double antena_n = 0.0; + line.clear(); + line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_h, 4), 14); + line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_e, 4), 14); + line += Rinex_Printer::rightJustify(Rinex_Printer::asString(antena_n, 4), 14); + line += std::string(18, ' '); + line += Rinex_Printer::leftJustify("ANTENNA: DELTA H/E/N", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- SYS / OBS TYPES + // one line per available system + line.clear(); + uint32_t number_of_observations_gps = 0; + std::string signal_("2S"); + std::size_t found_2S = gps_bands.find(signal_); + if (found_2S != std::string::npos) + { + number_of_observations_gps = number_of_observations_gps + 4; + } + signal_ = "L5"; + std::size_t found_L5 = gps_bands.find(signal_); + if (found_L5 != std::string::npos) + { + number_of_observations_gps = number_of_observations_gps + 4; + } + line += satelliteSystem["GPS"]; + line += std::string(2, ' '); + std::stringstream strm; + numberTypesObservations = number_of_observations_gps; + strm << numberTypesObservations; + line += Rinex_Printer::rightJustify(strm.str(), 3); + // per type of observation + if (found_2S != std::string::npos) + { + // GPS L2 PSEUDORANGE + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GPS_L2_L2CM"]; + // GPS L2 PHASE + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GPS_L2_L2CM"]; + // GPS DOPPLER L2 + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GPS_L2_L2CM"]; + // GPS L2 SIGNAL STRENGTH + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GPS_L2_L2CM"]; + } + if (found_L5 != std::string::npos) + { + // GPS L5 PSEUDORANGE + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GPS_L5_Q"]; + // GPS L5 PHASE + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GPS_L5_Q"]; + // GPS DOPPLER L5 + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GPS_L5_Q"]; + // GPS L5 SIGNAL STRENGTH + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GPS_L5_Q"]; + } + line += std::string(60 - line.size(), ' '); + line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + line.clear(); + uint32_t number_of_observations_gal = 0; + signal_ = "1B"; + std::size_t found_1B = galileo_bands.find(signal_); + if (found_1B != std::string::npos) + { + number_of_observations_gal = number_of_observations_gal + 4; + } + signal_ = "5X"; + std::size_t found_5X = galileo_bands.find(signal_); + if (found_5X != std::string::npos) + { + number_of_observations_gal = number_of_observations_gal + 4; + } + signal_ = "7X"; + std::size_t found_7X = galileo_bands.find(signal_); + if (found_7X != std::string::npos) + { + number_of_observations_gal = number_of_observations_gal + 4; + } + line += satelliteSystem["Galileo"]; + line += std::string(2, ' '); + line += Rinex_Printer::rightJustify(std::to_string(number_of_observations_gal), 3); + if (found_1B != std::string::npos) + { + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GALILEO_E1_B"]; + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GALILEO_E1_B"]; + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GALILEO_E1_B"]; + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GALILEO_E1_B"]; + } + if (found_5X != std::string::npos) + { + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GALILEO_E5a_IQ"]; + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GALILEO_E5a_IQ"]; + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GALILEO_E5a_IQ"]; + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GALILEO_E5a_IQ"]; + } + if (found_7X != std::string::npos) + { + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GALILEO_E5b_IQ"]; + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GALILEO_E5b_IQ"]; + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GALILEO_E5b_IQ"]; + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GALILEO_E5b_IQ"]; + } + line += std::string(60 - line.size(), ' '); + line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- Signal Strength units + line.clear(); + line += Rinex_Printer::leftJustify("DBHZ", 20); + line += std::string(40, ' '); + line += Rinex_Printer::leftJustify("SIGNAL STRENGTH UNIT", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- TIME OF FIRST OBS + line.clear(); + boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(eph_cnav, d_TOW_first_observation); + std::string timestring = boost::posix_time::to_iso_string(p_gps_time); + std::string year(timestring, 0, 4); + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); + double gps_t = d_TOW_first_observation; + double seconds = fmod(gps_t, 60); + line += Rinex_Printer::rightJustify(year, 6); + line += Rinex_Printer::rightJustify(month, 6); + line += Rinex_Printer::rightJustify(day, 6); + line += Rinex_Printer::rightJustify(hour, 6); + line += Rinex_Printer::rightJustify(minutes, 6); + line += Rinex_Printer::rightJustify(asString(seconds, 7), 13); + line += Rinex_Printer::rightJustify(std::string("GPS"), 8); + line += std::string(9, ' '); + line += Rinex_Printer::leftJustify("TIME OF FIRST OBS", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + // -------- end of header + line.clear(); + line += std::string(60, ' '); + line += Rinex_Printer::leftJustify("END OF HEADER", 20); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; +} + + void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& eph, const double d_TOW_first_observation, const std::string bands) { std::string line; @@ -7482,6 +8488,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c //Get maps with GPS L1 and L2 observations std::map observablesL1; std::map observablesL2; + std::map observablesL5; std::map::const_iterator observables_iter; std::multimap total_mmap; @@ -7508,6 +8515,18 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c } total_mmap.insert(std::pair(observables_iter->second.PRN, observables_iter->second)); } + + if ((system_.compare("G") == 0) && (sig_.compare("L5") == 0)) + { + observablesL5.insert(std::pair(observables_iter->first, observables_iter->second)); + mmap_iter = total_mmap.find(observables_iter->second.PRN); + if (mmap_iter == total_mmap.end()) + { + Gnss_Synchro gs = Gnss_Synchro(); + total_mmap.insert(std::pair(observables_iter->second.PRN, gs)); + } + total_mmap.insert(std::pair(observables_iter->second.PRN, observables_iter->second)); + } } // Fill with zeros satellites with L1 obs but not L2 @@ -7555,6 +8574,18 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c } } + for (observables_iter = observablesL5.cbegin(); + observables_iter != observablesL5.cend(); + observables_iter++) + { + uint32_t prn_ = observables_iter->second.PRN; + it = available_prns.find(prn_); + if (it == available_prns.end()) + { + available_prns.insert(prn_); + } + } + int32_t numSatellitesObserved = available_prns.size(); line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); // Receiver clock offset (optional) @@ -8121,6 +9152,603 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep } +void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map& observables) +{ + if (galileo_eph.e_1) + { + } // avoid warning, not needed + std::string line; + + boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(eph, gps_obs_time); + std::string timestring = boost::posix_time::to_iso_string(p_gps_time); + //double utc_t = nav_msg.utc_time(nav_msg.sv_clock_correction(obs_time)); + //double gps_t = eph.sv_clock_correction(obs_time); + double gps_t = gps_obs_time; + + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); + + std::string year(timestring, 0, 4); + line += std::string(1, '>'); + line += std::string(1, ' '); + line += year; + line += std::string(1, ' '); + line += month; + line += std::string(1, ' '); + line += day; + line += std::string(1, ' '); + line += hour; + line += std::string(1, ' '); + line += minutes; + + line += std::string(1, ' '); + double seconds = fmod(gps_t, 60); + // Add extra 0 if seconds are < 10 + if (seconds < 10) + { + line += std::string(1, '0'); + } + line += Rinex_Printer::asString(seconds, 7); + line += std::string(2, ' '); + // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event + line += std::string(1, '0'); + + //Number of satellites observed in current epoch + + //Get maps with observations + std::map observablesG2S; + std::map observablesGL5; + std::map observablesE1B; + std::map observablesE5A; + std::map observablesE5B; + std::map::const_iterator observables_iter; + + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) + { + std::string system_(&observables_iter->second.System, 1); + std::string sig_(observables_iter->second.Signal); + if ((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) + { + observablesE1B.insert(std::pair(observables_iter->first, observables_iter->second)); + } + if ((system_.compare("E") == 0) && (sig_.compare("5X") == 0)) + { + observablesE5A.insert(std::pair(observables_iter->first, observables_iter->second)); + } + if ((system_.compare("E") == 0) && (sig_.compare("7X") == 0)) + { + observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); + } + if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + { + observablesG2S.insert(std::pair(observables_iter->first, observables_iter->second)); + } + if ((system_.compare("G") == 0) && (sig_.compare("L5") == 0)) + { + observablesGL5.insert(std::pair(observables_iter->first, observables_iter->second)); + } + } + + std::multimap total_gps_map; + std::multimap total_gal_map; + std::set available_gal_prns; + std::set available_gps_prns; + std::set::iterator it; + for (observables_iter = observablesE1B.cbegin(); + observables_iter != observablesE1B.cend(); + observables_iter++) + { + uint32_t prn_ = observables_iter->second.PRN; + total_gal_map.insert(std::pair(prn_, observables_iter->second)); + it = available_gal_prns.find(prn_); + if (it == available_gal_prns.end()) + { + available_gal_prns.insert(prn_); + } + } + + for (observables_iter = observablesE5A.cbegin(); + observables_iter != observablesE5A.cend(); + observables_iter++) + { + uint32_t prn_ = observables_iter->second.PRN; + total_gal_map.insert(std::pair(prn_, observables_iter->second)); + it = available_gal_prns.find(prn_); + if (it == available_gal_prns.end()) + { + available_gal_prns.insert(prn_); + } + } + + for (observables_iter = observablesE5B.cbegin(); + observables_iter != observablesE5B.cend(); + observables_iter++) + { + uint32_t prn_ = observables_iter->second.PRN; + total_gal_map.insert(std::pair(prn_, observables_iter->second)); + it = available_gal_prns.find(prn_); + if (it == available_gal_prns.end()) + { + available_gal_prns.insert(prn_); + } + } + + for (observables_iter = observablesG2S.cbegin(); + observables_iter != observablesG2S.cend(); + observables_iter++) + { + uint32_t prn_ = observables_iter->second.PRN; + total_gps_map.insert(std::pair(prn_, observables_iter->second)); + it = available_gps_prns.find(prn_); + if (it == available_gps_prns.end()) + { + available_gps_prns.insert(prn_); + } + } + + for (observables_iter = observablesGL5.cbegin(); + observables_iter != observablesGL5.cend(); + observables_iter++) + { + uint32_t prn_ = observables_iter->second.PRN; + total_gps_map.insert(std::pair(prn_, observables_iter->second)); + it = available_gps_prns.find(prn_); + if (it == available_gps_prns.end()) + { + available_gps_prns.insert(prn_); + } + } + + int32_t numGalSatellitesObserved = available_gal_prns.size(); + int32_t numGpsSatellitesObserved = available_gps_prns.size(); + int32_t numSatellitesObserved = numGalSatellitesObserved + numGpsSatellitesObserved; + line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + + // Receiver clock offset (optional) + //line += rightJustify(asString(clockOffset, 12), 15); + + line += std::string(80 - line.size(), ' '); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + std::string s; + std::string lineObs; + + std::pair::iterator, std::multimap::iterator> ret; + for (it = available_gps_prns.begin(); + it != available_gps_prns.end(); + it++) + { + lineObs.clear(); + lineObs += satelliteSystem["GPS"]; + if (static_cast(*it) < 10) lineObs += std::string(1, '0'); + lineObs += boost::lexical_cast(static_cast(*it)); + ret = total_gps_map.equal_range(*it); + for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) + { + lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); + + //Loss of lock indicator (LLI) + int32_t lli = 0; // Include in the observation!! + if (lli == 0) + { + lineObs += std::string(1, ' '); + } + //else + // { + // lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(lli), 1); + // } + + // Signal Strength Indicator (SSI) + int32_t ssi = Rinex_Printer::signalStrength(iter->second.CN0_dB_hz); + lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); + + // CARRIER PHASE + lineObs += Rinex_Printer::rightJustify(asString(iter->second.Carrier_phase_rads / (GALILEO_TWO_PI), 3), 14); + if (lli == 0) + { + lineObs += std::string(1, ' '); + } + //else + // { + // lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(lli), 1); + // } + lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); + + // DOPPLER + lineObs += Rinex_Printer::rightJustify(asString(iter->second.Carrier_Doppler_hz, 3), 14); + if (lli == 0) + { + lineObs += std::string(1, ' '); + } + //else + // { + // lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(lli), 1); + // } + lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); + + // SIGNAL STRENGTH + lineObs += Rinex_Printer::rightJustify(asString(iter->second.CN0_dB_hz, 3), 14); + } + + out << lineObs << std::endl; + } + + for (it = available_gal_prns.begin(); + it != available_gal_prns.end(); + it++) + { + lineObs.clear(); + lineObs += satelliteSystem["Galileo"]; + if (static_cast(*it) < 10) lineObs += std::string(1, '0'); + lineObs += boost::lexical_cast(static_cast(*it)); + ret = total_gal_map.equal_range(*it); + for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) + { + lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); + + //Loss of lock indicator (LLI) + int32_t lli = 0; // Include in the observation!! + if (lli == 0) + { + lineObs += std::string(1, ' '); + } + //else + // { + // lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(lli), 1); + // } + + // Signal Strength Indicator (SSI) + int32_t ssi = Rinex_Printer::signalStrength(iter->second.CN0_dB_hz); + lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); + + // Galileo CARRIER PHASE + lineObs += Rinex_Printer::rightJustify(asString(iter->second.Carrier_phase_rads / (GALILEO_TWO_PI), 3), 14); + if (lli == 0) + { + lineObs += std::string(1, ' '); + } + //else + // { + // lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(lli), 1); + // } + lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); + + // Galileo DOPPLER + lineObs += Rinex_Printer::rightJustify(asString(iter->second.Carrier_Doppler_hz, 3), 14); + if (lli == 0) + { + lineObs += std::string(1, ' '); + } + //else + // { + // lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(lli), 1); + // } + lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); + + // Galileo SIGNAL STRENGTH + lineObs += Rinex_Printer::rightJustify(asString(iter->second.CN0_dB_hz, 3), 14); + } + + //if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + out << lineObs << std::endl; + } +} + + +void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map& observables) +{ + if (galileo_eph.e_1) + { + } // avoid warning, not needed + if (gps_cnav_eph.d_e_eccentricity) + { + } // avoid warning, not needed + std::string line; + + boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(gps_eph, gps_obs_time); + std::string timestring = boost::posix_time::to_iso_string(p_gps_time); + //double utc_t = nav_msg.utc_time(nav_msg.sv_clock_correction(obs_time)); + //double gps_t = eph.sv_clock_correction(obs_time); + double gps_t = gps_obs_time; + + std::string month(timestring, 4, 2); + std::string day(timestring, 6, 2); + std::string hour(timestring, 9, 2); + std::string minutes(timestring, 11, 2); + + std::string year(timestring, 0, 4); + line += std::string(1, '>'); + line += std::string(1, ' '); + line += year; + line += std::string(1, ' '); + line += month; + line += std::string(1, ' '); + line += day; + line += std::string(1, ' '); + line += hour; + line += std::string(1, ' '); + line += minutes; + + line += std::string(1, ' '); + double seconds = fmod(gps_t, 60); + // Add extra 0 if seconds are < 10 + if (seconds < 10) + { + line += std::string(1, '0'); + } + line += Rinex_Printer::asString(seconds, 7); + line += std::string(2, ' '); + // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event + line += std::string(1, '0'); + + //Number of satellites observed in current epoch + + //Get maps with observations + std::map observablesG2S; + std::map observablesGL5; + std::map observablesG1C; + std::map observablesE1B; + std::map observablesE5A; + std::map observablesE5B; + std::map::const_iterator observables_iter; + + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); + observables_iter++) + { + std::string system_(&observables_iter->second.System, 1); + std::string sig_(observables_iter->second.Signal); + if ((system_.compare("E") == 0) && (sig_.compare("1B") == 0)) + { + observablesE1B.insert(std::pair(observables_iter->first, observables_iter->second)); + } + if ((system_.compare("E") == 0) && (sig_.compare("5X") == 0)) + { + observablesE5A.insert(std::pair(observables_iter->first, observables_iter->second)); + } + if ((system_.compare("E") == 0) && (sig_.compare("7X") == 0)) + { + observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); + } + if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + { + observablesG2S.insert(std::pair(observables_iter->first, observables_iter->second)); + } + if ((system_.compare("G") == 0) && (sig_.compare("L5") == 0)) + { + observablesGL5.insert(std::pair(observables_iter->first, observables_iter->second)); + } + if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + { + observablesG1C.insert(std::pair(observables_iter->first, observables_iter->second)); + } + } + + std::multimap total_gps_map; + std::multimap total_gal_map; + std::set available_gal_prns; + std::set available_gps_prns; + std::set::iterator it; + for (observables_iter = observablesE1B.cbegin(); + observables_iter != observablesE1B.cend(); + observables_iter++) + { + uint32_t prn_ = observables_iter->second.PRN; + total_gal_map.insert(std::pair(prn_, observables_iter->second)); + it = available_gal_prns.find(prn_); + if (it == available_gal_prns.end()) + { + available_gal_prns.insert(prn_); + } + } + + for (observables_iter = observablesE5A.cbegin(); + observables_iter != observablesE5A.cend(); + observables_iter++) + { + uint32_t prn_ = observables_iter->second.PRN; + total_gal_map.insert(std::pair(prn_, observables_iter->second)); + it = available_gal_prns.find(prn_); + if (it == available_gal_prns.end()) + { + available_gal_prns.insert(prn_); + } + } + + for (observables_iter = observablesE5B.cbegin(); + observables_iter != observablesE5B.cend(); + observables_iter++) + { + uint32_t prn_ = observables_iter->second.PRN; + total_gal_map.insert(std::pair(prn_, observables_iter->second)); + it = available_gal_prns.find(prn_); + if (it == available_gal_prns.end()) + { + available_gal_prns.insert(prn_); + } + } + + for (observables_iter = observablesG1C.cbegin(); + observables_iter != observablesG1C.cend(); + observables_iter++) + { + uint32_t prn_ = observables_iter->second.PRN; + total_gps_map.insert(std::pair(prn_, observables_iter->second)); + it = available_gps_prns.find(prn_); + if (it == available_gps_prns.end()) + { + available_gps_prns.insert(prn_); + } + } + + for (observables_iter = observablesG2S.cbegin(); + observables_iter != observablesG2S.cend(); + observables_iter++) + { + uint32_t prn_ = observables_iter->second.PRN; + total_gps_map.insert(std::pair(prn_, observables_iter->second)); + it = available_gps_prns.find(prn_); + if (it == available_gps_prns.end()) + { + available_gps_prns.insert(prn_); + } + } + + for (observables_iter = observablesGL5.cbegin(); + observables_iter != observablesGL5.cend(); + observables_iter++) + { + uint32_t prn_ = observables_iter->second.PRN; + total_gps_map.insert(std::pair(prn_, observables_iter->second)); + it = available_gps_prns.find(prn_); + if (it == available_gps_prns.end()) + { + available_gps_prns.insert(prn_); + } + } + + int32_t numGalSatellitesObserved = available_gal_prns.size(); + int32_t numGpsSatellitesObserved = available_gps_prns.size(); + int32_t numSatellitesObserved = numGalSatellitesObserved + numGpsSatellitesObserved; + line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); + + // Receiver clock offset (optional) + //line += rightJustify(asString(clockOffset, 12), 15); + + line += std::string(80 - line.size(), ' '); + Rinex_Printer::lengthCheck(line); + out << line << std::endl; + + std::string s; + std::string lineObs; + + std::pair::iterator, std::multimap::iterator> ret; + for (it = available_gps_prns.begin(); + it != available_gps_prns.end(); + it++) + { + lineObs.clear(); + lineObs += satelliteSystem["GPS"]; + if (static_cast(*it) < 10) lineObs += std::string(1, '0'); + lineObs += boost::lexical_cast(static_cast(*it)); + ret = total_gps_map.equal_range(*it); + for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) + { + lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); + + //Loss of lock indicator (LLI) + int32_t lli = 0; // Include in the observation!! + if (lli == 0) + { + lineObs += std::string(1, ' '); + } + //else + // { + // lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(lli), 1); + // } + + // Signal Strength Indicator (SSI) + int32_t ssi = Rinex_Printer::signalStrength(iter->second.CN0_dB_hz); + lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); + + // CARRIER PHASE + lineObs += Rinex_Printer::rightJustify(asString(iter->second.Carrier_phase_rads / (GALILEO_TWO_PI), 3), 14); + if (lli == 0) + { + lineObs += std::string(1, ' '); + } + //else + // { + // lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(lli), 1); + // } + lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); + + // DOPPLER + lineObs += Rinex_Printer::rightJustify(asString(iter->second.Carrier_Doppler_hz, 3), 14); + if (lli == 0) + { + lineObs += std::string(1, ' '); + } + //else + // { + // lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(lli), 1); + // } + lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); + + // SIGNAL STRENGTH + lineObs += Rinex_Printer::rightJustify(asString(iter->second.CN0_dB_hz, 3), 14); + } + + out << lineObs << std::endl; + } + + for (it = available_gal_prns.begin(); + it != available_gal_prns.end(); + it++) + { + lineObs.clear(); + lineObs += satelliteSystem["Galileo"]; + if (static_cast(*it) < 10) lineObs += std::string(1, '0'); + lineObs += boost::lexical_cast(static_cast(*it)); + ret = total_gal_map.equal_range(*it); + for (std::multimap::iterator iter = ret.first; iter != ret.second; ++iter) + { + lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); + + //Loss of lock indicator (LLI) + int32_t lli = 0; // Include in the observation!! + if (lli == 0) + { + lineObs += std::string(1, ' '); + } + //else + // { + // lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(lli), 1); + // } + + // Signal Strength Indicator (SSI) + int32_t ssi = Rinex_Printer::signalStrength(iter->second.CN0_dB_hz); + lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); + + // Galileo CARRIER PHASE + lineObs += Rinex_Printer::rightJustify(asString(iter->second.Carrier_phase_rads / (GALILEO_TWO_PI), 3), 14); + if (lli == 0) + { + lineObs += std::string(1, ' '); + } + //else + // { + // lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(lli), 1); + // } + lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); + + // Galileo DOPPLER + lineObs += Rinex_Printer::rightJustify(asString(iter->second.Carrier_Doppler_hz, 3), 14); + if (lli == 0) + { + lineObs += std::string(1, ' '); + } + //else + // { + // lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(lli), 1); + // } + lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); + + // Galileo SIGNAL STRENGTH + lineObs += Rinex_Printer::rightJustify(asString(iter->second.CN0_dB_hz, 3), 14); + } + + //if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + out << lineObs << std::endl; + } +} + + void Rinex_Printer::to_date_time(int32_t gps_week, int32_t gps_tow, int& year, int& month, int& day, int& hour, int& minute, int& second) { // represents GPS time (week, TOW) in the date time format of the Gregorian calendar. diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index 9f4e21129..24b140e83 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -113,6 +113,11 @@ public: */ void rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model); + /*! + * \brief Generates the Mixed (GPS CNAV/Galileo) Navigation Data header + */ + void rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& iono, const Gps_CNAV_Utc_Model& utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model); + /*! * \brief Generates the GLONASS L1, L2 C/A Navigation Data header */ @@ -141,12 +146,12 @@ public: /*! * \brief Generates the GPS L2 Observation data header */ - void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& eph, const double d_TOW_first_observation); + void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& eph, const double d_TOW_first_observation, const std::string gps_bands = "2S"); /*! - * \brief Generates the dual frequency GPS L1 & L2 Observation data header + * \brief Generates the dual frequency GPS L1 & L2/L5 Observation data header */ - void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, const double d_TOW_first_observation); + void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, const double d_TOW_first_observation, const std::string gps_bands = "1C 2S"); /*! * \brief Generates the Galileo Observation data header. Example: bands("1B"), bands("1B 5X"), bands("5X"), ... Default: "1B". @@ -158,6 +163,16 @@ public: */ void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string galileo_bands = "1B"); + /*! + * \brief Generates the Mixed (GPS/Galileo) Observation data header. Example: galileo_bands("1B"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". + */ + void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& eph_cnav, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string gps_bands = "1C 2S", const std::string galileo_bands = "1B"); + + /*! + * \brief Generates the Mixed (GPS/Galileo) Observation data header. Example: galileo_bands("1B"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". + */ + void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& eph_cnav, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string gps_bands = "2S", const std::string galileo_bands = "1B"); + /*! * \brief Generates the GLONASS GNAV Observation data header. Example: bands("1C"), bands("1C 2C"), bands("2C"), ... Default: "1C". */ @@ -239,6 +254,11 @@ public: */ void log_rinex_nav(std::fstream& out, const std::map& gps_eph_map, const std::map& galileo_eph_map); + /*! + * \brief Writes data from the Mixed (GPS/Galileo) navigation message into the RINEX file + */ + void log_rinex_nav(std::fstream& out, const std::map& gps_cnav_eph_map, const std::map& galileo_eph_map); + /*! * \brief Writes data from the GLONASS GNAV navigation message into the RINEX file */ @@ -284,6 +304,16 @@ public: */ void log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, const double gps_obs_time, const std::map& observables); + /*! + * \brief Writes Mixed GPS / Galileo observables into the RINEX file + */ + void log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map& observables); + + /*! + * \brief Writes Mixed GPS / Galileo observables into the RINEX file + */ + void log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map& observables); + /*! * \brief Writes GLONASS GNAV observables into the RINEX file. Example: glonass_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". */ @@ -320,6 +350,8 @@ public: void update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model); + void update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Model& utc_model, const Gps_CNAV_Iono& iono, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model); + void update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& utc_model); void update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); From 1ca28873ab595036f3e587a4960df16f78ed07b4 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 1 Nov 2018 19:10:50 +0100 Subject: [PATCH 041/143] Fix warnings --- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 14 +++++++------- src/algorithms/PVT/libs/rinex_printer.cc | 13 ++++++++++++- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index d6f044e08..dd5468c6e 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -1326,13 +1326,13 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (type_of_rx == 32) // L1+E1+L5+E5a { - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && - (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) && + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and + (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 5X"); std::string gps_signal("1C L5"); - rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal); + rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal); rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } @@ -1564,7 +1564,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated && (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) && (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) { rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); @@ -1677,11 +1677,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated && (d_ls_pvt->gps_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0)) { rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); @@ -1690,7 +1690,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 67fb12ea3..9a2ab524b 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -5628,6 +5628,14 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps { std::string line; version = 3; + if (eph_cnav.d_e_eccentricity == 0) + { + // avoid warning + } + if (galileo_eph.e_1 == 0) + { + // avoid warning + } // -------- Line 1 line = std::string(5, ' '); @@ -5968,7 +5976,10 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris { std::string line; version = 3; - + if (galileo_eph.e_1 == 0) + { + // avoid warning + } // -------- Line 1 line = std::string(5, ' '); line += "3.02"; From 99e4dcbe2be53e6ae60e457aa06e3c6fa2ddb420 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 1 Nov 2018 19:24:06 +0100 Subject: [PATCH 042/143] Cosmetic fix --- src/algorithms/PVT/libs/rinex_printer.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index 24b140e83..dde6724a6 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -134,8 +134,8 @@ public: void rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); /*! - * \brief Generates the Mixed (GPS L2C C/A/GLONASS L1, L2) Navigation Data header - */ + * \brief Generates the Mixed (GPS L2C C/A/GLONASS L1, L2) Navigation Data header + */ void rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_iono, const Gps_CNAV_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); /*! @@ -255,8 +255,8 @@ public: void log_rinex_nav(std::fstream& out, const std::map& gps_eph_map, const std::map& galileo_eph_map); /*! - * \brief Writes data from the Mixed (GPS/Galileo) navigation message into the RINEX file - */ + * \brief Writes data from the Mixed (GPS/Galileo) navigation message into the RINEX file + */ void log_rinex_nav(std::fstream& out, const std::map& gps_cnav_eph_map, const std::map& galileo_eph_map); /*! @@ -310,8 +310,8 @@ public: void log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map& observables); /*! - * \brief Writes Mixed GPS / Galileo observables into the RINEX file - */ + * \brief Writes Mixed GPS / Galileo observables into the RINEX file + */ void log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map& observables); /*! From 15df79837f7ecc8ee67a244dcff36cd8ed54741a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 1 Nov 2018 20:10:41 +0100 Subject: [PATCH 043/143] Fix header in RINEX nav file for L1+L5 --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index dd5468c6e..8ad22c461 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -1535,12 +1535,12 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) { rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono); + rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono); } else { rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono); + rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono); } b_rinex_header_updated = true; } From 7c238bfb44126d6866a3ff7fa26f89519b9ecc4c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 2 Nov 2018 12:15:28 +0100 Subject: [PATCH 044/143] Add RTCM messages for more signal combinations --- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 904 +++++++++++------- 1 file changed, 561 insertions(+), 343 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 8ad22c461..e005ff45b 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -868,9 +868,6 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item bool flag_write_RTCM_MSM_output = false; bool flag_write_RINEX_obs_output = false; bool flag_write_RINEX_nav_output = false; - uint32_t gps_channel = 0; - uint32_t gal_channel = 0; - uint32_t glo_channel = 0; gnss_observables_map.clear(); const Gnss_Synchro** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer @@ -1067,7 +1064,6 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::map::const_iterator gps_ephemeris_iter; std::map::const_iterator gps_cnav_ephemeris_iter; std::map::const_iterator glonass_gnav_ephemeris_iter; - std::map::const_iterator gnss_observables_iter; // ####################### RINEX FILES ################# if (b_rinex_output_enabled) @@ -1339,7 +1335,6 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } - if (b_rinex_header_written) // The header is already written, we can now log the navigation message data { if (flag_write_RINEX_nav_output) @@ -1738,6 +1733,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } } + // ####################### RTCM MESSAGES ################# try { @@ -1747,19 +1743,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_ephemeris_iter; - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) + std::map::const_iterator gps_eph_iter; + gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } } @@ -1767,18 +1762,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_ephemeris_iter++) + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_ephemeris_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gal_ephemeris_iter; - gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + std::map::const_iterator gal_eph_iter; + gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } } @@ -1786,20 +1781,41 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_ephemeris_iter; - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_ephemeris_iter; - gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + std::map::const_iterator gps_eph_iter; + gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_eph_iter; + gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); + if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + } + } + if (type_of_rx == 8) // L1+L5 + { + if (flag_write_RTCM_1019_output == true) + { + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + } + } + if (flag_write_RTCM_MSM_output == true) + { + std::map::const_iterator gps_eph_iter; + gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_eph_iter; + gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); + if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + { + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } } @@ -1807,23 +1823,25 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (flag_write_RTCM_1019_output == true) { - for (gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++) + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (flag_write_RTCM_1045_output == true) { - for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end(); galileo_ephemeris_iter++) + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.begin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end(); gal_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } } if (flag_write_RTCM_MSM_output == true) { - //gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end(); - //galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end(); - uint32_t i = 0; + std::map::const_iterator gnss_observables_iter; + std::map::const_iterator gps_eph_iter; + std::map::const_iterator gal_eph_iter; + int gps_channel = 0; + int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -1832,10 +1850,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("G") == 0) { // This is a channel with valid GPS signal - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) + gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) { - gps_channel = i; + gps_channel = 1; } } } @@ -1843,28 +1861,46 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("E") == 0) { - galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { - gal_channel = i; + gal_channel = 1; } } } - i++; } - if (flag_write_RTCM_MSM_output == true) + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (flag_write_RTCM_MSM_output == true) + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + } + } + if (type_of_rx == 13) // L5+E5a + { + std::map::const_iterator gal_eph_iter; + std::map::const_iterator gps_cnav_eph_iter; + if (flag_write_RTCM_1045_output == true) + { + for (gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + } + } + gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); + if (flag_write_RTCM_MSM_output == true) + { + if (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } } @@ -1877,22 +1913,24 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); } } - - std::map::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); - - if (glo_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (flag_write_RTCM_MSM_output == true) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + std::map::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + if (glo_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } } b_rtcm_writing_started = true; } if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A { + std::map::const_iterator gps_eph_iter; if (flag_write_RTCM_1019_output == true) { - for (gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) + for (gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (flag_write_RTCM_1020_output == true) @@ -1904,10 +1942,12 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (flag_write_RTCM_MSM_output == true) { - //gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end(); - //galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end(); - uint32_t i = 0; - for (gnss_observables_iter = gnss_observables_map.begin(); gnss_observables_iter != gnss_observables_map.end(); gnss_observables_iter++) + std::map::const_iterator gnss_observables_iter; + std::map::const_iterator glonass_gnav_eph_iter; + std::map::const_iterator gps_eph_iter; + int gps_channel = 0; + int glo_channel = 0; + for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) @@ -1915,10 +1955,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("G") == 0) { // This is a channel with valid GPS signal - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) + gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) { - gps_channel = i; + gps_channel = 1; } } } @@ -1926,28 +1966,22 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("R") == 0) { - glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { - glo_channel = i; + glo_channel = 1; } } } - i++; } - if (flag_write_RTCM_MSM_output == true) + + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (flag_write_RTCM_MSM_output == true) + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) { - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } } @@ -1955,23 +1989,25 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); } } if (flag_write_RTCM_1045_output == true) { - for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); galileo_ephemeris_iter++) + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } } if (flag_write_RTCM_MSM_output == true) { - // gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end(); - // galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end(); - uint32_t i = 0; + std::map::const_iterator gnss_observables_iter; + std::map::const_iterator gal_eph_iter; + std::map::const_iterator glonass_gnav_eph_iter; + int gal_channel = 0; + int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -1980,10 +2016,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("E") == 0) { // This is a channel with valid GPS signal - galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { - gal_channel = i; + gal_channel = 1; } } } @@ -1991,28 +2027,21 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("R") == 0) { - glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) { - glo_channel = i; + glo_channel = 1; } } } - i++; } - if (flag_write_RTCM_MSM_output == true) + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end()) { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (flag_write_RTCM_MSM_output == true) + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) { - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } } @@ -2020,23 +2049,25 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (flag_write_RTCM_1019_output == true) { - for (gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); } } if (flag_write_RTCM_MSM_output == true) { - // gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end(); - // galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end(); - uint32_t i = 0; + std::map::const_iterator gnss_observables_iter; + std::map::const_iterator gps_eph_iter; + std::map::const_iterator glonass_gnav_eph_iter; + int gps_channel = 0; + int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.begin(); gnss_observables_iter != gnss_observables_map.end(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -2045,10 +2076,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("G") == 0) { // This is a channel with valid GPS signal - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) + gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) { - gps_channel = i; + gps_channel = 1; } } } @@ -2056,28 +2087,21 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("R") == 0) { - glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { - glo_channel = i; + glo_channel = 1; } } } - i++; } - if (flag_write_RTCM_MSM_output == true) + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (flag_write_RTCM_MSM_output == true) + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) { - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } } @@ -2085,23 +2109,25 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); } } if (flag_write_RTCM_1045_output == true) { - for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); galileo_ephemeris_iter++) + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } } if (flag_write_RTCM_MSM_output == true) { - // gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end(); - // galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end(); - uint32_t i = 0; + std::map::const_iterator gnss_observables_iter; + std::map::const_iterator gal_eph_iter; + std::map::const_iterator glonass_gnav_eph_iter; + int gal_channel = 0; + int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -2110,10 +2136,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("E") == 0) { // This is a channel with valid GPS signal - galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { - gal_channel = i; + gal_channel = 1; } } } @@ -2121,28 +2147,81 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("R") == 0) { - glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) { - glo_channel = i; + glo_channel = 1; } } } - i++; } - if (flag_write_RTCM_MSM_output == true) + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end()) { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + } + } + if (type_of_rx == 32) // L1+E1+L5+E5a + { + if (flag_write_RTCM_1019_output == true) + { + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + } + } + if (flag_write_RTCM_1045_output == true) + { + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + } + } + if (flag_write_RTCM_MSM_output == true) + { + std::map::const_iterator gnss_observables_iter; + std::map::const_iterator gal_eph_iter; + std::map::const_iterator gps_eph_iter; + int gal_channel = 0; + int gps_channel = 0; + for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + { + std::string system(&gnss_observables_iter->second.System, 1); + if (gal_channel == 0) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + if (system.compare("E") == 0) + { + // This is a channel with valid GPS signal + gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + { + gal_channel = 1; + } + } + } + if (gps_channel == 0) + { + if (system.compare("G") == 0) + { + gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.end()) + { + gps_channel = 1; + } + } } } - if (flag_write_RTCM_MSM_output == true) + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) { - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } } @@ -2152,47 +2231,83 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (type_of_rx == 1) // GPS L1 C/A { - for (std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) + if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + } } - - std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) + if (d_rtcm_MSM_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } } b_rtcm_writing_started = true; } if ((type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6) || (type_of_rx == 14) || (type_of_rx == 15)) // Galileo { - for (std::map::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_ephemeris_iter++) + if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - d_rtcm_printer->Print_Rtcm_MT1045(gal_ephemeris_iter->second); + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + } } - - std::map::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - - if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (d_rtcm_MSM_rate_ms != 0) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } } b_rtcm_writing_started = true; } if (type_of_rx == 7) // GPS L1 C/A + GPS L2C { - for (std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) + if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + } } - - std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + if (d_rtcm_MSM_rate_ms != 0) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); + + if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + { + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + } + b_rtcm_writing_started = true; + } + if (type_of_rx == 8) // L1+L5 + { + if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 + { + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + } + } + if (d_rtcm_MSM_rate_ms != 0) + { + std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); + + if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + { + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } } b_rtcm_writing_started = true; } @@ -2200,72 +2315,100 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (d_rtcm_MT1045_rate_ms != 0) { - for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end(); galileo_ephemeris_iter++) + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.begin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end(); gal_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } } - - uint32_t i = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + if (d_rtcm_MSM_rate_ms != 0) { - std::string system(&gnss_observables_iter->second.System, 1); - if (gps_channel == 0) + std::map::const_iterator gnss_observables_iter; + std::map::const_iterator gal_eph_iter; + std::map::const_iterator gps_eph_iter; + int gps_channel = 0; + int gal_channel = 0; + for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { - if (system.compare("G") == 0) + std::string system(&gnss_observables_iter->second.System, 1); + if (gps_channel == 0) { - // This is a channel with valid GPS signal - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) + if (system.compare("G") == 0) { - gps_channel = i; + // This is a channel with valid GPS signal + gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.end()) + { + gps_channel = 1; + } + } + } + if (gal_channel == 0) + { + if (system.compare("E") == 0) + { + gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end()) + { + gal_channel = 1; + } } } } - if (gal_channel == 0) + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.end() and (d_rtcm_MT1077_rate_ms != 0)) { - if (system.compare("E") == 0) - { - galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) - { - gal_channel = i; - } - } + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end() and (d_rtcm_MT1097_rate_ms != 0)) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - i++; - } - - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end() and (d_rtcm_MT1077_rate_ms != 0)) - { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } - - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end() and (d_rtcm_MT1097_rate_ms != 0)) - { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } b_rtcm_writing_started = true; } if ((type_of_rx == 23) || (type_of_rx == 24) || (type_of_rx == 25)) // GLONASS { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); + for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); + } } - - std::map::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); - - if (glo_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (d_rtcm_MSM_rate_ms != 0) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + std::map::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + + if (glo_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + } + b_rtcm_writing_started = true; + } + if (type_of_rx == 13) // L5+E5a + { + std::map::const_iterator gal_eph_iter; + if (d_rtcm_MT1045_rate_ms != 0) + { + for (gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + } + } + if (d_rtcm_MSM_rate_ms != 0) + { + gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } } b_rtcm_writing_started = true; } @@ -2273,235 +2416,310 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); } } - - // gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end(); - // galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end(); - uint32_t i = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + if (d_rtcm_MSM_rate_ms != 0) { - std::string system(&gnss_observables_iter->second.System, 1); - if (gps_channel == 0) + std::map::const_iterator glonass_gnav_eph_iter; + std::map::const_iterator gnss_observables_iter; + std::map::const_iterator gps_eph_iter; + int gps_channel = 0; + int glo_channel = 0; + for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { - if (system.compare("G") == 0) + std::string system(&gnss_observables_iter->second.System, 1); + if (gps_channel == 0) { - // This is a channel with valid GPS signal - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) + if (system.compare("G") == 0) { - gps_channel = i; + // This is a channel with valid GPS signal + gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + { + gps_channel = 1; + } + } + } + if (glo_channel == 0) + { + if (system.compare("R") == 0) + { + glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + { + glo_channel = 1; + } } } } - if (glo_channel == 0) + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { - if (system.compare("R") == 0) - { - glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) - { - glo_channel = i; - } - } + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - i++; } - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } - - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } - b_rtcm_writing_started = true; } if (type_of_rx == 27) // GLONASS L1 C/A + Galileo E1B { if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); galileo_ephemeris_iter++) + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } } - - uint32_t i = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + if (d_rtcm_MSM_rate_ms != 0) { - std::string system(&gnss_observables_iter->second.System, 1); - if (gal_channel == 0) + int gal_channel = 0; + int glo_channel = 0; + std::map::const_iterator gnss_observables_iter; + std::map::const_iterator gal_eph_iter; + std::map::const_iterator glonass_gnav_eph_iter; + for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { - if (system.compare("E") == 0) + std::string system(&gnss_observables_iter->second.System, 1); + if (gal_channel == 0) { - // This is a channel with valid GPS signal - galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (system.compare("E") == 0) { - gal_channel = i; + // This is a channel with valid GPS signal + gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + { + gal_channel = 1; + } + } + } + if (glo_channel == 0) + { + if (system.compare("R") == 0) + { + glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + { + glo_channel = 1; + } } } } - if (glo_channel == 0) + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end()) { - if (system.compare("R") == 0) - { - glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) - { - glo_channel = i; - } - } + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - i++; - } - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } + b_rtcm_writing_started = true; } if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A { if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++) + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); } } - - // gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end(); - // galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end(); - uint32_t i = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + if (d_rtcm_MSM_rate_ms != 0) { - std::string system(&gnss_observables_iter->second.System, 1); - if (gps_channel == 0) + std::map::const_iterator gps_eph_iter; + std::map::const_iterator glonass_gnav_eph_iter; + std::map::const_iterator gnss_observables_iter; + int gps_channel = 0; + int glo_channel = 0; + for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { - if (system.compare("G") == 0) + std::string system(&gnss_observables_iter->second.System, 1); + if (gps_channel == 0) { - // This is a channel with valid GPS signal - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) + if (system.compare("G") == 0) { - gps_channel = i; + // This is a channel with valid GPS signal + gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + { + gps_channel = 1; + } + } + } + if (glo_channel == 0) + { + if (system.compare("R") == 0) + { + glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + { + glo_channel = 1; + } } } } - if (glo_channel == 0) + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { - if (system.compare("R") == 0) - { - glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) - { - glo_channel = i; - } - } + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - i++; - } - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } } - b_rtcm_writing_started = true; } if (type_of_rx == 30) // GLONASS L2 C/A + Galileo E1B { if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); galileo_ephemeris_iter++) + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } } - - uint32_t i = 0; - for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + if (d_rtcm_MSM_rate_ms != 0) { - std::string system(&gnss_observables_iter->second.System, 1); - if (gal_channel == 0) + int gal_channel = 0; + int glo_channel = 0; + std::map::const_iterator gnss_observables_iter; + std::map::const_iterator gal_eph_iter; + std::map::const_iterator glonass_gnav_eph_iter; + for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { - if (system.compare("E") == 0) + std::string system(&gnss_observables_iter->second.System, 1); + if (gal_channel == 0) { - // This is a channel with valid GPS signal - galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (system.compare("E") == 0) { - gal_channel = i; + // This is a channel with valid GPS signal + gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + { + gal_channel = 1; + } + } + } + if (glo_channel == 0) + { + if (system.compare("R") == 0) + { + glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + { + glo_channel = 1; + } } } } - if (glo_channel == 0) + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end()) { - if (system.compare("R") == 0) + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + } + b_rtcm_writing_started = true; + } + if (type_of_rx == 32) // L1+E1+L5+E5a + { + if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 + { + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + } + } + if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 + { + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + } + } + if (d_rtcm_MSM_rate_ms != 0) + { + std::map::const_iterator gnss_observables_iter; + std::map::const_iterator gal_eph_iter; + std::map::const_iterator gps_eph_iter; + int gps_channel = 0; + int gal_channel = 0; + for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + { + std::string system(&gnss_observables_iter->second.System, 1); + if (gps_channel == 0) { - glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + if (system.compare("G") == 0) { - glo_channel = i; + // This is a channel with valid GPS signal + gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.end()) + { + gps_channel = 1; + } + } + } + if (gal_channel == 0) + { + if (system.compare("E") == 0) + { + gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end()) + { + gal_channel = 1; + } } } } - i++; - } - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) - { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } } + b_rtcm_writing_started = true; } } } - catch (const boost::exception& ex) { std::cout << "RTCM boost exception: " << boost::diagnostic_information(ex) << std::endl; From 01394474084e31507d4a863a26e764eb950ff605 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 2 Nov 2018 14:12:31 +0100 Subject: [PATCH 045/143] Deactivate RTCM printer if not used --- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 123 ++++++++++-------- .../PVT/gnuradio_blocks/rtklib_pvt_cc.h | 1 + 2 files changed, 67 insertions(+), 57 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index e005ff45b..aa3c921c5 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -342,59 +342,69 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, // initialize rtcm_printer std::string rtcm_dump_filename; rtcm_dump_filename = d_dump_filename; - d_rtcm_printer = std::make_shared(rtcm_dump_filename, conf_.rtcm_output_file_enabled, conf_.flag_rtcm_server, conf_.flag_rtcm_tty_port, conf_.rtcm_tcp_port, conf_.rtcm_station_id, conf_.rtcm_dump_devname, true, conf_.rtcm_output_file_path); - std::map rtcm_msg_rate_ms = conf_.rtcm_msg_rate_ms; - if (rtcm_msg_rate_ms.find(1019) != rtcm_msg_rate_ms.end()) + if (conf_.flag_rtcm_server or conf_.flag_rtcm_tty_port or conf_.rtcm_output_file_enabled) { - d_rtcm_MT1019_rate_ms = rtcm_msg_rate_ms[1019]; + d_rtcm_printer = std::make_shared(rtcm_dump_filename, conf_.rtcm_output_file_enabled, conf_.flag_rtcm_server, conf_.flag_rtcm_tty_port, conf_.rtcm_tcp_port, conf_.rtcm_station_id, conf_.rtcm_dump_devname, true, conf_.rtcm_output_file_path); + std::map rtcm_msg_rate_ms = conf_.rtcm_msg_rate_ms; + if (rtcm_msg_rate_ms.find(1019) != rtcm_msg_rate_ms.end()) + { + d_rtcm_MT1019_rate_ms = rtcm_msg_rate_ms[1019]; + } + else + { + d_rtcm_MT1019_rate_ms = bc::lcm(5000, d_output_rate_ms); // default value if not set + } + if (rtcm_msg_rate_ms.find(1020) != rtcm_msg_rate_ms.end()) + { + d_rtcm_MT1020_rate_ms = rtcm_msg_rate_ms[1020]; + } + else + { + d_rtcm_MT1020_rate_ms = bc::lcm(5000, d_output_rate_ms); // default value if not set + } + if (rtcm_msg_rate_ms.find(1045) != rtcm_msg_rate_ms.end()) + { + d_rtcm_MT1045_rate_ms = rtcm_msg_rate_ms[1045]; + } + else + { + d_rtcm_MT1045_rate_ms = bc::lcm(5000, d_output_rate_ms); // default value if not set + } + if (rtcm_msg_rate_ms.find(1077) != rtcm_msg_rate_ms.end()) // whatever between 1071 and 1077 + { + d_rtcm_MT1077_rate_ms = rtcm_msg_rate_ms[1077]; + } + else + { + d_rtcm_MT1077_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set + } + if (rtcm_msg_rate_ms.find(1087) != rtcm_msg_rate_ms.end()) // whatever between 1081 and 1087 + { + d_rtcm_MT1087_rate_ms = rtcm_msg_rate_ms[1087]; + } + else + { + d_rtcm_MT1087_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set + } + if (rtcm_msg_rate_ms.find(1097) != rtcm_msg_rate_ms.end()) // whatever between 1091 and 1097 + { + d_rtcm_MT1097_rate_ms = rtcm_msg_rate_ms[1097]; + d_rtcm_MSM_rate_ms = rtcm_msg_rate_ms[1097]; + } + else + { + d_rtcm_MT1097_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set + d_rtcm_MSM_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set + } + b_rtcm_writing_started = false; + b_rtcm_enabled = true; } else { - d_rtcm_MT1019_rate_ms = bc::lcm(5000, d_output_rate_ms); // default value if not set + b_rtcm_enabled = false; + b_rtcm_writing_started = false; + d_rtcm_printer = nullptr; } - if (rtcm_msg_rate_ms.find(1020) != rtcm_msg_rate_ms.end()) - { - d_rtcm_MT1020_rate_ms = rtcm_msg_rate_ms[1020]; - } - else - { - d_rtcm_MT1020_rate_ms = bc::lcm(5000, d_output_rate_ms); // default value if not set - } - if (rtcm_msg_rate_ms.find(1045) != rtcm_msg_rate_ms.end()) - { - d_rtcm_MT1045_rate_ms = rtcm_msg_rate_ms[1045]; - } - else - { - d_rtcm_MT1045_rate_ms = bc::lcm(5000, d_output_rate_ms); // default value if not set - } - if (rtcm_msg_rate_ms.find(1077) != rtcm_msg_rate_ms.end()) // whatever between 1071 and 1077 - { - d_rtcm_MT1077_rate_ms = rtcm_msg_rate_ms[1077]; - } - else - { - d_rtcm_MT1077_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set - } - if (rtcm_msg_rate_ms.find(1087) != rtcm_msg_rate_ms.end()) // whatever between 1081 and 1087 - { - d_rtcm_MT1087_rate_ms = rtcm_msg_rate_ms[1087]; - } - else - { - d_rtcm_MT1087_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set - } - if (rtcm_msg_rate_ms.find(1097) != rtcm_msg_rate_ms.end()) // whatever between 1091 and 1097 - { - d_rtcm_MT1097_rate_ms = rtcm_msg_rate_ms[1097]; - d_rtcm_MSM_rate_ms = rtcm_msg_rate_ms[1097]; - } - else - { - d_rtcm_MT1097_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set - d_rtcm_MSM_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set - } - b_rtcm_writing_started = false; // initialize RINEX printer b_rinex_header_written = false; @@ -954,7 +964,6 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item // it->second.Pseudorange_m = it->second.Pseudorange_m - d_ls_pvt->get_time_offset_s() * GPS_C_m_s; // } - if (d_ls_pvt->get_PVT(gnss_observables_map, false)) { //Optional debug code: export observables snapshot for rtklib unit testing @@ -1001,7 +1010,6 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { flag_write_RINEX_obs_output = true; } - if (current_RX_time_ms % static_cast(d_rinexnav_rate_ms) == 0) { flag_write_RINEX_nav_output = true; @@ -1059,15 +1067,16 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item * 29 | GPS L1 C/A + GLONASS L2 C/A * 30 | Galileo E1B + GLONASS L2 C/A * 31 | GPS L2C + GLONASS L2 C/A + * 32 | GPS L1 C/A + Galileo E1B + GPS L5 + Galileo E5a */ - std::map::const_iterator galileo_ephemeris_iter; - std::map::const_iterator gps_ephemeris_iter; - std::map::const_iterator gps_cnav_ephemeris_iter; - std::map::const_iterator glonass_gnav_ephemeris_iter; // ####################### RINEX FILES ################# if (b_rinex_output_enabled) { + std::map::const_iterator galileo_ephemeris_iter; + std::map::const_iterator gps_ephemeris_iter; + std::map::const_iterator gps_cnav_ephemeris_iter; + std::map::const_iterator glonass_gnav_ephemeris_iter; if (!b_rinex_header_written) // & we have utc data in nav message! { galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); @@ -1737,7 +1746,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item // ####################### RTCM MESSAGES ################# try { - if (b_rtcm_writing_started) + if (b_rtcm_writing_started and b_rtcm_enabled) { if (type_of_rx == 1) // GPS L1 C/A { @@ -2219,7 +2228,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2227,7 +2236,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } - if (!b_rtcm_writing_started) // the first time + if (!b_rtcm_writing_started and b_rtcm_enabled) // the first time { if (type_of_rx == 1) // GPS L1 C/A { diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index 38db64a1b..427936704 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -81,6 +81,7 @@ private: int32_t d_rinexnav_rate_ms; bool b_rtcm_writing_started; + bool b_rtcm_enabled; 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) From 6b854c35130173a6372622f2849c630e6a176112 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 3 Nov 2018 10:50:19 +0100 Subject: [PATCH 046/143] Fix segmentation fault under certain output combinations --- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 115 +++++++++++------- 1 file changed, 71 insertions(+), 44 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index aa3c921c5..1a8bdae3c 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -401,6 +401,13 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, } else { + d_rtcm_MT1019_rate_ms = 0; + d_rtcm_MT1045_rate_ms = 0; + d_rtcm_MT1020_rate_ms = 0; + d_rtcm_MT1077_rate_ms = 0; + d_rtcm_MT1087_rate_ms = 0; + d_rtcm_MT1097_rate_ms = 0; + d_rtcm_MSM_rate_ms = 0; b_rtcm_enabled = false; b_rtcm_writing_started = false; d_rtcm_printer = nullptr; @@ -895,46 +902,49 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item // store valid observables in a map. gnss_observables_map.insert(std::pair(i, in[i][epoch])); } - try + if (b_rtcm_enabled) { - if (d_ls_pvt->gps_ephemeris_map.empty() == false) + try { - if (tmp_eph_iter_gps != d_ls_pvt->gps_ephemeris_map.end()) + if (d_ls_pvt->gps_ephemeris_map.empty() == false) { - d_rtcm_printer->lock_time(d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + if (tmp_eph_iter_gps != d_ls_pvt->gps_ephemeris_map.end()) + { + d_rtcm_printer->lock_time(d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + } + } + if (d_ls_pvt->galileo_ephemeris_map.empty() == false) + { + if (tmp_eph_iter_gal != d_ls_pvt->galileo_ephemeris_map.end()) + { + d_rtcm_printer->lock_time(d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + } + } + if (d_ls_pvt->gps_cnav_ephemeris_map.empty() == false) + { + if (tmp_eph_iter_cnav != d_ls_pvt->gps_cnav_ephemeris_map.end()) + { + d_rtcm_printer->lock_time(d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + } + } + if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false) + { + if (tmp_eph_iter_glo_gnav != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + { + d_rtcm_printer->lock_time(d_ls_pvt->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + } } } - if (d_ls_pvt->galileo_ephemeris_map.empty() == false) + catch (const boost::exception& ex) { - if (tmp_eph_iter_gal != d_ls_pvt->galileo_ephemeris_map.end()) - { - d_rtcm_printer->lock_time(d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time - } + std::cout << "RTCM boost exception: " << boost::diagnostic_information(ex) << std::endl; + LOG(ERROR) << "RTCM boost exception: " << boost::diagnostic_information(ex); } - if (d_ls_pvt->gps_cnav_ephemeris_map.empty() == false) + catch (const std::exception& ex) { - if (tmp_eph_iter_cnav != d_ls_pvt->gps_cnav_ephemeris_map.end()) - { - d_rtcm_printer->lock_time(d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time - } + std::cout << "RTCM std exception: " << ex.what() << std::endl; + LOG(ERROR) << "RTCM std exception: " << ex.what(); } - if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false) - { - if (tmp_eph_iter_glo_gnav != d_ls_pvt->glonass_gnav_ephemeris_map.end()) - { - d_rtcm_printer->lock_time(d_ls_pvt->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time - } - } - } - catch (const boost::exception& ex) - { - std::cout << "RTCM boost exception: " << boost::diagnostic_information(ex) << std::endl; - LOG(ERROR) << "RTCM boost exception: " << boost::diagnostic_information(ex); - } - catch (const std::exception& ex) - { - std::cout << "RTCM std exception: " << ex.what() << std::endl; - LOG(ERROR) << "RTCM std exception: " << ex.what(); } } } @@ -976,17 +986,26 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { flag_display_pvt = true; } - if (current_RX_time_ms % d_rtcm_MT1019_rate_ms == 0 and d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 + if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - flag_write_RTCM_1019_output = true; + if (current_RX_time_ms % d_rtcm_MT1019_rate_ms == 0) + { + flag_write_RTCM_1019_output = true; + } } - if (current_RX_time_ms % d_rtcm_MT1020_rate_ms == 0 and d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 + if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - flag_write_RTCM_1020_output = true; + if (current_RX_time_ms % d_rtcm_MT1020_rate_ms == 0) + { + flag_write_RTCM_1020_output = true; + } } - if (current_RX_time_ms % d_rtcm_MT1045_rate_ms == 0 and d_rtcm_MT1045_rate_ms != 0) + if (d_rtcm_MT1045_rate_ms != 0) { - flag_write_RTCM_1045_output = true; + if (current_RX_time_ms % d_rtcm_MT1045_rate_ms == 0) + { + flag_write_RTCM_1045_output = true; + } } // TODO: RTCM 1077, 1087 and 1097 are not used, so, disable the output rates // if (current_RX_time_ms % d_rtcm_MT1077_rate_ms==0 and d_rtcm_MT1077_rate_ms != 0) @@ -1001,18 +1020,26 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item // { // last_RTCM_1097_output_time = current_RX_time; // } - - if (current_RX_time_ms % d_rtcm_MSM_rate_ms == 0 and d_rtcm_MSM_rate_ms != 0) + if (d_rtcm_MSM_rate_ms != 0) { - flag_write_RTCM_MSM_output = true; + if (current_RX_time_ms % d_rtcm_MSM_rate_ms == 0) + { + flag_write_RTCM_MSM_output = true; + } } - if (current_RX_time_ms % static_cast(d_rinexobs_rate_ms) == 0) + if (d_rinexobs_rate_ms != 0) { - flag_write_RINEX_obs_output = true; + if (current_RX_time_ms % static_cast(d_rinexobs_rate_ms) == 0) + { + flag_write_RINEX_obs_output = true; + } } - if (current_RX_time_ms % static_cast(d_rinexnav_rate_ms) == 0) + if (d_rinexnav_rate_ms != 0) { - flag_write_RINEX_nav_output = true; + if (current_RX_time_ms % static_cast(d_rinexnav_rate_ms) == 0) + { + flag_write_RINEX_nav_output = true; + } } if (first_fix == true) From 766cc308bd79b83056cc691aa00c86a28bce3c7a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 4 Nov 2018 19:49:26 +0100 Subject: [PATCH 047/143] Fix crash after the first fix in some signal combinations --- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 172 +++++++++--------- 1 file changed, 81 insertions(+), 91 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 1a8bdae3c..35630f31b 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -908,28 +908,28 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (d_ls_pvt->gps_ephemeris_map.empty() == false) { - if (tmp_eph_iter_gps != d_ls_pvt->gps_ephemeris_map.end()) + if (tmp_eph_iter_gps != d_ls_pvt->gps_ephemeris_map.cend()) { d_rtcm_printer->lock_time(d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } if (d_ls_pvt->galileo_ephemeris_map.empty() == false) { - if (tmp_eph_iter_gal != d_ls_pvt->galileo_ephemeris_map.end()) + if (tmp_eph_iter_gal != d_ls_pvt->galileo_ephemeris_map.cend()) { d_rtcm_printer->lock_time(d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } if (d_ls_pvt->gps_cnav_ephemeris_map.empty() == false) { - if (tmp_eph_iter_cnav != d_ls_pvt->gps_cnav_ephemeris_map.end()) + if (tmp_eph_iter_cnav != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { d_rtcm_printer->lock_time(d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false) { - if (tmp_eph_iter_glo_gnav != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + if (tmp_eph_iter_glo_gnav != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->lock_time(d_ls_pvt->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } @@ -967,7 +967,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { // receiver clock correction is disabled to be coherent with the RINEX and RTCM standard // std::cout << TEXT_RED << "(internal) accumulated RX clock offset: " << d_ls_pvt->get_time_offset_s() << "[s]" << TEXT_RESET << std::endl; - // for (std::map::iterator it = gnss_observables_map.begin(); it != gnss_observables_map.end(); ++it) + // for (std::map::iterator it = gnss_observables_map.begin(); it != gnss_observables_map.cend(); ++it) // { // todo: check if it has effect to correct the receiver time for the internal pvt solution // take into account that the RINEX obs with the RX time (integer ms) CAN NOT be corrected to keep the coherence in obs time @@ -1466,7 +1466,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (type_of_rx == 1) // GPS L1 C/A only { - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) + if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, d_rx_time, gnss_observables_map); } @@ -1479,7 +1479,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 2) // GPS L2C only { - if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) + if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } @@ -1492,7 +1492,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 3) // GPS L5 { - if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) + if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } @@ -1505,7 +1505,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 4) // Galileo E1B only { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B"); } @@ -1518,7 +1518,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 5) // Galileo E5a only { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "5X"); } @@ -1531,7 +1531,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 6) // Galileo E5b only { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "7X"); } @@ -1544,7 +1544,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 7) // GPS L1 C/A + GPS L2C { - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } @@ -1557,7 +1557,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 8) // L1+L5 { - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } @@ -1578,7 +1578,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B { - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())) + if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); } @@ -1591,7 +1591,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 13) // L5+E5a { - if ((gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())) + if ((gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); } @@ -1604,7 +1604,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 14) // Galileo E1B + Galileo E5a { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 5X"); } @@ -1617,7 +1617,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 15) // Galileo E1B + Galileo E5b { - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 7X"); } @@ -1630,7 +1630,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 23) // GLONASS L1 C/A only { - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C"); } @@ -1643,7 +1643,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 24) // GLONASS L2 C/A only { - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "2C"); } @@ -1656,7 +1656,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 25) // GLONASS L1 C/A + GLONASS L2 C/A { - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C 2C"); } @@ -1669,7 +1669,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } @@ -1682,7 +1682,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } @@ -1695,7 +1695,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } @@ -1708,7 +1708,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } @@ -1721,7 +1721,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } @@ -1734,7 +1734,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A { - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())) + if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } @@ -1747,7 +1747,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (type_of_rx == 32) // L1+E1+L5+E5a { - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())) + if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); } @@ -1786,8 +1786,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_eph_iter; - gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); @@ -1805,8 +1804,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gal_eph_iter; - gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); @@ -1824,10 +1822,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_eph_iter; - gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter; - gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); @@ -1845,10 +1841,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_eph_iter; - gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter; - gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); @@ -1859,14 +1853,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.begin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } @@ -1874,8 +1868,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gps_eph_iter; - std::map::const_iterator gal_eph_iter; + std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -1979,8 +1973,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator glonass_gnav_eph_iter; - std::map::const_iterator gps_eph_iter; + std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2040,8 +2034,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter; - std::map::const_iterator glonass_gnav_eph_iter; + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); int gal_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2064,18 +2058,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("R") == 0) { glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2100,11 +2094,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gps_eph_iter; - std::map::const_iterator glonass_gnav_eph_iter; + std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; - for (gnss_observables_iter = gnss_observables_map.begin(); gnss_observables_iter != gnss_observables_map.end(); gnss_observables_iter++) + for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) @@ -2160,8 +2154,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter; - std::map::const_iterator glonass_gnav_eph_iter; + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); int gal_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2184,18 +2178,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("R") == 0) { glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2220,8 +2214,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter; - std::map::const_iterator gps_eph_iter; + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); int gal_channel = 0; int gps_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2244,7 +2238,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("G") == 0) { gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.end()) + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -2255,7 +2249,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2297,7 +2291,6 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); @@ -2318,7 +2311,6 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); @@ -2339,7 +2331,6 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); @@ -2358,7 +2349,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (d_rtcm_MT1045_rate_ms != 0) { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.begin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } @@ -2366,8 +2357,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter; - std::map::const_iterator gps_eph_iter; + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2379,7 +2370,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { // This is a channel with valid GPS signal gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.end()) + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -2390,18 +2381,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("E") == 0) { gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { gal_channel = 1; } } } } - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.end() and (d_rtcm_MT1077_rate_ms != 0)) + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end() and (d_rtcm_MT1097_rate_ms != 0)) + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2420,7 +2411,6 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); - if (glo_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); @@ -2466,9 +2456,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator glonass_gnav_eph_iter; std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gps_eph_iter; + std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2530,8 +2520,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item int gal_channel = 0; int glo_channel = 0; std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter; - std::map::const_iterator glonass_gnav_eph_iter; + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -2552,18 +2542,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("R") == 0) { glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2588,8 +2578,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gps_eph_iter; - std::map::const_iterator glonass_gnav_eph_iter; + std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); std::map::const_iterator gnss_observables_iter; int gps_channel = 0; int glo_channel = 0; @@ -2653,8 +2643,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item int gal_channel = 0; int glo_channel = 0; std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter; - std::map::const_iterator glonass_gnav_eph_iter; + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -2675,18 +2665,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("R") == 0) { glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) + if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2712,8 +2702,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter; - std::map::const_iterator gps_eph_iter; + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2725,7 +2715,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { // This is a channel with valid GPS signal gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.end()) + if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -2736,7 +2726,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("E") == 0) { gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.end()) + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { gal_channel = 1; } From 40efd08b56de3ed6074c771f0eba91c946c94893 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 4 Nov 2018 19:52:20 +0100 Subject: [PATCH 048/143] Fix typo --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 35630f31b..fe2cce6e1 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -2521,7 +2521,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item int glo_channel = 0; std::map::const_iterator gnss_observables_iter; std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); From 70800a7c6c941618928a178d39c06348abdbadbf Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 4 Nov 2018 20:14:25 +0100 Subject: [PATCH 049/143] Improve const correctness --- src/algorithms/PVT/libs/rinex_printer.cc | 88 ++++++++++++------------ 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 9a2ab524b..88c001e2b 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -3296,8 +3296,8 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map::const_iterator glonass_gnav_ephemeris_iter; - for (glonass_gnav_ephemeris_iter = eph_map.begin(); - glonass_gnav_ephemeris_iter != eph_map.end(); + for (glonass_gnav_ephemeris_iter = eph_map.cbegin(); + glonass_gnav_ephemeris_iter != eph_map.cend(); glonass_gnav_ephemeris_iter++) { // -------- SV / EPOCH / SV CLK @@ -7114,15 +7114,15 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri //Number of satellites observed in current epoch int32_t numSatellitesObserved = 0; std::map::const_iterator observables_iter; - for (observables_iter = observables.begin(); - observables_iter != observables.end(); + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); observables_iter++) { numSatellitesObserved++; } line += Rinex_Printer::rightJustify(boost::lexical_cast(numSatellitesObserved), 3); - for (observables_iter = observables.begin(); - observables_iter != observables.end(); + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); observables_iter++) { line += satelliteSystem["GLONASS"]; @@ -7135,8 +7135,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri Rinex_Printer::lengthCheck(line); out << line << std::endl; - for (observables_iter = observables.begin(); - observables_iter != observables.end(); + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); observables_iter++) { std::string lineObs; @@ -7218,8 +7218,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri //Number of satellites observed in current epoch int32_t numSatellitesObserved = 0; std::map::const_iterator observables_iter; - for (observables_iter = observables.begin(); - observables_iter != observables.end(); + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); observables_iter++) { numSatellitesObserved++; @@ -7233,8 +7233,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri Rinex_Printer::lengthCheck(line); out << line << std::endl; - for (observables_iter = observables.begin(); - observables_iter != observables.end(); + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); observables_iter++) { std::string lineObs; @@ -7390,8 +7390,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep std::map observablesR2C; std::map::const_iterator observables_iter; - for (observables_iter = observables.begin(); - observables_iter != observables.end(); + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); observables_iter++) { std::string system_(&observables_iter->second.System, 1); @@ -7413,8 +7413,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep std::multimap total_glo_map; std::set available_glo_prns; std::set::iterator it; - for (observables_iter = observablesR1C.begin(); - observables_iter != observablesR1C.end(); + for (observables_iter = observablesR1C.cbegin(); + observables_iter != observablesR1C.cend(); observables_iter++) { uint32_t prn_ = observables_iter->second.PRN; @@ -7426,8 +7426,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep } } - for (observables_iter = observablesR2C.begin(); - observables_iter != observablesR2C.end(); + for (observables_iter = observablesR2C.cbegin(); + observables_iter != observablesR2C.cend(); observables_iter++) { uint32_t prn_ = observables_iter->second.PRN; @@ -7446,8 +7446,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep if (version == 2) { // Add list of GPS satellites - for (observables_iter = observablesG1C.begin(); - observables_iter != observablesG1C.end(); + for (observables_iter = observablesG1C.cbegin(); + observables_iter != observablesG1C.cend(); observables_iter++) { line += satelliteSystem["GPS"]; @@ -7455,8 +7455,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep line += boost::lexical_cast(static_cast(observables_iter->second.PRN)); } // Add list of GLONASS L1 satellites - for (observables_iter = observablesR1C.begin(); - observables_iter != observablesR1C.end(); + for (observables_iter = observablesR1C.cbegin(); + observables_iter != observablesR1C.cend(); observables_iter++) { line += satelliteSystem["GLONASS"]; @@ -7464,8 +7464,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep line += boost::lexical_cast(static_cast(observables_iter->second.PRN)); } // Add list of GLONASS L2 satellites - for (observables_iter = observablesR2C.begin(); - observables_iter != observablesR2C.end(); + for (observables_iter = observablesR2C.cbegin(); + observables_iter != observablesR2C.cend(); observables_iter++) { line += satelliteSystem["GLONASS"]; @@ -7480,8 +7480,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep // -------- OBSERVATION record std::string s; std::string lineObs; - for (observables_iter = observablesG1C.begin(); - observables_iter != observablesG1C.end(); + for (observables_iter = observablesG1C.cbegin(); + observables_iter != observablesG1C.cend(); observables_iter++) { lineObs.clear(); @@ -7664,8 +7664,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g std::map observablesR2C; std::map::const_iterator observables_iter; - for (observables_iter = observables.begin(); - observables_iter != observables.end(); + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); observables_iter++) { std::string system_(&observables_iter->second.System, 1); @@ -7687,8 +7687,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g std::multimap total_glo_map; std::set available_glo_prns; std::set::iterator it; - for (observables_iter = observablesR1C.begin(); - observables_iter != observablesR1C.end(); + for (observables_iter = observablesR1C.cbegin(); + observables_iter != observablesR1C.cend(); observables_iter++) { uint32_t prn_ = observables_iter->second.PRN; @@ -7700,8 +7700,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g } } - for (observables_iter = observablesR2C.begin(); - observables_iter != observablesR2C.end(); + for (observables_iter = observablesR2C.cbegin(); + observables_iter != observablesR2C.cend(); observables_iter++) { uint32_t prn_ = observables_iter->second.PRN; @@ -7725,8 +7725,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g // -------- OBSERVATION record std::string s; std::string lineObs; - for (observables_iter = observablesG2S.begin(); - observables_iter != observablesG2S.end(); + for (observables_iter = observablesG2S.cbegin(); + observables_iter != observablesG2S.cend(); observables_iter++) { lineObs.clear(); @@ -7904,8 +7904,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga std::map observablesR2C; std::map::const_iterator observables_iter; - for (observables_iter = observables.begin(); - observables_iter != observables.end(); + for (observables_iter = observables.cbegin(); + observables_iter != observables.cend(); observables_iter++) { std::string system_(&observables_iter->second.System, 1); @@ -7927,8 +7927,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga std::multimap total_glo_map; std::set available_glo_prns; std::set::iterator it; - for (observables_iter = observablesR1C.begin(); - observables_iter != observablesR1C.end(); + for (observables_iter = observablesR1C.cbegin(); + observables_iter != observablesR1C.cend(); observables_iter++) { uint32_t prn_ = observables_iter->second.PRN; @@ -7939,8 +7939,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga available_glo_prns.insert(prn_); } } - for (observables_iter = observablesR2C.begin(); - observables_iter != observablesR2C.end(); + for (observables_iter = observablesR2C.cbegin(); + observables_iter != observablesR2C.cend(); observables_iter++) { uint32_t prn_ = observables_iter->second.PRN; @@ -7966,8 +7966,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga std::string s; std::string lineObs; - for (observables_iter = observablesE1B.begin(); - observables_iter != observablesE1B.end(); + for (observables_iter = observablesE1B.cbegin(); + observables_iter != observablesE1B.cend(); observables_iter++) { lineObs.clear(); @@ -8747,8 +8747,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep std::set::iterator it; if (found_1B != std::string::npos) { - for (observables_iter = observablesE1B.begin(); - observables_iter != observablesE1B.end(); + for (observables_iter = observablesE1B.cbegin(); + observables_iter != observablesE1B.cend(); observables_iter++) { uint32_t prn_ = observables_iter->second.PRN; From 8d3074a9dc31c0ca4e4fa087e0fa67562b92d29b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 4 Nov 2018 22:50:46 +0100 Subject: [PATCH 050/143] Replace boost::lexical_cast by std::to_string --- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 6 +++--- .../tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 5401fae93..09f1cf8bf 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -50,7 +50,7 @@ #include "GPS_L5.h" #include "gps_l5_signal.h" #include "gnss_sdr_create_directory.h" -#include +#include #include #include #include @@ -1091,7 +1091,7 @@ int32_t dll_pll_veml_tracking::save_matfile() std::ifstream dump_file; std::string dump_filename_ = d_dump_filename; // add channel number to the filename - dump_filename_.append(boost::lexical_cast(d_channel)); + dump_filename_.append(std::to_string(d_channel)); // add extension dump_filename_.append(".dat"); std::cout << "Generating .mat file for " << dump_filename_ << std::endl; @@ -1335,7 +1335,7 @@ void dll_pll_veml_tracking::set_channel(uint32_t channel) { std::string dump_filename_ = d_dump_filename; // add channel number to the filename - dump_filename_.append(boost::lexical_cast(d_channel)); + dump_filename_.append(std::to_string(d_channel)); // add extension dump_filename_.append(".dat"); diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index 71d8cfc5a..f73ed6c90 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -48,7 +48,7 @@ #include "GPS_L5.h" #include "gps_l5_signal.h" #include "gnss_sdr_create_directory.h" -#include +#include #include #include #include @@ -999,7 +999,7 @@ int32_t dll_pll_veml_tracking_fpga::save_matfile() std::ifstream dump_file; std::string dump_filename_ = d_dump_filename; // add channel number to the filename - dump_filename_.append(boost::lexical_cast(d_channel)); + dump_filename_.append(std::to_string(d_channel)); // add extension dump_filename_.append(".dat"); std::cout << "Generating .mat file for " << dump_filename_ << std::endl; @@ -1227,7 +1227,7 @@ void dll_pll_veml_tracking_fpga::set_channel(uint32_t channel) { std::string dump_filename_ = d_dump_filename; // add channel number to the filename - dump_filename_.append(boost::lexical_cast(d_channel)); + dump_filename_.append(std::to_string(d_channel)); // add extension dump_filename_.append(".dat"); From 99989d472cf572411679c6f9fdddda36713f3074 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 5 Nov 2018 15:39:56 +0100 Subject: [PATCH 051/143] Fix NMEA GPGSV message for GPS L1 --- src/algorithms/PVT/libs/nmea_printer.cc | 88 ++---------------------- src/algorithms/PVT/libs/rtklib_solver.cc | 50 +++++++++++++- src/algorithms/PVT/libs/rtklib_solver.h | 1 + 3 files changed, 57 insertions(+), 82 deletions(-) diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index 1337526b9..26b18e3d0 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -34,6 +34,7 @@ */ #include "nmea_printer.h" +#include "rtklib_solution.h" #include #include // for create_directories, exists #include // for path, operator<< @@ -560,88 +561,13 @@ std::string Nmea_Printer::get_GPGSA() std::string Nmea_Printer::get_GPGSV() { // GSV-GNSS Satellites in View - // Notice that NMEA 2.1 only supports 12 channels - int n_sats_used = d_PVT_data->get_num_valid_observations(); - std::stringstream sentence_str; - std::stringstream frame_str; - std::string sentence_header; - sentence_header = "$GPGSV,"; - char checksum; - std::string tmpstr; - - // 1st step: How many GPGSV frames we need? (up to 3) - // Each frame contains up to 4 satellites - int n_frames; - n_frames = std::ceil((static_cast(n_sats_used)) / 4.0); - - // generate the frames - int current_satellite = 0; - for (int i = 1; i < (n_frames + 1); i++) - { - frame_str.str(""); - frame_str << sentence_header; - - // number of messages - frame_str << n_frames; - - // message number - frame_str << ","; - frame_str << i; - - // total number of satellites in view - frame_str << ","; - frame_str.width(2); - frame_str.fill('0'); - frame_str << std::dec << n_sats_used; - - // satellites info - for (int j = 0; j < 4; j++) - { - // write satellite info - frame_str << ","; - frame_str.width(2); - frame_str.fill('0'); - frame_str << std::dec << d_PVT_data->get_visible_satellites_ID(current_satellite); - - frame_str << ","; - frame_str.width(2); - frame_str.fill('0'); - frame_str << std::dec << static_cast(d_PVT_data->get_visible_satellites_El(current_satellite)); - - frame_str << ","; - frame_str.width(3); - frame_str.fill('0'); - frame_str << std::dec << static_cast(d_PVT_data->get_visible_satellites_Az(current_satellite)); - - frame_str << ","; - frame_str.width(2); - frame_str.fill('0'); - frame_str << std::dec << static_cast(d_PVT_data->get_visible_satellites_CN0_dB(current_satellite)); - - current_satellite++; - - if (current_satellite == n_sats_used) - { - break; - } - } - - // frame checksum - tmpstr = frame_str.str(); - checksum = checkSum(tmpstr.substr(1)); - frame_str << "*"; - frame_str.width(2); - frame_str.fill('0'); - frame_str << std::hex << static_cast(checksum); - - // end NMEA sentence - frame_str << "\r\n"; - - //add frame to sentence - sentence_str << frame_str.str(); - } - return sentence_str.str(); // $GPGSV,2,1,07,07,79,048,42,02,51,062,43,26,36,256,42,27,27,138,42*71 + // Notice that NMEA 2.1 only supports 12 channels + std::stringstream sentence_str; + unsigned char buff[200]; + outnmea_gsv(buff, &d_PVT_data->pvt_sol, *d_PVT_data->pvt_ssat); + sentence_str << buff; + return sentence_str.str(); } diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 12d316196..1ef53bc58 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -53,6 +53,7 @@ #include "rtklib_solver.h" #include "rtklib_conversions.h" +#include "rtklib_solution.h" #include "GPS_L1_CA.h" #include "Galileo_E1.h" #include "GLONASS_L1_L2_CA.h" @@ -809,8 +810,55 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ index_aux++; } } - if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_); + for (gnss_observables_iter = gnss_observables_map.cbegin(); + gnss_observables_iter != gnss_observables_map.cend(); + ++gnss_observables_iter) // CHECK INCONSISTENCY when combining GLONASS + other system + { + switch (gnss_observables_iter->second.System) + { + case 'E': + break; + + case 'G': + { + // GPS L1 + std::string sig_(gnss_observables_iter->second.Signal); + if (sig_.compare("1C") == 0) + { + unsigned int snr = static_cast(std::round(gnss_observables_iter->second.CN0_dB_hz / 0.25)); + rtk_.ssat[gnss_observables_iter->second.PRN - 1].snr[0] = snr; //newobs.SNR[0]; + pvt_ssat[gnss_observables_iter->second.PRN - 1] = &rtk_.ssat[gnss_observables_iter->second.PRN - 1]; + } + // GPS L2 + if (sig_.compare("2S") == 0) + { + } + // GPS L5 + if (sig_.compare("L5") == 0) + { + } + break; + } + case 'R': + { + std::string sig_(gnss_observables_iter->second.Signal); + // GLONASS GNAV L1 + if (sig_.compare("1G") == 0) + { + } + // GLONASS GNAV L2 + if (sig_.compare("2G") == 0) + { + } + break; + } + default: + break; + } + } + + if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_); this->set_valid_position(true); arma::vec rx_position_and_time(4); rx_position_and_time(0) = pvt_sol.rr[0]; // [m] diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index b584c4826..1e9684685 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -86,6 +86,7 @@ private: public: sol_t pvt_sol; + ssat_t* pvt_ssat[MAXSAT]; rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, rtk_t& rtk); ~rtklib_solver(); From 4f7b43255acc9c608a66f4f9ec035c6f593f05e4 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 5 Nov 2018 17:36:26 +0100 Subject: [PATCH 052/143] Add work on NMEA messages --- src/algorithms/PVT/libs/rtklib_solver.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 1ef53bc58..9e0e375e2 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -818,8 +818,16 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ switch (gnss_observables_iter->second.System) { case 'E': - break; - + { + std::string sig_(gnss_observables_iter->second.Signal); + if (sig_.compare("1B") == 0) + { + unsigned int snr = static_cast(std::round(gnss_observables_iter->second.CN0_dB_hz / 0.25)); + rtk_.ssat[gnss_observables_iter->second.PRN - 1].snr[0] = snr; + pvt_ssat[gnss_observables_iter->second.PRN - 1] = &rtk_.ssat[gnss_observables_iter->second.PRN - 1]; + } + break; + } case 'G': { // GPS L1 @@ -827,7 +835,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ if (sig_.compare("1C") == 0) { unsigned int snr = static_cast(std::round(gnss_observables_iter->second.CN0_dB_hz / 0.25)); - rtk_.ssat[gnss_observables_iter->second.PRN - 1].snr[0] = snr; //newobs.SNR[0]; + rtk_.ssat[gnss_observables_iter->second.PRN - 1].snr[0] = snr; pvt_ssat[gnss_observables_iter->second.PRN - 1] = &rtk_.ssat[gnss_observables_iter->second.PRN - 1]; } // GPS L2 From 01a1954b155b5d9a72d0c2e05ddfb5f03fda67a1 Mon Sep 17 00:00:00 2001 From: Javier Date: Mon, 5 Nov 2018 17:53:53 +0100 Subject: [PATCH 053/143] Adding the Hotstart telecommand implementation to predict visible satellites for GPS and Galileo constellations --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 22 +++ src/algorithms/PVT/adapters/rtklib_pvt.h | 7 + .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 23 ++- .../PVT/gnuradio_blocks/rtklib_pvt_cc.h | 19 ++- src/algorithms/channel/libs/channel_fsm.cc | 4 +- src/algorithms/libs/CMakeLists.txt | 1 + .../libs/geofunctions.cc | 0 .../libs/geofunctions.h | 0 .../libs/rtklib/rtklib_conversions.cc | 58 ++++++- .../libs/rtklib/rtklib_conversions.h | 6 + src/core/interfaces/pvt_interface.h | 9 ++ src/core/receiver/control_thread.cc | 147 ++++++++++++++++++ src/core/receiver/control_thread.h | 13 +- src/core/receiver/gnss_flowgraph.cc | 64 ++++++-- src/core/receiver/gnss_flowgraph.h | 22 ++- src/core/receiver/tcp_cmd_interface.cc | 87 +++++++++-- src/core/receiver/tcp_cmd_interface.h | 17 +- src/main/CMakeLists.txt | 1 + src/tests/system-tests/libs/CMakeLists.txt | 1 - 19 files changed, 458 insertions(+), 43 deletions(-) rename src/{tests/system-tests => algorithms}/libs/geofunctions.cc (100%) rename src/{tests/system-tests => algorithms}/libs/geofunctions.h (100%) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 74b2f4c5d..c5532dea2 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -48,6 +48,12 @@ namespace bc = boost::integer; using google::LogMessage; + +void RtklibPvt::clear_ephemeris() +{ + pvt_->clear_ephemeris(); +} + RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, std::string role, unsigned int in_streams, @@ -515,6 +521,22 @@ RtklibPvt::~RtklibPvt() rtkfree(&rtk); } +std::map RtklibPvt::get_gps_ephemeris() +{ + return pvt_->get_gps_ephemeris_map(); +} +std::map RtklibPvt::get_galileo_ephemeris() +{ + return pvt_->get_galileo_ephemeris_map(); +} +std::map RtklibPvt::get_gps_almanac() +{ + return pvt_->get_gps_almanac_map(); +} +std::map RtklibPvt::get_galileo_almanac() +{ + return pvt_->get_galileo_almanac_map(); +} void RtklibPvt::connect(gr::top_block_sptr top_block) { diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.h b/src/algorithms/PVT/adapters/rtklib_pvt.h index c79519581..75e9c6c6d 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.h +++ b/src/algorithms/PVT/adapters/rtklib_pvt.h @@ -63,6 +63,13 @@ public: return "RTKLIB_PVT"; } + void clear_ephemeris(); + std::map get_gps_ephemeris(); + std::map get_galileo_ephemeris(); + std::map get_gps_almanac(); + std::map get_galileo_almanac(); + + void connect(gr::top_block_sptr top_block) override; void disconnect(gr::top_block_sptr top_block) override; gr::basic_block_sptr get_left_block() override; diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index fe2cce6e1..69cc62264 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -234,11 +234,32 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) } -std::map rtklib_pvt_cc::get_GPS_L1_ephemeris_map() +std::map rtklib_pvt_cc::get_gps_ephemeris_map() { return d_ls_pvt->gps_ephemeris_map; } +std::map rtklib_pvt_cc::get_gps_almanac_map() +{ + return d_ls_pvt->gps_almanac_map; +} + +std::map rtklib_pvt_cc::get_galileo_ephemeris_map() +{ + return d_ls_pvt->galileo_ephemeris_map; +} +std::map rtklib_pvt_cc::get_galileo_almanac_map() +{ + return d_ls_pvt->galileo_almanac_map; +} + +void rtklib_pvt_cc::clear_ephemeris() +{ + d_ls_pvt->gps_ephemeris_map.clear(); + d_ls_pvt->gps_almanac_map.clear(); + d_ls_pvt->galileo_ephemeris_map.clear(); + d_ls_pvt->galileo_almanac_map.clear(); +} rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, const Pvt_Conf& conf_, diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index 427936704..f063431d1 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -31,7 +31,7 @@ #ifndef GNSS_SDR_RTKLIB_PVT_CC_H #define GNSS_SDR_RTKLIB_PVT_CC_H - +#include "gps_ephemeris.h" #include "nmea_printer.h" #include "kml_printer.h" #include "gpx_printer.h" @@ -142,11 +142,22 @@ public: rtk_t& rtk); /*! - * \brief Get latest set of GPS L1 ephemeris from PVT block + * \brief Get latest set of ephemeris from PVT block * - * It is used to save the assistance data at the receiver shutdown */ - std::map get_GPS_L1_ephemeris_map(); + std::map get_gps_ephemeris_map(); + + std::map get_gps_almanac_map(); + + std::map get_galileo_ephemeris_map(); + + std::map get_galileo_almanac_map(); + + /*! + * \brief Clear all ephemeris information and the almanacs for GPS and Galileo + * + */ + void clear_ephemeris(); ~rtklib_pvt_cc(); //!< Default destructor diff --git a/src/algorithms/channel/libs/channel_fsm.cc b/src/algorithms/channel/libs/channel_fsm.cc index 5b212193a..14a4e6b12 100644 --- a/src/algorithms/channel/libs/channel_fsm.cc +++ b/src/algorithms/channel/libs/channel_fsm.cc @@ -59,7 +59,6 @@ bool ChannelFsm::Event_stop_channel() switch (d_state) { case 0: //already in stanby - return true; break; case 1: //acquisition d_state = 0; @@ -70,8 +69,9 @@ bool ChannelFsm::Event_stop_channel() stop_tracking(); break; default: - return true; + break; } + return true; } bool ChannelFsm::Event_start_acquisition() diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 18dd400b0..ce4560e6f 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -39,6 +39,7 @@ set(GNSS_SPLIBS_SOURCES conjugate_sc.cc conjugate_ic.cc gnss_sdr_create_directory.cc + geofunctions.cc ) set(GNSS_SPLIBS_HEADERS diff --git a/src/tests/system-tests/libs/geofunctions.cc b/src/algorithms/libs/geofunctions.cc similarity index 100% rename from src/tests/system-tests/libs/geofunctions.cc rename to src/algorithms/libs/geofunctions.cc diff --git a/src/tests/system-tests/libs/geofunctions.h b/src/algorithms/libs/geofunctions.h similarity index 100% rename from src/tests/system-tests/libs/geofunctions.h rename to src/algorithms/libs/geofunctions.h diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index 7953509a2..22b8af3b9 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -116,7 +116,7 @@ geph_t eph_to_rtklib(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glona eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph) { eph_t rtklib_sat = {0, 0, 0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, {}, 0.0, 0.0 }; + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, {}, 0.0, 0.0}; //Galileo is the third satellite system for RTKLIB, so, add the required offset to discriminate Galileo ephemeris rtklib_sat.sat = gal_eph.i_satellite_PRN + NSATGPS + NSATGLO; rtklib_sat.A = gal_eph.A_1 * gal_eph.A_1; @@ -174,7 +174,7 @@ eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph) eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph) { eph_t rtklib_sat = {0, 0, 0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, {}, 0.0, 0.0 }; + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, {}, 0.0, 0.0}; rtklib_sat.sat = gps_eph.i_satellite_PRN; rtklib_sat.A = gps_eph.d_sqrt_A * gps_eph.d_sqrt_A; rtklib_sat.M0 = gps_eph.d_M_0; @@ -231,7 +231,7 @@ eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph) eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph) { eph_t rtklib_sat = {0, 0, 0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, {}, 0.0, 0.0 }; + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, {}, 0.0, 0.0}; rtklib_sat.sat = gps_cnav_eph.i_satellite_PRN; const double A_REF = 26559710.0; // See IS-GPS-200H, pp. 170 rtklib_sat.A = A_REF + gps_cnav_eph.d_DELTA_A; @@ -291,3 +291,55 @@ eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph) return rtklib_sat; } + +alm_t alm_to_rtklib(const Gps_Almanac& gps_alm) +{ + alm_t rtklib_alm; + + rtklib_alm = {0, 0, 0, 0, {0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + + rtklib_alm.sat = gps_alm.i_satellite_PRN; + rtklib_alm.svh = gps_alm.i_SV_health; + rtklib_alm.svconf = gps_alm.i_AS_status; + rtklib_alm.week = gps_alm.i_WNa; + rtklib_alm.toa = gpst2time(gps_alm.i_WNa, gps_alm.d_Toa); + rtklib_alm.A = gps_alm.d_sqrt_A * gps_alm.d_sqrt_A; + rtklib_alm.e = gps_alm.d_e_eccentricity; + rtklib_alm.i0 = gps_alm.d_Delta_i + 0.3; + rtklib_alm.OMG0 = gps_alm.d_OMEGA0; + rtklib_alm.OMGd = gps_alm.d_OMEGA_DOT; + rtklib_alm.omg = gps_alm.d_OMEGA; + rtklib_alm.M0 = gps_alm.d_M_0; + rtklib_alm.f0 = gps_alm.d_A_f0; + rtklib_alm.f1 = gps_alm.d_A_f1; + rtklib_alm.toas = gps_alm.d_Toa; + + + return rtklib_alm; +} +alm_t alm_to_rtklib(const Galileo_Almanac& gal_alm) +{ + alm_t rtklib_alm; + + rtklib_alm = {0, 0, 0, 0, {0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + + rtklib_alm.sat = gal_alm.i_satellite_PRN; + rtklib_alm.svh = gal_alm.E1B_HS; + rtklib_alm.svconf = gal_alm.E1B_HS; + rtklib_alm.week = gal_alm.d_WNa; + rtklib_alm.toa = gpst2time(gal_alm.d_WNa, gal_alm.d_Toa); + rtklib_alm.A = 5440.588203494 + gal_alm.d_Delta_sqrt_A; + rtklib_alm.A = rtklib_alm.A * rtklib_alm.A; + rtklib_alm.e = gal_alm.d_e_eccentricity; + rtklib_alm.i0 = gal_alm.d_Delta_i + 0.31111; + rtklib_alm.OMG0 = gal_alm.d_OMEGA0; + rtklib_alm.OMGd = gal_alm.d_OMEGA_DOT; + rtklib_alm.omg = gal_alm.d_OMEGA; + rtklib_alm.M0 = gal_alm.d_M_0; + rtklib_alm.f0 = gal_alm.d_A_f0; + rtklib_alm.f1 = gal_alm.d_A_f1; + rtklib_alm.toas = gal_alm.d_Toa; + + + return rtklib_alm; +} diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.h b/src/algorithms/libs/rtklib/rtklib_conversions.h index 11f4208d1..dca5ec7be 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.h +++ b/src/algorithms/libs/rtklib/rtklib_conversions.h @@ -38,10 +38,16 @@ #include "gps_cnav_ephemeris.h" #include "glonass_gnav_ephemeris.h" #include "glonass_gnav_utc_model.h" +#include "gps_almanac.h" +#include "galileo_almanac.h" eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph); eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph); eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph); + +alm_t alm_to_rtklib(const Gps_Almanac& gps_alm); +alm_t alm_to_rtklib(const Galileo_Almanac& gal_alm); + /*! * \brief Transforms a Glonass_Gnav_Ephemeris to its RTKLIB counterpart * \param glonass_gnav_eph GLONASS GNAV Ephemeris structure diff --git a/src/core/interfaces/pvt_interface.h b/src/core/interfaces/pvt_interface.h index 69b23f541..c9a2db162 100644 --- a/src/core/interfaces/pvt_interface.h +++ b/src/core/interfaces/pvt_interface.h @@ -38,6 +38,10 @@ #define GNSS_SDR_PVT_INTERFACE_H_ #include "gnss_block_interface.h" +#include "gps_ephemeris.h" +#include "galileo_ephemeris.h" +#include "gps_almanac.h" +#include "galileo_almanac.h" /*! * \brief This class represents an interface to a PVT block. @@ -52,6 +56,11 @@ class PvtInterface : public GNSSBlockInterface { public: virtual void reset() = 0; + virtual void clear_ephemeris() = 0; + virtual std::map get_gps_ephemeris() = 0; + virtual std::map get_galileo_ephemeris() = 0; + virtual std::map get_gps_almanac() = 0; + virtual std::map get_galileo_almanac() = 0; }; #endif /* GNSS_SDR_PVT_INTERFACE_H_ */ diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index a73d2b446..c95973797 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -35,6 +35,7 @@ #include "control_thread.h" #include "concurrent_queue.h" #include "concurrent_map.h" +#include "pvt_interface.h" #include "control_message_factory.h" #include "file_configuration.h" #include "gnss_flowgraph.h" @@ -49,6 +50,10 @@ #include "gps_almanac.h" #include "glonass_gnav_ephemeris.h" #include "glonass_gnav_utc_model.h" +#include "geofunctions.h" +#include "rtklib_rtkcmn.h" +#include "rtklib_conversions.h" +#include "rtklib_ephemeris.h" #include #include #include @@ -693,6 +698,10 @@ void ControlThread::process_control_messages() } else { + if (control_messages_->at(i)->who == 300) //some TC commands require also actions from controlthread + { + apply_action(control_messages_->at(i)->what); + } flowgraph_->apply_action(control_messages_->at(i)->who, control_messages_->at(i)->what); } processed_control_messages_++; @@ -704,6 +713,8 @@ void ControlThread::process_control_messages() void ControlThread::apply_action(unsigned int what) { + std::shared_ptr pvt_ptr; + std::vector> visible_satellites; switch (what) { case 0: @@ -717,12 +728,148 @@ void ControlThread::apply_action(unsigned int what) restart_ = true; applied_actions_++; break; + case 12: + DLOG(INFO) << "Receiver action HOTSTART"; + visible_satellites = get_visible_sats(cmd_interface_.get_utc_time(), cmd_interface_.get_LLH()); + //reorder the satellite queue to acquire first those visible satellites + flowgraph_->priorize_satellites(visible_satellites); + //start again the satellite acquisitions (done in chained applyaction to flowgraph) + break; + case 13: + DLOG(INFO) << "Receiver action WARMSTART"; + //delete all ephemeris and almanac information from maps (also the PVT map queue) + pvt_ptr = flowgraph_->get_pvt(); + pvt_ptr->clear_ephemeris(); + //load the ephemeris and the almanac from XML files (receiver assistance) + read_assistance_from_XML(); + //call here the function that computes the set of visible satellites and its elevation + //for the date and time specified by the warmstart command and the assisted position + get_visible_sats(cmd_interface_.get_utc_time(), cmd_interface_.get_LLH()); + //reorder the satellite queue to acquire first those visible satellites + flowgraph_->priorize_satellites(visible_satellites); + //start again the satellite acquisitions (done in chained applyaction to flowgraph) + break; default: DLOG(INFO) << "Unrecognized action."; break; } } +std::vector> ControlThread::get_visible_sats(time_t rx_utc_time, arma::vec LLH) +{ + //1. Compute rx ECEF position from LLH WGS84 + arma::vec LLH_rad = arma::vec{degtorad(LLH(0)), degtorad(LLH(1)), LLH(2)}; + arma::mat C_tmp = arma::zeros(3, 3); + arma::vec r_eb_e = arma::zeros(3, 1); + arma::vec v_eb_e = arma::zeros(3, 1); + Geo_to_ECEF(LLH_rad, arma::vec{0, 0, 0}, C_tmp, r_eb_e, v_eb_e, C_tmp); + + //2. Compute rx GPS time from UTC time + gtime_t utc_gtime; + utc_gtime.time = rx_utc_time; + utc_gtime.sec = 0; + gtime_t gps_gtime = utc2gpst(utc_gtime); + + //2. loop throught all the available ephemeris or almanac and compute satellite positions and elevations + // store visible satellites in a vector of pairs to associate an elevation to the each satellite + std::vector> available_satellites; + + std::shared_ptr pvt_ptr = flowgraph_->get_pvt(); + + std::map gps_eph_map = pvt_ptr->get_gps_ephemeris(); + for (std::map::iterator it = gps_eph_map.begin(); it != gps_eph_map.end(); ++it) + { + eph_t rtklib_eph = eph_to_rtklib(it->second); + double r_sat[3]; + double clock_bias_s; + double sat_pos_variance_m2; + eph2pos(gps_gtime, &rtklib_eph, &r_sat[0], &clock_bias_s, + &sat_pos_variance_m2); + double Az, El, dist_m; + arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; + arma::vec dx = r_sat_eb_e - r_eb_e; + topocent(&Az, &El, &dist_m, r_eb_e, dx); + std::cout << "Using GPS Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + //push sat + if (El > 0) + { + available_satellites.push_back(std::pair(floor(El), + (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); + } + } + + std::map gal_eph_map = pvt_ptr->get_galileo_ephemeris(); + for (std::map::iterator it = gal_eph_map.begin(); it != gal_eph_map.end(); ++it) + { + eph_t rtklib_eph = eph_to_rtklib(it->second); + double r_sat[3]; + double clock_bias_s; + double sat_pos_variance_m2; + eph2pos(gps_gtime, &rtklib_eph, &r_sat[0], &clock_bias_s, + &sat_pos_variance_m2); + double Az, El, dist_m; + arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; + arma::vec dx = r_sat_eb_e - r_eb_e; + topocent(&Az, &El, &dist_m, r_eb_e, dx); + std::cout << "Using Galileo Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + //push sat + if (El > 0) + { + available_satellites.push_back(std::pair(floor(El), + (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); + } + } + + std::map gps_alm_map = pvt_ptr->get_gps_almanac(); + for (std::map::iterator it = gps_alm_map.begin(); it != gps_alm_map.end(); ++it) + { + alm_t rtklib_alm = alm_to_rtklib(it->second); + double r_sat[3]; + double clock_bias_s; + double sat_pos_variance_m2; + alm2pos(gps_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); + double Az, El, dist_m; + arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; + arma::vec dx = r_sat_eb_e - r_eb_e; + topocent(&Az, &El, &dist_m, r_eb_e, dx); + std::cout << "Using GPS Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + //push sat + if (El > 0) + { + available_satellites.push_back(std::pair(floor(El), + (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); + } + } + + std::map gal_alm_map = pvt_ptr->get_galileo_almanac(); + for (std::map::iterator it = gal_alm_map.begin(); it != gal_alm_map.end(); ++it) + { + alm_t rtklib_alm = alm_to_rtklib(it->second); + double r_sat[3]; + double clock_bias_s; + double sat_pos_variance_m2; + alm2pos(gps_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); + double Az, El, dist_m; + arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; + arma::vec dx = r_sat_eb_e - r_eb_e; + topocent(&Az, &El, &dist_m, r_eb_e, dx); + std::cout << "Using Galileo Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + //push sat + if (El > 0) + { + available_satellites.push_back(std::pair(floor(El), + (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); + } + } + + //sort the visible satellites in ascending order of elevation + std::sort(available_satellites.begin(), available_satellites.end(), [](const std::pair &a, const std::pair &b) { // use lambda. Cleaner and easier to read + return a.first < b.first; + }); + //std::reverse(available_satellites.begin(), available_satellites.end()); + return available_satellites; +} + void ControlThread::gps_acq_assist_data_collector() { diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index ffc2ffa39..c62006eee 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -35,16 +35,17 @@ #ifndef GNSS_SDR_CONTROL_THREAD_H_ #define GNSS_SDR_CONTROL_THREAD_H_ +#include "gnss_satellite.h" #include "control_message_factory.h" #include "gnss_sdr_supl_client.h" #include "tcp_cmd_interface.h" +#include "gnss_flowgraph.h" +#include "configuration_interface.h" #include #include #include #include - -class GNSSFlowgraph; -class ConfigurationInterface; +#include /*! @@ -143,6 +144,12 @@ private: */ void gps_acq_assist_data_collector(); + /* + * Compute elevations for the specified time and position for all the available satellites in ephemeris and almanac queues + * returns a vector filled with the available satellites ordered from high elevation to low elevation angle. + */ + + std::vector> get_visible_sats(time_t rx_utc_time, arma::vec LLH); /* * Read initial GNSS assistance from SUPL server or local XML files */ diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index dbeabf004..527696d00 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -1137,10 +1137,6 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) break; case 12: //request hotstart mode LOG(INFO) << "TC request hotstart"; - //todo: call here the function that computes the set of visible satellites and its elevation - //for the date and time specified by the hotstart command and the last available PVT - //todo: reorder the satellite queue to acquire first those visible satellites - //start again the satellite acquisitions for (unsigned int i = 0; i < channels_count_; i++) { unsigned int ch_index = (who + i + 1) % channels_count_; @@ -1169,12 +1165,6 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) break; case 13: //request warmstart mode LOG(INFO) << "TC request warmstart"; - //todo: delete all ephemeris and almanac information from maps (also the PVT map queue) - //todo: load the ephemeris and the almanac from XML files (receiver assistance) - //todo: call here the function that computes the set of visible satellites and its elevation - //for the date and time specified by the warmstart command and the assisted position - //todo: reorder the satellite queue to acquire first those visible satellites - //start again the satellite acquisitions for (unsigned int i = 0; i < channels_count_; i++) { @@ -1209,6 +1199,60 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) } +void GNSSFlowgraph::priorize_satellites(std::vector> visible_satellites) +{ + size_t old_size; + Gnss_Signal gs; + for (std::vector>::iterator it = visible_satellites.begin(); it != visible_satellites.end(); ++it) + { + if (it->second.get_system() == "GPS") + { + gs = Gnss_Signal(it->second, "1C"); + old_size = available_GPS_1C_signals_.size(); + available_GPS_1C_signals_.remove(gs); + if (old_size > available_GPS_1C_signals_.size()) + { + available_GPS_1C_signals_.push_front(gs); + } + + gs = Gnss_Signal(it->second, "2S"); + old_size = available_GPS_2S_signals_.size(); + available_GPS_2S_signals_.remove(gs); + if (old_size > available_GPS_2S_signals_.size()) + { + available_GPS_2S_signals_.push_front(gs); + } + + gs = Gnss_Signal(it->second, "L5"); + old_size = available_GPS_L5_signals_.size(); + available_GPS_L5_signals_.remove(gs); + if (old_size > available_GPS_L5_signals_.size()) + { + available_GPS_L5_signals_.push_front(gs); + } + } + else if (it->second.get_system() == "Galileo") + { + gs = Gnss_Signal(it->second, "1B"); + old_size = available_GAL_1B_signals_.size(); + available_GAL_1B_signals_.remove(gs); + if (old_size > available_GAL_1B_signals_.size()) + { + available_GAL_1B_signals_.push_front(gs); + } + + gs = Gnss_Signal(it->second, "5X"); + old_size = available_GAL_5X_signals_.size(); + available_GAL_5X_signals_.remove(gs); + if (old_size > available_GAL_5X_signals_.size()) + { + available_GAL_5X_signals_.push_front(gs); + } + } + } +} + + void GNSSFlowgraph::set_configuration(std::shared_ptr configuration) { if (running_) diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 1f1d07ada..d5e25543a 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -41,6 +41,11 @@ #include "gnss_signal.h" #include "gnss_sdr_sample_counter.h" #include "gnss_synchro_monitor.h" +#include "gnss_block_interface.h" +#include "pvt_interface.h" +#include "channel_interface.h" +#include "configuration_interface.h" +#include "gnss_block_factory.h" #include #include #include @@ -55,10 +60,6 @@ #include "gnss_sdr_fpga_sample_counter.h" #endif -class GNSSBlockInterface; -class ChannelInterface; -class ConfigurationInterface; -class GNSSBlockFactory; /*! \brief This class represents a GNSS flow graph. * @@ -129,6 +130,19 @@ public: */ bool send_telemetry_msg(pmt::pmt_t msg); + /*! + * \brief Returns a smart pointer to the PVT object + */ + std::shared_ptr get_pvt() + { + return std::dynamic_pointer_cast(pvt_); + } + + /*! + * \brief Priorize visible satellites in the specified vector + */ + void priorize_satellites(std::vector> visible_satellites); + private: void init(); // Populates the SV PRN list available for acquisition and tracking void set_signals_list(); diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 175d96859..b857ee204 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -34,6 +34,15 @@ #include +time_t TcpCmdInterface::get_utc_time() +{ + return receiver_utc_time_; +} + +arma::vec TcpCmdInterface::get_LLH() +{ + return arma::vec{rx_latitude_, rx_longitude_, rx_altitude_}; +} std::string TcpCmdInterface::reset(const std::vector &commandLine) { std::string response; @@ -78,17 +87,40 @@ std::string TcpCmdInterface::status(const std::vector &commandLine) std::string TcpCmdInterface::hotstart(const std::vector &commandLine) { std::string response; - //todo: read and parse the command line parameter: dd/mm/yyyy HH:MM:SS - //todo: store it in a member variable - std::unique_ptr cmf(new ControlMessageFactory()); - if (control_queue_ != nullptr) + if (commandLine.size() > 5) { - control_queue_->handle(cmf->GetQueueMessage(300, 12)); //send the standby message (who=300,what=12) - response = "OK\n"; + //read commandline time parameter + struct tm tm; + strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm); + receiver_utc_time_ = timegm(&tm); + + + //read latitude, longitude, and height + rx_latitude_ = std::stod(commandLine.at(3).c_str()); + rx_longitude_ = std::stod(commandLine.at(4).c_str()); + rx_altitude_ = std::stod(commandLine.at(5).c_str()); + + if (std::isnan(rx_latitude_) || std::isnan(rx_longitude_) || std::isnan(rx_altitude_)) + { + response = "ERROR: position malformed\n"; + } + else + { + std::unique_ptr cmf(new ControlMessageFactory()); + if (control_queue_ != nullptr) + { + control_queue_->handle(cmf->GetQueueMessage(300, 12)); //send the standby message (who=300,what=12) + response = "OK\n"; + } + else + { + response = "ERROR\n"; + } + } } else { - response = "ERROR\n"; + response = "ERROR: time parameter not found, please use hotstart %d/%m/%Y %H:%M:%S\n"; } return response; } @@ -96,17 +128,40 @@ std::string TcpCmdInterface::hotstart(const std::vector &commandLin std::string TcpCmdInterface::warmstart(const std::vector &commandLine) { std::string response; - //todo: read and parse the command line parameter: dd/mm/yyyy HH:MM:SS - //todo: store it in a member variable - std::unique_ptr cmf(new ControlMessageFactory()); - if (control_queue_ != nullptr) + if (commandLine.size() > 5) { - control_queue_->handle(cmf->GetQueueMessage(300, 13)); //send the standby message (who=300,what=13) - response = "OK\n"; + std::string tmp_str; + //read commandline time parameter + struct tm tm; + tmp_str = commandLine.at(1) + commandLine.at(2); + strptime(tmp_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm); + receiver_utc_time_ = timegm(&tm); + + //read latitude, longitude, and height + rx_latitude_ = std::stod(commandLine.at(3).c_str()); + rx_longitude_ = std::stod(commandLine.at(4).c_str()); + rx_altitude_ = std::stod(commandLine.at(5).c_str()); + if (std::isnan(rx_latitude_) || std::isnan(rx_longitude_) || std::isnan(rx_altitude_)) + { + response = "ERROR: position malformed\n"; + } + else + { + std::unique_ptr cmf(new ControlMessageFactory()); + if (control_queue_ != nullptr) + { + control_queue_->handle(cmf->GetQueueMessage(300, 13)); //send the standby message (who=300,what=13) + response = "OK\n"; + } + else + { + response = "ERROR\n"; + } + } } else { - response = "ERROR\n"; + response = "ERROR: time parameter not found, please use warmstart %d/%m/%Y %H:%M:%S Lat Long H\n"; } return response; } @@ -154,6 +209,10 @@ TcpCmdInterface::TcpCmdInterface() register_functions(); keep_running_ = true; control_queue_ = nullptr; + rx_latitude_ = 0; + rx_longitude_ = 0; + rx_altitude_ = 0; + receiver_utc_time_ = 0; } diff --git a/src/core/receiver/tcp_cmd_interface.h b/src/core/receiver/tcp_cmd_interface.h index 6071e32bd..7da156fe0 100644 --- a/src/core/receiver/tcp_cmd_interface.h +++ b/src/core/receiver/tcp_cmd_interface.h @@ -42,7 +42,8 @@ #include #include #include - +#include +#include "time.h" class TcpCmdInterface { @@ -51,6 +52,14 @@ public: virtual ~TcpCmdInterface(); void run_cmd_server(int tcp_port); void set_msg_queue(gr::msg_queue::sptr control_queue); + /*! + * \brief gets the UTC time parsed from the last TC command issued + */ + time_t get_utc_time(); + /*! + * \brief gets the Latitude, Longitude and Altitude vector from the last TC command issued + */ + arma::vec get_LLH(); private: @@ -68,6 +77,12 @@ private: gr::msg_queue::sptr control_queue_; bool keep_running_; + + time_t receiver_utc_time_; + + double rx_latitude_; + double rx_longitude_; + double rx_altitude_; }; #endif /* GNSS_SDR_TCPCMDINTERFACE_H_ */ diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 7b41ccfbd..701f8ca95 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -50,6 +50,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/core/system_parameters ${CMAKE_SOURCE_DIR}/src/core/interfaces ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/core/monitor ${CMAKE_SOURCE_DIR}/src/core/libs ${CMAKE_SOURCE_DIR}/src/core/libs/supl ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp diff --git a/src/tests/system-tests/libs/CMakeLists.txt b/src/tests/system-tests/libs/CMakeLists.txt index 4742e80fc..89b6970c3 100644 --- a/src/tests/system-tests/libs/CMakeLists.txt +++ b/src/tests/system-tests/libs/CMakeLists.txt @@ -18,7 +18,6 @@ set(SYSTEM_TESTING_LIB_SOURCES - geofunctions.cc spirent_motion_csv_dump_reader.cc rtklib_solver_dump_reader.cc ) From 18db62dfd391991423af074ccbd2c311e8a5bfa4 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 5 Nov 2018 19:18:05 +0100 Subject: [PATCH 054/143] Fix building if Armadillo was not installed --- src/algorithms/libs/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index ce4560e6f..8ee0be55c 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -102,6 +102,7 @@ include_directories( ${Boost_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS} + ${ARMADILLO_INCLUDE_DIRS} ${GNURADIO_RUNTIME_INCLUDE_DIRS} ${GNURADIO_BLOCKS_INCLUDE_DIRS} ${VOLK_INCLUDE_DIRS} @@ -129,6 +130,7 @@ target_link_libraries(gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES} ${VOLK_LIBRARIES} ${ORC_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} ${GFlags_LIBS} + ${ARMADILLO_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} @@ -137,7 +139,9 @@ target_link_libraries(gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES} ) if(NOT VOLK_GNSSSDR_FOUND) - add_dependencies(gnss_sp_libs volk_gnsssdr_module) + add_dependencies(gnss_sp_libs volk_gnsssdr_module armadillo-${armadillo_RELEASE}) +else(NOT VOLK_GNSSSDR_FOUND) + add_dependencies(gnss_sp_libs armadillo-${armadillo_RELEASE}) endif(NOT VOLK_GNSSSDR_FOUND) if(${GFLAGS_GREATER_20}) From e3446e47caa84723b91eaf30560a4d305098d4fa Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 5 Nov 2018 19:42:59 +0100 Subject: [PATCH 055/143] Add missing header to the list --- src/algorithms/libs/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 8ee0be55c..de4efc084 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -64,6 +64,7 @@ set(GNSS_SPLIBS_HEADERS conjugate_ic.h gnss_sdr_create_directory.h gnss_circular_deque.h + geofunctions.h ) From ea3db59fd720b4493902538580e63f9e95131b15 Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 6 Nov 2018 14:39:57 +0100 Subject: [PATCH 056/143] Adding Tele Command status for reporting the Position, Speed and Course over ground and Time --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 15 +++++ src/algorithms/PVT/adapters/rtklib_pvt.h | 7 +++ .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 28 ++++++++++ .../PVT/gnuradio_blocks/rtklib_pvt_cc.h | 13 ++++- src/algorithms/PVT/libs/pvt_solution.cc | 22 ++++++++ src/algorithms/PVT/libs/pvt_solution.h | 14 ++++- src/algorithms/PVT/libs/rtklib_solver.cc | 16 ++++++ src/core/interfaces/pvt_interface.h | 7 +++ src/core/receiver/control_thread.cc | 33 ++++++++--- src/core/receiver/gnss_flowgraph.cc | 10 +--- src/core/receiver/tcp_cmd_interface.cc | 56 ++++++++++++++++++- src/core/receiver/tcp_cmd_interface.h | 6 +- 12 files changed, 204 insertions(+), 23 deletions(-) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index c5532dea2..126813e26 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -49,6 +49,21 @@ namespace bc = boost::integer; using google::LogMessage; +bool RtklibPvt::get_latest_PVT(double* longitude_deg, + double* latitude_deg, + double* height_m, + double* ground_speed_kmh, + double* course_over_ground_deg, + time_t* UTC_time) +{ + return pvt_->get_latest_PVT(longitude_deg, + latitude_deg, + height_m, + ground_speed_kmh, + course_over_ground_deg, + UTC_time); +} + void RtklibPvt::clear_ephemeris() { pvt_->clear_ephemeris(); diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.h b/src/algorithms/PVT/adapters/rtklib_pvt.h index 75e9c6c6d..93f238733 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.h +++ b/src/algorithms/PVT/adapters/rtklib_pvt.h @@ -86,6 +86,13 @@ public: return sizeof(gr_complex); } + bool get_latest_PVT(double* longitude_deg, + double* latitude_deg, + double* height_m, + double* ground_speed_kmh, + double* course_over_ground_deg, + time_t* UTC_time); + private: rtklib_pvt_cc_sptr pvt_; rtk_t rtk; diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 69cc62264..98202bb68 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -47,6 +47,7 @@ #include #include #include +#include #if OLD_BOOST #include namespace bc = boost::math; @@ -893,9 +894,36 @@ bool rtklib_pvt_cc::load_gnss_synchro_map_xml(const std::string file_name) } +bool rtklib_pvt_cc::get_latest_PVT(double* longitude_deg, + double* latitude_deg, + double* height_m, + double* ground_speed_kmh, + double* course_over_ground_deg, + time_t* UTC_time) +{ + gr::thread::scoped_lock lock(d_setlock); + if (d_ls_pvt->is_valid_position()) + { + *latitude_deg = d_ls_pvt->get_latitude(); + *longitude_deg = d_ls_pvt->get_longitude(); + *height_m = d_ls_pvt->get_height(); + *ground_speed_kmh = d_ls_pvt->get_speed_over_ground() * 3600.0 / 1000.0; + *course_over_ground_deg = d_ls_pvt->get_course_over_ground(); + *UTC_time = boost::posix_time::to_time_t(d_ls_pvt->get_position_UTC_time()); + + return true; + } + else + { + return false; + } +} + int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items __attribute__((unused))) { + gr::thread::scoped_lock l(d_setlock); + for (int32_t epoch = 0; epoch < noutput_items; epoch++) { bool flag_display_pvt = false; diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index f063431d1..bf53bfd3d 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -60,7 +60,7 @@ rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t n_channels, rtk_t& rtk); /*! - * \brief This class implements a block that computes the PVT solution with Galileo E1 signals + * \brief This class implements a block that computes the PVT solution using the RTKLIB integrated library */ class rtklib_pvt_cc : public gr::sync_block { @@ -159,6 +159,17 @@ public: */ void clear_ephemeris(); + + /*! + * \brief Get the latest Position WGS84 [deg], Ground Velocity, Course over Ground, and UTC Time, if available + */ + bool get_latest_PVT(double* longitude_deg, + double* latitude_deg, + double* height_m, + double* ground_speed_kmh, + double* course_over_ground_deg, + time_t* UTC_time); + ~rtklib_pvt_cc(); //!< Default destructor int work(int noutput_items, gr_vector_const_void_star& input_items, diff --git a/src/algorithms/PVT/libs/pvt_solution.cc b/src/algorithms/PVT/libs/pvt_solution.cc index e71030085..0ecbd15eb 100644 --- a/src/algorithms/PVT/libs/pvt_solution.cc +++ b/src/algorithms/PVT/libs/pvt_solution.cc @@ -43,6 +43,8 @@ Pvt_Solution::Pvt_Solution() d_latitude_d = 0.0; d_longitude_d = 0.0; d_height_m = 0.0; + d_speed_over_ground_m_s = 0.0; + d_course_over_ground_d = 0.0; d_avg_latitude_d = 0.0; d_avg_longitude_d = 0.0; d_avg_height_m = 0.0; @@ -126,6 +128,7 @@ int Pvt_Solution::cart2geo(double X, double Y, double Z, int elipsoid_selection) d_latitude_d = phi * 180.0 / GPS_PI; d_longitude_d = lambda * 180.0 / GPS_PI; d_height_m = h; + //todo: refactor this class. Mix of duplicated functions, use either RTKLIB geodetic functions or geofunctions.h return 0; } @@ -516,6 +519,25 @@ double Pvt_Solution::get_height() const return d_height_m; } +double Pvt_Solution::get_speed_over_ground() const +{ + return d_speed_over_ground_m_s; +} + +void Pvt_Solution::set_speed_over_ground(double speed_m_s) +{ + d_speed_over_ground_m_s = speed_m_s; +} + +void Pvt_Solution::set_course_over_ground(double cog_deg) +{ + d_course_over_ground_d = cog_deg; +} + +double Pvt_Solution::get_course_over_ground() const +{ + return d_course_over_ground_d; +} double Pvt_Solution::get_avg_latitude() const { diff --git a/src/algorithms/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h index 958bf4668..585703d68 100644 --- a/src/algorithms/PVT/libs/pvt_solution.h +++ b/src/algorithms/PVT/libs/pvt_solution.h @@ -49,9 +49,11 @@ class Pvt_Solution private: double d_rx_dt_s; // RX time offset [s] - double d_latitude_d; // RX position Latitude WGS84 [deg] - double d_longitude_d; // RX position Longitude WGS84 [deg] - double d_height_m; // RX position height WGS84 [m] + double d_latitude_d; // RX position Latitude WGS84 [deg] + double d_longitude_d; // RX position Longitude WGS84 [deg] + double d_height_m; // RX position height WGS84 [m] + double d_speed_over_ground_m_s; // RX speed over ground [m/s] + double d_course_over_ground_d; // RX course over ground [deg] double d_avg_latitude_d; // Averaged latitude in degrees double d_avg_longitude_d; // Averaged longitude in degrees @@ -86,6 +88,12 @@ public: double get_longitude() const; //!< Get RX position Longitude WGS84 [deg] double get_height() const; //!< Get RX position height WGS84 [m] + double get_speed_over_ground() const; //!< Get RX speed over ground [m/s] + void set_speed_over_ground(double speed_m_s); //!< Set RX speed over ground [m/s] + + double get_course_over_ground() const; //!< Get RX course over ground [deg] + void set_course_over_ground(double cog_deg); //!< Set RX course over ground [deg] + double get_avg_latitude() const; //!< Get RX position averaged Latitude WGS84 [deg] double get_avg_longitude() const; //!< Get RX position averaged Longitude WGS84 [deg] double get_avg_height() const; //!< Get RX position averaged height WGS84 [m] diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 12d316196..a4e1251e9 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -827,6 +827,22 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ rx_position_and_time(3) = pvt_sol.dtr[0] / GPS_C_m_s; // the receiver clock offset is expressed in [meters], so we convert it into [s] } this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration + + //compute Ground speed and COG + double ground_speed_ms = 0.0; + double pos[3]; + double enuv[3]; + ecef2pos(pvt_sol.rr, pos); + ecef2enu(pos, &pvt_sol.rr[3], enuv); + this->set_speed_over_ground(norm_rtk(enuv, 2)); + double new_cog; + if (ground_speed_ms >= 1.0) + { + new_cog = atan2(enuv[0], enuv[1]) * R2D; + if (new_cog < 0.0) new_cog += 360.0; + this->set_course_over_ground(new_cog); + } + //observable fix: //double offset_s = this->get_time_offset_s(); //this->set_time_offset_s(offset_s + (rx_position_and_time(3) / GPS_C_m_s)); // accumulate the rx time error for the next iteration [meters]->[seconds] diff --git a/src/core/interfaces/pvt_interface.h b/src/core/interfaces/pvt_interface.h index c9a2db162..db37d9afd 100644 --- a/src/core/interfaces/pvt_interface.h +++ b/src/core/interfaces/pvt_interface.h @@ -61,6 +61,13 @@ public: virtual std::map get_galileo_ephemeris() = 0; virtual std::map get_gps_almanac() = 0; virtual std::map get_galileo_almanac() = 0; + + virtual bool get_latest_PVT(double* longitude_deg, + double* latitude_deg, + double* height_m, + double* ground_speed_kmh, + double* course_over_ground_deg, + time_t* UTC_time) = 0; }; #endif /* GNSS_SDR_PVT_INTERFACE_H_ */ diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index c95973797..b8bf6e345 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -161,6 +161,7 @@ int ControlThread::run() sysv_queue_thread_ = boost::thread(&ControlThread::sysv_queue_listener, this); //start the telecommand listener thread + cmd_interface_.set_pvt(flowgraph_->get_pvt()); cmd_interface_thread_ = boost::thread(&ControlThread::telecommand_listener, this); @@ -718,25 +719,33 @@ void ControlThread::apply_action(unsigned int what) switch (what) { case 0: - DLOG(INFO) << "Received action STOP"; + LOG(INFO) << "Received action STOP"; stop_ = true; applied_actions_++; break; case 1: - DLOG(INFO) << "Received action RESTART"; + LOG(INFO) << "Received action RESTART"; stop_ = true; restart_ = true; applied_actions_++; break; + case 11: + LOG(INFO) << "Receiver action COLDSTART"; + //delete all ephemeris and almanac information from maps (also the PVT map queue) + pvt_ptr = flowgraph_->get_pvt(); + pvt_ptr->clear_ephemeris(); + //todo: reorder the satellite queues to the receiver default startup order. + //This is required to allow repeatability. Otherwise the satellite search order will depend on the last tracked satellites + break; case 12: - DLOG(INFO) << "Receiver action HOTSTART"; + LOG(INFO) << "Receiver action HOTSTART"; visible_satellites = get_visible_sats(cmd_interface_.get_utc_time(), cmd_interface_.get_LLH()); //reorder the satellite queue to acquire first those visible satellites flowgraph_->priorize_satellites(visible_satellites); //start again the satellite acquisitions (done in chained applyaction to flowgraph) break; case 13: - DLOG(INFO) << "Receiver action WARMSTART"; + LOG(INFO) << "Receiver action WARMSTART"; //delete all ephemeris and almanac information from maps (also the PVT map queue) pvt_ptr = flowgraph_->get_pvt(); pvt_ptr->clear_ephemeris(); @@ -750,7 +759,7 @@ void ControlThread::apply_action(unsigned int what) //start again the satellite acquisitions (done in chained applyaction to flowgraph) break; default: - DLOG(INFO) << "Unrecognized action."; + LOG(INFO) << "Unrecognized action."; break; } } @@ -775,6 +784,13 @@ std::vector> ControlThread::get_visible_sats(time std::vector> available_satellites; std::shared_ptr pvt_ptr = flowgraph_->get_pvt(); + struct tm tstruct; + char buf[80]; + tstruct = *gmtime(&rx_utc_time); + strftime(buf, sizeof(buf), "%d/%m/%Y %H:%M:%S ", &tstruct); + std::string str_time = std::string(buf); + std::cout << "Get visible satellites at " << str_time + << " UTC, assuming RX position " << LLH(0) << " [deg], " << LLH(1) << " [deg], " << LLH(2) << " [m]" << std::endl; std::map gps_eph_map = pvt_ptr->get_gps_ephemeris(); for (std::map::iterator it = gps_eph_map.begin(); it != gps_eph_map.end(); ++it) @@ -789,10 +805,10 @@ std::vector> ControlThread::get_visible_sats(time arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec dx = r_sat_eb_e - r_eb_e; topocent(&Az, &El, &dist_m, r_eb_e, dx); - std::cout << "Using GPS Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; //push sat if (El > 0) { + std::cout << "Using GPS Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); } @@ -811,10 +827,10 @@ std::vector> ControlThread::get_visible_sats(time arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec dx = r_sat_eb_e - r_eb_e; topocent(&Az, &El, &dist_m, r_eb_e, dx); - std::cout << "Using Galileo Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; //push sat if (El > 0) { + std::cout << "Using Galileo Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); } @@ -832,10 +848,10 @@ std::vector> ControlThread::get_visible_sats(time arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec dx = r_sat_eb_e - r_eb_e; topocent(&Az, &El, &dist_m, r_eb_e, dx); - std::cout << "Using GPS Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; //push sat if (El > 0) { + std::cout << "Using GPS Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); } @@ -857,6 +873,7 @@ std::vector> ControlThread::get_visible_sats(time //push sat if (El > 0) { + std::cout << "Using GPS Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); } diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 527696d00..ab15b1084 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -1103,11 +1103,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) acq_channels_count_ = 0; //all channels are in stanby now break; case 11: //request coldstart mode - LOG(INFO) << "TC request coldstart"; - //todo: delete all ephemeris and almanac information from maps (also the PVT map queue) - //todo: reorder the satellite queues to the receiver default startup order. - //This is required to allow repeatability. Otherwise the satellite search order will depend on the last tracked satellites - + LOG(INFO) << "TC request flowgraph coldstart"; //start again the satellite acquisitions for (unsigned int i = 0; i < channels_count_; i++) { @@ -1136,7 +1132,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) } break; case 12: //request hotstart mode - LOG(INFO) << "TC request hotstart"; + LOG(INFO) << "TC request flowgraph hotstart"; for (unsigned int i = 0; i < channels_count_; i++) { unsigned int ch_index = (who + i + 1) % channels_count_; @@ -1164,7 +1160,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) } break; case 13: //request warmstart mode - LOG(INFO) << "TC request warmstart"; + LOG(INFO) << "TC request flowgraph warmstart"; //start again the satellite acquisitions for (unsigned int i = 0; i < channels_count_; i++) { diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index b857ee204..5913034b5 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -32,8 +32,13 @@ #include "tcp_cmd_interface.h" #include "control_message_factory.h" #include +#include +void TcpCmdInterface::set_pvt(std::shared_ptr PVT_sptr) +{ + PVT_sptr_ = PVT_sptr; +} time_t TcpCmdInterface::get_utc_time() { return receiver_utc_time_; @@ -78,10 +83,51 @@ std::string TcpCmdInterface::standby(const std::vector &commandLine std::string TcpCmdInterface::status(const std::vector &commandLine) { - std::string response; + std::stringstream str_stream; //todo: implement the receiver status report - response = "Not implemented\n"; - return response; + + // str_stream << "-------------------------------------------------------\n"; + // str_stream << "ch | sys | sig | mode | Tlm | Eph | Doppler | CN0 |\n"; + // str_stream << " | | | | | | [Hz] | [dB - Hz] |\n"; + // str_stream << "-------------------------------------------------------\n"; + // int n_ch = 10; + // for (int n = 0; n < n_ch; n++) + // { + // str_stream << n << "GPS | L1CA | TRK | YES | YES | 23412.4 | 44.3 |\n"; + // } + // str_stream << "--------------------------------------------------------\n"; + + double longitude_deg, latitude_deg, height_m, ground_speed_kmh, course_over_ground_deg; + time_t UTC_time; + if (PVT_sptr_->get_latest_PVT(&longitude_deg, + &latitude_deg, + &height_m, + &ground_speed_kmh, + &course_over_ground_deg, + &UTC_time) == true) + { + struct tm tstruct; + char buf1[80]; + tstruct = *gmtime(&UTC_time); + strftime(buf1, sizeof(buf1), "%d/%m/%Y %H:%M:%S", &tstruct); + std::string str_time = std::string(buf1); + str_stream << "- Receiver UTC Time: " << str_time << std::endl; + str_stream << std::setprecision(9); + str_stream << "- Receiver Position WGS84 [Lat, Long, H]: " + << latitude_deg << ", " + << longitude_deg << ", "; + str_stream << std::setprecision(3); + str_stream << height_m << std::endl; + str_stream << std::setprecision(1); + str_stream << "- Receiver Speed over Ground [km/h]: " << ground_speed_kmh << std::endl; + str_stream << "- Receiver Course over ground [deg]: " << course_over_ground_deg << std::endl; + } + else + { + str_stream << "No PVT information available.\n"; + } + + return str_stream.str(); } std::string TcpCmdInterface::hotstart(const std::vector &commandLine) @@ -277,6 +323,10 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) response = functions[cmd_vector.at(0)](cmd_vector); } } + catch (const std::bad_function_call &ex) + { + response = "ERROR: command not found \n "; + } catch (const std::exception &ex) { response = "ERROR: command execution error: " + std::string(ex.what()) + "\n"; diff --git a/src/core/receiver/tcp_cmd_interface.h b/src/core/receiver/tcp_cmd_interface.h index 7da156fe0..fa039116a 100644 --- a/src/core/receiver/tcp_cmd_interface.h +++ b/src/core/receiver/tcp_cmd_interface.h @@ -31,6 +31,7 @@ #ifndef GNSS_SDR_TCPCMDINTERFACE_H_ #define GNSS_SDR_TCPCMDINTERFACE_H_ +#include "pvt_interface.h" #include #include #include @@ -43,7 +44,7 @@ #include #include #include -#include "time.h" +#include class TcpCmdInterface { @@ -61,6 +62,7 @@ public: */ arma::vec get_LLH(); + void set_pvt(std::shared_ptr PVT_sptr); private: std::unordered_map &)>> @@ -83,6 +85,8 @@ private: double rx_latitude_; double rx_longitude_; double rx_altitude_; + + std::shared_ptr PVT_sptr_; }; #endif /* GNSS_SDR_TCPCMDINTERFACE_H_ */ From 2bdbaaf9a5eedc937de139a87d8a7c4164d8e926 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 7 Nov 2018 16:03:45 +0100 Subject: [PATCH 057/143] Fix generation of GPGSV and GAGSV messages (NMEA) --- src/algorithms/PVT/libs/nmea_printer.cc | 2 +- src/algorithms/PVT/libs/rtklib_solver.cc | 67 ++++-------------------- src/algorithms/PVT/libs/rtklib_solver.h | 2 +- 3 files changed, 12 insertions(+), 59 deletions(-) diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index 26b18e3d0..c06653680 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -565,7 +565,7 @@ std::string Nmea_Printer::get_GPGSV() // Notice that NMEA 2.1 only supports 12 channels std::stringstream sentence_str; unsigned char buff[200]; - outnmea_gsv(buff, &d_PVT_data->pvt_sol, *d_PVT_data->pvt_ssat); + outnmea_gsv(buff, &d_PVT_data->pvt_sol, d_PVT_data->pvt_ssat); sentence_str << buff; return sentence_str.str(); } diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 9024cd01a..b418dbdba 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -75,7 +75,11 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag rtk_ = rtk; for (unsigned int i = 0; i < 4; i++) dop_[i] = 0.0; pvt_sol = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0}; - + ssat_t ssat0 = {0, 0, {0.0}, {0.0}, {0.0}, {'0'}, {'0'}, {'0'}, {'0'}, {'0'}, {}, {}, {}, {}, 0.0, 0.0, 0.0, 0.0, {{{0, 0}}, {{0, 0}}}, {{}, {}}}; + for (unsigned int i = 0; i < MAXSAT; i++) + { + pvt_ssat[i] = ssat0; + } // ############# ENABLE DATA FILE LOG ################# if (d_flag_dump_enabled == true) { @@ -795,7 +799,11 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ unsigned int used_sats = 0; for (unsigned int i = 0; i < MAXSAT; i++) { - if (rtk_.ssat[i].vs == 1) used_sats++; + if (rtk_.ssat[i].vs == 1) + { + pvt_ssat[i] = rtk_.ssat[i]; + used_sats++; + } } std::vector azel; @@ -811,61 +819,6 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ } } - for (gnss_observables_iter = gnss_observables_map.cbegin(); - gnss_observables_iter != gnss_observables_map.cend(); - ++gnss_observables_iter) // CHECK INCONSISTENCY when combining GLONASS + other system - { - switch (gnss_observables_iter->second.System) - { - case 'E': - { - std::string sig_(gnss_observables_iter->second.Signal); - if (sig_.compare("1B") == 0) - { - unsigned int snr = static_cast(std::round(gnss_observables_iter->second.CN0_dB_hz / 0.25)); - rtk_.ssat[gnss_observables_iter->second.PRN - 1].snr[0] = snr; - pvt_ssat[gnss_observables_iter->second.PRN - 1] = &rtk_.ssat[gnss_observables_iter->second.PRN - 1]; - } - break; - } - case 'G': - { - // GPS L1 - std::string sig_(gnss_observables_iter->second.Signal); - if (sig_.compare("1C") == 0) - { - unsigned int snr = static_cast(std::round(gnss_observables_iter->second.CN0_dB_hz / 0.25)); - rtk_.ssat[gnss_observables_iter->second.PRN - 1].snr[0] = snr; - pvt_ssat[gnss_observables_iter->second.PRN - 1] = &rtk_.ssat[gnss_observables_iter->second.PRN - 1]; - } - // GPS L2 - if (sig_.compare("2S") == 0) - { - } - // GPS L5 - if (sig_.compare("L5") == 0) - { - } - break; - } - case 'R': - { - std::string sig_(gnss_observables_iter->second.Signal); - // GLONASS GNAV L1 - if (sig_.compare("1G") == 0) - { - } - // GLONASS GNAV L2 - if (sig_.compare("2G") == 0) - { - } - break; - } - default: - break; - } - } - if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_); this->set_valid_position(true); arma::vec rx_position_and_time(4); diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 1e9684685..293c0e06d 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -86,7 +86,7 @@ private: public: sol_t pvt_sol; - ssat_t* pvt_ssat[MAXSAT]; + ssat_t pvt_ssat[MAXSAT]; rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, rtk_t& rtk); ~rtklib_solver(); From e9ec521f241f79a2cddec29c44c379e6bc9d2f8b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 7 Nov 2018 16:53:40 +0100 Subject: [PATCH 058/143] Fix GPGGA, GPGSA, GAGSA and GPRMC messages (NMEA) --- src/algorithms/PVT/libs/nmea_printer.cc | 283 +----------------------- 1 file changed, 10 insertions(+), 273 deletions(-) diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index c06653680..7253b9f79 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -377,99 +377,10 @@ std::string Nmea_Printer::get_UTC_NMEA_time(boost::posix_time::ptime d_position_ std::string Nmea_Printer::get_GPRMC() { // Sample -> $GPRMC,161229.487,A,3723.2475,N,12158.3416,W,0.13,309.62,120598,*10 - bool valid_fix = d_PVT_data->is_valid_position(); - - // ToDo: Compute speed and course over ground - double speed_over_ground_knots = 0; - double course_over_ground_deg = 0; - - // boost::posix_time::ptime d_position_UTC_time=boost::posix_time::microsec_clock::universal_time(); - std::stringstream sentence_str; - - // GPRMC (RMC-Recommended,Minimum Specific GNSS Data) - std::string sentence_header; - sentence_header = "$GPRMC,"; - sentence_str << sentence_header; - - // UTC Time: hhmmss.sss - sentence_str << get_UTC_NMEA_time(d_PVT_data->get_position_UTC_time()); - - // Status: A: data valid, V: data NOT valid - if (valid_fix == true) - { - sentence_str << ",A"; - } - else - { - sentence_str << ",V"; - }; - - if (print_avg_pos == true) - { - // Latitude ddmm.mmmm,(N or S) - sentence_str << "," << latitude_to_hm(d_PVT_data->get_avg_latitude()); - // longitude dddmm.mmmm,(E or W) - sentence_str << "," << longitude_to_hm(d_PVT_data->get_avg_longitude()); - } - else - { - // Latitude ddmm.mmmm,(N or S) - sentence_str << "," << latitude_to_hm(d_PVT_data->get_latitude()); - // longitude dddmm.mmmm,(E or W) - sentence_str << "," << longitude_to_hm(d_PVT_data->get_longitude()); - } - - // Speed over ground (knots) - sentence_str << ","; - sentence_str.setf(std::ios::fixed, std::ios::floatfield); - sentence_str.precision(2); - sentence_str << speed_over_ground_knots; - - // course over ground (degrees) - sentence_str << ","; - sentence_str.setf(std::ios::fixed, std::ios::floatfield); - sentence_str.precision(2); - sentence_str << course_over_ground_deg; - - // Date ddmmyy - boost::gregorian::date sentence_date = d_PVT_data->get_position_UTC_time().date(); - unsigned int year = sentence_date.year(); - unsigned int day = sentence_date.day(); - unsigned int month = sentence_date.month(); - - sentence_str << ","; - sentence_str.width(2); - sentence_str.fill('0'); - sentence_str << day; - sentence_str.width(2); - sentence_str.fill('0'); - sentence_str << month; - - std::stringstream year_strs; - year_strs << std::dec << year; - sentence_str << std::dec << year_strs.str().substr(2); - - // Magnetic Variation (degrees) - // ToDo: Implement magnetic compass - sentence_str << ","; - - // Magnetic Variation (E or W) - // ToDo: Implement magnetic compass - sentence_str << ","; - - // Checksum - char checksum; - std::string tmpstr; - tmpstr = sentence_str.str(); - checksum = checkSum(tmpstr.substr(1)); - sentence_str << "*"; - sentence_str.width(2); - sentence_str.fill('0'); - sentence_str << std::hex << static_cast(checksum); - - // end NMEA sentence - sentence_str << "\r\n"; + unsigned char buff[1024] = {0}; + outnmea_rmc(buff, &d_PVT_data->pvt_sol); + sentence_str << buff; return sentence_str.str(); } @@ -478,82 +389,10 @@ std::string Nmea_Printer::get_GPGSA() { // $GPGSA,A,3,07,02,26,27,09,04,15, , , , , ,1.8,1.0,1.5*33 // GSA-GNSS DOP and Active Satellites - bool valid_fix = d_PVT_data->is_valid_position(); - int n_sats_used = d_PVT_data->get_num_valid_observations(); - double pdop = d_PVT_data->get_pdop(); - double hdop = d_PVT_data->get_hdop(); - double vdop = d_PVT_data->get_vdop(); - std::stringstream sentence_str; - std::string sentence_header; - sentence_header = "$GPGSA,"; - sentence_str << sentence_header; - - // mode1: - // (M) Manual-forced to operate in 2D or 3D mode - // (A) Automatic-allowed to automatically switch 2D/3D - std::string mode1 = "M"; - sentence_str << mode1; - - // mode2: - // 1 fix not available - // 2 fix 2D - // 3 fix 3D - if (valid_fix == true) - { - sentence_str << ",3"; - } - else - { - sentence_str << ",1"; - }; - - // Used satellites - for (int i = 0; i < 12; i++) - { - sentence_str << ","; - if (i < n_sats_used) - { - sentence_str.width(2); - sentence_str.fill('0'); - sentence_str << d_PVT_data->get_visible_satellites_ID(i); - } - } - - // PDOP - sentence_str << ","; - sentence_str.setf(std::ios::fixed, std::ios::floatfield); - sentence_str.width(2); - sentence_str.precision(1); - sentence_str.fill('0'); - sentence_str << pdop; - // HDOP - sentence_str << ","; - sentence_str.setf(std::ios::fixed, std::ios::floatfield); - sentence_str.width(2); - sentence_str.precision(1); - sentence_str.fill('0'); - sentence_str << hdop; - // VDOP - sentence_str << ","; - sentence_str.setf(std::ios::fixed, std::ios::floatfield); - sentence_str.width(2); - sentence_str.precision(1); - sentence_str.fill('0'); - sentence_str << vdop; - - // Checksum - char checksum; - std::string tmpstr; - tmpstr = sentence_str.str(); - checksum = checkSum(tmpstr.substr(1)); - sentence_str << "*"; - sentence_str.width(2); - sentence_str.fill('0'); - sentence_str << std::hex << static_cast(checksum); - - // end NMEA sentence - sentence_str << "\r\n"; + unsigned char buff[1024] = {0}; + outnmea_gsa(buff, &d_PVT_data->pvt_sol, d_PVT_data->pvt_ssat); + sentence_str << buff; return sentence_str.str(); } @@ -564,7 +403,7 @@ std::string Nmea_Printer::get_GPGSV() // $GPGSV,2,1,07,07,79,048,42,02,51,062,43,26,36,256,42,27,27,138,42*71 // Notice that NMEA 2.1 only supports 12 channels std::stringstream sentence_str; - unsigned char buff[200]; + unsigned char buff[1024] = {0}; outnmea_gsv(buff, &d_PVT_data->pvt_sol, d_PVT_data->pvt_ssat); sentence_str << buff; return sentence_str.str(); @@ -573,112 +412,10 @@ std::string Nmea_Printer::get_GPGSV() std::string Nmea_Printer::get_GPGGA() { - // boost::posix_time::ptime d_position_UTC_time=boost::posix_time::microsec_clock::universal_time(); - bool valid_fix = d_PVT_data->is_valid_position(); - int n_channels = d_PVT_data->get_num_valid_observations(); //d_nchannels - double hdop = d_PVT_data->get_hdop(); - double MSL_altitude; - - if (d_PVT_data->is_averaging() == true) - { - MSL_altitude = d_PVT_data->get_avg_height(); - } - else - { - MSL_altitude = d_PVT_data->get_height(); - } - std::stringstream sentence_str; - - // GPGGA (Global Positioning System Fixed Data) - std::string sentence_header; - sentence_header = "$GPGGA,"; - sentence_str << sentence_header; - - // UTC Time: hhmmss.sss - sentence_str << get_UTC_NMEA_time(d_PVT_data->get_position_UTC_time()); - - if (d_PVT_data->is_averaging() == true) - { - // Latitude ddmm.mmmm,(N or S) - sentence_str << "," << latitude_to_hm(d_PVT_data->get_avg_latitude()); - // longitude dddmm.mmmm,(E or W) - sentence_str << "," << longitude_to_hm(d_PVT_data->get_avg_longitude()); - } - else - { - // Latitude ddmm.mmmm,(N or S) - sentence_str << "," << latitude_to_hm(d_PVT_data->get_latitude()); - // longitude dddmm.mmmm,(E or W) - sentence_str << "," << longitude_to_hm(d_PVT_data->get_longitude()); - } - - // Position fix indicator - // 0 - Fix not available or invalid - // 1 - GPS SPS Mode, fix valid - // 2 - Differential GPS, SPS Mode, fix valid - // 3-5 - Not supported - // 6 - Dead Reckoning Mode, fix valid - // ToDo: Update PVT module to identify the fix mode - - if (valid_fix == true) - { - sentence_str << ",1"; - } - else - { - sentence_str << ",0"; - } - - // Number of satellites used in PVT - sentence_str << ","; - if (n_channels < 10) - { - sentence_str << '0' << n_channels; - } - else - { - sentence_str << n_channels; - } - - // HDOP - sentence_str << ","; - sentence_str.setf(std::ios::fixed, std::ios::floatfield); - sentence_str.width(2); - sentence_str.precision(1); - sentence_str.fill('0'); - sentence_str << hdop; - - // MSL Altitude - sentence_str << ","; - sentence_str.precision(1); - sentence_str << MSL_altitude; - sentence_str << ",M"; - - // Geoid-to-ellipsoid separation. Ellipsoid altitude = MSL Altitude + Geoid Separation. - // ToDo: Compute this value - sentence_str << ","; - sentence_str << "0.0"; - sentence_str << ",M"; - - // Age of Diff. Corr. (Seconds) Null fields when DGPS is not used - // Diff. Ref. Station ID (0000) - // ToDo: Implement this fields for Differential GPS - sentence_str << ","; - sentence_str << "0.0,0000"; - - // Checksum - char checksum; - std::string tmpstr; - tmpstr = sentence_str.str(); - checksum = checkSum(tmpstr.substr(1)); - sentence_str << "*"; - sentence_str.width(2); - sentence_str.fill('0'); - sentence_str << std::hex << static_cast(checksum); - - // end NMEA sentence - sentence_str << "\r\n"; + unsigned char buff[1024] = {0}; + outnmea_gga(buff, &d_PVT_data->pvt_sol); + sentence_str << buff; return sentence_str.str(); // $GPGGA,104427.591,5920.7009,N,01803.2938,E,1,05,3.3,78.2,M,23.2,M,0.0,0000*4A } From 234c770f6652b796acdb74ee8d2658cbd9611637 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 7 Nov 2018 19:23:40 +0100 Subject: [PATCH 059/143] Use the override keyword (fix warnings) --- src/algorithms/PVT/adapters/rtklib_pvt.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.h b/src/algorithms/PVT/adapters/rtklib_pvt.h index 93f238733..78d22f2b3 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.h +++ b/src/algorithms/PVT/adapters/rtklib_pvt.h @@ -57,18 +57,17 @@ public: return role_; } - //! Returns "RTKLIB_Pvt" + //! Returns "RTKLIB_PVT" inline std::string implementation() override { return "RTKLIB_PVT"; } - void clear_ephemeris(); - std::map get_gps_ephemeris(); - std::map get_galileo_ephemeris(); - std::map get_gps_almanac(); - std::map get_galileo_almanac(); - + void clear_ephemeris() override; + std::map get_gps_ephemeris() override; + std::map get_galileo_ephemeris() override; + std::map get_gps_almanac() override; + std::map get_galileo_almanac() override; void connect(gr::top_block_sptr top_block) override; void disconnect(gr::top_block_sptr top_block) override; @@ -91,7 +90,7 @@ public: double* height_m, double* ground_speed_kmh, double* course_over_ground_deg, - time_t* UTC_time); + time_t* UTC_time) override; private: rtklib_pvt_cc_sptr pvt_; From 3477f41198ec5c079c8fcc2138630a9497b6b3de Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 7 Nov 2018 19:27:26 +0100 Subject: [PATCH 060/143] Add local definition of to_time_t to be compatible with Boost < 1.58 --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 5 ++--- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 98202bb68..762a36f1c 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -36,7 +36,6 @@ #include "gnss_sdr_create_directory.h" #include #include -#include #include #include #include @@ -47,7 +46,6 @@ #include #include #include -#include #if OLD_BOOST #include namespace bc = boost::math; @@ -909,7 +907,7 @@ bool rtklib_pvt_cc::get_latest_PVT(double* longitude_deg, *height_m = d_ls_pvt->get_height(); *ground_speed_kmh = d_ls_pvt->get_speed_over_ground() * 3600.0 / 1000.0; *course_over_ground_deg = d_ls_pvt->get_course_over_ground(); - *UTC_time = boost::posix_time::to_time_t(d_ls_pvt->get_position_UTC_time()); + *UTC_time = to_time_t(d_ls_pvt->get_position_UTC_time()); return true; } @@ -919,6 +917,7 @@ bool rtklib_pvt_cc::get_latest_PVT(double* longitude_deg, } } + int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items __attribute__((unused))) { diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index bf53bfd3d..c26f923d4 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -40,6 +40,8 @@ #include "rtcm_printer.h" #include "pvt_conf.h" #include "rtklib_solver.h" +#include +#include #include #include #include @@ -135,6 +137,11 @@ private: bool d_xml_storage; std::string xml_base_path; + inline std::time_t to_time_t(boost::posix_time::ptime pt) + { + return (pt - boost::posix_time::ptime(boost::gregorian::date(1970, 1, 1))).total_seconds(); + } + public: rtklib_pvt_cc(uint32_t nchannels, From 11dc35084c1ee157f7d27983924d3c832f416b21 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 7 Nov 2018 19:33:54 +0100 Subject: [PATCH 061/143] Do not keep data of disappeared satellites in NMEA sentences --- src/algorithms/PVT/libs/rtklib_solver.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index b418dbdba..1481dea0e 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -777,9 +777,9 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ for (int i = 0; i < MAXSAT; i++) { - nav_data.lam[i][0] = SPEED_OF_LIGHT / FREQ1; /* L1/E1 */ - nav_data.lam[i][1] = SPEED_OF_LIGHT / FREQ2; /* L2 */ - nav_data.lam[i][2] = SPEED_OF_LIGHT / FREQ5; /* L5/E5 */ + nav_data.lam[i][0] = SPEED_OF_LIGHT / FREQ1; // L1/E1 + nav_data.lam[i][1] = SPEED_OF_LIGHT / FREQ2; // L2 + nav_data.lam[i][2] = SPEED_OF_LIGHT / FREQ5; // L5/E5 } result = rtkpos(&rtk_, obs_data, valid_obs + glo_valid_obs, &nav_data); @@ -788,20 +788,20 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ { LOG(INFO) << "RTKLIB rtkpos error"; DLOG(INFO) << "RTKLIB rtkpos error message: " << rtk_.errbuf; - this->set_time_offset_s(0.0); //reset rx time estimation + this->set_time_offset_s(0.0); // reset rx time estimation this->set_num_valid_observations(0); } else { - this->set_num_valid_observations(rtk_.sol.ns); //record the number of valid satellites used by the PVT solver + this->set_num_valid_observations(rtk_.sol.ns); // record the number of valid satellites used by the PVT solver pvt_sol = rtk_.sol; // DOP computation unsigned int used_sats = 0; for (unsigned int i = 0; i < MAXSAT; i++) { + pvt_ssat[i] = rtk_.ssat[i]; if (rtk_.ssat[i].vs == 1) { - pvt_ssat[i] = rtk_.ssat[i]; used_sats++; } } From de84a161fb21573211468927784c47300941a606 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 7 Nov 2018 20:33:34 +0100 Subject: [PATCH 062/143] Update NMEA printer test --- .../pvt/nmea_printer_test.cc | 60 +++++-------------- 1 file changed, 14 insertions(+), 46 deletions(-) diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc index 535cca464..ccf97ecaa 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc @@ -160,13 +160,20 @@ TEST_F(NmeaPrinterTest, PrintLine) std::shared_ptr pvt_solution = std::make_shared(12, "filename", false, false, rtk); boost::posix_time::ptime pt(boost::gregorian::date(1994, boost::date_time::Nov, 19), - boost::posix_time::hours(22) + boost::posix_time::minutes(54) + boost::posix_time::seconds(46)); // example from http://aprs.gids.nl/nmea/#rmc - pvt_solution->set_position_UTC_time(pt); + boost::posix_time::hours(22) + boost::posix_time::minutes(54) + boost::posix_time::seconds(46)); + std::time_t tim = (pt - boost::posix_time::ptime(boost::gregorian::date(1970, 1, 1))).total_seconds(); + gtime_t gtime; + gtime.time = tim; + gtime.sec = 0.0; - arma::vec pos = {49.27416667, -123.18533333, 0}; - pvt_solution->set_rx_pos(pos); - - pvt_solution->set_valid_position(true); + pvt_solution->pvt_sol.rr[0] = -2282104.0; //49.27416667; + pvt_solution->pvt_sol.rr[1] = -3489369.0; //-123.18533333; + pvt_solution->pvt_sol.rr[2] = 4810507.0; // 0 + pvt_solution->pvt_sol.rr[3] = 0.0; + pvt_solution->pvt_sol.rr[4] = 0.0; + pvt_solution->pvt_sol.rr[5] = 0.0; + pvt_solution->pvt_sol.stat = 1; // SOLQ_FIX + pvt_solution->pvt_sol.time = gtime; bool flag_nmea_output_file = true; ASSERT_NO_THROW({ @@ -184,46 +191,7 @@ TEST_F(NmeaPrinterTest, PrintLine) std::size_t found = line.find(GPRMC); if (found != std::string::npos) { - EXPECT_EQ(line, "$GPRMC,225446.000,A,4916.4500,N,12311.1199,W,0.00,0.00,191194,,*1c\r"); - } - } - test_file.close(); - } - EXPECT_EQ(0, remove(filename.c_str())) << "Failure deleting a temporary file."; -} - - -TEST_F(NmeaPrinterTest, PrintLineLessthan10min) -{ - std::string filename("nmea_test.nmea"); - std::shared_ptr pvt_solution = std::make_shared(12, "filename", false, false, rtk); - - boost::posix_time::ptime pt(boost::gregorian::date(1994, boost::date_time::Nov, 19), - boost::posix_time::hours(22) + boost::posix_time::minutes(54) + boost::posix_time::seconds(46)); // example from http://aprs.gids.nl/nmea/#rmc - pvt_solution->set_position_UTC_time(pt); - - arma::vec pos = {49.07416667, -123.02527778, 0}; - pvt_solution->set_rx_pos(pos); - - pvt_solution->set_valid_position(true); - - bool flag_nmea_output_file = true; - ASSERT_NO_THROW({ - std::shared_ptr nmea_printer = std::make_shared(filename, flag_nmea_output_file, false, ""); - nmea_printer->Print_Nmea_Line(pvt_solution, false); - }) << "Failure printing NMEA messages."; - - std::ifstream test_file(filename); - std::string line; - std::string GPRMC("$GPRMC"); - if (test_file.is_open()) - { - while (getline(test_file, line)) - { - std::size_t found = line.find(GPRMC); - if (found != std::string::npos) - { - EXPECT_EQ(line, "$GPRMC,225446.000,A,4904.4500,N,12301.5166,W,0.00,0.00,191194,,*1a\r"); + EXPECT_EQ(line, "$GPRMC,225436.00,A,4916.4497617,N,12311.1202744,W,0.00,0.00,191194,0.0,E,D*21\r"); } } test_file.close(); From ae722fd354202b954572c718d91b7929c8f0ff81 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 7 Nov 2018 21:12:00 +0100 Subject: [PATCH 063/143] Clean Pvt_Solution class --- src/algorithms/PVT/libs/hybrid_ls_pvt.cc | 6 - src/algorithms/PVT/libs/ls_pvt.cc | 8 +- src/algorithms/PVT/libs/pvt_solution.cc | 170 +---------------------- src/algorithms/PVT/libs/pvt_solution.h | 21 --- 4 files changed, 2 insertions(+), 203 deletions(-) diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc index 6f269b7c7..2bded706f 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc @@ -150,8 +150,6 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do // 4- fill the observations vector with the corrected observables obs.resize(valid_obs + 1, 1); obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_m_s - this->get_time_offset_s() * GALILEO_C_m_s; - this->set_visible_satellites_ID(valid_obs, galileo_ephemeris_iter->second.i_satellite_PRN); - this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz); Galileo_week_number = galileo_ephemeris_iter->second.WN_5; //for GST GST = galileo_ephemeris_iter->second.Galileo_System_Time(Galileo_week_number, hybrid_current_time); @@ -213,8 +211,6 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do double Code_bias_m = P1_P2 / (1.0 - Gamma); obs.resize(valid_obs + 1, 1); obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s - Code_bias_m - this->get_time_offset_s() * GPS_C_m_s; - this->set_visible_satellites_ID(valid_obs, gps_ephemeris_iter->second.i_satellite_PRN); - this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz); // SV ECEF DEBUG OUTPUT LOG(INFO) << "(new)ECEF GPS L1 CA satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN @@ -265,8 +261,6 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do // 4- fill the observations vector with the corrected observables obs.resize(valid_obs + 1, 1); obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s + SV_clock_bias_s * GPS_C_m_s; - this->set_visible_satellites_ID(valid_obs, gps_cnav_ephemeris_iter->second.i_satellite_PRN); - this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz); GPS_week = gps_cnav_ephemeris_iter->second.i_GPS_week; GPS_week = GPS_week % 1024; //Necessary due to the increase of WN bits in CNAV message (10 in GPS NAV and 13 in CNAV) diff --git a/src/algorithms/PVT/libs/ls_pvt.cc b/src/algorithms/PVT/libs/ls_pvt.cc index 8525d952f..f7c48b0aa 100644 --- a/src/algorithms/PVT/libs/ls_pvt.cc +++ b/src/algorithms/PVT/libs/ls_pvt.cc @@ -236,9 +236,6 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs, double* elev = 0; double* dist = 0; Ls_Pvt::topocent(azim, elev, dist, pos.subvec(0, 2), Rot_X - pos.subvec(0, 2)); - this->set_visible_satellites_Az(i, *azim); - this->set_visible_satellites_El(i, *elev); - this->set_visible_satellites_Distance(i, *dist); if (traveltime < 0.1 && nmbOfSatellites > 3) { @@ -253,7 +250,7 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs, else { //--- Find delay due to troposphere (in meters) - Ls_Pvt::tropo(&trop, sin(this->get_visible_satellites_El(i) * GPS_PI / 180.0), h / 1000.0, 1013.0, 293.0, 50.0, 0.0, 0.0, 0.0); + Ls_Pvt::tropo(&trop, sin(*elev * GPS_PI / 180.0), h / 1000.0, 1013.0, 293.0, 50.0, 0.0, 0.0, 0.0); if (trop > 5.0) trop = 0.0; //check for erratic values } } @@ -280,9 +277,6 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs, } } - //-- compute the Dilution Of Precision values - //this->set_Q(arma::inv(arma::htrans(A) * A)); - // check the consistency of the PVT solution if (((fabs(pos(3)) * 1000.0) / GPS_C_m_s) > GPS_STARTOFFSET_ms * 2) { diff --git a/src/algorithms/PVT/libs/pvt_solution.cc b/src/algorithms/PVT/libs/pvt_solution.cc index 0ecbd15eb..55c52324b 100644 --- a/src/algorithms/PVT/libs/pvt_solution.cc +++ b/src/algorithms/PVT/libs/pvt_solution.cc @@ -562,6 +562,7 @@ bool Pvt_Solution::is_averaging() const return d_flag_averaging; } + bool Pvt_Solution::is_valid_position() const { return b_valid_position; @@ -611,172 +612,3 @@ void Pvt_Solution::set_num_valid_observations(int num) { d_valid_observations = num; } - - -bool Pvt_Solution::set_visible_satellites_ID(size_t index, unsigned int prn) -{ - if (index >= PVT_MAX_CHANNELS) - { - LOG(WARNING) << "Setting sat ID to channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; - return false; - } - else - { - if (prn >= PVT_MAX_PRN) - { - LOG(WARNING) << "Setting to channel " << index << " a PRN of " << prn << " (the maximum is " << PVT_MAX_PRN << ")"; - return false; - } - else - { - d_visible_satellites_IDs[index] = prn; - return true; - } - } -} - - -unsigned int Pvt_Solution::get_visible_satellites_ID(size_t index) const -{ - if (index >= PVT_MAX_CHANNELS) - { - LOG(WARNING) << "Getting sat ID for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; - return 0; - } - else - { - return d_visible_satellites_IDs[index]; - } -} - - -bool Pvt_Solution::set_visible_satellites_El(size_t index, double el) -{ - if (index >= PVT_MAX_CHANNELS) - { - LOG(WARNING) << "Setting sat elevation for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; - return false; - } - else - { - if (el > 90.0) - { - LOG(WARNING) << "Setting a sat elevation > 90 [degrees]. Saturating to 90"; - d_visible_satellites_El[index] = 90.0; - } - else - { - if (el < -90.0) - { - LOG(WARNING) << "Setting a sat elevation < -90 [degrees]. Saturating to -90"; - d_visible_satellites_El[index] = -90.0; - } - else - { - d_visible_satellites_El[index] = el; - } - } - return true; - } -} - - -double Pvt_Solution::get_visible_satellites_El(size_t index) const -{ - if (index >= PVT_MAX_CHANNELS) - { - LOG(WARNING) << "Getting sat elevation for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; - return 0.0; - } - else - { - return d_visible_satellites_El[index]; - } -} - - -bool Pvt_Solution::set_visible_satellites_Az(size_t index, double az) -{ - if (index >= PVT_MAX_CHANNELS) - { - LOG(WARNING) << "Getting sat azimuth for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; - return false; - } - else - { - d_visible_satellites_Az[index] = az; - return true; - } -} - - -double Pvt_Solution::get_visible_satellites_Az(size_t index) const -{ - if (index >= PVT_MAX_CHANNELS) - { - LOG(WARNING) << "Getting sat azimuth for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; - return 0.0; - } - else - { - return d_visible_satellites_Az[index]; - } -} - - -bool Pvt_Solution::set_visible_satellites_Distance(size_t index, double dist) -{ - if (index >= PVT_MAX_CHANNELS) - { - LOG(WARNING) << "Setting sat distance for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; - return false; - } - else - { - d_visible_satellites_Distance[index] = dist; - return true; - } -} - - -double Pvt_Solution::get_visible_satellites_Distance(size_t index) const -{ - if (index >= PVT_MAX_CHANNELS) - { - LOG(WARNING) << "Getting sat distance for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; - return 0.0; - } - else - { - return d_visible_satellites_Distance[index]; - } -} - - -bool Pvt_Solution::set_visible_satellites_CN0_dB(size_t index, double cn0) -{ - if (index >= PVT_MAX_CHANNELS) - { - LOG(WARNING) << "Setting sat Cn0 for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; - return false; - } - else - { - d_visible_satellites_CN0_dB[index] = cn0; - return true; - } -} - - -double Pvt_Solution::get_visible_satellites_CN0_dB(size_t index) const -{ - if (index >= PVT_MAX_CHANNELS) - { - LOG(WARNING) << "Getting received CN0 for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; - return 0.0; - } - else - { - return d_visible_satellites_CN0_dB[index]; - } -} diff --git a/src/algorithms/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h index 585703d68..5c21de7c6 100644 --- a/src/algorithms/PVT/libs/pvt_solution.h +++ b/src/algorithms/PVT/libs/pvt_solution.h @@ -72,12 +72,6 @@ private: boost::posix_time::ptime d_position_UTC_time; int d_valid_observations; - int d_visible_satellites_IDs[PVT_MAX_CHANNELS] = {}; // Array with the IDs of the valid satellites - double d_visible_satellites_El[PVT_MAX_CHANNELS] = {}; // Array with the LOS Elevation of the valid satellites - double d_visible_satellites_Az[PVT_MAX_CHANNELS] = {}; // Array with the LOS Azimuth of the valid satellites - double d_visible_satellites_Distance[PVT_MAX_CHANNELS] = {}; // Array with the LOS Distance of the valid satellites - double d_visible_satellites_CN0_dB[PVT_MAX_CHANNELS] = {}; // Array with the IDs of the valid satellites - public: Pvt_Solution(); @@ -110,21 +104,6 @@ public: int get_num_valid_observations() const; //!< Get the number of valid pseudorange observations (valid satellites) void set_num_valid_observations(int num); //!< Set the number of valid pseudorange observations (valid satellites) - bool set_visible_satellites_ID(size_t index, unsigned int prn); //!< Set the ID of the visible satellite index channel - unsigned int get_visible_satellites_ID(size_t index) const; //!< Get the ID of the visible satellite index channel - - bool set_visible_satellites_El(size_t index, double el); //!< Set the LOS Elevation, in degrees, of the visible satellite index channel - double get_visible_satellites_El(size_t index) const; //!< Get the LOS Elevation, in degrees, of the visible satellite index channel - - bool set_visible_satellites_Az(size_t index, double az); //!< Set the LOS Azimuth, in degrees, of the visible satellite index channel - double get_visible_satellites_Az(size_t index) const; //!< Get the LOS Azimuth, in degrees, of the visible satellite index channel - - bool set_visible_satellites_Distance(size_t index, double dist); //!< Set the LOS Distance of the visible satellite index channel - double get_visible_satellites_Distance(size_t index) const; //!< Get the LOS Distance of the visible satellite index channel - - bool set_visible_satellites_CN0_dB(size_t index, double cn0); //!< Set the CN0 in dB of the visible satellite index channel - double get_visible_satellites_CN0_dB(size_t index) const; //!< Get the CN0 in dB of the visible satellite index channel - //averaging void perform_pos_averaging(); void set_averaging_depth(int depth); //!< Set length of averaging window From d77448cd766c290c7b77852b0d6345550c55d878 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 7 Nov 2018 22:25:09 +0100 Subject: [PATCH 064/143] Improve data types for almanac parameters --- docs/xml-schemas/gal_almanac_map.xsd | 12 ++--- docs/xml-schemas/gps_almanac_map.xsd | 2 +- .../libs/rtklib/rtklib_conversions.cc | 10 ++-- src/core/libs/gnss_sdr_supl_client.cc | 2 +- src/core/system_parameters/galileo_almanac.cc | 12 ++--- src/core/system_parameters/galileo_almanac.h | 20 +++---- .../galileo_almanac_helper.cc | 45 ++++++++-------- .../galileo_almanac_helper.h | 22 ++++---- .../galileo_navigation_message.cc | 52 +++++++++---------- .../galileo_navigation_message.h | 24 ++++----- src/core/system_parameters/gps_almanac.cc | 2 +- src/core/system_parameters/gps_almanac.h | 4 +- .../gps_navigation_message.cc | 6 +-- .../gps_navigation_message.h | 4 +- 14 files changed, 108 insertions(+), 109 deletions(-) diff --git a/docs/xml-schemas/gal_almanac_map.xsd b/docs/xml-schemas/gal_almanac_map.xsd index 887caf064..390609c58 100644 --- a/docs/xml-schemas/gal_almanac_map.xsd +++ b/docs/xml-schemas/gal_almanac_map.xsd @@ -15,9 +15,9 @@ - - - + + + @@ -27,9 +27,9 @@ - - - + + + diff --git a/docs/xml-schemas/gps_almanac_map.xsd b/docs/xml-schemas/gps_almanac_map.xsd index 5e96b4af1..86b9d2a2d 100644 --- a/docs/xml-schemas/gps_almanac_map.xsd +++ b/docs/xml-schemas/gps_almanac_map.xsd @@ -16,7 +16,7 @@ - + diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index 22b8af3b9..3106b6bc1 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -302,7 +302,7 @@ alm_t alm_to_rtklib(const Gps_Almanac& gps_alm) rtklib_alm.svh = gps_alm.i_SV_health; rtklib_alm.svconf = gps_alm.i_AS_status; rtklib_alm.week = gps_alm.i_WNa; - rtklib_alm.toa = gpst2time(gps_alm.i_WNa, gps_alm.d_Toa); + rtklib_alm.toa = gpst2time(gps_alm.i_WNa, gps_alm.i_Toa); rtklib_alm.A = gps_alm.d_sqrt_A * gps_alm.d_sqrt_A; rtklib_alm.e = gps_alm.d_e_eccentricity; rtklib_alm.i0 = gps_alm.d_Delta_i + 0.3; @@ -312,7 +312,7 @@ alm_t alm_to_rtklib(const Gps_Almanac& gps_alm) rtklib_alm.M0 = gps_alm.d_M_0; rtklib_alm.f0 = gps_alm.d_A_f0; rtklib_alm.f1 = gps_alm.d_A_f1; - rtklib_alm.toas = gps_alm.d_Toa; + rtklib_alm.toas = gps_alm.i_Toa; return rtklib_alm; @@ -326,8 +326,8 @@ alm_t alm_to_rtklib(const Galileo_Almanac& gal_alm) rtklib_alm.sat = gal_alm.i_satellite_PRN; rtklib_alm.svh = gal_alm.E1B_HS; rtklib_alm.svconf = gal_alm.E1B_HS; - rtklib_alm.week = gal_alm.d_WNa; - rtklib_alm.toa = gpst2time(gal_alm.d_WNa, gal_alm.d_Toa); + rtklib_alm.week = gal_alm.i_WNa; + rtklib_alm.toa = gpst2time(gal_alm.i_WNa, gal_alm.i_Toa); rtklib_alm.A = 5440.588203494 + gal_alm.d_Delta_sqrt_A; rtklib_alm.A = rtklib_alm.A * rtklib_alm.A; rtklib_alm.e = gal_alm.d_e_eccentricity; @@ -338,7 +338,7 @@ alm_t alm_to_rtklib(const Galileo_Almanac& gal_alm) rtklib_alm.M0 = gal_alm.d_M_0; rtklib_alm.f0 = gal_alm.d_A_f0; rtklib_alm.f1 = gal_alm.d_A_f1; - rtklib_alm.toas = gal_alm.d_Toa; + rtklib_alm.toas = gal_alm.i_Toa; return rtklib_alm; diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index b95221856..7494d2f3f 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -267,7 +267,7 @@ void gnss_sdr_supl_client::read_supl_data() gps_almanac_iterator->second.d_OMEGA0 = static_cast(a->OMEGA_0) * pow(2.0, -23); gps_almanac_iterator->second.d_sqrt_A = static_cast(a->A_sqrt) * pow(2.0, -11); gps_almanac_iterator->second.d_OMEGA_DOT = static_cast(a->OMEGA_dot) * pow(2.0, -38); - gps_almanac_iterator->second.d_Toa = static_cast(a->toa) * pow(2.0, 12); + gps_almanac_iterator->second.i_Toa = static_cast(a->toa) * pow(2.0, 12); gps_almanac_iterator->second.d_e_eccentricity = static_cast(a->e) * pow(2.0, -21); gps_almanac_iterator->second.d_M_0 = static_cast(a->M0) * pow(2.0, -23); } diff --git a/src/core/system_parameters/galileo_almanac.cc b/src/core/system_parameters/galileo_almanac.cc index 27931f8b0..6dbc7b25e 100644 --- a/src/core/system_parameters/galileo_almanac.cc +++ b/src/core/system_parameters/galileo_almanac.cc @@ -34,9 +34,9 @@ Galileo_Almanac::Galileo_Almanac() { i_satellite_PRN = 0U; - d_Toa = 0.0; - d_WNa = 0.0; - d_IODa = 0.0; + i_Toa = 0; + i_WNa = 0; + i_IODa = 0; d_Delta_i = 0.0; d_M_0 = 0.0; d_e_eccentricity = 0.0; @@ -46,7 +46,7 @@ Galileo_Almanac::Galileo_Almanac() d_OMEGA_DOT = 0.0; d_A_f0 = 0.0; d_A_f1 = 0.0; - E5b_HS = 0.0; - E1B_HS = 0.0; - E5a_HS = 0.0; + E5b_HS = 0; + E1B_HS = 0; + E5a_HS = 0; } diff --git a/src/core/system_parameters/galileo_almanac.h b/src/core/system_parameters/galileo_almanac.h index 1529355ae..022d778be 100644 --- a/src/core/system_parameters/galileo_almanac.h +++ b/src/core/system_parameters/galileo_almanac.h @@ -42,10 +42,10 @@ class Galileo_Almanac { public: uint32_t i_satellite_PRN; //!< SV PRN NUMBER - double d_Toa; - double d_WNa; - double d_IODa; - double d_Delta_i; + int32_t i_Toa; + int32_t i_WNa; + int32_t i_IODa; + double d_Delta_i; //!< Inclination at reference time relative to i0 = 56º [semi-circles] double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] double d_e_eccentricity; //!< Eccentricity [dimensionless] double d_Delta_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] @@ -54,9 +54,9 @@ public: double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] double d_A_f0; //!< Coefficient 0 of code phase offset model [s] double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - double E5b_HS; - double E1B_HS; - double E5a_HS; + int32_t E5b_HS; + int32_t E1B_HS; + int32_t E5a_HS; /*! * Default constructor @@ -71,9 +71,9 @@ public: { }; ar& BOOST_SERIALIZATION_NVP(i_satellite_PRN); - ar& BOOST_SERIALIZATION_NVP(d_Toa); - ar& BOOST_SERIALIZATION_NVP(d_WNa); - ar& BOOST_SERIALIZATION_NVP(d_IODa); + ar& BOOST_SERIALIZATION_NVP(i_Toa); + ar& BOOST_SERIALIZATION_NVP(i_WNa); + ar& BOOST_SERIALIZATION_NVP(i_IODa); ar& BOOST_SERIALIZATION_NVP(d_Delta_i); ar& BOOST_SERIALIZATION_NVP(d_M_0); ar& BOOST_SERIALIZATION_NVP(d_e_eccentricity); diff --git a/src/core/system_parameters/galileo_almanac_helper.cc b/src/core/system_parameters/galileo_almanac_helper.cc index 738ecc8dc..2fbd3e689 100644 --- a/src/core/system_parameters/galileo_almanac_helper.cc +++ b/src/core/system_parameters/galileo_almanac_helper.cc @@ -34,8 +34,8 @@ Galileo_Almanac_Helper::Galileo_Almanac_Helper() { // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number IOD_a_7 = 0; - WN_a_7 = 0.0; - t0a_7 = 0.0; + WN_a_7 = 0; + t0a_7 = 0; SVID1_7 = 0; DELTA_A_7 = 0.0; e_7 = 0.0; @@ -49,9 +49,9 @@ Galileo_Almanac_Helper::Galileo_Almanac_Helper() IOD_a_8 = 0; af0_8 = 0.0; af1_8 = 0.0; - E5b_HS_8 = 0.0; - E1B_HS_8 = 0.0; - E5a_HS_8 = 0.0; + E5b_HS_8 = 0; + E1B_HS_8 = 0; + E5a_HS_8 = 0; SVID2_8 = 0; DELTA_A_8 = 0.0; e_8 = 0.0; @@ -62,14 +62,14 @@ Galileo_Almanac_Helper::Galileo_Almanac_Helper() // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) IOD_a_9 = 0; - WN_a_9 = 0.0; - t0a_9 = 0.0; + WN_a_9 = 0; + t0a_9 = 0; M0_9 = 0.0; af0_9 = 0.0; af1_9 = 0.0; - E5b_HS_9 = 0.0; - E1B_HS_9 = 0.0; - E5a_HS_9 = 0.0; + E5b_HS_9 = 0; + E1B_HS_9 = 0; + E5a_HS_9 = 0; SVID3_9 = 0; DELTA_A_9 = 0.0; e_9 = 0.0; @@ -83,9 +83,9 @@ Galileo_Almanac_Helper::Galileo_Almanac_Helper() M0_10 = 0.0; af0_10 = 0.0; af1_10 = 0.0; - E5b_HS_10 = 0.0; - E1B_HS_10 = 0.0; - E5a_HS_10 = 0.0; + E5b_HS_10 = 0; + E1B_HS_10 = 0; + E5a_HS_10 = 0; } Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) @@ -95,9 +95,9 @@ Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) { case 1: galileo_almanac.i_satellite_PRN = this->SVID1_7; - galileo_almanac.d_Toa = this->t0a_7; - galileo_almanac.d_WNa = this->WN_a_7; - galileo_almanac.d_IODa = this->IOD_a_7; + galileo_almanac.i_Toa = this->t0a_7; + galileo_almanac.i_WNa = this->WN_a_7; + galileo_almanac.i_IODa = this->IOD_a_7; galileo_almanac.d_Delta_i = this->delta_i_7; galileo_almanac.d_M_0 = this->M0_7; galileo_almanac.d_e_eccentricity = this->e_7; @@ -114,9 +114,9 @@ Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) case 2: galileo_almanac.i_satellite_PRN = this->SVID2_8; - galileo_almanac.d_Toa = this->t0a_9; - galileo_almanac.d_WNa = this->WN_a_9; - galileo_almanac.d_IODa = this->IOD_a_9; + galileo_almanac.i_Toa = this->t0a_9; + galileo_almanac.i_WNa = this->WN_a_9; + galileo_almanac.i_IODa = this->IOD_a_9; galileo_almanac.d_Delta_i = this->delta_i_8; galileo_almanac.d_M_0 = this->M0_9; galileo_almanac.d_e_eccentricity = this->e_8; @@ -126,16 +126,15 @@ Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) galileo_almanac.d_OMEGA_DOT = this->Omega_dot_8; galileo_almanac.d_A_f0 = this->af0_9; galileo_almanac.d_A_f1 = this->af1_9; - galileo_almanac.E5b_HS = this->E5b_HS_9; galileo_almanac.E1B_HS = this->E1B_HS_9; galileo_almanac.E5a_HS = this->E5a_HS_9; break; case 3: galileo_almanac.i_satellite_PRN = this->SVID3_9; - galileo_almanac.d_Toa = this->t0a_9; - galileo_almanac.d_WNa = this->WN_a_9; - galileo_almanac.d_IODa = this->IOD_a_10; + galileo_almanac.i_Toa = this->t0a_9; + galileo_almanac.i_WNa = this->WN_a_9; + galileo_almanac.i_IODa = this->IOD_a_10; galileo_almanac.d_Delta_i = this->delta_i_9; galileo_almanac.d_M_0 = this->M0_10; galileo_almanac.d_e_eccentricity = this->e_9; diff --git a/src/core/system_parameters/galileo_almanac_helper.h b/src/core/system_parameters/galileo_almanac_helper.h index c0541a214..1b2e1b28e 100644 --- a/src/core/system_parameters/galileo_almanac_helper.h +++ b/src/core/system_parameters/galileo_almanac_helper.h @@ -44,7 +44,7 @@ class Galileo_Almanac_Helper public: // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number int32_t IOD_a_7; - double WN_a_7; + int32_t WN_a_7; double t0a_7; int32_t SVID1_7; double DELTA_A_7; @@ -59,9 +59,9 @@ public: int32_t IOD_a_8; double af0_8; double af1_8; - double E5b_HS_8; - double E1B_HS_8; - double E5a_HS_8; + int32_t E5b_HS_8; + int32_t E1B_HS_8; + int32_t E5a_HS_8; int32_t SVID2_8; double DELTA_A_8; double e_8; @@ -72,14 +72,14 @@ public: // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) int32_t IOD_a_9; - double WN_a_9; + int32_t WN_a_9; double t0a_9; double M0_9; double af0_9; double af1_9; - double E5b_HS_9; - double E1B_HS_9; - double E5a_HS_9; + int32_t E5b_HS_9; + int32_t E1B_HS_9; + int32_t E5a_HS_9; int32_t SVID3_9; double DELTA_A_9; double e_9; @@ -93,9 +93,9 @@ public: double M0_10; double af0_10; double af1_10; - double E5b_HS_10; - double E1B_HS_10; - double E5a_HS_10; + int32_t E5b_HS_10; + int32_t E1B_HS_10; + int32_t E5a_HS_10; Galileo_Almanac_Helper(); //!< Default constructor Galileo_Almanac get_almanac(int i); diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index 6d157aa46..4e72f62d3 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -123,10 +123,10 @@ void Galileo_Navigation_Message::reset() Region5_flag_5 = false; BGD_E1E5a_5 = 0.0; BGD_E1E5b_5 = 0.0; - E5b_HS_5 = 0.0; - E1B_HS_5 = 0.0; - E5b_DVS_5 = 0.0; - E1B_DVS_5 = 0.0; + E5b_HS_5 = 0; + E1B_HS_5 = 0; + E5b_DVS_5 = 0; + E1B_DVS_5 = 0; // GST WN_5 = 0.0; @@ -146,7 +146,7 @@ void Galileo_Navigation_Message::reset() // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number IOD_a_7 = 0; - WN_a_7 = 0.0; + WN_a_7 = 0; t0a_7 = 0.0; SVID1_7 = 0; DELTA_A_7 = 0.0; @@ -161,8 +161,8 @@ void Galileo_Navigation_Message::reset() IOD_a_8 = 0; af0_8 = 0.0; af1_8 = 0.0; - E5b_HS_8 = 0.0; - E1B_HS_8 = 0.0; + E5b_HS_8 = 0; + E1B_HS_8 = 0; SVID2_8 = 0; DELTA_A_8 = 0.0; e_8 = 0.0; @@ -173,13 +173,13 @@ void Galileo_Navigation_Message::reset() // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) IOD_a_9 = 0; - WN_a_9 = 0.0; + WN_a_9 = 0; t0a_9 = 0.0; M0_9 = 0.0; af0_9 = 0.0; af1_9 = 0.0; - E5b_HS_9 = 0.0; - E1B_HS_9 = 0.0; + E5b_HS_9 = 0; + E1B_HS_9 = 0; SVID3_9 = 0; DELTA_A_9 = 0.0; e_9 = 0.0; @@ -193,8 +193,8 @@ void Galileo_Navigation_Message::reset() M0_10 = 0.0; af0_10 = 0.0; af1_10 = 0.0; - E5b_HS_10 = 0.0; - E1B_HS_10 = 0.0; + E5b_HS_10 = 0; + E1B_HS_10 = 0; // GST-GPS A_0G_10 = 0.0; @@ -781,13 +781,13 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char *data_jk) BGD_E1E5b_5 = static_cast(read_navigation_signed(data_jk_bits, BGD_E1E5b_5_bit)); BGD_E1E5b_5 = BGD_E1E5b_5 * BGD_E1E5b_5_LSB; DLOG(INFO) << "BGD_E1E5b_5= " << BGD_E1E5b_5; - E5b_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_5_bit)); + E5b_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_5_bit)); DLOG(INFO) << "E5b_HS_5= " << E5b_HS_5; - E1B_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_5_bit)); + E1B_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_5_bit)); DLOG(INFO) << "E1B_HS_5= " << E1B_HS_5; - E5b_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_DVS_5_bit)); + E5b_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_DVS_5_bit)); DLOG(INFO) << "E5b_DVS_5= " << E5b_DVS_5; - E1B_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_DVS_5_bit)); + E1B_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_DVS_5_bit)); DLOG(INFO) << "E1B_DVS_5= " << E1B_DVS_5; // GST WN_5 = static_cast(read_navigation_unsigned(data_jk_bits, WN_5_bit)); @@ -833,7 +833,7 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char *data_jk) case 7: // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number IOD_a_7 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_7_bit)); DLOG(INFO) << "IOD_a_7= " << IOD_a_7; - WN_a_7 = static_cast(read_navigation_unsigned(data_jk_bits, WN_a_7_bit)); + WN_a_7 = static_cast(read_navigation_unsigned(data_jk_bits, WN_a_7_bit)); DLOG(INFO) << "WN_a_7= " << WN_a_7; t0a_7 = static_cast(read_navigation_unsigned(data_jk_bits, t0a_7_bit)); t0a_7 = t0a_7 * t0a_7_LSB; @@ -874,11 +874,11 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char *data_jk) af1_8 = static_cast(read_navigation_signed(data_jk_bits, af1_8_bit)); af1_8 = af1_8 * af1_8_LSB; DLOG(INFO) << "af1_8= " << af1_8; - E5b_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_8_bit)); + E5b_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_8_bit)); DLOG(INFO) << "E5b_HS_8= " << E5b_HS_8; - E1B_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_8_bit)); + E1B_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_8_bit)); DLOG(INFO) << "E1B_HS_8= " << E1B_HS_8; - SVID2_8 = static_cast(read_navigation_unsigned(data_jk_bits, SVID2_8_bit)); + SVID2_8 = static_cast(read_navigation_unsigned(data_jk_bits, SVID2_8_bit)); DLOG(INFO) << "SVID2_8= " << SVID2_8; DELTA_A_8 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_8_bit)); DELTA_A_8 = DELTA_A_8 * DELTA_A_8_LSB; @@ -905,7 +905,7 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char *data_jk) case 9: // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) IOD_a_9 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_9_bit)); DLOG(INFO) << "IOD_a_9= " << IOD_a_9; - WN_a_9 = static_cast(read_navigation_unsigned(data_jk_bits, WN_a_9_bit)); + WN_a_9 = static_cast(read_navigation_unsigned(data_jk_bits, WN_a_9_bit)); DLOG(INFO) << "WN_a_9= " << WN_a_9; t0a_9 = static_cast(read_navigation_unsigned(data_jk_bits, t0a_9_bit)); t0a_9 = t0a_9 * t0a_9_LSB; @@ -919,11 +919,11 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char *data_jk) af1_9 = static_cast(read_navigation_signed(data_jk_bits, af1_9_bit)); af1_9 = af1_9 * af1_9_LSB; DLOG(INFO) << "af1_9= " << af1_9; - E5b_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_9_bit)); + E5b_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_9_bit)); DLOG(INFO) << "E5b_HS_9= " << E5b_HS_9; - E1B_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_9_bit)); + E1B_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_9_bit)); DLOG(INFO) << "E1B_HS_9= " << E1B_HS_9; - SVID3_9 = static_cast(read_navigation_unsigned(data_jk_bits, SVID3_9_bit)); + SVID3_9 = static_cast(read_navigation_unsigned(data_jk_bits, SVID3_9_bit)); DLOG(INFO) << "SVID3_9= " << SVID3_9; DELTA_A_9 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_9_bit)); DELTA_A_9 = DELTA_A_9 * DELTA_A_9_LSB; @@ -959,9 +959,9 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char *data_jk) af1_10 = static_cast(read_navigation_signed(data_jk_bits, af1_10_bit)); af1_10 = af1_10 * af1_10_LSB; DLOG(INFO) << "af1_10= " << af1_10; - E5b_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_10_bit)); + E5b_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_10_bit)); DLOG(INFO) << "E5b_HS_10= " << E5b_HS_10; - E1B_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_10_bit)); + E1B_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_10_bit)); DLOG(INFO) << "E1B_HS_10= " << E1B_HS_10; A_0G_10 = static_cast(read_navigation_signed(data_jk_bits, A_0G_10_bit)); A_0G_10 = A_0G_10 * A_0G_10_LSB; diff --git a/src/core/system_parameters/galileo_navigation_message.h b/src/core/system_parameters/galileo_navigation_message.h index d54e1b980..1e71baafd 100644 --- a/src/core/system_parameters/galileo_navigation_message.h +++ b/src/core/system_parameters/galileo_navigation_message.h @@ -143,10 +143,10 @@ public: double BGD_E1E5a_5; //!< E1-E5a Broadcast Group Delay [s] double BGD_E1E5b_5; //!< E1-E5b Broadcast Group Delay [s] - double E5b_HS_5; //!< E5b Signal Health Status - double E1B_HS_5; //!< E1B Signal Health Status - double E5b_DVS_5; //!< E5b Data Validity Status - double E1B_DVS_5; //!< E1B Data Validity Status + int32_t E5b_HS_5; //!< E5b Signal Health Status + int32_t E1B_HS_5; //!< E1B Signal Health Status + int32_t E5b_DVS_5; //!< E5b Data Validity Status + int32_t E1B_DVS_5; //!< E1B Data Validity Status // GST double WN_5; @@ -166,7 +166,7 @@ public: // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number int32_t IOD_a_7; - double WN_a_7; + int32_t WN_a_7; double t0a_7; int32_t SVID1_7; double DELTA_A_7; @@ -181,8 +181,8 @@ public: int32_t IOD_a_8; double af0_8; double af1_8; - double E5b_HS_8; - double E1B_HS_8; + int32_t E5b_HS_8; + int32_t E1B_HS_8; int32_t SVID2_8; double DELTA_A_8; double e_8; @@ -193,13 +193,13 @@ public: // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) int32_t IOD_a_9; - double WN_a_9; + int32_t WN_a_9; double t0a_9; double M0_9; double af0_9; double af1_9; - double E5b_HS_9; - double E1B_HS_9; + int32_t E5b_HS_9; + int32_t E1B_HS_9; int32_t SVID3_9; double DELTA_A_9; double e_9; @@ -213,8 +213,8 @@ public: double M0_10; double af0_10; double af1_10; - double E5b_HS_10; - double E1B_HS_10; + int32_t E5b_HS_10; + int32_t E1B_HS_10; // GST-GPS conversion double A_0G_10; //!< Constant term of the offset Delta t systems diff --git a/src/core/system_parameters/gps_almanac.cc b/src/core/system_parameters/gps_almanac.cc index c2776dcce..987032668 100644 --- a/src/core/system_parameters/gps_almanac.cc +++ b/src/core/system_parameters/gps_almanac.cc @@ -36,7 +36,7 @@ Gps_Almanac::Gps_Almanac() { i_satellite_PRN = 0U; d_Delta_i = 0.0; - d_Toa = 0.0; + i_Toa = 0.0; i_WNa = 0; d_M_0 = 0.0; d_e_eccentricity = 0.0; diff --git a/src/core/system_parameters/gps_almanac.h b/src/core/system_parameters/gps_almanac.h index 57288d3db..71175a8bd 100644 --- a/src/core/system_parameters/gps_almanac.h +++ b/src/core/system_parameters/gps_almanac.h @@ -45,7 +45,7 @@ class Gps_Almanac public: uint32_t i_satellite_PRN; //!< SV PRN NUMBER double d_Delta_i; //!< Inclination Angle at Reference Time (relative to i_0 = 0.30 semi-circles) - double d_Toa; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] + int32_t i_Toa; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] int32_t i_WNa; //!< Almanac week number double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] double d_e_eccentricity; //!< Eccentricity [dimensionless] @@ -72,7 +72,7 @@ public: }; ar& BOOST_SERIALIZATION_NVP(i_satellite_PRN); ar& BOOST_SERIALIZATION_NVP(d_Delta_i); - ar& BOOST_SERIALIZATION_NVP(d_Toa); + ar& BOOST_SERIALIZATION_NVP(i_Toa); ar& BOOST_SERIALIZATION_NVP(i_WNa); ar& BOOST_SERIALIZATION_NVP(d_M_0); ar& BOOST_SERIALIZATION_NVP(d_e_eccentricity); diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index 742cfb19e..e77317ccd 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -125,7 +125,7 @@ void Gps_Navigation_Message::reset() d_DeltaT_LSF = 0.0; // Almanac - d_Toa = 0.0; + i_Toa = 0; i_WN_A = 0; for (int32_t i = 1; i < 32; i++) { @@ -433,8 +433,8 @@ int32_t Gps_Navigation_Message::subframe_decoder(char *subframe) } if (SV_page_5 == 51) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110) { - d_Toa = static_cast(read_navigation_unsigned(subframe_bits, T_OA)); - d_Toa = d_Toa * T_OA_LSB; + i_Toa = static_cast(read_navigation_unsigned(subframe_bits, T_OA)); + i_Toa = i_Toa * T_OA_LSB; i_WN_A = static_cast(read_navigation_unsigned(subframe_bits, WN_A)); almanacHealth[1] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV1)); almanacHealth[2] = static_cast(read_navigation_unsigned(subframe_bits, HEALTH_SV2)); diff --git a/src/core/system_parameters/gps_navigation_message.h b/src/core/system_parameters/gps_navigation_message.h index 73e3c873b..595d74d30 100644 --- a/src/core/system_parameters/gps_navigation_message.h +++ b/src/core/system_parameters/gps_navigation_message.h @@ -109,8 +109,8 @@ public: double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] // Almanac - double d_Toa; //!< Almanac reference time [s] - int32_t i_WN_A; //!< Modulo 256 of the GPS week number to which the almanac reference time (d_Toa) is referenced + int32_t i_Toa; //!< Almanac reference time [s] + int32_t i_WN_A; //!< Modulo 256 of the GPS week number to which the almanac reference time (i_Toa) is referenced std::map almanacHealth; //!< Map that stores the health information stored in the almanac std::map satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus From 61d67a764286180ea64380cfcf1039ace6dfbcc6 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 7 Nov 2018 23:53:16 +0100 Subject: [PATCH 065/143] Make use of the more efficient switch statement for printers --- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 550 +++++++++--------- 1 file changed, 266 insertions(+), 284 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 762a36f1c..7f4d311db 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -1158,18 +1158,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); - - if (type_of_rx == 1) // GPS L1 C/A only + switch (type_of_rx) { + case 1: // GPS L1 C/A only if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time); rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 2) // GPS L2C only - { + break; + case 2: // GPS L2C only if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { std::string signal("2S"); @@ -1177,9 +1176,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 3) // GPS L5 only - { + break; + case 3: // GPS L5 only if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { std::string signal("L5"); @@ -1187,38 +1185,34 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 4) // Galileo E1B only - { + break; + case 4: // Galileo E1B only if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time); rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 5) // Galileo E5a only - { - std::string signal("5X"); + break; + case 5: // Galileo E5a only if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { + std::string signal("5X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 6) // Galileo E5b only - { - std::string signal("7X"); + break; + case 6: // Galileo E5b only if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { + std::string signal("7X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 7) // GPS L1 C/A + GPS L2C - { + break; + case 7: // GPS L1 C/A + GPS L2C if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { std::string signal("1C 2S"); @@ -1226,9 +1220,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 8) // GPS L1 + GPS L5 - { + break; + case 8: // GPS L1 + GPS L5 if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { std::string signal("1C L5"); @@ -1236,9 +1229,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B - { + break; + case 9: // GPS L1 C/A + Galileo E1B if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { std::string gal_signal("1B"); @@ -1246,9 +1238,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 10) // GPS L1 C/A + Galileo E5a - { + break; + case 10: // GPS L1 C/A + Galileo E5a if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { std::string gal_signal("5X"); @@ -1256,9 +1247,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 11) // GPS L1 C/A + Galileo E5b - { + break; + case 11: // GPS L1 C/A + Galileo E5b if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { std::string gal_signal("7X"); @@ -1266,9 +1256,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 13) // L5+E5a - { + break; + case 13: // L5+E5a if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { std::string gal_signal("5X"); @@ -1277,9 +1266,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 14) // Galileo E1B + Galileo E5a - { + break; + case 14: // Galileo E1B + Galileo E5a if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 5X"); @@ -1287,9 +1275,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 15) // Galileo E1B + Galileo E5b - { + break; + case 15: // Galileo E1B + Galileo E5b if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 7X"); @@ -1297,40 +1284,35 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 23) // GLONASS L1 C/A only - { - std::string signal("1G"); + break; + case 23: // GLONASS L1 C/A only if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { + std::string signal("1G"); rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 24) // GLONASS L2 C/A only - { - std::string signal("2G"); + break; + case 24: // GLONASS L2 C/A only if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { + std::string signal("2G"); rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 25) // GLONASS L1 C/A + GLONASS L2 C/A - { - std::string signal("1G 2G"); + break; + case 25: // GLONASS L1 C/A + GLONASS L2 C/A if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { + std::string signal("1G 2G"); rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); b_rinex_header_written = true; // do not write header anymore } - } - - if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A - { + break; + case 26: // GPS L1 C/A + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { std::string glo_signal("1G"); @@ -1344,9 +1326,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A - { + break; + case 27: // Galileo E1B + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { std::string glo_signal("1G"); @@ -1355,9 +1336,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A - { + break; + case 28: // GPS L2C + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { std::string glo_signal("1G"); @@ -1365,9 +1345,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A - { + break; + case 29: // GPS L1 C/A + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { std::string glo_signal("2G"); @@ -1381,9 +1360,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A - { + break; + case 30: // Galileo E1B + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { std::string glo_signal("2G"); @@ -1392,9 +1370,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_written = true; // do not write header anymore } - } - if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A - { + break; + case 31: // GPS L2C + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { std::string glo_signal("2G"); @@ -1402,10 +1379,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_written = true; // do not write header anymore } - } - - if (type_of_rx == 32) // L1+E1+L5+E5a - { + break; + case 32: // L1+E1+L5+E5a if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) @@ -1416,55 +1391,55 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } + break; + default: + break; } } - if (b_rinex_header_written) // The header is already written, we can now log the navigation message data { if (flag_write_RINEX_nav_output) { - if (type_of_rx == 1) // GPS L1 C/A only + switch (type_of_rx) { + case 1: // GPS L1 C/A only rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); - } - if (type_of_rx == 2) // GPS L2C only - { + break; + case 2: // GPS L2C only rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); - } - if (type_of_rx == 3) // GPS L5 only - { + break; + case 3: // GPS L5 only rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); - } - if ((type_of_rx == 4) or (type_of_rx == 5) or (type_of_rx == 6)) // Galileo - { + break; + case 4: + case 5: + case 6: rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map); - } - if (type_of_rx == 7) // GPS L1 C/A + GPS L2C - { + break; + case 7: // GPS L1 C/A + GPS L2C rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); - } - if (type_of_rx == 8) // L1+L5 - { + break; + case 8: // L1+L5 rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); - } - if ((type_of_rx == 9) or (type_of_rx == 10) or (type_of_rx == 11)) // GPS L1 C/A + Galileo - { + break; + case 9: + case 10: + case 11: rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->galileo_ephemeris_map); - } - if (type_of_rx == 13) // L5+E5a - { + break; + case 13: // L5+E5a rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->galileo_ephemeris_map); - } - if ((type_of_rx == 14) or (type_of_rx == 15)) // Galileo E1B + Galileo E5a - { + break; + case 14: + case 15: rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map); - } - if ((type_of_rx == 23) or (type_of_rx == 24) or (type_of_rx == 25)) // GLONASS L1 C/A, GLONASS L2 C/A - { + break; + case 23: + case 24: + case 25: rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); - } - if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A - { + break; + case 26: // GPS L1 C/A + GLONASS L1 C/A if (d_rinex_version == 3) rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); if (d_rinex_version == 2) @@ -1472,17 +1447,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); } - } - if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A - { + break; + case 27: // Galileo E1B + GLONASS L1 C/A rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); - } - if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A - { + break; + case 28: // GPS L2C + GLONASS L1 C/A rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); - } - if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A - { + break; + case 29: // GPS L1 C/A + GLONASS L2 C/A if (d_rinex_version == 3) rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); if (d_rinex_version == 2) @@ -1490,18 +1462,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); } - } - if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A - { + break; + case 30: // Galileo E1B + GLONASS L2 C/A rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); - } - if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A - { + break; + case 31: // GPS L2C + GLONASS L2 C/A rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); - } - if (type_of_rx == 32) // L1+E1+L5+E5a - { + break; + case 32: // L1+E1+L5+E5a rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->galileo_ephemeris_map); + break; + default: + break; } } galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); @@ -1512,8 +1484,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item // Log observables into the RINEX file if (flag_write_RINEX_obs_output) { - if (type_of_rx == 1) // GPS L1 C/A only + switch (type_of_rx) { + case 1: // GPS L1 C/A only if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1524,9 +1497,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono); b_rinex_header_updated = true; } - } - if (type_of_rx == 2) // GPS L2C only - { + break; + case 2: // GPS L2C only if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1537,9 +1509,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono); b_rinex_header_updated = true; } - } - if (type_of_rx == 3) // GPS L5 - { + break; + case 3: // GPS L5 if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1550,9 +1521,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono); b_rinex_header_updated = true; } - } - if (type_of_rx == 4) // Galileo E1B only - { + break; + case 4: // Galileo E1B only if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B"); @@ -1563,9 +1533,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 5) // Galileo E5a only - { + break; + case 5: // Galileo E5a only if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "5X"); @@ -1576,9 +1545,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 6) // Galileo E5b only - { + break; + case 6: // Galileo E5b only if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "7X"); @@ -1589,9 +1557,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 7) // GPS L1 C/A + GPS L2C - { + break; + case 7: // GPS L1 C/A + GPS L2C if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1602,9 +1569,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono); b_rinex_header_updated = true; } - } - if (type_of_rx == 8) // L1+L5 - { + break; + case 8: // L1+L5 if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1623,9 +1589,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } b_rinex_header_updated = true; } - } - if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B - { + break; + case 9: // GPS L1 C/A + Galileo E1B if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1636,9 +1601,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 13) // L5+E5a - { + break; + case 13: // L5+E5a if ((gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1649,9 +1613,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; // do not write header anymore } - } - if (type_of_rx == 14) // Galileo E1B + Galileo E5a - { + break; + case 14: // Galileo E1B + Galileo E5a if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 5X"); @@ -1662,9 +1625,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 15) // Galileo E1B + Galileo E5b - { + break; + case 15: // Galileo E1B + Galileo E5b if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 7X"); @@ -1675,9 +1637,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 23) // GLONASS L1 C/A only - { + break; + case 23: // GLONASS L1 C/A only if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C"); @@ -1688,9 +1649,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 24) // GLONASS L2 C/A only - { + break; + case 24: // GLONASS L2 C/A only if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "2C"); @@ -1701,9 +1661,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 25) // GLONASS L1 C/A + GLONASS L2 C/A - { + break; + case 25: // GLONASS L1 C/A + GLONASS L2 C/A if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C 2C"); @@ -1714,9 +1673,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model); b_rinex_header_updated = true; } - } - if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A - { + break; + case 26: // GPS L1 C/A + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1727,9 +1685,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } - } - if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A - { + break; + case 27: // Galileo E1B + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1740,9 +1697,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } - } - if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A - { + break; + case 28: // GPS L2C + GLONASS L1 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1753,9 +1709,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } - } - if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A - { + break; + case 29: // GPS L1 C/A + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1766,9 +1721,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } - } - if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A - { + break; + case 30: // Galileo E1B + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1779,9 +1733,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } - } - if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A - { + break; + case 31: // GPS L2C + GLONASS L2 C/A if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1792,9 +1745,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } - } - if (type_of_rx == 32) // L1+E1+L5+E5a - { + break; + case 32: // L1+E1+L5+E5a if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); @@ -1813,6 +1765,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } b_rinex_header_updated = true; // do not write header anymore } + break; } } } @@ -1823,8 +1776,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (b_rtcm_writing_started and b_rtcm_enabled) { - if (type_of_rx == 1) // GPS L1 C/A + switch (type_of_rx) { + case 1: // GPS L1 C/A if (flag_write_RTCM_1019_output == true) { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -1840,9 +1794,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if ((type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6) || (type_of_rx == 14) || (type_of_rx == 15)) // Galileo - { + break; + case 4: + case 5: + case 6: if (flag_write_RTCM_1045_output == true) { for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) @@ -1858,9 +1813,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 7) // GPS L1 C/A + GPS L2C - { + break; + case 7: // GPS L1 C/A + GPS L2C if (flag_write_RTCM_1019_output == true) { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -1877,9 +1831,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 8) // L1+L5 - { + break; + case 8: // L1+L5 if (flag_write_RTCM_1019_output == true) { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -1896,9 +1849,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B - { + break; + case 9: // GPS L1 C/A + Galileo E1B if (flag_write_RTCM_1019_output == true) { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -1956,22 +1908,20 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 13) // L5+E5a - { - std::map::const_iterator gal_eph_iter; - std::map::const_iterator gps_cnav_eph_iter; + break; + case 13: // L5+E5a if (flag_write_RTCM_1045_output == true) { - for (gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } } - gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); + if (flag_write_RTCM_MSM_output == true) { + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); if (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); @@ -1981,9 +1931,28 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if ((type_of_rx == 23) || (type_of_rx == 24) || (type_of_rx == 25)) // GLONASS - { + break; + case 14: + case 15: + if (flag_write_RTCM_1045_output == true) + { + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + } + } + if (flag_write_RTCM_MSM_output == true) + { + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + } + break; + case 23: + case 24: + case 25: if (flag_write_RTCM_1020_output == true) { for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) @@ -2000,13 +1969,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A - { - std::map::const_iterator gps_eph_iter; + break; + case 26: // GPS L1 C/A + GLONASS L1 C/A if (flag_write_RTCM_1019_output == true) { - for (gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } @@ -2062,9 +2029,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 27) // GLONASS L1 C/A + Galileo E1B - { + break; + case 27: // GLONASS L1 C/A + Galileo E1B if (flag_write_RTCM_1020_output == true) { for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) @@ -2122,9 +2088,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A - { + break; + case 29: // GPS L1 C/A + GLONASS L2 C/A if (flag_write_RTCM_1019_output == true) { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2182,9 +2147,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 30) // GLONASS L2 C/A + Galileo E1B - { + break; + case 30: // GLONASS L2 C/A + Galileo E1B if (flag_write_RTCM_1020_output == true) { for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) @@ -2242,9 +2206,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } - } - if (type_of_rx == 32) // L1+E1+L5+E5a - { + break; + case 32: // L1+E1+L5+E5a if (flag_write_RTCM_1019_output == true) { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2302,13 +2265,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } } + break; + default: + break; } } if (!b_rtcm_writing_started and b_rtcm_enabled) // the first time { - if (type_of_rx == 1) // GPS L1 C/A + switch (type_of_rx) { + case 1: // GPS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2326,9 +2293,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if ((type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6) || (type_of_rx == 14) || (type_of_rx == 15)) // Galileo - { + break; + case 4: + case 5: + case 6: if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) @@ -2345,9 +2313,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 7) // GPS L1 C/A + GPS L2C - { + break; + case 7: // GPS L1 C/A + GPS L2C if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2365,9 +2332,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 8) // L1+L5 - { + break; + case 8: // L1+L5 if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2385,9 +2351,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B - { + break; + case 9: // GPS L1 C/A + Galileo E1B if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2446,9 +2411,48 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if ((type_of_rx == 23) || (type_of_rx == 24) || (type_of_rx == 25)) // GLONASS - { + break; + + case 13: // L5+E5a + if (d_rtcm_MT1045_rate_ms != 0) + { + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + } + } + if (d_rtcm_MSM_rate_ms != 0) + { + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + } + b_rtcm_writing_started = true; + break; + case 14: + case 15: + if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 + { + for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + { + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + } + } + if (d_rtcm_MSM_rate_ms != 0) + { + std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + { + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + } + } + b_rtcm_writing_started = true; + break; + case 23: + case 24: + case 25: if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) @@ -2465,29 +2469,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 13) // L5+E5a - { - std::map::const_iterator gal_eph_iter; - if (d_rtcm_MT1045_rate_ms != 0) - { - for (gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) - { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); - } - } - if (d_rtcm_MSM_rate_ms != 0) - { - gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) - { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); - } - } - b_rtcm_writing_started = true; - } - if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A - { + break; + case 26: // GPS L1 C/A + GLONASS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2546,9 +2529,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 27) // GLONASS L1 C/A + Galileo E1B - { + break; + case 27: // GLONASS L1 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) @@ -2607,9 +2589,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A - { + break; + case 29: // GPS L1 C/A + GLONASS L2 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2669,9 +2650,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 30) // GLONASS L2 C/A + Galileo E1B - { + break; + case 30: // GLONASS L2 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) @@ -2730,9 +2710,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; - } - if (type_of_rx == 32) // L1+E1+L5+E5a - { + break; + case 32: // L1+E1+L5+E5a if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) @@ -2791,6 +2770,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } b_rtcm_writing_started = true; + break; + default: + break; } } } From 6b6dc63dfc8a09a7ad1f8f2670918f81c2b90f60 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 8 Nov 2018 01:14:17 +0100 Subject: [PATCH 066/143] Remove functions now present in geofunctions --- src/algorithms/PVT/libs/ls_pvt.cc | 5 +- src/algorithms/PVT/libs/pvt_solution.cc | 192 +----------------------- src/algorithms/PVT/libs/pvt_solution.h | 35 ----- 3 files changed, 9 insertions(+), 223 deletions(-) diff --git a/src/algorithms/PVT/libs/ls_pvt.cc b/src/algorithms/PVT/libs/ls_pvt.cc index f7c48b0aa..77e2c69a9 100644 --- a/src/algorithms/PVT/libs/ls_pvt.cc +++ b/src/algorithms/PVT/libs/ls_pvt.cc @@ -31,6 +31,7 @@ #include "ls_pvt.h" #include "GPS_L1_CA.h" +#include "geofunctions.h" #include #include #include @@ -235,12 +236,12 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs, double* azim = 0; double* elev = 0; double* dist = 0; - Ls_Pvt::topocent(azim, elev, dist, pos.subvec(0, 2), Rot_X - pos.subvec(0, 2)); + topocent(azim, elev, dist, pos.subvec(0, 2), Rot_X - pos.subvec(0, 2)); if (traveltime < 0.1 && nmbOfSatellites > 3) { //--- Find receiver's height - Ls_Pvt::togeod(&dphi, &dlambda, &h, 6378137.0, 298.257223563, pos(0), pos(1), pos(2)); + togeod(&dphi, &dlambda, &h, 6378137.0, 298.257223563, pos(0), pos(1), pos(2)); // Add troposphere correction if the receiver is below the troposphere if (h > 15000) { diff --git a/src/algorithms/PVT/libs/pvt_solution.cc b/src/algorithms/PVT/libs/pvt_solution.cc index 55c52324b..6071f38b0 100644 --- a/src/algorithms/PVT/libs/pvt_solution.cc +++ b/src/algorithms/PVT/libs/pvt_solution.cc @@ -31,6 +31,7 @@ #include "pvt_solution.h" #include "GPS_L1_CA.h" +#include "geofunctions.h" #include #include @@ -133,125 +134,6 @@ int Pvt_Solution::cart2geo(double X, double Y, double Z, int elipsoid_selection) } -int Pvt_Solution::togeod(double *dphi, double *dlambda, double *h, double a, double finv, double X, double Y, double Z) -{ - /* Subroutine to calculate geodetic coordinates latitude, longitude, - height given Cartesian coordinates X,Y,Z, and reference ellipsoid - values semi-major axis (a) and the inverse of flattening (finv). - - The output units of angular quantities will be in decimal degrees - (15.5 degrees not 15 deg 30 min). The output units of h will be the - same as the units of X,Y,Z,a. - - Inputs: - a - semi-major axis of the reference ellipsoid - finv - inverse of flattening of the reference ellipsoid - X,Y,Z - Cartesian coordinates - - Outputs: - dphi - latitude - dlambda - longitude - h - height above reference ellipsoid - - Based in a Matlab function by Kai Borre - */ - - *h = 0; - double tolsq = 1.e-10; // tolerance to accept convergence - int maxit = 10; // max number of iterations - double rtd = 180.0 / GPS_PI; - - // compute square of eccentricity - double esq; - if (finv < 1.0E-20) - { - esq = 0.0; - } - else - { - esq = (2.0 - 1.0 / finv) / finv; - } - - // first guess - double P = sqrt(X * X + Y * Y); // P is distance from spin axis - - //direct calculation of longitude - if (P > 1.0E-20) - { - *dlambda = atan2(Y, X) * rtd; - } - else - { - *dlambda = 0.0; - } - - // correct longitude bound - if (*dlambda < 0) - { - *dlambda = *dlambda + 360.0; - } - - double r = sqrt(P * P + Z * Z); // r is distance from origin (0,0,0) - - double sinphi; - if (r > 1.0E-20) - { - sinphi = Z / r; - } - else - { - sinphi = 0.0; - } - *dphi = asin(sinphi); - - // initial value of height = distance from origin minus - // approximate distance from origin to surface of ellipsoid - if (r < 1.0E-20) - { - *h = 0; - return 1; - } - - *h = r - a * (1 - sinphi * sinphi / finv); - - // iterate - double cosphi; - double N_phi; - double dP; - double dZ; - double oneesq = 1.0 - esq; - - for (int i = 0; i < maxit; i++) - { - sinphi = sin(*dphi); - cosphi = cos(*dphi); - - // compute radius of curvature in prime vertical direction - N_phi = a / sqrt(1 - esq * sinphi * sinphi); - - // compute residuals in P and Z - dP = P - (N_phi + (*h)) * cosphi; - dZ = Z - (N_phi * oneesq + (*h)) * sinphi; - - // update height and latitude - *h = *h + (sinphi * dZ + cosphi * dP); - *dphi = *dphi + (cosphi * dZ - sinphi * dP) / (N_phi + (*h)); - - // test for convergence - if ((dP * dP + dZ * dZ) < tolsq) - { - break; - } - if (i == (maxit - 1)) - { - LOG(WARNING) << "The computation of geodetic coordinates did not converge"; - } - } - *dphi = (*dphi) * rtd; - return 0; -} - - int Pvt_Solution::tropo(double *ddr_m, double sinel, double hsta_km, double p_mb, double t_kel, double hum, double hp_km, double htkel_km, double hhum_km) { /* Inputs: @@ -359,73 +241,6 @@ int Pvt_Solution::tropo(double *ddr_m, double sinel, double hsta_km, double p_mb } -int Pvt_Solution::topocent(double *Az, double *El, double *D, const arma::vec &x, const arma::vec &dx) -{ - /* Transformation of vector dx into topocentric coordinate - system with origin at x - Inputs: - x - vector origin coordinates (in ECEF system [X; Y; Z;]) - dx - vector ([dX; dY; dZ;]). - - Outputs: - D - vector length. Units like the input - Az - azimuth from north positive clockwise, degrees - El - elevation angle, degrees - - Based on a Matlab function by Kai Borre - */ - - double lambda; - double phi; - double h; - double dtr = GPS_PI / 180.0; - double a = 6378137.0; // semi-major axis of the reference ellipsoid WGS-84 - double finv = 298.257223563; // inverse of flattening of the reference ellipsoid WGS-84 - - // Transform x into geodetic coordinates - Pvt_Solution::togeod(&phi, &lambda, &h, a, finv, x(0), x(1), x(2)); - - double cl = cos(lambda * dtr); - double sl = sin(lambda * dtr); - double cb = cos(phi * dtr); - double sb = sin(phi * dtr); - - arma::mat F = {{-sl, -sb * cl, cb * cl}, - {cl, -sb * sl, cb * sl}, - {0, 0, cb, sb}}; - - arma::vec local_vector; - - local_vector = arma::htrans(F) * dx; - - double E = local_vector(0); - double N = local_vector(1); - double U = local_vector(2); - - double hor_dis; - hor_dis = sqrt(E * E + N * N); - - if (hor_dis < 1.0E-20) - { - *Az = 0; - *El = 90; - } - else - { - *Az = atan2(E, N) / dtr; - *El = atan2(U, hor_dis) / dtr; - } - - if (*Az < 0) - { - *Az = *Az + 360.0; - } - - *D = sqrt(dx(0) * dx(0) + dx(1) * dx(1) + dx(2) * dx(2)); - return 0; -} - - void Pvt_Solution::set_averaging_depth(int depth) { d_averaging_depth = depth; @@ -519,26 +334,31 @@ double Pvt_Solution::get_height() const return d_height_m; } + double Pvt_Solution::get_speed_over_ground() const { return d_speed_over_ground_m_s; } + void Pvt_Solution::set_speed_over_ground(double speed_m_s) { d_speed_over_ground_m_s = speed_m_s; } + void Pvt_Solution::set_course_over_ground(double cog_deg) { d_course_over_ground_d = cog_deg; } + double Pvt_Solution::get_course_over_ground() const { return d_course_over_ground_d; } + double Pvt_Solution::get_avg_latitude() const { return d_avg_latitude_d; diff --git a/src/algorithms/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h index 5c21de7c6..bfdc217b7 100644 --- a/src/algorithms/PVT/libs/pvt_solution.h +++ b/src/algorithms/PVT/libs/pvt_solution.h @@ -129,41 +129,6 @@ public: */ int cart2geo(double X, double Y, double Z, int elipsoid_selection); - /*! - * \brief Transformation of vector dx into topocentric coordinate system with origin at x - * - * \param[in] x Vector origin coordinates (in ECEF system [X; Y; Z;]) - * \param[in] dx Vector ([dX; dY; dZ;]). - * - * \param[out] D Vector length. Units like the input - * \param[out] Az Azimuth from north positive clockwise, degrees - * \param[out] El Elevation angle, degrees - * - * Based on a Matlab function by Kai Borre - */ - int topocent(double *Az, double *El, double *D, const arma::vec &x, const arma::vec &dx); - - /*! - * \brief Subroutine to calculate geodetic coordinates latitude, longitude, - * height given Cartesian coordinates X,Y,Z, and reference ellipsoid - * values semi-major axis (a) and the inverse of flattening (finv). - * - * The output units of angular quantities will be in decimal degrees - * (15.5 degrees not 15 deg 30 min). The output units of h will be the - * same as the units of X,Y,Z,a. - * - * \param[in] a - semi-major axis of the reference ellipsoid - * \param[in] finv - inverse of flattening of the reference ellipsoid - * \param[in] X,Y,Z - Cartesian coordinates - * - * \param[out] dphi - latitude - * \param[out] dlambda - longitude - * \param[out] h - height above reference ellipsoid - * - * Based in a Matlab function by Kai Borre - */ - int togeod(double *dphi, double *dlambda, double *h, double a, double finv, double X, double Y, double Z); - /*! * \brief Tropospheric correction * From ae7a6d686ebf5f0ca948023b0bc909dd462cb8ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Cebri=C3=A1n=20Juan?= Date: Tue, 6 Nov 2018 18:19:17 +0100 Subject: [PATCH 067/143] Record Speed and Course over ground in GPX output --- src/algorithms/PVT/libs/gpx_printer.cc | 31 +++++++++++++++++--------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/algorithms/PVT/libs/gpx_printer.cc b/src/algorithms/PVT/libs/gpx_printer.cc index f0b4b3ff3..1861139be 100644 --- a/src/algorithms/PVT/libs/gpx_printer.cc +++ b/src/algorithms/PVT/libs/gpx_printer.cc @@ -138,13 +138,15 @@ bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name) gpx_file << std::setprecision(14); gpx_file << "" << std::endl << "" << std::endl - << "" << std::endl - << indent << "Position fixes computed by GNSS-SDR v" << GNSS_SDR_VERSION << "" << std::endl - << indent << "GNSS-SDR position log generated at " << pt << " (local time)" << std::endl - << indent << "" << std::endl; + << indent << "xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v2 http://www.garmin.com/xmlschemas/TrackPointExtensionv2.xsd\"" << std::endl + << indent << "xmlns=\"http://www.topografix.com/GPX/1/1\"" << std::endl + << indent << "xmlns:gpxx=\"http://www.garmin.com/xmlschemas/GpxExtensions/v3\"" << std::endl + << indent << "xmlns:gpxtpx=\"http://www.garmin.com/xmlschemas/TrackPointExtension/v2\"" << std::endl + << indent << "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" << std::endl + << indent << "" << std::endl + << indent << indent << "Position fixes computed by GNSS-SDR v" << GNSS_SDR_VERSION << "" << std::endl + << indent << indent << "GNSS-SDR position log generated at " << pt << " (local time)" << std::endl + << indent << indent << "" << std::endl; return true; } else @@ -164,6 +166,9 @@ bool Gpx_Printer::print_position(const std::shared_ptr& position, positions_printed = true; std::shared_ptr position_ = position; + double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s + double course_over_ground = position_->get_course_over_ground(); // expressed in deg + double hdop = position_->get_hdop(); double vdop = position_->get_vdop(); double pdop = position_->get_pdop(); @@ -187,9 +192,13 @@ bool Gpx_Printer::print_position(const std::shared_ptr& position, if (gpx_file.is_open()) { - gpx_file << indent << indent << "" << height << "" + gpx_file << indent << indent << indent << "" << height << "" << "" - << "" << hdop << "" << vdop << "" << pdop << "" << std::endl; + << "" << hdop << "" << vdop << "" << pdop << "" + << "" + << "" << speed_over_ground << "" + << "" << course_over_ground << "" + << "" << std::endl; return true; } else @@ -203,8 +212,8 @@ bool Gpx_Printer::close_file() { if (gpx_file.is_open()) { - gpx_file << indent << "" << std::endl - << "" << std::endl + gpx_file << indent << indent << "" << std::endl + << indent << "" << std::endl << ""; gpx_file.close(); return true; From 686305da7174f26b8903a7c49c9bbf35cf09bb10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Cebri=C3=A1n=20Juan?= Date: Wed, 7 Nov 2018 14:01:46 +0100 Subject: [PATCH 068/143] Improve maintainability of indentation in KML files --- src/algorithms/PVT/libs/kml_printer.cc | 55 +++++++++++++------------- src/algorithms/PVT/libs/kml_printer.h | 1 + 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index 4ebfcb970..ddbbd9159 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -43,6 +43,7 @@ using google::LogMessage; Kml_Printer::Kml_Printer(const std::string& base_path) { positions_printed = false; + indent = " "; kml_base_path = base_path; boost::filesystem::path full_path(boost::filesystem::current_path()); const boost::filesystem::path p(kml_base_path); @@ -135,28 +136,27 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) kml_file << std::setprecision(14); kml_file << "" << std::endl << "" << std::endl - << " " << std::endl - << " GNSS Track" << std::endl - << " GNSS-SDR Receiver position log file created at " << pt - << " " << std::endl - << "" << std::endl - << "" << std::endl - << "GNSS-SDR PVT" << std::endl - << "GNSS-SDR position log" << std::endl - << "#yellowLineGreenPoly" << std::endl - << "" << std::endl - << "0" << std::endl - << "1" << std::endl - << "absolute" << std::endl - << "" << std::endl; + << indent << "" << std::endl + << indent << indent << "GNSS Track" << std::endl + << indent << indent << "GNSS-SDR Receiver position log file created at " << pt << "" << std::endl + << indent << indent << "" << std::endl + << indent << indent << "" << std::endl + << indent << indent << indent << "GNSS-SDR PVT" << std::endl + << indent << indent << indent << "GNSS-SDR position log" << std::endl + << indent << indent << indent << "#yellowLineGreenPoly" << std::endl + << indent << indent << indent << "" << std::endl + << indent << indent << indent << indent << "0" << std::endl + << indent << indent << indent << indent << "1" << std::endl + << indent << indent << indent << indent << "absolute" << std::endl + << indent << indent << indent << indent << "" << std::endl; return true; } else @@ -192,7 +192,8 @@ bool Kml_Printer::print_position(const std::shared_ptr& position, if (kml_file.is_open()) { - kml_file << longitude << "," << latitude << "," << height << std::endl; + kml_file << indent << indent << indent << indent << indent + << longitude << "," << latitude << "," << height << std::endl; return true; } else @@ -206,10 +207,10 @@ bool Kml_Printer::close_file() { if (kml_file.is_open()) { - kml_file << "" << std::endl - << "" << std::endl - << "" << std::endl - << "" << std::endl + kml_file << indent << indent << indent << indent << "" << std::endl + << indent << indent << indent << "" << std::endl + << indent << indent << "" << std::endl + << indent << "" << std::endl << ""; kml_file.close(); return true; diff --git a/src/algorithms/PVT/libs/kml_printer.h b/src/algorithms/PVT/libs/kml_printer.h index 9aed7c02c..c7f725e0b 100644 --- a/src/algorithms/PVT/libs/kml_printer.h +++ b/src/algorithms/PVT/libs/kml_printer.h @@ -50,6 +50,7 @@ private: std::ofstream kml_file; bool positions_printed; std::string kml_filename; + std::string indent; std::string kml_base_path; public: From 0e00b5eaa4c3b886d663531c25a6f82a079a0ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Cebri=C3=A1n=20Juan?= Date: Thu, 8 Nov 2018 03:44:31 +0100 Subject: [PATCH 069/143] Record Time, Speed over ground, Course over ground and Dilution of precision in KML output --- src/algorithms/PVT/libs/kml_printer.cc | 138 ++++++++++++++++++++++--- src/algorithms/PVT/libs/kml_printer.h | 10 +- 2 files changed, 128 insertions(+), 20 deletions(-) diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index ddbbd9159..fb742b385 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -2,6 +2,7 @@ * \file kml_printer.cc * \brief Implementation of a class that prints PVT information to a kml file * \author Javier Arribas, 2011. jarribas(at)cttc.es + * Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com * * * ------------------------------------------------------------------------- @@ -75,6 +76,14 @@ Kml_Printer::Kml_Printer(const std::string& base_path) } kml_base_path = kml_base_path + boost::filesystem::path::preferred_separator; + + boost::filesystem::path tmp_base_path = boost::filesystem::temp_directory_path(); + boost::filesystem::path tmp_filename = boost::filesystem::unique_path(); + boost::filesystem::path tmp_file = tmp_base_path / tmp_filename; + + tmp_file_str = tmp_file.string(); + + point_id = 0; } @@ -128,17 +137,61 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) kml_filename = kml_base_path + kml_filename; kml_file.open(kml_filename.c_str()); - if (kml_file.is_open()) + tmp_file.open(tmp_file_str.c_str()); + + if (kml_file.is_open() && tmp_file.is_open()) { DLOG(INFO) << "KML printer writing on " << filename.c_str(); // Set iostream numeric format and precision kml_file.setf(kml_file.fixed, kml_file.floatfield); kml_file << std::setprecision(14); + + tmp_file.setf(tmp_file.fixed, tmp_file.floatfield); + tmp_file << std::setprecision(14); + kml_file << "" << std::endl - << "" << std::endl + << "" << std::endl << indent << "" << std::endl << indent << indent << "GNSS Track" << std::endl - << indent << indent << "GNSS-SDR Receiver position log file created at " << pt << "" << std::endl + << indent << indent << "" << std::endl + << indent << indent << indent << indent << "GNSS-SDR Receiver position log file created at " << pt << "" << std::endl + << indent << indent << indent << indent << "https://gnss-sdr.org/" << std::endl + << indent << indent << indent << "" << std::endl + << indent << indent << "]]>" << std::endl + << indent << indent << "" << std::endl + << indent << indent << "" << std::endl + << indent << indent << "" << std::endl + << indent << indent << "" << std::endl + << indent << indent << "" << std::endl + << indent << indent << indent << "" << std::endl + << indent << indent << indent << indent << "normal" << std::endl + << indent << indent << indent << indent << "#track_n" << std::endl + << indent << indent << indent << "" << std::endl + << indent << indent << indent << "" << std::endl + << indent << indent << indent << indent << "highlight" << std::endl + << indent << indent << indent << indent << "#track_h" << std::endl + << indent << indent << indent << "" << std::endl + << indent << indent << "" << std::endl << indent << indent << "" << std::endl - << indent << indent << "" << std::endl - << indent << indent << indent << "GNSS-SDR PVT" << std::endl - << indent << indent << indent << "GNSS-SDR position log" << std::endl - << indent << indent << indent << "#yellowLineGreenPoly" << std::endl - << indent << indent << indent << "" << std::endl - << indent << indent << indent << indent << "0" << std::endl - << indent << indent << indent << indent << "1" << std::endl - << indent << indent << indent << indent << "absolute" << std::endl - << indent << indent << indent << indent << "" << std::endl; + << indent << indent << "" << std::endl + << indent << indent << indent << "Points" << std::endl; + return true; } else @@ -167,7 +214,7 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) } -bool Kml_Printer::print_position(const std::shared_ptr& position, bool print_average_values) +bool Kml_Printer::print_position(const std::shared_ptr& position, bool print_average_values) { double latitude; double longitude; @@ -175,7 +222,18 @@ bool Kml_Printer::print_position(const std::shared_ptr& position, positions_printed = true; - std::shared_ptr position_ = position; + std::shared_ptr position_ = position; + + double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s + double course_over_ground = position_->get_course_over_ground(); // expressed in deg + + double hdop = position_->get_hdop(); + double vdop = position_->get_vdop(); + double pdop = position_->get_pdop(); + std::string utc_time = to_iso_extended_string(position_->get_position_UTC_time()); + if (utc_time.length() < 23) utc_time += "."; + utc_time.resize(23, '0'); // time up to ms + utc_time.append("Z"); // UTC time zone if (print_average_values == false) { @@ -190,10 +248,38 @@ bool Kml_Printer::print_position(const std::shared_ptr& position, height = position_->get_avg_height(); } - if (kml_file.is_open()) + if (kml_file.is_open() && tmp_file.is_open()) { - kml_file << indent << indent << indent << indent << indent + point_id++; + kml_file << indent << indent << indent << "" << std::endl + << indent << indent << indent << indent << "" << point_id << "" << std::endl + << indent << indent << indent << indent << "" << std::endl + << indent << indent << indent << indent << "" << std::endl + << indent << indent << indent << indent << indent << indent << "Time:" << utc_time << "" << std::endl + << indent << indent << indent << indent << indent << indent << "Longitude:" << longitude << "deg" << std::endl + << indent << indent << indent << indent << indent << indent << "Latitude:" << latitude << "deg" << std::endl + << indent << indent << indent << indent << indent << indent << "Altitude:" << height << "m" << std::endl + << indent << indent << indent << indent << indent << indent << "Speed:" << speed_over_ground << "m/s" << std::endl + << indent << indent << indent << indent << indent << indent << "Course:" << course_over_ground << "deg" << std::endl + << indent << indent << indent << indent << indent << indent << "HDOP:" << hdop << "" << std::endl + << indent << indent << indent << indent << indent << indent << "VDOP:" << vdop << "" << std::endl + << indent << indent << indent << indent << indent << indent << "PDOP:" << pdop << "" << std::endl + << indent << indent << indent << indent << indent << "" << std::endl + << indent << indent << indent << indent << "]]>" << std::endl + << indent << indent << indent << indent << "" << std::endl + << indent << indent << indent << indent << indent << "" << utc_time << "" << std::endl + << indent << indent << indent << indent << "" << std::endl + << indent << indent << indent << indent << "#track" << std::endl + << indent << indent << indent << indent << "" << std::endl + << indent << indent << indent << indent << indent << "absolute" << std::endl + << indent << indent << indent << indent << indent << "" << longitude << "," << latitude << "," << height << "" << std::endl + << indent << indent << indent << indent << "" << std::endl + << indent << indent << indent << "" << std::endl; + + tmp_file << indent << indent << indent << indent << indent << longitude << "," << latitude << "," << height << std::endl; + return true; } else @@ -205,14 +291,32 @@ bool Kml_Printer::print_position(const std::shared_ptr& position, bool Kml_Printer::close_file() { - if (kml_file.is_open()) + if (kml_file.is_open() && tmp_file.is_open()) { + tmp_file.close(); + + kml_file << indent << indent << "" + << indent << indent << "" << std::endl + << indent << indent << indent << "Path" << std::endl + << indent << indent << indent << "#yellowLineGreenPoly" << std::endl + << indent << indent << indent << "" << std::endl + << indent << indent << indent << indent << "0" << std::endl + << indent << indent << indent << indent << "1" << std::endl + << indent << indent << indent << indent << "absolute" << std::endl + << indent << indent << indent << indent << "" << std::endl; + + // Copy the contents of tmp_file into kml_file + std::ifstream src(tmp_file_str, std::ios::binary); + kml_file << src.rdbuf(); + kml_file << indent << indent << indent << indent << "" << std::endl << indent << indent << indent << "" << std::endl << indent << indent << "" << std::endl << indent << "" << std::endl << ""; + kml_file.close(); + return true; } else diff --git a/src/algorithms/PVT/libs/kml_printer.h b/src/algorithms/PVT/libs/kml_printer.h index c7f725e0b..27225df7a 100644 --- a/src/algorithms/PVT/libs/kml_printer.h +++ b/src/algorithms/PVT/libs/kml_printer.h @@ -2,7 +2,7 @@ * \file kml_printer.h * \brief Interface of a class that prints PVT information to a kml file * \author Javier Arribas, 2011. jarribas(at)cttc.es - * + * Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com * * ------------------------------------------------------------------------- * @@ -34,6 +34,7 @@ #define GNSS_SDR_KML_PRINTER_H_ #include "pvt_solution.h" +#include "rtklib_solver.h" #include #include #include @@ -48,16 +49,19 @@ class Kml_Printer { private: std::ofstream kml_file; + std::ofstream tmp_file; bool positions_printed; std::string kml_filename; - std::string indent; std::string kml_base_path; + std::string tmp_file_str; + unsigned int point_id; + std::string indent; public: Kml_Printer(const std::string& base_path = std::string(".")); ~Kml_Printer(); bool set_headers(std::string filename, bool time_tag_name = true); - bool print_position(const std::shared_ptr& position, bool print_average_values); + bool print_position(const std::shared_ptr& position, bool print_average_values); bool close_file(); }; From b8a412895ab9ccaccca7df50da90be70782be594 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 8 Nov 2018 10:02:52 +0100 Subject: [PATCH 070/143] Deactivate the NMEA printer if not used --- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 20 ++++++++++++++----- .../PVT/gnuradio_blocks/rtklib_pvt_cc.h | 1 + 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 7f4d311db..cf1591909 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -357,7 +357,15 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, } // initialize nmea_printer - d_nmea_printer = std::make_shared(conf_.nmea_dump_filename, conf_.nmea_output_file_enabled, conf_.flag_nmea_tty_port, conf_.nmea_dump_devname, conf_.nmea_output_file_path); + d_nmea_output_file_enabled = (conf_.nmea_output_file_enabled or conf_.flag_nmea_tty_port); + if (d_nmea_output_file_enabled) + { + d_nmea_printer = std::make_shared(conf_.nmea_dump_filename, conf_.nmea_output_file_enabled, conf_.flag_nmea_tty_port, conf_.nmea_dump_devname, conf_.nmea_output_file_path); + } + else + { + d_nmea_printer = nullptr; + } // initialize rtcm_printer std::string rtcm_dump_filename; @@ -1029,10 +1037,12 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item //save_gnss_synchro_map_xml("./gnss_synchro_map.xml"); //getchar(); //stop the execution //end debug - - if (current_RX_time_ms % d_display_rate_ms == 0) + if (d_display_rate_ms != 0) { - flag_display_pvt = true; + if (current_RX_time_ms % d_display_rate_ms == 0) + { + flag_display_pvt = true; + } } if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { @@ -1106,7 +1116,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (d_kml_output_enabled) d_kml_dump->print_position(d_ls_pvt, false); if (d_gpx_output_enabled) d_gpx_dump->print_position(d_ls_pvt, false); if (d_geojson_output_enabled) d_geojson_printer->print_position(d_ls_pvt, false); - d_nmea_printer->Print_Nmea_Line(d_ls_pvt, false); + if (d_nmea_output_file_enabled) d_nmea_printer->Print_Nmea_Line(d_ls_pvt, false); /* * TYPE | RECEIVER diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index c26f923d4..dfb59cd1e 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -111,6 +111,7 @@ private: bool d_geojson_output_enabled; bool d_gpx_output_enabled; bool d_kml_output_enabled; + bool d_nmea_output_file_enabled; std::shared_ptr d_ls_pvt; From 98726ef036e4654046145203e57e9764e52a3d5a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 8 Nov 2018 14:25:38 +0100 Subject: [PATCH 071/143] Improve const correctess, change name of variable to a more meaningful name --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 16 +- src/algorithms/PVT/adapters/rtklib_pvt.h | 8 +- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 928 +++++++++--------- .../PVT/gnuradio_blocks/rtklib_pvt_cc.h | 11 +- src/core/interfaces/pvt_interface.h | 8 +- 5 files changed, 492 insertions(+), 479 deletions(-) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 126813e26..05ea52e5f 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -536,23 +536,31 @@ RtklibPvt::~RtklibPvt() rtkfree(&rtk); } -std::map RtklibPvt::get_gps_ephemeris() + +std::map RtklibPvt::get_gps_ephemeris() const { return pvt_->get_gps_ephemeris_map(); } -std::map RtklibPvt::get_galileo_ephemeris() + + +std::map RtklibPvt::get_galileo_ephemeris() const { return pvt_->get_galileo_ephemeris_map(); } -std::map RtklibPvt::get_gps_almanac() + + +std::map RtklibPvt::get_gps_almanac() const { return pvt_->get_gps_almanac_map(); } -std::map RtklibPvt::get_galileo_almanac() + + +std::map RtklibPvt::get_galileo_almanac() const { return pvt_->get_galileo_almanac_map(); } + void RtklibPvt::connect(gr::top_block_sptr top_block) { if (top_block) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.h b/src/algorithms/PVT/adapters/rtklib_pvt.h index 78d22f2b3..bc753a560 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.h +++ b/src/algorithms/PVT/adapters/rtklib_pvt.h @@ -64,10 +64,10 @@ public: } void clear_ephemeris() override; - std::map get_gps_ephemeris() override; - std::map get_galileo_ephemeris() override; - std::map get_gps_almanac() override; - std::map get_galileo_almanac() override; + std::map get_gps_ephemeris() const override; + std::map get_galileo_ephemeris() const override; + std::map get_gps_almanac() const override; + std::map get_galileo_almanac() const override; void connect(gr::top_block_sptr top_block) override; void disconnect(gr::top_block_sptr top_block) override; diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index cf1591909..7e6753b48 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -83,14 +83,14 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) << "inserted with Toe=" << gps_eph->d_Toe << " and GPS Week=" << gps_eph->i_GPS_week; // update/insert new ephemeris record to the global ephemeris map - d_ls_pvt->gps_ephemeris_map[gps_eph->i_satellite_PRN] = *gps_eph; + d_pvt_solver->gps_ephemeris_map[gps_eph->i_satellite_PRN] = *gps_eph; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### GPS IONO ### std::shared_ptr gps_iono; gps_iono = boost::any_cast>(pmt::any_ref(msg)); - d_ls_pvt->gps_iono = *gps_iono; + d_pvt_solver->gps_iono = *gps_iono; DLOG(INFO) << "New IONO record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -98,7 +98,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) // ### GPS UTC MODEL ### std::shared_ptr gps_utc_model; gps_utc_model = boost::any_cast>(pmt::any_ref(msg)); - d_ls_pvt->gps_utc_model = *gps_utc_model; + d_pvt_solver->gps_utc_model = *gps_utc_model; DLOG(INFO) << "New UTC record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -107,7 +107,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) std::shared_ptr gps_cnav_ephemeris; gps_cnav_ephemeris = boost::any_cast>(pmt::any_ref(msg)); // update/insert new ephemeris record to the global ephemeris map - d_ls_pvt->gps_cnav_ephemeris_map[gps_cnav_ephemeris->i_satellite_PRN] = *gps_cnav_ephemeris; + d_pvt_solver->gps_cnav_ephemeris_map[gps_cnav_ephemeris->i_satellite_PRN] = *gps_cnav_ephemeris; DLOG(INFO) << "New GPS CNAV ephemeris record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -115,7 +115,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) // ### GPS CNAV IONO ### std::shared_ptr gps_cnav_iono; gps_cnav_iono = boost::any_cast>(pmt::any_ref(msg)); - d_ls_pvt->gps_cnav_iono = *gps_cnav_iono; + d_pvt_solver->gps_cnav_iono = *gps_cnav_iono; DLOG(INFO) << "New CNAV IONO record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -123,7 +123,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) // ### GPS CNAV UTC MODEL ### std::shared_ptr gps_cnav_utc_model; gps_cnav_utc_model = boost::any_cast>(pmt::any_ref(msg)); - d_ls_pvt->gps_cnav_utc_model = *gps_cnav_utc_model; + d_pvt_solver->gps_cnav_utc_model = *gps_cnav_utc_model; DLOG(INFO) << "New CNAV UTC record has arrived "; } @@ -132,7 +132,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) // ### GPS ALMANAC ### std::shared_ptr gps_almanac; gps_almanac = boost::any_cast>(pmt::any_ref(msg)); - d_ls_pvt->gps_almanac_map[gps_almanac->i_satellite_PRN] = *gps_almanac; + d_pvt_solver->gps_almanac_map[gps_almanac->i_satellite_PRN] = *gps_almanac; DLOG(INFO) << "New GPS almanac record has arrived "; } @@ -147,14 +147,14 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) << ", GALILEO Week Number =" << galileo_eph->WN_5 << " and Ephemeris IOD = " << galileo_eph->IOD_ephemeris; // update/insert new ephemeris record to the global ephemeris map - d_ls_pvt->galileo_ephemeris_map[galileo_eph->i_satellite_PRN] = *galileo_eph; + d_pvt_solver->galileo_ephemeris_map[galileo_eph->i_satellite_PRN] = *galileo_eph; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### Galileo IONO ### std::shared_ptr galileo_iono; galileo_iono = boost::any_cast>(pmt::any_ref(msg)); - d_ls_pvt->galileo_iono = *galileo_iono; + d_pvt_solver->galileo_iono = *galileo_iono; DLOG(INFO) << "New IONO record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -162,7 +162,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) // ### Galileo UTC MODEL ### std::shared_ptr galileo_utc_model; galileo_utc_model = boost::any_cast>(pmt::any_ref(msg)); - d_ls_pvt->galileo_utc_model = *galileo_utc_model; + d_pvt_solver->galileo_utc_model = *galileo_utc_model; DLOG(INFO) << "New UTC record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -175,9 +175,9 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) Galileo_Almanac sv2 = galileo_almanac_helper->get_almanac(2); Galileo_Almanac sv3 = galileo_almanac_helper->get_almanac(3); - if (sv1.i_satellite_PRN != 0) d_ls_pvt->galileo_almanac_map[sv1.i_satellite_PRN] = sv1; - if (sv2.i_satellite_PRN != 0) d_ls_pvt->galileo_almanac_map[sv2.i_satellite_PRN] = sv2; - if (sv3.i_satellite_PRN != 0) d_ls_pvt->galileo_almanac_map[sv3.i_satellite_PRN] = sv3; + if (sv1.i_satellite_PRN != 0) d_pvt_solver->galileo_almanac_map[sv1.i_satellite_PRN] = sv1; + if (sv2.i_satellite_PRN != 0) d_pvt_solver->galileo_almanac_map[sv2.i_satellite_PRN] = sv2; + if (sv3.i_satellite_PRN != 0) d_pvt_solver->galileo_almanac_map[sv3.i_satellite_PRN] = sv3; DLOG(INFO) << "New Galileo Almanac data have arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -186,7 +186,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) std::shared_ptr galileo_alm; galileo_alm = boost::any_cast>(pmt::any_ref(msg)); // update/insert new almanac record to the global almanac map - d_ls_pvt->galileo_almanac_map[galileo_alm->i_satellite_PRN] = *galileo_alm; + d_pvt_solver->galileo_almanac_map[galileo_alm->i_satellite_PRN] = *galileo_alm; } // **************** GLONASS GNAV Telemetry ************************** @@ -202,14 +202,14 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) << " and Ephemeris IOD in UTC = " << glonass_gnav_eph->compute_GLONASS_time(glonass_gnav_eph->d_t_b) << " from SV = " << glonass_gnav_eph->i_satellite_slot_number; // update/insert new ephemeris record to the global ephemeris map - d_ls_pvt->glonass_gnav_ephemeris_map[glonass_gnav_eph->i_satellite_PRN] = *glonass_gnav_eph; + d_pvt_solver->glonass_gnav_ephemeris_map[glonass_gnav_eph->i_satellite_PRN] = *glonass_gnav_eph; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### GLONASS GNAV UTC MODEL ### std::shared_ptr glonass_gnav_utc_model; glonass_gnav_utc_model = boost::any_cast>(pmt::any_ref(msg)); - d_ls_pvt->glonass_gnav_utc_model = *glonass_gnav_utc_model; + d_pvt_solver->glonass_gnav_utc_model = *glonass_gnav_utc_model; DLOG(INFO) << "New GLONASS GNAV UTC record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -217,7 +217,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) // ### GLONASS GNAV Almanac ### std::shared_ptr glonass_gnav_almanac; glonass_gnav_almanac = boost::any_cast>(pmt::any_ref(msg)); - d_ls_pvt->glonass_gnav_almanac = *glonass_gnav_almanac; + d_pvt_solver->glonass_gnav_almanac = *glonass_gnav_almanac; DLOG(INFO) << "New GLONASS GNAV Almanac has arrived " << ", GLONASS GNAV Slot Number =" << glonass_gnav_almanac->d_n_A; } @@ -233,33 +233,39 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) } -std::map rtklib_pvt_cc::get_gps_ephemeris_map() +std::map rtklib_pvt_cc::get_gps_ephemeris_map() const { - return d_ls_pvt->gps_ephemeris_map; + return d_pvt_solver->gps_ephemeris_map; } -std::map rtklib_pvt_cc::get_gps_almanac_map() + +std::map rtklib_pvt_cc::get_gps_almanac_map() const { - return d_ls_pvt->gps_almanac_map; + return d_pvt_solver->gps_almanac_map; } -std::map rtklib_pvt_cc::get_galileo_ephemeris_map() + +std::map rtklib_pvt_cc::get_galileo_ephemeris_map() const { - return d_ls_pvt->galileo_ephemeris_map; + return d_pvt_solver->galileo_ephemeris_map; } -std::map rtklib_pvt_cc::get_galileo_almanac_map() + + +std::map rtklib_pvt_cc::get_galileo_almanac_map() const { - return d_ls_pvt->galileo_almanac_map; + return d_pvt_solver->galileo_almanac_map; } + void rtklib_pvt_cc::clear_ephemeris() { - d_ls_pvt->gps_ephemeris_map.clear(); - d_ls_pvt->gps_almanac_map.clear(); - d_ls_pvt->galileo_ephemeris_map.clear(); - d_ls_pvt->galileo_almanac_map.clear(); + d_pvt_solver->gps_ephemeris_map.clear(); + d_pvt_solver->gps_almanac_map.clear(); + d_pvt_solver->galileo_ephemeris_map.clear(); + d_pvt_solver->galileo_almanac_map.clear(); } + rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, const Pvt_Conf& conf_, rtk_t& rtk) : gr::sync_block("rtklib_pvt_cc", @@ -494,8 +500,8 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, xml_base_path = xml_base_path + boost::filesystem::path::preferred_separator; } - d_ls_pvt = std::make_shared(static_cast(nchannels), dump_ls_pvt_filename, d_dump, d_dump_mat, rtk); - d_ls_pvt->set_averaging_depth(1); + d_pvt_solver = std::make_shared(static_cast(nchannels), dump_ls_pvt_filename, d_dump, d_dump_mat, rtk); + d_pvt_solver->set_averaging_depth(1); d_rx_time = 0.0; @@ -521,14 +527,14 @@ rtklib_pvt_cc::~rtklib_pvt_cc() { // save GPS L2CM ephemeris to XML file std::string file_name = xml_base_path + "gps_cnav_ephemeris.xml"; - if (d_ls_pvt->gps_cnav_ephemeris_map.empty() == false) + if (d_pvt_solver->gps_cnav_ephemeris_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_cnav_ephemeris_map", d_ls_pvt->gps_cnav_ephemeris_map); + xml << boost::serialization::make_nvp("GNSS-SDR_cnav_ephemeris_map", d_pvt_solver->gps_cnav_ephemeris_map); LOG(INFO) << "Saved GPS L2CM or L5 Ephemeris map data"; } catch (std::exception& e) @@ -543,14 +549,14 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // save GPS L1 CA ephemeris to XML file file_name = xml_base_path + "gps_ephemeris.xml"; - if (d_ls_pvt->gps_ephemeris_map.empty() == false) + if (d_pvt_solver->gps_ephemeris_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_ls_pvt->gps_ephemeris_map); + xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_pvt_solver->gps_ephemeris_map); LOG(INFO) << "Saved GPS L1 CA Ephemeris map data"; } catch (const std::exception& e) @@ -565,14 +571,14 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // save Galileo E1 ephemeris to XML file file_name = xml_base_path + "gal_ephemeris.xml"; - if (d_ls_pvt->galileo_ephemeris_map.empty() == false) + if (d_pvt_solver->galileo_ephemeris_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gal_ephemeris_map", d_ls_pvt->galileo_ephemeris_map); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_ephemeris_map", d_pvt_solver->galileo_ephemeris_map); LOG(INFO) << "Saved Galileo E1 Ephemeris map data"; } catch (const std::exception& e) @@ -587,14 +593,14 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // save GLONASS GNAV ephemeris to XML file file_name = xml_base_path + "eph_GLONASS_GNAV.xml"; - if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false) + if (d_pvt_solver->glonass_gnav_ephemeris_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_ls_pvt->glonass_gnav_ephemeris_map); + xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_pvt_solver->glonass_gnav_ephemeris_map); LOG(INFO) << "Saved GLONASS GNAV Ephemeris map data"; } catch (std::exception& e) @@ -609,14 +615,14 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // Save GPS UTC model parameters file_name = xml_base_path + "gps_utc_model.xml"; - if (d_ls_pvt->gps_utc_model.valid) + if (d_pvt_solver->gps_utc_model.valid) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_utc_model", d_ls_pvt->gps_utc_model); + xml << boost::serialization::make_nvp("GNSS-SDR_utc_model", d_pvt_solver->gps_utc_model); LOG(INFO) << "Saved GPS UTC model parameters"; } catch (std::exception& e) @@ -631,14 +637,14 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // Save Galileo UTC model parameters file_name = xml_base_path + "gal_utc_model.xml"; - if (d_ls_pvt->galileo_utc_model.Delta_tLS_6 != 0.0) + if (d_pvt_solver->galileo_utc_model.Delta_tLS_6 != 0.0) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gal_utc_model", d_ls_pvt->galileo_utc_model); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_utc_model", d_pvt_solver->galileo_utc_model); LOG(INFO) << "Saved Galileo UTC model parameters"; } catch (std::exception& e) @@ -653,14 +659,14 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // Save GPS iono parameters file_name = xml_base_path + "gps_iono.xml"; - if (d_ls_pvt->gps_iono.valid == true) + if (d_pvt_solver->gps_iono.valid == true) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_iono_model", d_ls_pvt->gps_iono); + xml << boost::serialization::make_nvp("GNSS-SDR_iono_model", d_pvt_solver->gps_iono); LOG(INFO) << "Saved GPS ionospheric model parameters"; } catch (std::exception& e) @@ -675,14 +681,14 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // Save GPS CNAV iono parameters file_name = xml_base_path + "gps_cnav_iono.xml"; - if (d_ls_pvt->gps_cnav_iono.valid == true) + if (d_pvt_solver->gps_cnav_iono.valid == true) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_cnav_iono_model", d_ls_pvt->gps_cnav_iono); + xml << boost::serialization::make_nvp("GNSS-SDR_cnav_iono_model", d_pvt_solver->gps_cnav_iono); LOG(INFO) << "Saved GPS CNAV ionospheric model parameters"; } catch (std::exception& e) @@ -697,14 +703,14 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // Save Galileo iono parameters file_name = xml_base_path + "gal_iono.xml"; - if (d_ls_pvt->galileo_iono.ai0_5 != 0.0) + if (d_pvt_solver->galileo_iono.ai0_5 != 0.0) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gal_iono_model", d_ls_pvt->galileo_iono); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_iono_model", d_pvt_solver->galileo_iono); LOG(INFO) << "Saved Galileo ionospheric model parameters"; } catch (std::exception& e) @@ -719,14 +725,14 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // save GPS almanac to XML file file_name = xml_base_path + "gps_almanac.xml"; - if (d_ls_pvt->gps_almanac_map.empty() == false) + if (d_pvt_solver->gps_almanac_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gps_almanac_map", d_ls_pvt->gps_almanac_map); + xml << boost::serialization::make_nvp("GNSS-SDR_gps_almanac_map", d_pvt_solver->gps_almanac_map); LOG(INFO) << "Saved GPS almanac map data"; } catch (const std::exception& e) @@ -741,14 +747,14 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // Save Galileo almanac file_name = xml_base_path + "gal_almanac.xml"; - if (d_ls_pvt->galileo_almanac_map.empty() == false) + if (d_pvt_solver->galileo_almanac_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gal_almanac_map", d_ls_pvt->galileo_almanac_map); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_almanac_map", d_pvt_solver->galileo_almanac_map); LOG(INFO) << "Saved Galileo almanac data"; } catch (std::exception& e) @@ -763,14 +769,14 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // Save GPS CNAV UTC model parameters file_name = xml_base_path + "gps_cnav_utc_model.xml"; - if (d_ls_pvt->gps_cnav_utc_model.valid) + if (d_pvt_solver->gps_cnav_utc_model.valid) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_cnav_utc_model", d_ls_pvt->gps_cnav_utc_model); + xml << boost::serialization::make_nvp("GNSS-SDR_cnav_utc_model", d_pvt_solver->gps_cnav_utc_model); LOG(INFO) << "Saved GPS CNAV UTC model parameters"; } catch (std::exception& e) @@ -785,14 +791,14 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // save GLONASS GNAV ephemeris to XML file file_name = xml_base_path + "glo_gnav_ephemeris.xml"; - if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false) + if (d_pvt_solver->glonass_gnav_ephemeris_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_ls_pvt->glonass_gnav_ephemeris_map); + xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_pvt_solver->glonass_gnav_ephemeris_map); LOG(INFO) << "Saved GLONASS GNAV ephemeris map data"; } catch (std::exception& e) @@ -807,14 +813,14 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // save GLONASS UTC model parameters to XML file file_name = xml_base_path + "glo_utc_model.xml"; - if (d_ls_pvt->glonass_gnav_utc_model.valid) + if (d_pvt_solver->glonass_gnav_utc_model.valid) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gnav_utc_model", d_ls_pvt->glonass_gnav_utc_model); + xml << boost::serialization::make_nvp("GNSS-SDR_gnav_utc_model", d_pvt_solver->glonass_gnav_utc_model); LOG(INFO) << "Saved GLONASS UTC model parameters"; } catch (std::exception& e) @@ -908,14 +914,14 @@ bool rtklib_pvt_cc::get_latest_PVT(double* longitude_deg, time_t* UTC_time) { gr::thread::scoped_lock lock(d_setlock); - if (d_ls_pvt->is_valid_position()) + if (d_pvt_solver->is_valid_position()) { - *latitude_deg = d_ls_pvt->get_latitude(); - *longitude_deg = d_ls_pvt->get_longitude(); - *height_m = d_ls_pvt->get_height(); - *ground_speed_kmh = d_ls_pvt->get_speed_over_ground() * 3600.0 / 1000.0; - *course_over_ground_deg = d_ls_pvt->get_course_over_ground(); - *UTC_time = to_time_t(d_ls_pvt->get_position_UTC_time()); + *latitude_deg = d_pvt_solver->get_latitude(); + *longitude_deg = d_pvt_solver->get_longitude(); + *height_m = d_pvt_solver->get_height(); + *ground_speed_kmh = d_pvt_solver->get_speed_over_ground() * 3600.0 / 1000.0; + *course_over_ground_deg = d_pvt_solver->get_course_over_ground(); + *UTC_time = to_time_t(d_pvt_solver->get_position_UTC_time()); return true; } @@ -949,10 +955,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (in[i][epoch].Flag_valid_pseudorange) { - std::map::const_iterator tmp_eph_iter_gps = d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN); - std::map::const_iterator tmp_eph_iter_gal = d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN); - std::map::const_iterator tmp_eph_iter_cnav = d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN); - std::map::const_iterator tmp_eph_iter_glo_gnav = d_ls_pvt->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN); + std::map::const_iterator tmp_eph_iter_gps = d_pvt_solver->gps_ephemeris_map.find(in[i][epoch].PRN); + std::map::const_iterator tmp_eph_iter_gal = d_pvt_solver->galileo_ephemeris_map.find(in[i][epoch].PRN); + std::map::const_iterator tmp_eph_iter_cnav = d_pvt_solver->gps_cnav_ephemeris_map.find(in[i][epoch].PRN); + std::map::const_iterator tmp_eph_iter_glo_gnav = d_pvt_solver->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN); if (((tmp_eph_iter_gps->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("1C") == 0)) or ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("2S") == 0)) or ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("1B") == 0)) or ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("5X") == 0)) or ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("1G") == 0)) or ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("2G") == 0)) or ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal).compare("L5") == 0))) { // store valid observables in a map. @@ -962,32 +968,32 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { try { - if (d_ls_pvt->gps_ephemeris_map.empty() == false) + if (d_pvt_solver->gps_ephemeris_map.empty() == false) { - if (tmp_eph_iter_gps != d_ls_pvt->gps_ephemeris_map.cend()) + if (tmp_eph_iter_gps != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->lock_time(d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + d_rtcm_printer->lock_time(d_pvt_solver->gps_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } - if (d_ls_pvt->galileo_ephemeris_map.empty() == false) + if (d_pvt_solver->galileo_ephemeris_map.empty() == false) { - if (tmp_eph_iter_gal != d_ls_pvt->galileo_ephemeris_map.cend()) + if (tmp_eph_iter_gal != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->lock_time(d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + d_rtcm_printer->lock_time(d_pvt_solver->galileo_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } - if (d_ls_pvt->gps_cnav_ephemeris_map.empty() == false) + if (d_pvt_solver->gps_cnav_ephemeris_map.empty() == false) { - if (tmp_eph_iter_cnav != d_ls_pvt->gps_cnav_ephemeris_map.cend()) + if (tmp_eph_iter_cnav != d_pvt_solver->gps_cnav_ephemeris_map.cend()) { - d_rtcm_printer->lock_time(d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + d_rtcm_printer->lock_time(d_pvt_solver->gps_cnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } - if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false) + if (d_pvt_solver->glonass_gnav_ephemeris_map.empty() == false) { - if (tmp_eph_iter_glo_gnav != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (tmp_eph_iter_glo_gnav != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->lock_time(d_ls_pvt->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + d_rtcm_printer->lock_time(d_pvt_solver->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } } @@ -1022,15 +1028,15 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_compute_pvt_output == true) { // receiver clock correction is disabled to be coherent with the RINEX and RTCM standard - // std::cout << TEXT_RED << "(internal) accumulated RX clock offset: " << d_ls_pvt->get_time_offset_s() << "[s]" << TEXT_RESET << std::endl; + // std::cout << TEXT_RED << "(internal) accumulated RX clock offset: " << d_pvt_solver->get_time_offset_s() << "[s]" << TEXT_RESET << std::endl; // for (std::map::iterator it = gnss_observables_map.begin(); it != gnss_observables_map.cend(); ++it) // { // todo: check if it has effect to correct the receiver time for the internal pvt solution // take into account that the RINEX obs with the RX time (integer ms) CAN NOT be corrected to keep the coherence in obs time - // it->second.Pseudorange_m = it->second.Pseudorange_m - d_ls_pvt->get_time_offset_s() * GPS_C_m_s; + // it->second.Pseudorange_m = it->second.Pseudorange_m - d_pvt_solver->get_time_offset_s() * GPS_C_m_s; // } - if (d_ls_pvt->get_PVT(gnss_observables_map, false)) + if (d_pvt_solver->get_PVT(gnss_observables_map, false)) { //Optional debug code: export observables snapshot for rtklib unit testing //std::cout << "step 1: save gnss_synchro map" << std::endl; @@ -1102,9 +1108,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (first_fix == true) { - std::cout << "First position fix at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time()) - << " UTC is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude() - << " [deg], Height= " << d_ls_pvt->get_height() << " [m]" << std::endl; + std::cout << "First position fix at " << boost::posix_time::to_simple_string(d_pvt_solver->get_position_UTC_time()) + << " UTC is Lat = " << d_pvt_solver->get_latitude() << " [deg], Long = " << d_pvt_solver->get_longitude() + << " [deg], Height= " << d_pvt_solver->get_height() << " [m]" << std::endl; ttff_msgbuf ttff; ttff.mtype = 1; end = std::chrono::system_clock::now(); @@ -1113,10 +1119,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item send_sys_v_ttff_msg(ttff); first_fix = false; } - if (d_kml_output_enabled) d_kml_dump->print_position(d_ls_pvt, false); - if (d_gpx_output_enabled) d_gpx_dump->print_position(d_ls_pvt, false); - if (d_geojson_output_enabled) d_geojson_printer->print_position(d_ls_pvt, false); - if (d_nmea_output_file_enabled) d_nmea_printer->Print_Nmea_Line(d_ls_pvt, false); + if (d_kml_output_enabled) d_kml_dump->print_position(d_pvt_solver, false); + if (d_gpx_output_enabled) d_gpx_dump->print_position(d_pvt_solver, false); + if (d_geojson_output_enabled) d_geojson_printer->print_position(d_pvt_solver, false); + if (d_nmea_output_file_enabled) d_nmea_printer->Print_Nmea_Line(d_pvt_solver, false); /* * TYPE | RECEIVER @@ -1164,241 +1170,241 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::map::const_iterator glonass_gnav_ephemeris_iter; if (!b_rinex_header_written) // & we have utc data in nav message! { - galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + galileo_ephemeris_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + gps_ephemeris_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + gps_cnav_ephemeris_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); switch (type_of_rx) { case 1: // GPS L1 C/A only - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) + if (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time); - rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); + rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 2: // GPS L2C only - if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) + if (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) { std::string signal("2S"); rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model); + rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_cnav_iono, d_pvt_solver->gps_cnav_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 3: // GPS L5 only - if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) + if (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) { std::string signal("L5"); rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model); + rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_cnav_iono, d_pvt_solver->gps_cnav_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 4: // Galileo E1B only - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->rinex_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 5: // Galileo E5a only - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { std::string signal("5X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->rinex_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 6: // Galileo E5b only - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { std::string signal("7X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->rinex_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 7: // GPS L1 C/A + GPS L2C - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { std::string signal("1C 2S"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); + rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 8: // GPS L1 + GPS L5 - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { std::string signal("1C L5"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); + rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 9: // GPS L1 C/A + Galileo E1B - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) + if ((galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) { std::string gal_signal("1B"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 10: // GPS L1 C/A + Galileo E5a - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) + if ((galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) { std::string gal_signal("5X"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 11: // GPS L1 C/A + Galileo E5b - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) + if ((galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) { std::string gal_signal("7X"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 13: // L5+E5a - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + if ((galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { std::string gal_signal("5X"); std::string gps_signal("L5"); rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_cnav_iono, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 14: // Galileo E1B + Galileo E5a - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) + if ((galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 5X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->rinex_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 15: // Galileo E1B + Galileo E5b - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) + if ((galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 7X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->rinex_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 23: // GLONASS L1 C/A only - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { std::string signal("1G"); rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + rp->rinex_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); b_rinex_header_written = true; // do not write header anymore } break; case 24: // GLONASS L2 C/A only - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { std::string signal("2G"); rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + rp->rinex_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); b_rinex_header_written = true; // do not write header anymore } break; case 25: // GLONASS L1 C/A + GLONASS L2 C/A - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { std::string signal("1G 2G"); rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + rp->rinex_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); b_rinex_header_written = true; // do not write header anymore } break; case 26: // GPS L1 C/A + GLONASS L1 C/A - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) { std::string glo_signal("1G"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); if (d_rinex_version == 3) - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); if (d_rinex_version == 2) { - rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); - rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model); + rp->rinex_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); } b_rinex_header_written = true; // do not write header anymore } break; case 27: // Galileo E1B + GLONASS L1 C/A - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) { std::string glo_signal("1G"); std::string gal_signal("1B"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); b_rinex_header_written = true; // do not write header anymore } break; case 28: // GPS L2C + GLONASS L1 C/A - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { std::string glo_signal("1G"); rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_cnav_iono, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); b_rinex_header_written = true; // do not write header anymore } break; case 29: // GPS L1 C/A + GLONASS L2 C/A - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) { std::string glo_signal("2G"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); if (d_rinex_version == 3) - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); if (d_rinex_version == 2) { - rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); - rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model); + rp->rinex_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); } b_rinex_header_written = true; // do not write header anymore } break; case 30: // Galileo E1B + GLONASS L2 C/A - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) { std::string glo_signal("2G"); std::string gal_signal("1B"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); b_rinex_header_written = true; // do not write header anymore } break; case 31: // GPS L2C + GLONASS L2 C/A - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { std::string glo_signal("2G"); rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_cnav_iono, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); b_rinex_header_written = true; // do not write header anymore } break; case 32: // L1+E1+L5+E5a - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and - (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) and - (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) + if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and + (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) and + (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 5X"); std::string gps_signal("1C L5"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } break; @@ -1413,83 +1419,83 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item switch (type_of_rx) { case 1: // GPS L1 C/A only - rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); + rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_ephemeris_map); break; case 2: // GPS L2C only - rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); + rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_cnav_ephemeris_map); break; case 3: // GPS L5 only - rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); + rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_cnav_ephemeris_map); break; case 4: case 5: case 6: - rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map); + rp->log_rinex_nav(rp->navGalFile, d_pvt_solver->galileo_ephemeris_map); break; case 7: // GPS L1 C/A + GPS L2C - rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map); + rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_cnav_ephemeris_map); break; case 8: // L1+L5 - rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); + rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_ephemeris_map); break; case 9: case 10: case 11: - rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->galileo_ephemeris_map); + rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->galileo_ephemeris_map); break; case 13: // L5+E5a - rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->galileo_ephemeris_map); + rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_cnav_ephemeris_map, d_pvt_solver->galileo_ephemeris_map); break; case 14: case 15: - rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map); + rp->log_rinex_nav(rp->navGalFile, d_pvt_solver->galileo_ephemeris_map); break; case 23: case 24: case 25: - rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); + rp->log_rinex_nav(rp->navGloFile, d_pvt_solver->glonass_gnav_ephemeris_map); break; case 26: // GPS L1 C/A + GLONASS L1 C/A if (d_rinex_version == 3) - rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); + rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); if (d_rinex_version == 2) { - rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); - rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); + rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_ephemeris_map); + rp->log_rinex_nav(rp->navGloFile, d_pvt_solver->glonass_gnav_ephemeris_map); } break; case 27: // Galileo E1B + GLONASS L1 C/A - rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); + rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->galileo_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); break; case 28: // GPS L2C + GLONASS L1 C/A - rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); + rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_cnav_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); break; case 29: // GPS L1 C/A + GLONASS L2 C/A if (d_rinex_version == 3) - rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); + rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); if (d_rinex_version == 2) { - rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); - rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map); + rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_ephemeris_map); + rp->log_rinex_nav(rp->navGloFile, d_pvt_solver->glonass_gnav_ephemeris_map); } break; case 30: // Galileo E1B + GLONASS L2 C/A - rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); + rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->galileo_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); break; case 31: // GPS L2C + GLONASS L2 C/A - rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map); + rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_cnav_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); break; case 32: // L1+E1+L5+E5a - rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->galileo_ephemeris_map); + rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->galileo_ephemeris_map); break; default: break; } } - galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + galileo_ephemeris_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + gps_ephemeris_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + gps_cnav_ephemeris_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); // Log observables into the RINEX file if (flag_write_RINEX_obs_output) @@ -1497,281 +1503,281 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item switch (type_of_rx) { case 1: // GPS L1 C/A only - if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) + if (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono); + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navFile, d_pvt_solver->gps_utc_model, d_pvt_solver->gps_iono); b_rinex_header_updated = true; } break; case 2: // GPS L2C only - if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) + if (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); - rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono); + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model); + rp->update_nav_header(rp->navFile, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->gps_cnav_iono); b_rinex_header_updated = true; } break; case 3: // GPS L5 - if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) + if (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); - rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono); + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model); + rp->update_nav_header(rp->navFile, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->gps_cnav_iono); b_rinex_header_updated = true; } break; case 4: // Galileo E1B only - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B"); } - if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); + rp->update_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_pvt_solver->galileo_utc_model); b_rinex_header_updated = true; } break; case 5: // Galileo E5a only - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "5X"); } - if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); + rp->update_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_pvt_solver->galileo_utc_model); b_rinex_header_updated = true; } break; case 6: // Galileo E5b only - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "7X"); } - if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); + rp->update_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_pvt_solver->galileo_utc_model); b_rinex_header_updated = true; } break; case 7: // GPS L1 C/A + GPS L2C - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono); + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navFile, d_pvt_solver->gps_utc_model, d_pvt_solver->gps_iono); b_rinex_header_updated = true; } break; case 8: // L1+L5 - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and ((d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) or (d_ls_pvt->gps_utc_model.d_A0 != 0))) + if (!b_rinex_header_updated and ((d_pvt_solver->gps_cnav_utc_model.d_A0 != 0) or (d_pvt_solver->gps_utc_model.d_A0 != 0))) { - if (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) + if (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0) { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); - rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono); + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model); + rp->update_nav_header(rp->navFile, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->gps_cnav_iono); } else { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono); + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navFile, d_pvt_solver->gps_utc_model, d_pvt_solver->gps_iono); } b_rinex_header_updated = true; } break; case 9: // GPS L1 C/A + Galileo E1B - if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) + if ((galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); b_rinex_header_updated = true; } break; case 13: // L5+E5a - if ((gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) + if ((gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0) and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model); + rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->gps_cnav_iono, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); b_rinex_header_updated = true; // do not write header anymore } break; case 14: // Galileo E1B + Galileo E5a - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 5X"); } - if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); + rp->update_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_pvt_solver->galileo_utc_model); b_rinex_header_updated = true; } break; case 15: // Galileo E1B + Galileo E5b - if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 7X"); } - if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); + rp->update_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_pvt_solver->galileo_utc_model); b_rinex_header_updated = true; } break; case 23: // GLONASS L1 C/A only - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C"); } - if (!b_rinex_header_updated and (d_ls_pvt->glonass_gnav_utc_model.d_tau_c != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->glonass_gnav_utc_model.d_tau_c != 0)) { - rp->update_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model); + rp->update_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_pvt_solver->glonass_gnav_utc_model); b_rinex_header_updated = true; } break; case 24: // GLONASS L2 C/A only - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "2C"); } - if (!b_rinex_header_updated and (d_ls_pvt->glonass_gnav_utc_model.d_tau_c != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->glonass_gnav_utc_model.d_tau_c != 0)) { - rp->update_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model); + rp->update_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_pvt_solver->glonass_gnav_utc_model); b_rinex_header_updated = true; } break; case 25: // GLONASS L1 C/A + GLONASS L2 C/A - if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C 2C"); } - if (!b_rinex_header_updated and (d_ls_pvt->glonass_gnav_utc_model.d_tau_c != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->glonass_gnav_utc_model.d_tau_c != 0)) { - rp->update_nav_header(rp->navMixFile, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); - rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model); + rp->update_nav_header(rp->navMixFile, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_pvt_solver->glonass_gnav_utc_model); b_rinex_header_updated = true; } break; case 26: // GPS L1 C/A + GLONASS L1 C/A - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } break; case 27: // Galileo E1B + GLONASS L1 C/A - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_pvt_solver->galileo_utc_model); + rp->update_nav_header(rp->navMixFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } break; case 28: // GPS L2C + GLONASS L1 C/A - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model); + rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_cnav_iono, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } break; case 29: // GPS L1 C/A + GLONASS L2 C/A - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } break; case 30: // Galileo E1B + GLONASS L2 C/A - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_pvt_solver->galileo_utc_model); + rp->update_nav_header(rp->navMixFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } break; case 31: // GPS L2C + GLONASS L2 C/A - if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model); + rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_cnav_iono, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } break; case 32: // L1+E1+L5+E5a - if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())) + if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and ((d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) or (d_ls_pvt->gps_utc_model.d_A0 != 0)) and (d_ls_pvt->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and ((d_pvt_solver->gps_cnav_utc_model.d_A0 != 0) or (d_pvt_solver->gps_utc_model.d_A0 != 0)) and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) { - if (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) + if (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0) { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model); + rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->gps_cnav_iono, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); } else { - rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); } b_rinex_header_updated = true; // do not write header anymore } @@ -1791,15 +1797,15 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 1: // GPS L1 C/A if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -1810,15 +1816,15 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 6: if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -1827,16 +1833,16 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 7: // GPS L1 C/A + GPS L2C if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -1845,16 +1851,16 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 8: // L1+L5 if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -1863,14 +1869,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 9: // GPS L1 C/A + Galileo E1B if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } @@ -1878,8 +1884,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -1890,8 +1896,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("G") == 0) { // This is a channel with valid GPS signal - gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -1901,19 +1907,19 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("E") == 0) { - gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } } } } - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -1922,7 +1928,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 13: // L5+E5a if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } @@ -1930,13 +1936,13 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - if (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) + std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + if (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -1946,15 +1952,15 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 15: if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -1965,15 +1971,15 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 25: if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); - if (glo_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + std::map::const_iterator glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + if (glo_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -1983,23 +1989,23 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 26: // GPS L1 C/A + GLONASS L1 C/A if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2010,8 +2016,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("G") == 0) { // This is a channel with valid GPS signal - gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -2021,8 +2027,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("R") == 0) { - glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } @@ -2030,11 +2036,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } } - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2043,14 +2049,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 27: // GLONASS L1 C/A + Galileo E1B if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } @@ -2058,8 +2064,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gal_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2070,8 +2076,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("E") == 0) { // This is a channel with valid GPS signal - gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } @@ -2081,19 +2087,19 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("R") == 0) { - glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2102,23 +2108,23 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 29: // GPS L1 C/A + GLONASS L2 C/A if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2129,8 +2135,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("G") == 0) { // This is a channel with valid GPS signal - gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -2140,19 +2146,19 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("R") == 0) { - glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2161,14 +2167,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 30: // GLONASS L2 C/A + Galileo E1B if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } @@ -2176,8 +2182,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gal_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2188,8 +2194,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("E") == 0) { // This is a channel with valid GPS signal - gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } @@ -2199,19 +2205,19 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("R") == 0) { - glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2220,14 +2226,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 32: // L1+E1+L5+E5a if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } @@ -2235,8 +2241,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gal_channel = 0; int gps_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2247,8 +2253,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("E") == 0) { // This is a channel with valid GPS signal - gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } @@ -2258,19 +2264,19 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("G") == 0) { - gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } } } } - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2288,16 +2294,16 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 1: // GPS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (d_rtcm_MSM_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2309,15 +2315,15 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 6: if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2327,16 +2333,16 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 7: // GPS L1 C/A + GPS L2C if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2346,16 +2352,16 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 8: // L1+L5 if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin(); - if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())) + std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2365,14 +2371,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 9: // GPS L1 C/A + Galileo E1B if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (d_rtcm_MT1045_rate_ms != 0) { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } @@ -2380,8 +2386,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2392,8 +2398,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("G") == 0) { // This is a channel with valid GPS signal - gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -2403,19 +2409,19 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("E") == 0) { - gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } } } } - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2426,15 +2432,15 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 13: // L5+E5a if (d_rtcm_MT1045_rate_ms != 0) { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) + std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2445,15 +2451,15 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 15: if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2465,15 +2471,15 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 25: if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); - if (glo_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + std::map::const_iterator glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + if (glo_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2483,23 +2489,23 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 26: // GPS L1 C/A + GLONASS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2510,8 +2516,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("G") == 0) { // This is a channel with valid GPS signal - gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -2521,19 +2527,19 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("R") == 0) { - glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2543,14 +2549,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 27: // GLONASS L1 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } @@ -2560,8 +2566,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item int gal_channel = 0; int glo_channel = 0; std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -2570,8 +2576,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("E") == 0) { // This is a channel with valid GPS signal - gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } @@ -2581,19 +2587,19 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("R") == 0) { - glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2603,22 +2609,22 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 29: // GPS L1 C/A + GLONASS L2 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); std::map::const_iterator gnss_observables_iter; int gps_channel = 0; int glo_channel = 0; @@ -2630,8 +2636,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("G") == 0) { // This is a channel with valid GPS signal - gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -2641,20 +2647,20 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("R") == 0) { - glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2664,14 +2670,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 30: // GLONASS L2 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } @@ -2681,8 +2687,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item int gal_channel = 0; int glo_channel = 0; std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); + std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -2691,8 +2697,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("E") == 0) { // This is a channel with valid GPS signal - gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } @@ -2702,19 +2708,19 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("R") == 0) { - glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2724,14 +2730,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 32: // L1+E1+L5+E5a if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++) + for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); } @@ -2739,8 +2745,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); + std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2751,8 +2757,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (system.compare("G") == 0) { // This is a channel with valid GPS signal - gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -2762,19 +2768,19 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item { if (system.compare("E") == 0) { - gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } } } } - if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } - if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); } @@ -2800,7 +2806,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } // DEBUG MESSAGE: Display position in console output - if (d_ls_pvt->is_valid_position() and flag_display_pvt) + if (d_pvt_solver->is_valid_position() and flag_display_pvt) { std::streamsize ss = std::cout.precision(); // save current precision std::cout.setf(std::ios::fixed, std::ios::floatfield); @@ -2808,29 +2814,29 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::cout.imbue(std::locale(std::cout.getloc(), facet)); std::cout << TEXT_BOLD_GREEN - << "Position at " << d_ls_pvt->get_position_UTC_time() - << " UTC using " << d_ls_pvt->get_num_valid_observations() + << "Position at " << d_pvt_solver->get_position_UTC_time() + << " UTC using " << d_pvt_solver->get_num_valid_observations() << std::fixed << std::setprecision(9) - << " observations is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude() + << " observations is Lat = " << d_pvt_solver->get_latitude() << " [deg], Long = " << d_pvt_solver->get_longitude() << std::fixed << std::setprecision(3) - << " [deg], Height = " << d_ls_pvt->get_height() << " [m]" << TEXT_RESET << std::endl; + << " [deg], Height = " << d_pvt_solver->get_height() << " [m]" << TEXT_RESET << std::endl; std::cout << std::setprecision(ss); - DLOG(INFO) << "RX clock offset: " << d_ls_pvt->get_time_offset_s() << "[s]"; + DLOG(INFO) << "RX clock offset: " << d_pvt_solver->get_time_offset_s() << "[s]"; // boost::posix_time::ptime p_time; - // gtime_t rtklib_utc_time = gpst2time(adjgpsweek(d_ls_pvt->gps_ephemeris_map.cbegin()->second.i_GPS_week), d_rx_time); + // gtime_t rtklib_utc_time = gpst2time(adjgpsweek(d_pvt_solver->gps_ephemeris_map.cbegin()->second.i_GPS_week), d_rx_time); // p_time = boost::posix_time::from_time_t(rtklib_utc_time.time); // p_time += boost::posix_time::microseconds(round(rtklib_utc_time.sec * 1e6)); // std::cout << TEXT_MAGENTA << "Observable RX time (GPST) " << boost::posix_time::to_simple_string(p_time) << TEXT_RESET << std::endl; - DLOG(INFO) << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time()) - << " UTC using " << d_ls_pvt->get_num_valid_observations() << " observations is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude() - << " [deg], Height = " << d_ls_pvt->get_height() << " [m]"; + DLOG(INFO) << "Position at " << boost::posix_time::to_simple_string(d_pvt_solver->get_position_UTC_time()) + << " UTC using " << d_pvt_solver->get_num_valid_observations() << " observations is Lat = " << d_pvt_solver->get_latitude() << " [deg], Long = " << d_pvt_solver->get_longitude() + << " [deg], Height = " << d_pvt_solver->get_height() << " [m]"; - /* std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time()) - << " UTC using "<< d_ls_pvt->get_num_valid_observations() <<" observations is HDOP = " << d_ls_pvt->get_hdop() << " VDOP = " - << d_ls_pvt->get_vdop() - << " GDOP = " << d_ls_pvt->get_gdop() << std::endl; */ + /* std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_pvt_solver->get_position_UTC_time()) + << " UTC using "<< d_pvt_solver->get_num_valid_observations() <<" observations is HDOP = " << d_pvt_solver->get_hdop() << " VDOP = " + << d_pvt_solver->get_vdop() + << " GDOP = " << d_pvt_solver->get_gdop() << std::endl; */ } } } diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index dfb59cd1e..2f6bd32f0 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -113,7 +113,7 @@ private: bool d_kml_output_enabled; bool d_nmea_output_file_enabled; - std::shared_ptr d_ls_pvt; + std::shared_ptr d_pvt_solver; std::map gnss_observables_map; bool observables_pairCompare_min(const std::pair& a, const std::pair& b); @@ -153,13 +153,13 @@ public: * \brief Get latest set of ephemeris from PVT block * */ - std::map get_gps_ephemeris_map(); + std::map get_gps_ephemeris_map() const; - std::map get_gps_almanac_map(); + std::map get_gps_almanac_map() const; - std::map get_galileo_ephemeris_map(); + std::map get_galileo_ephemeris_map() const; - std::map get_galileo_almanac_map(); + std::map get_galileo_almanac_map() const; /*! * \brief Clear all ephemeris information and the almanacs for GPS and Galileo @@ -167,7 +167,6 @@ public: */ void clear_ephemeris(); - /*! * \brief Get the latest Position WGS84 [deg], Ground Velocity, Course over Ground, and UTC Time, if available */ diff --git a/src/core/interfaces/pvt_interface.h b/src/core/interfaces/pvt_interface.h index db37d9afd..afabfa590 100644 --- a/src/core/interfaces/pvt_interface.h +++ b/src/core/interfaces/pvt_interface.h @@ -57,10 +57,10 @@ class PvtInterface : public GNSSBlockInterface public: virtual void reset() = 0; virtual void clear_ephemeris() = 0; - virtual std::map get_gps_ephemeris() = 0; - virtual std::map get_galileo_ephemeris() = 0; - virtual std::map get_gps_almanac() = 0; - virtual std::map get_galileo_almanac() = 0; + virtual std::map get_gps_ephemeris() const = 0; + virtual std::map get_galileo_ephemeris() const = 0; + virtual std::map get_gps_almanac() const = 0; + virtual std::map get_galileo_almanac() const = 0; virtual bool get_latest_PVT(double* longitude_deg, double* latitude_deg, From 79fa7ce6ca2d824c38cf2052b38e1bc3d0eadc5a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 8 Nov 2018 15:11:55 +0100 Subject: [PATCH 072/143] Remove duplicated code --- src/algorithms/PVT/libs/hybrid_ls_pvt.cc | 2 +- src/algorithms/PVT/libs/pvt_solution.cc | 48 +++--------------------- src/algorithms/PVT/libs/pvt_solution.h | 2 +- src/algorithms/PVT/libs/rtklib_solver.cc | 4 +- 4 files changed, 11 insertions(+), 45 deletions(-) diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc index 2bded706f..d807a82db 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc @@ -338,7 +338,7 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); this->set_position_UTC_time(p_time); - cart2geo(static_cast(rx_position_and_time(0)), static_cast(rx_position_and_time(1)), static_cast(rx_position_and_time(2)), 4); + cart_to_geo(static_cast(rx_position_and_time(0)), static_cast(rx_position_and_time(1)), static_cast(rx_position_and_time(2)), 4); DLOG(INFO) << "Hybrid Position at " << boost::posix_time::to_simple_string(p_time) << " is Lat = " << this->get_latitude() << " [deg], Long = " << this->get_longitude() diff --git a/src/algorithms/PVT/libs/pvt_solution.cc b/src/algorithms/PVT/libs/pvt_solution.cc index 6071f38b0..0703421b1 100644 --- a/src/algorithms/PVT/libs/pvt_solution.cc +++ b/src/algorithms/PVT/libs/pvt_solution.cc @@ -87,49 +87,13 @@ arma::vec Pvt_Solution::rotateSatellite(double const traveltime, const arma::vec } -int Pvt_Solution::cart2geo(double X, double Y, double Z, int elipsoid_selection) +int Pvt_Solution::cart_to_geo(double X, double Y, double Z, int elipsoid_selection) { - /* Conversion of Cartesian coordinates (X,Y,Z) to geographical - coordinates (latitude, longitude, h) on a selected reference ellipsoid. - - Choices of Reference Ellipsoid for Geographical Coordinates - 0. International Ellipsoid 1924 - 1. International Ellipsoid 1967 - 2. World Geodetic System 1972 - 3. Geodetic Reference System 1980 - 4. World Geodetic System 1984 - */ - - const double a[5] = {6378388.0, 6378160.0, 6378135.0, 6378137.0, 6378137.0}; - const double f[5] = {1.0 / 297.0, 1.0 / 298.247, 1.0 / 298.26, 1.0 / 298.257222101, 1.0 / 298.257223563}; - - double lambda = atan2(Y, X); - double ex2 = (2.0 - f[elipsoid_selection]) * f[elipsoid_selection] / ((1.0 - f[elipsoid_selection]) * (1.0 - f[elipsoid_selection])); - double c = a[elipsoid_selection] * sqrt(1.0 + ex2); - double phi = atan(Z / ((sqrt(X * X + Y * Y) * (1.0 - (2.0 - f[elipsoid_selection])) * f[elipsoid_selection]))); - - double h = 0.1; - double oldh = 0.0; - double N; - int iterations = 0; - do - { - oldh = h; - N = c / sqrt(1 + ex2 * (cos(phi) * cos(phi))); - phi = atan(Z / ((sqrt(X * X + Y * Y) * (1.0 - (2.0 - f[elipsoid_selection]) * f[elipsoid_selection] * N / (N + h))))); - h = sqrt(X * X + Y * Y) / cos(phi) - N; - iterations = iterations + 1; - if (iterations > 100) - { - DLOG(WARNING) << "Failed to approximate h with desired precision. h-oldh= " << h - oldh; - break; - } - } - while (std::abs(h - oldh) > 1.0e-12); - d_latitude_d = phi * 180.0 / GPS_PI; - d_longitude_d = lambda * 180.0 / GPS_PI; - d_height_m = h; - //todo: refactor this class. Mix of duplicated functions, use either RTKLIB geodetic functions or geofunctions.h + arma::vec XYZ = {X, Y, Z}; + arma::vec LLH = cart2geo(XYZ, elipsoid_selection); + d_latitude_d = LLH(0) * 180.0 / GPS_PI; + d_longitude_d = LLH(1) * 180.0 / GPS_PI; + d_height_m = LLH(2); return 0; } diff --git a/src/algorithms/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h index bfdc217b7..1367cc38f 100644 --- a/src/algorithms/PVT/libs/pvt_solution.h +++ b/src/algorithms/PVT/libs/pvt_solution.h @@ -127,7 +127,7 @@ public: * 4 - World Geodetic System 1984. * */ - int cart2geo(double X, double Y, double Z, int elipsoid_selection); + int cart_to_geo(double X, double Y, double Z, int elipsoid_selection); /*! * \brief Tropospheric correction diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 1481dea0e..f5964b22e 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -99,6 +99,7 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag } } + bool rtklib_solver::save_matfile() { // READ DUMP FILE @@ -395,6 +396,7 @@ bool rtklib_solver::save_matfile() return true; } + rtklib_solver::~rtklib_solver() { if (d_dump_file.is_open() == true) @@ -868,7 +870,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ p_time = boost::posix_time::from_time_t(rtklib_utc_time.time); p_time += boost::posix_time::microseconds(static_cast(round(rtklib_utc_time.sec * 1e6))); this->set_position_UTC_time(p_time); - cart2geo(static_cast(rx_position_and_time(0)), static_cast(rx_position_and_time(1)), static_cast(rx_position_and_time(2)), 4); + cart_to_geo(static_cast(rx_position_and_time(0)), static_cast(rx_position_and_time(1)), static_cast(rx_position_and_time(2)), 4); DLOG(INFO) << "RTKLIB Position at " << boost::posix_time::to_simple_string(p_time) << " is Lat = " << this->get_latitude() << " [deg], Long = " << this->get_longitude() From a544112a840c2802ea8a55e6c74ccc76b5235ae5 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 8 Nov 2018 15:34:58 +0100 Subject: [PATCH 073/143] Fix defects detected by Coverity Scan --- src/algorithms/libs/geofunctions.cc | 2 +- src/core/receiver/control_thread.cc | 28 +++++++++++++++------------- src/core/receiver/control_thread.h | 2 +- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/algorithms/libs/geofunctions.cc b/src/algorithms/libs/geofunctions.cc index a99e2572e..bf67e07f8 100644 --- a/src/algorithms/libs/geofunctions.cc +++ b/src/algorithms/libs/geofunctions.cc @@ -301,7 +301,7 @@ double mstokph(double MetersPerSeconds) arma::vec CTM_to_Euler(const arma::mat &C) { // Calculate Euler angles using (2.23) - arma::mat CTM = C; + arma::mat CTM(C); arma::vec eul = arma::zeros(3, 1); eul(0) = atan2(CTM(1, 2), CTM(2, 2)); // roll if (CTM(0, 2) < -1.0) CTM(0, 2) = -1.0; diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index b8bf6e345..b21f68ff8 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -94,6 +94,7 @@ ControlThread::ControlThread(std::shared_ptr configurati { configuration_ = configuration; delete_configuration_ = false; + restart_ = false; init(); } @@ -112,6 +113,7 @@ void ControlThread::telecommand_listener() cmd_interface_.run_cmd_server(tcp_cmd_port); } + /* * Runs the control thread that manages the receiver control plane * @@ -154,17 +156,16 @@ int ControlThread::run() return 0; } - //launch GNSS assistance process AFTER the flowgraph is running because the GNURadio asynchronous queues must be already running to transport msgs + // launch GNSS assistance process AFTER the flowgraph is running because the GNU Radio asynchronous queues must be already running to transport msgs assist_GNSS(); // start the keyboard_listener thread keyboard_thread_ = boost::thread(&ControlThread::keyboard_listener, this); sysv_queue_thread_ = boost::thread(&ControlThread::sysv_queue_listener, this); - //start the telecommand listener thread + // start the telecommand listener thread cmd_interface_.set_pvt(flowgraph_->get_pvt()); cmd_interface_thread_ = boost::thread(&ControlThread::telecommand_listener, this); - bool enable_FPGA = configuration_->property("Channel.enable_FPGA", false); if (enable_FPGA == true) { @@ -764,22 +765,23 @@ void ControlThread::apply_action(unsigned int what) } } -std::vector> ControlThread::get_visible_sats(time_t rx_utc_time, arma::vec LLH) + +std::vector> ControlThread::get_visible_sats(time_t rx_utc_time, const arma::vec &LLH) { - //1. Compute rx ECEF position from LLH WGS84 + // 1. Compute rx ECEF position from LLH WGS84 arma::vec LLH_rad = arma::vec{degtorad(LLH(0)), degtorad(LLH(1)), LLH(2)}; arma::mat C_tmp = arma::zeros(3, 3); arma::vec r_eb_e = arma::zeros(3, 1); arma::vec v_eb_e = arma::zeros(3, 1); Geo_to_ECEF(LLH_rad, arma::vec{0, 0, 0}, C_tmp, r_eb_e, v_eb_e, C_tmp); - //2. Compute rx GPS time from UTC time + // 2. Compute rx GPS time from UTC time gtime_t utc_gtime; utc_gtime.time = rx_utc_time; utc_gtime.sec = 0; gtime_t gps_gtime = utc2gpst(utc_gtime); - //2. loop throught all the available ephemeris or almanac and compute satellite positions and elevations + // 3. loop through all the available ephemeris or almanac and compute satellite positions and elevations // store visible satellites in a vector of pairs to associate an elevation to the each satellite std::vector> available_satellites; @@ -805,7 +807,7 @@ std::vector> ControlThread::get_visible_sats(time arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec dx = r_sat_eb_e - r_eb_e; topocent(&Az, &El, &dist_m, r_eb_e, dx); - //push sat + // push sat if (El > 0) { std::cout << "Using GPS Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; @@ -827,7 +829,7 @@ std::vector> ControlThread::get_visible_sats(time arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec dx = r_sat_eb_e - r_eb_e; topocent(&Az, &El, &dist_m, r_eb_e, dx); - //push sat + // push sat if (El > 0) { std::cout << "Using Galileo Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; @@ -848,7 +850,7 @@ std::vector> ControlThread::get_visible_sats(time arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec dx = r_sat_eb_e - r_eb_e; topocent(&Az, &El, &dist_m, r_eb_e, dx); - //push sat + // push sat if (El > 0) { std::cout << "Using GPS Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; @@ -870,7 +872,7 @@ std::vector> ControlThread::get_visible_sats(time arma::vec dx = r_sat_eb_e - r_eb_e; topocent(&Az, &El, &dist_m, r_eb_e, dx); std::cout << "Using Galileo Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; - //push sat + // push sat if (El > 0) { std::cout << "Using GPS Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; @@ -879,11 +881,11 @@ std::vector> ControlThread::get_visible_sats(time } } - //sort the visible satellites in ascending order of elevation + // sort the visible satellites in ascending order of elevation std::sort(available_satellites.begin(), available_satellites.end(), [](const std::pair &a, const std::pair &b) { // use lambda. Cleaner and easier to read return a.first < b.first; }); - //std::reverse(available_satellites.begin(), available_satellites.end()); + // std::reverse(available_satellites.begin(), available_satellites.end()); return available_satellites; } diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index c62006eee..50bdc06c0 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -148,8 +148,8 @@ private: * Compute elevations for the specified time and position for all the available satellites in ephemeris and almanac queues * returns a vector filled with the available satellites ordered from high elevation to low elevation angle. */ + std::vector> get_visible_sats(time_t rx_utc_time, const arma::vec& LLH); - std::vector> get_visible_sats(time_t rx_utc_time, arma::vec LLH); /* * Read initial GNSS assistance from SUPL server or local XML files */ From 2206969be69f2111163b0b961501430cef7d7db2 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 8 Nov 2018 17:13:11 +0100 Subject: [PATCH 074/143] Revert "Remove duplicated code" This reverts commit 79fa7ce6ca2d824c38cf2052b38e1bc3d0eadc5a. --- src/algorithms/PVT/libs/hybrid_ls_pvt.cc | 2 +- src/algorithms/PVT/libs/pvt_solution.cc | 48 +++++++++++++++++++++--- src/algorithms/PVT/libs/pvt_solution.h | 2 +- src/algorithms/PVT/libs/rtklib_solver.cc | 4 +- 4 files changed, 45 insertions(+), 11 deletions(-) diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc index d807a82db..2bded706f 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc @@ -338,7 +338,7 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); this->set_position_UTC_time(p_time); - cart_to_geo(static_cast(rx_position_and_time(0)), static_cast(rx_position_and_time(1)), static_cast(rx_position_and_time(2)), 4); + cart2geo(static_cast(rx_position_and_time(0)), static_cast(rx_position_and_time(1)), static_cast(rx_position_and_time(2)), 4); DLOG(INFO) << "Hybrid Position at " << boost::posix_time::to_simple_string(p_time) << " is Lat = " << this->get_latitude() << " [deg], Long = " << this->get_longitude() diff --git a/src/algorithms/PVT/libs/pvt_solution.cc b/src/algorithms/PVT/libs/pvt_solution.cc index 0703421b1..6071f38b0 100644 --- a/src/algorithms/PVT/libs/pvt_solution.cc +++ b/src/algorithms/PVT/libs/pvt_solution.cc @@ -87,13 +87,49 @@ arma::vec Pvt_Solution::rotateSatellite(double const traveltime, const arma::vec } -int Pvt_Solution::cart_to_geo(double X, double Y, double Z, int elipsoid_selection) +int Pvt_Solution::cart2geo(double X, double Y, double Z, int elipsoid_selection) { - arma::vec XYZ = {X, Y, Z}; - arma::vec LLH = cart2geo(XYZ, elipsoid_selection); - d_latitude_d = LLH(0) * 180.0 / GPS_PI; - d_longitude_d = LLH(1) * 180.0 / GPS_PI; - d_height_m = LLH(2); + /* Conversion of Cartesian coordinates (X,Y,Z) to geographical + coordinates (latitude, longitude, h) on a selected reference ellipsoid. + + Choices of Reference Ellipsoid for Geographical Coordinates + 0. International Ellipsoid 1924 + 1. International Ellipsoid 1967 + 2. World Geodetic System 1972 + 3. Geodetic Reference System 1980 + 4. World Geodetic System 1984 + */ + + const double a[5] = {6378388.0, 6378160.0, 6378135.0, 6378137.0, 6378137.0}; + const double f[5] = {1.0 / 297.0, 1.0 / 298.247, 1.0 / 298.26, 1.0 / 298.257222101, 1.0 / 298.257223563}; + + double lambda = atan2(Y, X); + double ex2 = (2.0 - f[elipsoid_selection]) * f[elipsoid_selection] / ((1.0 - f[elipsoid_selection]) * (1.0 - f[elipsoid_selection])); + double c = a[elipsoid_selection] * sqrt(1.0 + ex2); + double phi = atan(Z / ((sqrt(X * X + Y * Y) * (1.0 - (2.0 - f[elipsoid_selection])) * f[elipsoid_selection]))); + + double h = 0.1; + double oldh = 0.0; + double N; + int iterations = 0; + do + { + oldh = h; + N = c / sqrt(1 + ex2 * (cos(phi) * cos(phi))); + phi = atan(Z / ((sqrt(X * X + Y * Y) * (1.0 - (2.0 - f[elipsoid_selection]) * f[elipsoid_selection] * N / (N + h))))); + h = sqrt(X * X + Y * Y) / cos(phi) - N; + iterations = iterations + 1; + if (iterations > 100) + { + DLOG(WARNING) << "Failed to approximate h with desired precision. h-oldh= " << h - oldh; + break; + } + } + while (std::abs(h - oldh) > 1.0e-12); + d_latitude_d = phi * 180.0 / GPS_PI; + d_longitude_d = lambda * 180.0 / GPS_PI; + d_height_m = h; + //todo: refactor this class. Mix of duplicated functions, use either RTKLIB geodetic functions or geofunctions.h return 0; } diff --git a/src/algorithms/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h index 1367cc38f..bfdc217b7 100644 --- a/src/algorithms/PVT/libs/pvt_solution.h +++ b/src/algorithms/PVT/libs/pvt_solution.h @@ -127,7 +127,7 @@ public: * 4 - World Geodetic System 1984. * */ - int cart_to_geo(double X, double Y, double Z, int elipsoid_selection); + int cart2geo(double X, double Y, double Z, int elipsoid_selection); /*! * \brief Tropospheric correction diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index f5964b22e..1481dea0e 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -99,7 +99,6 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag } } - bool rtklib_solver::save_matfile() { // READ DUMP FILE @@ -396,7 +395,6 @@ bool rtklib_solver::save_matfile() return true; } - rtklib_solver::~rtklib_solver() { if (d_dump_file.is_open() == true) @@ -870,7 +868,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ p_time = boost::posix_time::from_time_t(rtklib_utc_time.time); p_time += boost::posix_time::microseconds(static_cast(round(rtklib_utc_time.sec * 1e6))); this->set_position_UTC_time(p_time); - cart_to_geo(static_cast(rx_position_and_time(0)), static_cast(rx_position_and_time(1)), static_cast(rx_position_and_time(2)), 4); + cart2geo(static_cast(rx_position_and_time(0)), static_cast(rx_position_and_time(1)), static_cast(rx_position_and_time(2)), 4); DLOG(INFO) << "RTKLIB Position at " << boost::posix_time::to_simple_string(p_time) << " is Lat = " << this->get_latitude() << " [deg], Long = " << this->get_longitude() From 2db629a6c1f75f72444ffd1b1a1fd4765c00228a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 9 Nov 2018 12:14:05 +0100 Subject: [PATCH 075/143] Remove old KML reader --- .../system-tests/libs/position_test_flags.h | 1 - src/tests/system-tests/position_test.cc | 127 +++++------------- 2 files changed, 31 insertions(+), 97 deletions(-) diff --git a/src/tests/system-tests/libs/position_test_flags.h b/src/tests/system-tests/libs/position_test_flags.h index cf33c344f..1ebe296e6 100644 --- a/src/tests/system-tests/libs/position_test_flags.h +++ b/src/tests/system-tests/libs/position_test_flags.h @@ -37,7 +37,6 @@ DEFINE_string(config_file_ptest, std::string(""), "File containing the configuration parameters for the position test."); DEFINE_bool(plot_position_test, false, "Plots results of with gnuplot"); DEFINE_bool(static_scenario, true, "Compute figures of merit for static user position (DRMS, CEP, etc..)"); -DEFINE_bool(use_pvt_solver_dump, false, "Use PVT solver binary dump or fall back to KML PVT file (contains only position information)"); DEFINE_bool(use_ref_motion_file, false, "Enable or disable the use of a reference file containing the true receiver position, velocity and acceleration."); DEFINE_int32(ref_motion_file_type, 1, "Type of reference motion file: 1- Spirent CSV motion file"); DEFINE_string(ref_motion_filename, std::string("motion.csv"), "Path and filename for the reference motion file"); diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index 1a4c5e780..f030130e1 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -455,107 +455,42 @@ void PositionSystemTest::check_results() ref_R_eb_e.insert_cols(0, true_r_eb_e); arma::vec ref_r_enu = {0, 0, 0}; cart2utm(true_r_eb_e, utm_zone, ref_r_enu); - if (!FLAGS_use_pvt_solver_dump) + + rtklib_solver_dump_reader pvt_reader; + pvt_reader.open_obs_file(FLAGS_pvt_solver_dump_filename); + int64_t n_epochs = pvt_reader.num_epochs(); + R_eb_e = arma::zeros(3, n_epochs); + V_eb_e = arma::zeros(3, n_epochs); + LLH = arma::zeros(3, n_epochs); + receiver_time_s = arma::zeros(n_epochs, 1); + int64_t current_epoch = 0; + while (pvt_reader.read_binary_obs()) { - //fall back to read receiver KML output (position only) - std::fstream myfile(PositionSystemTest::generated_kml_file, std::ios_base::in); - ASSERT_TRUE(myfile.is_open()) << "No valid kml file could be opened"; - std::string line; - // Skip header - std::getline(myfile, line); - bool is_header = true; - while (is_header) - { - std::getline(myfile, line); - ASSERT_FALSE(myfile.eof()) << "No valid kml file found."; - std::size_t found = line.find(""); - if (found != std::string::npos) is_header = false; - } - bool is_data = true; - //read data - int64_t current_epoch = 0; - while (is_data) - { - if (!std::getline(myfile, line)) - { - is_data = false; - break; - } - std::size_t found = line.find(""); - if (found != std::string::npos) - is_data = false; - else - { - std::string str2; - std::istringstream iss(line); - double value; - double lat = 0.0; - double longitude = 0.0; - double h = 0.0; - for (int i = 0; i < 3; i++) - { - std::getline(iss, str2, ','); - value = std::stod(str2); - if (i == 0) longitude = value; - if (i == 1) lat = value; - if (i == 2) h = value; - } + receiver_time_s(current_epoch) = pvt_reader.RX_time - pvt_reader.clk_offset_s; + R_eb_e(0, current_epoch) = pvt_reader.rr[0]; + R_eb_e(1, current_epoch) = pvt_reader.rr[1]; + R_eb_e(2, current_epoch) = pvt_reader.rr[2]; + V_eb_e(0, current_epoch) = pvt_reader.rr[3]; + V_eb_e(1, current_epoch) = pvt_reader.rr[4]; + V_eb_e(2, current_epoch) = pvt_reader.rr[5]; + LLH(0, current_epoch) = pvt_reader.latitude; + LLH(1, current_epoch) = pvt_reader.longitude; + LLH(2, current_epoch) = pvt_reader.height; - arma::vec tmp_v_ecef; - arma::vec tmp_r_ecef; - pv_Geo_to_ECEF(degtorad(lat), degtorad(longitude), h, arma::vec{0, 0, 0}, tmp_r_ecef, tmp_v_ecef); - R_eb_e.insert_cols(current_epoch, tmp_r_ecef); - arma::vec tmp_r_enu = {0, 0, 0}; - cart2utm(tmp_r_ecef, utm_zone, tmp_r_enu); - R_eb_enu.insert_cols(current_epoch, tmp_r_enu); - // std::cout << "lat = " << lat << ", longitude = " << longitude << " h = " << h << std::endl; - // std::cout << "E = " << east << ", N = " << north << " U = " << up << std::endl; - // getchar(); - } - } - myfile.close(); - ASSERT_FALSE(R_eb_e.n_cols == 0) << "KML file is empty"; - } - else - { - //use complete binary dump from pvt solver - rtklib_solver_dump_reader pvt_reader; - pvt_reader.open_obs_file(FLAGS_pvt_solver_dump_filename); - int64_t n_epochs = pvt_reader.num_epochs(); - R_eb_e = arma::zeros(3, n_epochs); - V_eb_e = arma::zeros(3, n_epochs); - LLH = arma::zeros(3, n_epochs); - receiver_time_s = arma::zeros(n_epochs, 1); - int64_t current_epoch = 0; - while (pvt_reader.read_binary_obs()) - { - receiver_time_s(current_epoch) = pvt_reader.RX_time - pvt_reader.clk_offset_s; - R_eb_e(0, current_epoch) = pvt_reader.rr[0]; - R_eb_e(1, current_epoch) = pvt_reader.rr[1]; - R_eb_e(2, current_epoch) = pvt_reader.rr[2]; - V_eb_e(0, current_epoch) = pvt_reader.rr[3]; - V_eb_e(1, current_epoch) = pvt_reader.rr[4]; - V_eb_e(2, current_epoch) = pvt_reader.rr[5]; - LLH(0, current_epoch) = pvt_reader.latitude; - LLH(1, current_epoch) = pvt_reader.longitude; - LLH(2, current_epoch) = pvt_reader.height; - - arma::vec tmp_r_enu = {0, 0, 0}; - cart2utm(R_eb_e.col(current_epoch), utm_zone, tmp_r_enu); - R_eb_enu.insert_cols(current_epoch, tmp_r_enu); - - //debug check - // std::cout << "t1: " << pvt_reader.RX_time << std::endl; - // std::cout << "t2: " << pvt_reader.TOW_at_current_symbol_ms << std::endl; - // std::cout << "offset: " << pvt_reader.clk_offset_s << std::endl; - // getchar(); - current_epoch++; - } - ASSERT_FALSE(current_epoch == 0) << "PVT dump is empty"; + arma::vec tmp_r_enu = {0, 0, 0}; + cart2utm(R_eb_e.col(current_epoch), utm_zone, tmp_r_enu); + R_eb_enu.insert_cols(current_epoch, tmp_r_enu); + + // debug check + // std::cout << "t1: " << pvt_reader.RX_time << std::endl; + // std::cout << "t2: " << pvt_reader.TOW_at_current_symbol_ms << std::endl; + // std::cout << "offset: " << pvt_reader.clk_offset_s << std::endl; + // getchar(); + current_epoch++; } + ASSERT_FALSE(current_epoch == 0) << "PVT dump is empty"; // compute results - if (FLAGS_static_scenario) { double sigma_E_2_precision = arma::var(R_eb_enu.row(0)); From 0abb84b9a4599f2d0d6c0cc3dbe8d8ac211b4136 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 10 Nov 2018 19:16:13 +0100 Subject: [PATCH 076/143] Read Galileo almanac data from XML file in the format provided at https://www.gsc-europa.eu/system-status/almanac-data Requires PugiXML, feature only available if the library is found on the system at building time The format detection is transparent to the user. Just configure GNSS-SDR.AGNSS_gal_almanac_xml=./2018-11-06.xml --- CMakeLists.txt | 5 ++ README.md | 10 ++-- cmake/Modules/FindPugiXML.cmake | 67 +++++++++++++++++++++++++++ src/core/libs/CMakeLists.txt | 11 ++++- src/core/libs/gnss_sdr_supl_client.cc | 61 +++++++++++++++++++++++- src/core/libs/gnss_sdr_supl_client.h | 1 + src/core/receiver/control_thread.cc | 7 +-- 7 files changed, 152 insertions(+), 10 deletions(-) create mode 100644 cmake/Modules/FindPugiXML.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 62f3cec71..15432d2d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1216,6 +1216,11 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS endif(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERSION}) +################################################################################ +# PugiXML - https://pugixml.org/ +################################################################################ +find_package(PugiXML QUIET) + ################################################################################ # USRP Hardware Driver (UHD) - OPTIONAL diff --git a/README.md b/README.md index 6624d618d..c632b9ab2 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,8 @@ $ sudo apt-get install build-essential cmake git libboost-dev libboost-date-time libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev \ libboost-serialization-dev liblog4cpp5-dev libuhd-dev gnuradio-dev gr-osmosdr \ libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev \ - libgnutls-openssl-dev libpcap-dev python-mako python-six libmatio-dev libgtest-dev + libgnutls-openssl-dev libpcap-dev python-mako python-six libmatio-dev libpugixml-dev \ + libgtest-dev ~~~~~~ Please note that the required files from `libgtest-dev` were moved to `googletest` in Debian 9 "stretch" and Ubuntu 18.04 "bionic", and moved back again to `libgtest-dev` in Debian 10 "buster" and Ubuntu 18.10 "cosmic". @@ -85,7 +86,7 @@ $ sudo yum install make automake gcc gcc-c++ kernel-devel cmake git boost-devel boost-date-time boost-system boost-filesystem boost-thread boost-chrono \ boost-serialization log4cpp-devel gnuradio-devel gr-osmosdr-devel \ blas-devel lapack-devel matio-devel armadillo-devel gflags-devel \ - glog-devel openssl-devel libpcap-devel python-mako python-six + glog-devel openssl-devel libpcap-devel python-mako python-six pugixml-devel ~~~~~~ Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). @@ -102,7 +103,7 @@ $ sudo yum install make automake gcc gcc-c++ kernel-devel libtool \ hdf5-devel cmake git boost-devel boost-date-time boost-system \ boost-filesystem boost-thread boost-chrono boost-serialization \ log4cpp-devel gnuradio-devel gr-osmosdr-devel blas-devel lapack-devel \ - armadillo-devel openssl-devel libpcap-devel python-mako python-six + armadillo-devel openssl-devel libpcap-devel python-mako python-six pugixml-devel ~~~~~~ Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). @@ -113,7 +114,7 @@ If you are using Arch Linux (with base-devel group installed): ~~~~~~ $ pacman -S cmake git boost boost-libs log4cpp libvolk gnuradio gnuradio-osmosdr \ - blas lapack gflags google-glog openssl python2-mako python2-six \ + blas lapack gflags google-glog openssl pugixml python2-mako python2-six \ libmatio libpcap gtest ~~~~~~ @@ -547,6 +548,7 @@ $ sudo port install google-glog +gflags $ sudo port install py27-mako $ sudo port install py27-six $ sudo port install matio +$ sudo port install pugixml ~~~~~~ You also might need to activate a Python installation. The list of installed versions can be retrieved with: diff --git a/cmake/Modules/FindPugiXML.cmake b/cmake/Modules/FindPugiXML.cmake new file mode 100644 index 000000000..f60b441c8 --- /dev/null +++ b/cmake/Modules/FindPugiXML.cmake @@ -0,0 +1,67 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + + +# Find the pugixml XML parsing library. +# +# Sets the usual variables expected for find_package scripts: +# +# PUGIXML_INCLUDE_DIR - header location +# PUGIXML_LIBRARIES - library to link against +# PUGIXML_FOUND - true if pugixml was found. + + +find_path (PUGIXML_INCLUDE_DIR + NAMES pugixml.hpp + PATHS ${PUGIXML_HOME}/include + /usr/include + /usr/local/include + /opt/local/include) + +find_library (PUGIXML_LIBRARY + NAMES pugixml + PATHS ${PUGIXML_HOME}/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/i386-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/local/lib + /opt/local/lib + /usr/lib ) + +# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found. +include (FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS (PugiXML DEFAULT_MSG PUGIXML_LIBRARY + PUGIXML_INCLUDE_DIR) + +if (PUGIXML_FOUND) + set (PUGIXML_LIBRARIES ${PUGIXML_LIBRARY}) + if (NOT PugiXML_FIND_QUIETLY) + message (STATUS "PugiXML include = ${PUGIXML_INCLUDE_DIR}") + message (STATUS "PugiXML library = ${PUGIXML_LIBRARY}") + endif (NOT PugiXML_FIND_QUIETLY) +else (PUGIXML_FOUND) + message (STATUS "PugiXML not found.") +endif(PUGIXML_FOUND) + +mark_as_advanced (PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR) \ No newline at end of file diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index f8b7f7dc0..c901ea715 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -35,6 +35,14 @@ set(CORE_LIBS_HEADERS string_converter.h gnss_sdr_supl_client.h ) + +if(PugiXML_FOUND) + message(STATUS "PugiXML has been found. Reading of GSA Galileo almanac XML files enabled.") + add_definitions( -DPUGIXML_FOUND=1 ) +else(PugiXML_FOUND) + set(PUGIXML_INCLUDE_DIR "") + set(PUGIXML_LIBRARIES "") +endif(PugiXML_FOUND) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -45,6 +53,7 @@ include_directories( ${GLOG_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} + ${PUGIXML_INCLUDE_DIR} ) list(SORT CORE_LIBS_HEADERS) @@ -52,4 +61,4 @@ list(SORT CORE_LIBS_SOURCES) add_library(rx_core_lib ${CORE_LIBS_SOURCES} ${CORE_LIBS_HEADERS}) source_group(Headers FILES ${CORE_LIBS_HEADERS}) -target_link_libraries(rx_core_lib supl_library) +target_link_libraries(rx_core_lib supl_library ${PUGIXML_LIBRARIES}) diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index 7494d2f3f..30de44cdf 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -32,6 +32,9 @@ */ #include "gnss_sdr_supl_client.h" +#ifdef PUGIXML_FOUND +#include +#endif #include #include @@ -842,14 +845,68 @@ bool gnss_sdr_supl_client::load_gal_almanac_xml(const std::string file_name) boost::archive::xml_iarchive xml(ifs); gal_almanac_map.clear(); xml >> boost::serialization::make_nvp("GNSS-SDR_gal_almanac_map", this->gal_almanac_map); - LOG(INFO) << "Loaded Galileo almanac map data with " << this->gal_almanac_map.size() << " satellites"; } catch (std::exception& e) { - LOG(WARNING) << e.what() << "File: " << file_name; + // Maybe the file is from https://www.gsc-europa.eu/system-status/almanac-data ? + return this->read_gal_almanac_from_gsa(file_name); + } + LOG(INFO) << "Loaded Galileo almanac map data with " << this->gal_almanac_map.size() << " satellites"; + return true; +} + + +bool gnss_sdr_supl_client::read_gal_almanac_from_gsa(const std::string file_name) +{ +#ifdef PUGIXML_FOUND + pugi::xml_document doc; + pugi::xml_parse_result result = doc.load_file(file_name.c_str()); + if (!result) + { + LOG(WARNING) << "Error loading file " << file_name << ":" << result.description(); + return false; + } + for (pugi::xml_node almanac : doc.child("signalData") + .child("body") + .child("Almanacs") + .children("svAlmanac")) + { + Galileo_Almanac gal_alm; + try + { + uint32_t prn = static_cast(std::stoi(almanac.child_value("SVID"))); + gal_alm.i_satellite_PRN = prn; + gal_alm.i_Toa = std::stoi(almanac.child("almanac").child_value("t0a")); + gal_alm.i_WNa = std::stoi(almanac.child("almanac").child_value("wna")); + gal_alm.i_IODa = std::stoi(almanac.child("almanac").child_value("iod")); + gal_alm.d_Delta_i = std::stod(almanac.child("almanac").child_value("deltai")); + gal_alm.d_M_0 = std::stod(almanac.child("almanac").child_value("deltai")); + gal_alm.d_e_eccentricity = std::stod(almanac.child("almanac").child_value("ecc")); + gal_alm.d_Delta_sqrt_A = std::stod(almanac.child("almanac").child_value("aSqRoot")); + gal_alm.d_OMEGA0 = std::stod(almanac.child("almanac").child_value("omega0")); + gal_alm.d_OMEGA = std::stod(almanac.child("almanac").child_value("w")); + gal_alm.d_OMEGA_DOT = std::stod(almanac.child("almanac").child_value("omegaDot")); + gal_alm.d_A_f0 = std::stod(almanac.child("almanac").child_value("af0")); + gal_alm.d_A_f1 = std::stod(almanac.child("almanac").child_value("af1")); + gal_alm.E5b_HS = std::stoi(almanac.child("svINavSignalStatus").child_value("statusE5b")); + gal_alm.E1B_HS = std::stoi(almanac.child("svINavSignalStatus").child_value("statusE1B")); + gal_alm.E5a_HS = std::stoi(almanac.child("svFNavSignalStatus").child_value("statusE5a")); + + this->gal_almanac_map[static_cast(prn)] = gal_alm; + } + catch (const std::exception& e) + { + std::cerr << e.what() << std::endl; + } + } + if (this->gal_almanac_map.empty()) + { return false; } return true; +#else + return false; +#endif } diff --git a/src/core/libs/gnss_sdr_supl_client.h b/src/core/libs/gnss_sdr_supl_client.h index 52e4ed371..d20779d33 100644 --- a/src/core/libs/gnss_sdr_supl_client.h +++ b/src/core/libs/gnss_sdr_supl_client.h @@ -77,6 +77,7 @@ private: supl_ctx_t ctx; // assistance data supl_assist_t assist; + bool read_gal_almanac_from_gsa(const std::string file_name); public: // SUPL SERVER INFO diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index b21f68ff8..e4e6ce91d 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -241,8 +241,8 @@ bool ControlThread::read_assistance_from_XML() std::string cnav_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_cnav_utc_model_xml", cnav_utc_default_xml_filename); std::string eph_glo_xml_filename = configuration_->property("GNSS-SDR.SUPL_glo_ephemeris_xml", eph_glo_gnav_default_xml_filename); std::string glo_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_glo_utc_model_xml", glo_utc_default_xml_filename); - std::string gal_almanac_xml_filename = configuration_->property("GNSS-SDR.SUPL_gal_almanacl_xml", gal_almanac_default_xml_filename); - std::string gps_almanac_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_almanacl_xml", gps_almanac_default_xml_filename); + std::string gal_almanac_xml_filename = configuration_->property("GNSS-SDR.SUPL_gal_almanac_xml", gal_almanac_default_xml_filename); + std::string gps_almanac_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_almanac_xml", gps_almanac_default_xml_filename); if (configuration_->property("GNSS-SDR.AGNSS_XML_enabled", false) == true) { @@ -258,7 +258,8 @@ bool ControlThread::read_assistance_from_XML() cnav_utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_cnav_utc_model_xml", cnav_utc_default_xml_filename); eph_glo_xml_filename = configuration_->property("GNSS-SDR.AGNSS_glo_ephemeris_xml", eph_glo_gnav_default_xml_filename); glo_utc_xml_filename = configuration_->property("GNSS-SDR.AGNSS_glo_utc_model_xml", glo_utc_default_xml_filename); - gal_almanac_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gal_almanacl_xml", gal_almanac_default_xml_filename); + gal_almanac_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gal_almanac_xml", gal_almanac_default_xml_filename); + gps_almanac_xml_filename = configuration_->property("GNSS-SDR.AGNSS_gps_almanac_xml", gps_almanac_default_xml_filename); } std::cout << "Trying to read GNSS ephemeris from XML file(s)..." << std::endl; From a7f39c9470a54e4b91945c8be80fa3d3177fbb21 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 10 Nov 2018 19:23:13 +0100 Subject: [PATCH 077/143] Avoid warning --- src/core/libs/gnss_sdr_supl_client.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index 30de44cdf..1b4dcfa81 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -905,6 +905,10 @@ bool gnss_sdr_supl_client::read_gal_almanac_from_gsa(const std::string file_name } return true; #else + if (file_name.empty()) + { + // avoid warning + } return false; #endif } From 571c8c67fd3426c694467f73aa0ad676e74a7b83 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 10 Nov 2018 19:32:45 +0100 Subject: [PATCH 078/143] Improve CMake messages --- CMakeLists.txt | 3 +++ src/core/libs/CMakeLists.txt | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15432d2d3..e02ab71df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1220,6 +1220,9 @@ endif(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_V # PugiXML - https://pugixml.org/ ################################################################################ find_package(PugiXML QUIET) +if(PugiXML_FOUND) + message(STATUS "PugiXML has been found. Reading of GSA Galileo almanac XML files enabled.") +endif(PugiXML_FOUND) ################################################################################ diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index c901ea715..7640bca99 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -37,7 +37,6 @@ set(CORE_LIBS_HEADERS ) if(PugiXML_FOUND) - message(STATUS "PugiXML has been found. Reading of GSA Galileo almanac XML files enabled.") add_definitions( -DPUGIXML_FOUND=1 ) else(PugiXML_FOUND) set(PUGIXML_INCLUDE_DIR "") From 90e066344de047329e9d9e037bd6ecbecdb25f92 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 10 Nov 2018 21:26:42 +0100 Subject: [PATCH 079/143] Add PugiXML to Homebrew instructions --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c632b9ab2..d783c0858 100644 --- a/README.md +++ b/README.md @@ -588,6 +588,7 @@ $ brew install armadillo $ brew install glog gflags gnutls $ brew install gnuradio $ brew install libmatio +$ brew install pugixml $ pip install mako $ pip install six ~~~~~~ From e7c1a71a5a9ce73d934e5780e533cf5ccd410ef2 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 11 Nov 2018 12:17:37 +0100 Subject: [PATCH 080/143] Find PugiXML in Fedora --- cmake/Modules/FindPugiXML.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/FindPugiXML.cmake b/cmake/Modules/FindPugiXML.cmake index f60b441c8..e1e8df872 100644 --- a/cmake/Modules/FindPugiXML.cmake +++ b/cmake/Modules/FindPugiXML.cmake @@ -47,7 +47,9 @@ find_library (PUGIXML_LIBRARY /usr/lib/s390x-linux-gnu /usr/local/lib /opt/local/lib - /usr/lib ) + /usr/lib + /usr/lib64 + /usr/local/lib64 ) # Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found. include (FindPackageHandleStandardArgs) From 573092d033bcae3d4e46f3bc300d7f5224364c47 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 11 Nov 2018 12:27:01 +0100 Subject: [PATCH 081/143] Download and build PugiXML if not found --- CMakeLists.txt | 46 +++++++++++++++++++++++++- src/core/libs/CMakeLists.txt | 13 +++----- src/core/libs/gnss_sdr_supl_client.cc | 10 ------ src/core/receiver/CMakeLists.txt | 1 + src/main/CMakeLists.txt | 1 + src/tests/CMakeLists.txt | 1 + src/utils/front-end-cal/CMakeLists.txt | 1 + 7 files changed, 54 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e02ab71df..9be8bfb8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -352,7 +352,7 @@ set(GNSSSDR_GTEST_LOCAL_VERSION "1.8.1") set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master") set(GNSSSDR_GPSTK_LOCAL_VERSION "2.10.6") set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.13") - +set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.9") ################################################################################ @@ -1222,6 +1222,50 @@ endif(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_V find_package(PugiXML QUIET) if(PugiXML_FOUND) message(STATUS "PugiXML has been found. Reading of GSA Galileo almanac XML files enabled.") +else(PugiXML_FOUND) + message(STATUS " PugiXML v${GNSSSDR_PUGIXML_LOCAL_VERSION} will be downloaded and built automatically") + message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") + set(PUGIXML_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}) + set(TOOLCHAIN_ARG "") + if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) + set(PUGIXML_COMPILER "") + set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake") + endif(EXISTS $ENV{OECORE_TARGET_SYSROOT}) + if(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add( + pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml + GIT_REPOSITORY https://github.com/zeux/pugixml + GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + CMAKE_ARGS ${PUGIXML_COMPILER} ${TOOLCHAIN_ARG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" + ) + else(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add( + pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml + GIT_REPOSITORY https://github.com/zeux/pugixml + GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + CMAKE_ARGS ${PUGIXML_COMPILER} ${TOOLCHAIN_ARG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + INSTALL_COMMAND "" + ) + endif(CMAKE_VERSION VERSION_LESS 3.2) + set(PUGIXML_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} ) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src/pugixml.hpp + ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/pugixml.hpp COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src/pugiconfig.hpp + ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/pugiconfig.hpp COPYONLY) + set(PUGIXML_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} ) + set(PUGIXML_LOCAL true) endif(PugiXML_FOUND) diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index 7640bca99..45c7477ab 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -35,13 +35,6 @@ set(CORE_LIBS_HEADERS string_converter.h gnss_sdr_supl_client.h ) - -if(PugiXML_FOUND) - add_definitions( -DPUGIXML_FOUND=1 ) -else(PugiXML_FOUND) - set(PUGIXML_INCLUDE_DIR "") - set(PUGIXML_LIBRARIES "") -endif(PugiXML_FOUND) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -60,4 +53,8 @@ list(SORT CORE_LIBS_SOURCES) add_library(rx_core_lib ${CORE_LIBS_SOURCES} ${CORE_LIBS_HEADERS}) source_group(Headers FILES ${CORE_LIBS_HEADERS}) -target_link_libraries(rx_core_lib supl_library ${PUGIXML_LIBRARIES}) +target_link_libraries(rx_core_lib supl_library ${PUGIXML_LIBRARY}) + +if(PUGIXML_LOCAL) + add_dependencies(rx_core_lib pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}) +endif(PUGIXML_LOCAL) diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index 1b4dcfa81..1b9646de0 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -32,9 +32,7 @@ */ #include "gnss_sdr_supl_client.h" -#ifdef PUGIXML_FOUND #include -#endif #include #include @@ -858,7 +856,6 @@ bool gnss_sdr_supl_client::load_gal_almanac_xml(const std::string file_name) bool gnss_sdr_supl_client::read_gal_almanac_from_gsa(const std::string file_name) { -#ifdef PUGIXML_FOUND pugi::xml_document doc; pugi::xml_parse_result result = doc.load_file(file_name.c_str()); if (!result) @@ -904,13 +901,6 @@ bool gnss_sdr_supl_client::read_gal_almanac_from_gsa(const std::string file_name return false; } return true; -#else - if (file_name.empty()) - { - // avoid warning - } - return false; -#endif } diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index e0246a06f..461320653 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -157,6 +157,7 @@ include_directories( ${GFlags_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${PUGIXML_INCLUDE_DIR} ${OPT_RECEIVER_INCLUDE_DIRS} ${VOLK_GNSSSDR_INCLUDE_DIRS} ) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 701f8ca95..eaf6eff43 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -61,6 +61,7 @@ include_directories( ${ARMADILLO_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${PUGIXML_INCLUDE_DIR} ${GNSS_SDR_OPTIONAL_HEADERS} ${VOLK_GNSSSDR_INCLUDE_DIRS} ${OPT_GNSSSDR_INCLUDE_DIRS} diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 9e8d519b6..5bcd5729f 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -376,6 +376,7 @@ set(LIST_INCLUDE_DIRS ${VOLK_INCLUDE_DIRS} ${VOLK_GNSSSDR_INCLUDE_DIRS} ${MATIO_INCLUDE_DIRS} + ${PUGIXML_INCLUDE_DIR} ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ) diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index 6f0b15acb..151acf2b0 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -43,6 +43,7 @@ include_directories( ${GNURADIO_BLOCKS_INCLUDE_DIRS} ${ARMADILLO_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} + ${PUGIXML_INCLUDE_DIR} ${VOLK_GNSSSDR_INCLUDE_DIRS} ) From a8af1b166fcf11813841822464bc59d6fb9c0be9 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 11 Nov 2018 12:36:33 +0100 Subject: [PATCH 082/143] Fix PugiXML configuration --- CMakeLists.txt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9be8bfb8d..e2f33d0c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1223,8 +1223,7 @@ find_package(PugiXML QUIET) if(PugiXML_FOUND) message(STATUS "PugiXML has been found. Reading of GSA Galileo almanac XML files enabled.") else(PugiXML_FOUND) - message(STATUS " PugiXML v${GNSSSDR_PUGIXML_LOCAL_VERSION} will be downloaded and built automatically") - message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") + message(STATUS " PugiXML v${GNSSSDR_PUGIXML_LOCAL_VERSION} will be downloaded and built automatically when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'.") set(PUGIXML_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}) set(TOOLCHAIN_ARG "") if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) @@ -1260,11 +1259,7 @@ else(PugiXML_FOUND) ) endif(CMAKE_VERSION VERSION_LESS 3.2) set(PUGIXML_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} ) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src/pugixml.hpp - ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/pugixml.hpp COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src/pugiconfig.hpp - ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/pugiconfig.hpp COPYONLY) - set(PUGIXML_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} ) + set(PUGIXML_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src ) set(PUGIXML_LOCAL true) endif(PugiXML_FOUND) From f65845f4d6fdcb72d0016840fa33c9074cc2893d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 11 Nov 2018 19:19:58 +0100 Subject: [PATCH 083/143] Create only one folder for PugiXML --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2f33d0c3..eb797920f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1233,7 +1233,7 @@ else(PugiXML_FOUND) if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add( pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} GIT_REPOSITORY https://github.com/zeux/pugixml GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} @@ -1246,7 +1246,7 @@ else(PugiXML_FOUND) else(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add( pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} GIT_REPOSITORY https://github.com/zeux/pugixml GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} From 57a01809cbad6e8f87bd3176a10fc4f6b93e8204 Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 11 Nov 2018 20:25:14 +0100 Subject: [PATCH 084/143] Improving spir signal source --- .../spir_gss6450_file_signal_source.cc | 153 ++++++++++-------- .../spir_gss6450_file_signal_source.h | 11 +- .../unpack_spir_gss6450_samples.cc | 2 +- 3 files changed, 95 insertions(+), 71 deletions(-) diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc index 25473ce2f..8b124a3fd 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc @@ -59,7 +59,7 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* adc_bits_ = configuration->property(role + ".adc_bits", 4); n_channels_ = configuration->property(role + ".total_channels", 1); sel_ch_ = configuration->property(role + ".sel_ch", 1); - item_size_ = sizeof(int); + item_size_ = sizeof(int32_t); int64_t bytes_seek = configuration->property(role + ".bytes_to_skip", 65536); double sample_size_byte = static_cast(adc_bits_) / 4.0; @@ -69,17 +69,22 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* } if (n_channels_ > 1) { - for (uint32_t i = 0; i < (n_channels_ - 1); i++) + for (uint32_t i = 0; i < n_channels_; i++) { - null_sinks_.push_back(gr::blocks::null_sink::make(item_size_)); + null_sinks_.push_back(gr::blocks::null_sink::make(sizeof(gr_complex))); + unpack_spir_vec_.push_back(make_unpack_spir_gss6450_samples(adc_bits_)); + if (endian_swap_) + { + endian_vec_.push_back(gr::blocks::endian_swap::make(item_size_)); + } } - DLOG(INFO) << "NUMBER OF NULL SINKS = " << null_sinks_.size(); } try { file_source_ = gr::blocks::file_source::make(item_size_, filename_.c_str(), repeat_); file_source_->seek(bytes_seek / item_size_, SEEK_SET); - unpack_spir_ = make_unpack_spir_gss6450_samples(adc_bits_); + + deint_ = gr::blocks::deinterleave::make(item_size_); } catch (const std::exception& e) @@ -143,22 +148,19 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; - valve_ = gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue_); - DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; + for (uint32_t i = 0; i < (n_channels_); i++) + { + valve_vec_.push_back(gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue_)); + if (dump_) + { + sink_vec_.push_back(gr::blocks::file_sink::make(sizeof(gr_complex), dump_filename_.c_str())); + } + if (enable_throttle_control_) + { + throttle_vec_.push_back(gr::blocks::throttle::make(sizeof(gr_complex), sampling_frequency_)); + } + } - if (dump_) - { - sink_ = gr::blocks::file_sink::make(sizeof(gr_complex), dump_filename_.c_str()); - DLOG(INFO) << "file_sink(" << sink_->unique_id() << ")"; - } - if (enable_throttle_control_) - { - throttle_ = gr::blocks::throttle::make(sizeof(gr_complex), sampling_frequency_); - } - if (endian_swap_) - { - endian_ = gr::blocks::endian_swap::make(item_size_); - } DLOG(INFO) << "File source filename " << filename_; DLOG(INFO) << "Samples " << samples_; DLOG(INFO) << "Sampling frequency " << sampling_frequency_; @@ -188,15 +190,17 @@ void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block) if (samples_ > 0) { top_block->connect(file_source_, 0, deint_, 0); + if (endian_swap_) { - top_block->connect(deint_, sel_ch_ - 1, endian_, 0); - top_block->connect(endian_, 0, unpack_spir_, 0); + top_block->connect(deint_, sel_ch_ - 1, endian_vec_.at(sel_ch_ - 1), 0); + top_block->connect(endian_vec_.at(sel_ch_ - 1), 0, unpack_spir_vec_.at(sel_ch_ - 1), 0); } else { - top_block->connect(deint_, sel_ch_ - 1, unpack_spir_, 0); + top_block->connect(deint_, sel_ch_ - 1, unpack_spir_vec_.at(sel_ch_ - 1), 0); } + if (n_channels_ > 1) { uint32_t aux = 0; @@ -204,23 +208,37 @@ void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block) { if (i != (sel_ch_ - 1)) { - top_block->connect(deint_, i, null_sinks_.at(aux), 0); + if (endian_swap_) + { + top_block->connect(deint_, i, endian_vec_.at(i), 0); + top_block->connect(endian_vec_.at(i), 0, unpack_spir_vec_.at(i), 0); + } + else + { + top_block->connect(deint_, i, unpack_spir_vec_.at(i), 0); + } + aux++; } } } - if (enable_throttle_control_) + for (uint32_t i = 0; i < n_channels_; i++) { - top_block->connect(unpack_spir_, 0, throttle_, 0); - top_block->connect(throttle_, 0, valve_, 0); - } - else - { - top_block->connect(unpack_spir_, 0, valve_, 0); - } - if (dump_) - { - top_block->connect(valve_, 0, sink_, 0); + if (enable_throttle_control_) + { + top_block->connect(unpack_spir_vec_.at(i), 0, throttle_vec_.at(i), 0); + top_block->connect(throttle_vec_.at(i), 0, valve_vec_.at(i), 0); + } + else + { + top_block->connect(unpack_spir_vec_.at(i), 0, valve_vec_.at(i), 0); + } + if (dump_) + { + top_block->connect(valve_vec_.at(i), 0, sink_vec_.at(i), 0); + } + + top_block->connect(valve_vec_.at(i), 0, null_sinks_.at(i), 0); } } else @@ -237,12 +255,12 @@ void SpirGSS6450FileSignalSource::disconnect(gr::top_block_sptr top_block) top_block->disconnect(file_source_, 0, deint_, 0); if (endian_swap_) { - top_block->disconnect(deint_, sel_ch_ - 1, endian_, 0); - top_block->disconnect(endian_, 0, unpack_spir_, 0); + top_block->disconnect(deint_, sel_ch_ - 1, endian_vec_.at(sel_ch_ - 1), 0); + top_block->disconnect(endian_vec_.at(sel_ch_ - 1), 0, unpack_spir_vec_.at(sel_ch_ - 1), 0); } else { - top_block->disconnect(deint_, sel_ch_ - 1, unpack_spir_, 0); + top_block->disconnect(deint_, sel_ch_ - 1, unpack_spir_vec_.at(sel_ch_ - 1), 0); } if (n_channels_ > 1) { @@ -251,23 +269,38 @@ void SpirGSS6450FileSignalSource::disconnect(gr::top_block_sptr top_block) { if (i != (sel_ch_ - 1)) { - top_block->disconnect(deint_, i, null_sinks_.at(aux), 0); + if (endian_swap_) + { + top_block->disconnect(deint_, i, endian_vec_.at(i), 0); + top_block->disconnect(endian_vec_.at(i), 0, unpack_spir_vec_.at(i), 0); + } + else + { + top_block->disconnect(deint_, i, unpack_spir_vec_.at(i), 0); + } + aux++; } } } - if (enable_throttle_control_) + + for (uint32_t i = 0; i < (n_channels_); i++) { - top_block->disconnect(unpack_spir_, 0, throttle_, 0); - top_block->disconnect(throttle_, 0, valve_, 0); - } - else - { - top_block->disconnect(unpack_spir_, 0, valve_, 0); - } - if (dump_) - { - top_block->disconnect(valve_, 0, sink_, 0); + if (enable_throttle_control_) + { + top_block->disconnect(unpack_spir_vec_.at(i), 0, throttle_vec_.at(i), 0); + top_block->disconnect(throttle_vec_.at(i), 0, valve_vec_.at(i), 0); + } + else + { + top_block->disconnect(unpack_spir_vec_.at(i), 0, valve_vec_.at(i), 0); + } + if (dump_) + { + top_block->disconnect(valve_vec_.at(i), 0, sink_vec_.at(i), 0); + } + + top_block->disconnect(valve_vec_.at(i), 0, null_sinks_.at(i), 0); } } else @@ -283,22 +316,12 @@ gr::basic_block_sptr SpirGSS6450FileSignalSource::get_left_block() return gr::blocks::file_source::sptr(); } +gr::basic_block_sptr SpirGSS6450FileSignalSource::get_right_block(int RF_channel) +{ + return valve_vec_.at(RF_channel); +} gr::basic_block_sptr SpirGSS6450FileSignalSource::get_right_block() { - if (samples_ > 0) - { - return valve_; - } - else - { - if (enable_throttle_control_) - { - return throttle_; - } - else - { - return unpack_spir_; - } - } + return valve_vec_.at(0); } diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h index d09f0356b..a37a4fe7f 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h @@ -79,6 +79,7 @@ public: void connect(gr::top_block_sptr top_block) override; void disconnect(gr::top_block_sptr top_block) override; gr::basic_block_sptr get_left_block() override; + gr::basic_block_sptr get_right_block(int RF_channel) override; gr::basic_block_sptr get_right_block() override; inline std::string filename() const @@ -124,12 +125,12 @@ private: uint32_t sel_ch_; gr::blocks::file_source::sptr file_source_; gr::blocks::deinterleave::sptr deint_; - gr::blocks::endian_swap::sptr endian_; + std::vector endian_vec_; std::vector null_sinks_; - unpack_spir_gss6450_samples_sptr unpack_spir_; - boost::shared_ptr valve_; - gr::blocks::file_sink::sptr sink_; - gr::blocks::throttle::sptr throttle_; + std::vector unpack_spir_vec_; + std::vector> valve_vec_; + std::vector sink_vec_; + std::vector throttle_vec_; gr::msg_queue::sptr queue_; size_t item_size_; }; diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc index bca448c20..84d7ad0fc 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc @@ -40,7 +40,7 @@ unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(unsigned int a unpack_spir_gss6450_samples::unpack_spir_gss6450_samples(unsigned int adc_nbit) : gr::sync_interpolator("unpack_spir_gss6450_samples", - gr::io_signature::make(1, 1, sizeof(int)), + gr::io_signature::make(1, 1, sizeof(int32_t)), gr::io_signature::make(1, 1, sizeof(gr_complex)), 16 / adc_nbit) { adc_bits = adc_nbit; From b9fb38d71ef2295e80b8f58f0eacb21f4ffdd2bd Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 12 Nov 2018 11:03:50 +0100 Subject: [PATCH 085/143] Update gflags version to 2.2.2 --- CMakeLists.txt | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb797920f..7333a5ea0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -345,7 +345,7 @@ set(GNSSSDR_MATIO_MIN_VERSION "1.5.3") ################################################################################ # Versions to download and build (but not installed) if not found ################################################################################ -set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.1") +set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.2") set(GNSSSDR_GLOG_LOCAL_VERSION "0.3.5") set(GNSSSDR_ARMADILLO_LOCAL_VERSION "9.200.x") set(GNSSSDR_GTEST_LOCAL_VERSION "1.8.1") diff --git a/README.md b/README.md index d783c0858..14db5173a 100644 --- a/README.md +++ b/README.md @@ -202,9 +202,9 @@ The full stop separated from ```cmake``` by a space is important. [CMake](https: #### Install [Gflags](https://github.com/gflags/gflags "Gflags' Homepage"), a commandline flags processing module for C++: ~~~~~~ -$ wget https://github.com/gflags/gflags/archive/v2.2.1.tar.gz -$ tar xvfz v2.2.1.tar.gz -$ cd gflags-2.2.1 +$ wget https://github.com/gflags/gflags/archive/v2.2.2.tar.gz +$ tar xvfz v2.2.2.tar.gz +$ cd gflags-2.2.2 $ cmake -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF -DBUILD_gflags_nothreads_LIB=OFF . $ make $ sudo make install From 049b2d777d997a1b9bc947fdaf25f5ffb0b7454d Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 14 Nov 2018 18:28:14 +0100 Subject: [PATCH 086/143] Adding tracking pull-in delay simulation option in tracking pull-in unit test --- src/algorithms/libs/gnss_sdr_valve.cc | 70 +++++++++++++------ src/algorithms/libs/gnss_sdr_valve.h | 20 +++++- src/tests/common-files/tracking_tests_flags.h | 3 + .../tracking/tracking_pull-in_test.cc | 69 +++++++++++++++--- 4 files changed, 128 insertions(+), 34 deletions(-) diff --git a/src/algorithms/libs/gnss_sdr_valve.cc b/src/algorithms/libs/gnss_sdr_valve.cc index b49ab50f9..3b8b3a56d 100644 --- a/src/algorithms/libs/gnss_sdr_valve.cc +++ b/src/algorithms/libs/gnss_sdr_valve.cc @@ -2,6 +2,7 @@ * \file gnss_sdr_valve.cc * \brief Implementation of a GNU Radio block that sends a STOP message to the * control queue right after a specific number of samples have passed through it. + * \author Javier Arribas, 2018. jarribas(at)cttc.es * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * * @@ -39,42 +40,65 @@ gnss_sdr_valve::gnss_sdr_valve(size_t sizeof_stream_item, unsigned long long nitems, - gr::msg_queue::sptr queue) : gr::sync_block("valve", - gr::io_signature::make(1, 1, sizeof_stream_item), - gr::io_signature::make(1, 1, sizeof_stream_item)), - d_nitems(nitems), - d_ncopied_items(0), - d_queue(queue) + gr::msg_queue::sptr queue, bool stop_flowgraph) : gr::sync_block("valve", + gr::io_signature::make(1, 1, sizeof_stream_item), + gr::io_signature::make(1, 1, sizeof_stream_item)), + d_nitems(nitems), + d_ncopied_items(0), + d_queue(queue), + d_stop_flowgraph(stop_flowgraph) { + d_open_valve = false; } -boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, unsigned long long nitems, gr::msg_queue::sptr queue) +boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, unsigned long long nitems, gr::msg_queue::sptr queue, bool stop_flowgraph) { - boost::shared_ptr valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, queue)); + boost::shared_ptr valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, queue, stop_flowgraph)); return valve_; } +boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, unsigned long long nitems, gr::msg_queue::sptr queue) +{ + boost::shared_ptr valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, queue, false)); + return valve_; +} +void gnss_sdr_valve::open_valve() +{ + d_open_valve = true; +} int gnss_sdr_valve::work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { - if (d_ncopied_items >= d_nitems) + if (d_open_valve == false) { - ControlMessageFactory *cmf = new ControlMessageFactory(); - d_queue->handle(cmf->GetQueueMessage(200, 0)); - LOG(INFO) << "Stopping receiver, " << d_ncopied_items << " samples processed"; - delete cmf; - return -1; // Done! + if (d_ncopied_items >= d_nitems) + { + ControlMessageFactory *cmf = new ControlMessageFactory(); + d_queue->handle(cmf->GetQueueMessage(200, 0)); + LOG(INFO) << "Stopping receiver, " << d_ncopied_items << " samples processed"; + delete cmf; + if (d_stop_flowgraph) + { + return -1; // Done! + } + else + { + usleep(1000000); + return 0; //do not produce or consume + } + } + unsigned long long n = std::min(d_nitems - d_ncopied_items, static_cast(noutput_items)); + if (n == 0) return 0; + memcpy(output_items[0], input_items[0], n * input_signature()->sizeof_stream_item(0)); + d_ncopied_items += n; + return n; + } + else + { + memcpy(output_items[0], input_items[0], noutput_items * input_signature()->sizeof_stream_item(0)); + return noutput_items; } - unsigned long long n = std::min(d_nitems - d_ncopied_items, static_cast(noutput_items)); - if (n == 0) return 0; - memcpy(output_items[0], input_items[0], n * input_signature()->sizeof_stream_item(0)); - //for(long long i = 0; i++; i #include - boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, unsigned long long nitems, gr::msg_queue::sptr queue); +boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, + unsigned long long nitems, + gr::msg_queue::sptr queue, + bool stop_flowgraph); /*! * \brief Implementation of a GNU Radio block that sends a STOP message to the * control queue right after a specific number of samples have passed through it. @@ -50,14 +54,24 @@ class gnss_sdr_valve : public gr::sync_block friend boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, unsigned long long nitems, gr::msg_queue::sptr queue); - gnss_sdr_valve(size_t sizeof_stream_item, + friend boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, unsigned long long nitems, - gr::msg_queue::sptr queue); + gr::msg_queue::sptr queue, + bool stop_flowgraph); + + unsigned long long d_nitems; unsigned long long d_ncopied_items; gr::msg_queue::sptr d_queue; + bool d_stop_flowgraph; + bool d_open_valve; public: + gnss_sdr_valve(size_t sizeof_stream_item, + unsigned long long nitems, + gr::msg_queue::sptr queue, bool stop_flowgraph); + void open_valve(); + int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/src/tests/common-files/tracking_tests_flags.h b/src/tests/common-files/tracking_tests_flags.h index 6050ccd5c..2ff85dabf 100644 --- a/src/tests/common-files/tracking_tests_flags.h +++ b/src/tests/common-files/tracking_tests_flags.h @@ -67,6 +67,9 @@ DEFINE_double(acq_Delay_error_chips_start, 2.0, "Acquisition Code Delay error st DEFINE_double(acq_Delay_error_chips_stop, -2.0, "Acquisition Code Delay error stop sweep value [Chips]"); DEFINE_double(acq_Delay_error_chips_step, -0.1, "Acquisition Code Delay error sweep step value [Chips]"); +DEFINE_double(acq_to_trk_delay_s, 0.0, "Acquisition to Tracking delay value [s]"); + + DEFINE_int64(skip_samples, 0, "Skip an initial transitory in the processed signal file capture [samples]"); DEFINE_int32(plot_detail_level, 0, "Specify the desired plot detail (0,1,2): 0 - Minimum plots (default) 2 - Plot all tracking parameters"); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc index 0daa3cf59..6b33a2c33 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc @@ -33,7 +33,9 @@ #include "GPS_L1_CA.h" #include "gnss_block_factory.h" +#include "control_message_factory.h" #include "tracking_interface.h" +#include "gnss_sdr_valve.h" #include "gps_l2_m_pcps_acquisition.h" #include "gps_l1_ca_pcps_acquisition.h" #include "gps_l1_ca_pcps_acquisition_fine_doppler.h" @@ -56,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -186,6 +189,8 @@ public: std::shared_ptr config; Gnss_Synchro gnss_synchro; size_t item_size; + + gr::msg_queue::sptr queue; }; @@ -658,6 +663,18 @@ TEST_F(TrackingPullInTest, ValidationOfResults) << " [Hz], estimated Initial code delay " << true_acq_delay_samples << " [Samples]" << " Acquisition SampleStamp is " << acq_samplestamp_map.find(FLAGS_test_satellite_PRN)->second << std::endl; } + + // create the msg queue for valve + + queue = gr::msg_queue::make(0); + boost::shared_ptr reseteable_valve; + long long int acq_to_trk_delay_samples = ceil(static_cast(FLAGS_fs_gen_sps) * FLAGS_acq_to_trk_delay_s); + boost::shared_ptr resetable_valve_(new gnss_sdr_valve(sizeof(gr_complex), acq_to_trk_delay_samples, queue, false)); + + std::shared_ptr control_message_factory_; + std::shared_ptr>> control_messages_; + + //CN0 LOOP std::vector> pull_in_results_v_v; @@ -710,7 +727,15 @@ TEST_F(TrackingPullInTest, ValidationOfResults) gr::blocks::head::sptr head_samples = gr::blocks::head::make(sizeof(gr_complex), baseband_sampling_freq * FLAGS_duration); top_block->connect(file_source, 0, gr_interleaved_char_to_complex, 0); top_block->connect(gr_interleaved_char_to_complex, 0, head_samples, 0); - top_block->connect(head_samples, 0, tracking->get_left_block(), 0); + if (acq_to_trk_delay_samples > 0) + { + top_block->connect(head_samples, 0, resetable_valve_, 0); + top_block->connect(resetable_valve_, 0, tracking->get_left_block(), 0); + } + else + { + top_block->connect(head_samples, 0, tracking->get_left_block(), 0); + } top_block->connect(tracking->get_right_block(), 0, sink, 0); top_block->msg_connect(tracking->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); file_source->seek(2 * FLAGS_skip_samples, 0); //skip head. ibyte, two bytes per complex sample @@ -721,18 +746,46 @@ TEST_F(TrackingPullInTest, ValidationOfResults) //***** STEP 5: Perform the signal tracking and read the results ***** //******************************************************************** std::cout << "--- START TRACKING WITH PULL-IN ERROR: " << acq_doppler_error_hz_values.at(current_acq_doppler_error_idx) << " [Hz] and " << acq_delay_error_chips_values.at(current_acq_doppler_error_idx).at(current_acq_code_error_idx) << " [Chips] ---" << std::endl; - tracking->start_tracking(); std::chrono::time_point start, end; - EXPECT_NO_THROW({ - start = std::chrono::system_clock::now(); - top_block->run(); // Start threads and wait - end = std::chrono::system_clock::now(); - }) << "Failure running the top_block."; + if (acq_to_trk_delay_samples > 0) + { + EXPECT_NO_THROW({ + start = std::chrono::system_clock::now(); + std::cout << "--- SIMULATING A PULL-IN DELAY OF " << FLAGS_acq_to_trk_delay_s << " SECONDS ---\n"; + top_block->start(); + std::cout << " Waiting for valve...\n"; + //wait the valve message indicating the circulation of the amount of samples of the delay + gr::message::sptr queue_message = queue->delete_head(); + if (queue_message != 0) + { + control_messages_ = control_message_factory_->GetControlMessages(queue_message); + } + else + { + control_messages_->clear(); + } + std::cout << " Starting tracking...\n"; + tracking->start_tracking(); + resetable_valve_->open_valve(); + std::cout << " Waiting flowgraph..\n"; + top_block->wait(); + end = std::chrono::system_clock::now(); + }) << "Failure running the top_block."; + } + else + { + tracking->start_tracking(); + std::chrono::time_point start, end; + EXPECT_NO_THROW({ + start = std::chrono::system_clock::now(); + top_block->run(); // Start threads and wait + end = std::chrono::system_clock::now(); + }) << "Failure running the top_block."; + } std::chrono::duration elapsed_seconds = end - start; std::cout << "Signal tracking completed in " << elapsed_seconds.count() << " seconds" << std::endl; - pull_in_results_v.push_back(msg_rx->rx_message != 3); //save last asynchronous tracking message in order to detect a loss of lock //******************************** From bec3775f23dcbd524e496e9752ae1c3e19785bcc Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 17 Nov 2018 14:31:06 +0100 Subject: [PATCH 087/143] Replace CMAKE_COMPILER_IS_GNUCXX by CMAKE_CXX_COMPILER_ID --- CMakeLists.txt | 35 ++++++++----------- cmake/Modules/TestForARM.cmake | 6 ++-- .../volk_gnsssdr/CMakeLists.txt | 8 ++--- .../volk_gnsssdr/apps/CMakeLists.txt | 8 ++--- 4 files changed, 26 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7333a5ea0..18379951d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -359,7 +359,7 @@ set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.9") # Check cmake version ################################################################################ if(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION}) - message(STATUS "Your CMake version is too old and does not support some features required by GNSS-SDR. CMake version must be at least ${GNSSSDR_CMAKE_MIN_VERSION}. For more information check https://github.com/joakimkarlsson/bandit/issues/40") + message(STATUS "Your CMake version is too old and does not support some features required by GNSS-SDR. CMake version must be at least ${GNSSSDR_CMAKE_MIN_VERSION}.") # For more information check https://github.com/joakimkarlsson/bandit/issues/40 message(FATAL_ERROR "Fatal error: CMake >= ${GNSSSDR_CMAKE_MIN_VERSION} required.") endif(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION}) @@ -371,11 +371,6 @@ endif(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION}) if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION}) message(STATUS "Your GCC version is too old and does not support some C++ features required by GNSS-SDR. GCC version must be at least ${GNSSSDR_GCC_MIN_VERSION}") - if(${LINUX_DISTRIBUTION} MATCHES "Ubuntu") - if(${LINUX_VER} MATCHES "12.04") - message(STATUS "For instructions on how to upgrade GCC, check https://askubuntu.com/a/271561") - endif(${LINUX_VER} MATCHES "12.04") - endif(${LINUX_DISTRIBUTION} MATCHES "Ubuntu") message(FATAL_ERROR "Fatal error: GCC >= ${GNSSSDR_GCC_MIN_VERSION} required.") endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION}) endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") @@ -625,9 +620,9 @@ if(NOT VOLK_GNSSSDR_FOUND) set(READ_ENVIRO "") if(ENABLE_PACKAGING) - if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) + if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON -DCMAKE_VERBOSE_MAKEFILE=ON") - endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) + endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if(NOT DEFINED ENV{PROTECT_PASSWORDS}) set(READ_ENVIRO ${CMAKE_COMMAND} -E environment) endif(NOT DEFINED ENV{PROTECT_PASSWORDS}) @@ -1512,9 +1507,9 @@ if(ENABLE_GPERFTOOLS) # Set GPerftools related flags if it is available # See https://github.com/gperftools/gperftools/blob/master/README if(GPERFTOOLS_FOUND) - if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) + if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free") - endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) + endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin") endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") @@ -1527,11 +1522,11 @@ endif(ENABLE_GPERFTOOLS) # GNU gprof (OPTIONAL) - https://sourceware.org/binutils/docs/gprof/ ######################################################################## if(ENABLE_GPROF) - #if(CMAKE_COMPILER_IS_GNUCXX) + #if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -pg") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg") - #endif(CMAKE_COMPILER_IS_GNUCXX) + #endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif(ENABLE_GPROF) @@ -1541,7 +1536,7 @@ endif(ENABLE_GPROF) # Support of C++17 is still not possible due to pm_remez.h (solved in GNU Radio 3.8) # Enable C++14 support in GCC >= 6.1.1 # Fallback to C++11 when using GCC < 6.1.1 -if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) +if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") @@ -1552,7 +1547,7 @@ if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) # endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall -Wextra") #Add warning flags: For "-Wall" see https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html -endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) +endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) # Support of C++17 is still not possible due to pm_remez.h (solved in GNU Radio 3.8) # Enable C++14 support in Clang >= 3.5.0 or AppleClang >= 600 @@ -1586,17 +1581,17 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif(OS_IS_MACOSX) endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") -if(NOT (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) +if(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) AND NOT WIN32) if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 14) endif(NOT (CMAKE_VERSION VERSION_LESS "3.1")) -endif(NOT (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) +endif(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) AND NOT WIN32) # Processor-architecture related flags # See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html if (NOT ARCH_COMPILER_FLAGS) - if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) + if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if(OS_IS_MACOSX) set(ARCH_COMPILER_FLAGS "-march=corei7 -mfpmath=sse") else(OS_IS_MACOSX) @@ -1615,16 +1610,16 @@ if (NOT ARCH_COMPILER_FLAGS) endif(IS_ARM) endif(NOT ${ENABLE_GENERIC_ARCH}) endif(OS_IS_MACOSX) - endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) + endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) endif (NOT ARCH_COMPILER_FLAGS) set(MY_CXX_FLAGS "${MY_CXX_FLAGS} ${ARCH_COMPILER_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS}") -if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) +if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) # https://gcc.gnu.org/wiki/Visibility add_definitions(-fvisibility=hidden) -endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) +endif((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) diff --git a/cmake/Modules/TestForARM.cmake b/cmake/Modules/TestForARM.cmake index 26c0a1874..9a5445287 100644 --- a/cmake/Modules/TestForARM.cmake +++ b/cmake/Modules/TestForARM.cmake @@ -41,7 +41,7 @@ message(STATUS "Checking for ARM") set (IS_ARM NO) set (ARM_VERSION "") -if (CMAKE_COMPILER_IS_GNUCXX) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") execute_process(COMMAND echo "int main(){}" COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dM -E - OUTPUT_VARIABLE TEST_FOR_ARM_RESULTS) @@ -94,11 +94,11 @@ if (CMAKE_COMPILER_IS_GNUCXX) message(STATUS "System is not ARM") endif(NOT ARM_FOUND STREQUAL "") -else (CMAKE_COMPILE_IS_GNUCXX) +else (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # TODO: Other compilers message(STATUS "Not detecting ARM on non-GNUCXX compiler. Defaulting to false") message(STATUS "If you are compiling for ARM, set IS_ARM=ON manually") -endif(CMAKE_COMPILER_IS_GNUCXX) +endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(IS_ARM ${IS_ARM} CACHE BOOL "Compiling for ARM") set(ARM_VERSION ${ARM_VERSION} CACHE STRING "ARM version") diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt index 017132296..5a75277e6 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -63,7 +63,7 @@ endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # Enable C++14 support in 8.0.0 > GCC >= 6.1.1 # Fallback to C++11 when using GCC < 6.1.1 -if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) +if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") @@ -74,7 +74,7 @@ if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall -Wextra") #Add warning flags: For "-Wall" see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html -endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) +endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) # Enable C++17 support in Clang >= 6.0.0 # Enable C++14 support in 6.0.0 > Clang >= 3.5.0 or AppleClang >= 600 @@ -100,12 +100,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif(CMAKE_SYSTEM_NAME MATCHES "Darwin") endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") -if(NOT (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) +if(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 11) endif(NOT (CMAKE_VERSION VERSION_LESS "3.1")) -endif(NOT (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) +endif(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS} -Wall") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt index c95967d70..00a198b5d 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt @@ -75,10 +75,10 @@ endif(ENABLE_STATIC_LIBS) if(ENABLE_STRIP) - if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) + if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) set_target_properties(volk_gnsssdr_profile PROPERTIES LINK_FLAGS "-s") - endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) + endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) endif(ENABLE_STRIP) @@ -99,10 +99,10 @@ else(ENABLE_STATIC_LIBS) endif(ENABLE_STATIC_LIBS) if(ENABLE_STRIP) - if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) + if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) set_target_properties(volk_gnsssdr-config-info PROPERTIES LINK_FLAGS "-s") - endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) + endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) endif(ENABLE_STRIP) install( From 30d162c76a7d24feb175dd0d69ad1ca5e4f1e390 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 17 Nov 2018 19:26:06 +0100 Subject: [PATCH 088/143] Get rid of deprecated link_libraries() --- CMakeLists.txt | 4 ++-- src/main/CMakeLists.txt | 1 + src/tests/CMakeLists.txt | 9 ++++++--- src/utils/front-end-cal/CMakeLists.txt | 3 ++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18379951d..0c8dbb11f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -433,7 +433,7 @@ endif(NOT ENABLE_GENERIC_ARCH) ################################################################################ if(CMAKE_VERSION VERSION_LESS 3.1) find_package(Threads REQUIRED) - link_libraries(${CMAKE_THREAD_LIBS_INIT}) + set(THREAD_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) else(CMAKE_VERSION VERSION_LESS 3.1) set(CMAKE_THREAD_PREFER_PTHREAD TRUE) if(CMAKE_CROSSCOMPILING) @@ -442,7 +442,7 @@ else(CMAKE_VERSION VERSION_LESS 3.1) set(THREADS_PREFER_PTHREAD_FLAG TRUE) endif(CMAKE_CROSSCOMPILING) find_package(Threads REQUIRED) - link_libraries(Threads::Threads) + set(THREAD_LIBRARIES Threads::Threads) endif(CMAKE_VERSION VERSION_LESS 3.1) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index eaf6eff43..4dff21617 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -82,6 +82,7 @@ add_custom_command(TARGET gnss-sdr POST_BUILD ${CMAKE_SOURCE_DIR}/install/$ ) target_link_libraries(gnss-sdr ${MAC_LIBRARIES} + ${THREAD_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 5bcd5729f..70778c279 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -95,7 +95,7 @@ if(NOT ${GTEST_DIR_LOCAL}) set(GTEST_LIBRARIES ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} - ) + ${THREAD_LIBRARIES} ) set(GTEST_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest") else(NOT ${GTEST_DIR_LOCAL}) if(GTEST_INCLUDE_DIRS) @@ -109,6 +109,7 @@ else(NOT ${GTEST_DIR_LOCAL}) add_library(gtest ${GTEST_DIR}/src/gtest-all.cc ${GTEST_DIR}/src/gtest_main.cc) set(GTEST_LIBRARIES gtest) endif(GTEST_INCLUDE_DIRS) + target_link_libraries(gtest ${THREAD_LIBRARIES}) endif(NOT ${GTEST_DIR_LOCAL}) @@ -495,6 +496,7 @@ if(ENABLE_SYSTEM_TESTING) if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(HOST_SYSTEM "GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCH_}") string(REPLACE "\n" "" HOST_SYSTEM "${HOST_SYSTEM}") + string(REPLACE "\"" "" HOST_SYSTEM "${HOST_SYSTEM}") endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(HOST_SYSTEM "MacOS") @@ -502,7 +504,7 @@ if(ENABLE_SYSTEM_TESTING) add_definitions(-DHOST_SYSTEM="${HOST_SYSTEM}") #### TTFF - set(OPT_LIBS_ ${Boost_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} + set(OPT_LIBS_ ${Boost_LIBRARIES} ${THREAD_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GTEST_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} gnss_sp_libs @@ -512,7 +514,7 @@ if(ENABLE_SYSTEM_TESTING) if(ENABLE_SYSTEM_TESTING_EXTRA) #### POSITION_TEST - set(OPT_LIBS_ ${Boost_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} + set(OPT_LIBS_ ${Boost_LIBRARIES} ${THREAD_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} ${GTEST_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} @@ -601,6 +603,7 @@ if(NOT ${GTEST_DIR_LOCAL}) else(NOT ${GTEST_DIR_LOCAL}) add_dependencies(gnss_block_test gtest) endif(NOT ${GTEST_DIR_LOCAL}) +set_property(TEST gnss_block_test PROPERTY TIMEOUT 60) ######################################################### diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index 151acf2b0..a9d1d455a 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -32,7 +32,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/core/libs ${CMAKE_SOURCE_DIR}/src/core/libs/supl ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl + ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs @@ -51,6 +51,7 @@ add_library(front_end_cal_lib ${FRONT_END_CAL_SOURCES} ${FRONT_END_CAL_HEADERS}) source_group(Headers FILES ${FRONT_END_CAL_HEADERS}) target_link_libraries(front_end_cal_lib ${MAC_LIBRARIES} + ${THREAD_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} From f7e29209ca695b7ef086655b5b9db9c90f99773b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 17 Nov 2018 19:36:47 +0100 Subject: [PATCH 089/143] Fix for CentOS 7 --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c8dbb11f..9caeece66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -354,6 +354,9 @@ set(GNSSSDR_GPSTK_LOCAL_VERSION "2.10.6") set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.13") set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.9") +if(CMAKE_VERSION VERSION_LESS "3.0.2") + set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.1") +endif(CMAKE_VERSION VERSION_LESS "3.0.2") ################################################################################ # Check cmake version From 52a4dbcdc524a8bd97e31b8afac73ad3c2697d0b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 18 Nov 2018 00:18:41 +0100 Subject: [PATCH 090/143] Suggest python3 packages in ArchLinux --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 14db5173a..184f67102 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ If you are using Arch Linux (with base-devel group installed): ~~~~~~ $ pacman -S cmake git boost boost-libs log4cpp libvolk gnuradio gnuradio-osmosdr \ - blas lapack gflags google-glog openssl pugixml python2-mako python2-six \ + blas lapack gflags google-glog openssl pugixml python-mako python-six \ libmatio libpcap gtest ~~~~~~ From e8032d52f9c6fa90dbedcf3a9e084127b305d78b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 18 Nov 2018 09:14:22 +0100 Subject: [PATCH 091/143] Use MATCHES when looking for Clang in CMAKE_CXX_COMPILER_ID --- .../libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt index d077a6c14..c538f7206 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt @@ -213,7 +213,7 @@ if(CPU_IS_x86) endif(CMAKE_SIZEOF_VOID_P EQUAL 4) # Disable SSE4a if Clang is less than version 3.2 - if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") + if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") # Figure out the version of Clang if(CMAKE_VERSION VERSION_LESS "2.8.10") # Exctract the Clang version from the --version string. @@ -227,7 +227,7 @@ if(CPU_IS_x86) if(CMAKE_C_COMPILER_VERSION VERSION_LESS "3.2") OVERRULE_ARCH(sse4_a "Clang >= 3.2 required for SSE4a") endif(CMAKE_C_COMPILER_VERSION VERSION_LESS "3.2") - endif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") + endif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") endif(CPU_IS_x86) From 4ee36cd2ccd0349d543a08455ef3ebca96fe5e96 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 18 Nov 2018 13:00:36 +0100 Subject: [PATCH 092/143] Add timeouts to tests --- src/tests/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 70778c279..3978f1b71 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -627,6 +627,7 @@ if(NOT ${GTEST_DIR_LOCAL}) else(NOT ${GTEST_DIR_LOCAL}) add_dependencies(gnuradio_block_test gtest) endif(NOT ${GTEST_DIR_LOCAL}) +set_property(TEST gnuradio_block_test PROPERTY TIMEOUT 30) ######################################################### @@ -653,6 +654,7 @@ else(NOT ${GTEST_DIR_LOCAL}) add_dependencies(matio_test gtest matio-${GNSSSDR_MATIO_LOCAL_VERSION}) endif(MATIO_FOUND) endif(NOT ${GTEST_DIR_LOCAL}) +set_property(TEST matio_test PROPERTY TIMEOUT 30) ######################################################### @@ -679,6 +681,7 @@ if(NOT ${GTEST_DIR_LOCAL}) else(NOT ${GTEST_DIR_LOCAL}) add_dependencies(acq_test acq_test gtest) endif(NOT ${GTEST_DIR_LOCAL}) +set_property(TEST acq_test PROPERTY TIMEOUT 30) ######################################################### @@ -707,6 +710,8 @@ if(NOT ${GTEST_DIR_LOCAL}) else(NOT ${GTEST_DIR_LOCAL}) add_dependencies(trk_test gtest) endif(NOT ${GTEST_DIR_LOCAL}) +set_property(TEST trk_test PROPERTY TIMEOUT 30) + ######################################################### From e0fb3518db373a0f5a6d49711c11610ffc648c90 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 18 Nov 2018 13:29:54 +0100 Subject: [PATCH 093/143] Restore old behavior to gnss_valve if the same constructor is used (Fix tests) --- src/algorithms/libs/gnss_sdr_valve.cc | 23 ++++++++++++++--------- src/algorithms/libs/gnss_sdr_valve.h | 3 ++- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/algorithms/libs/gnss_sdr_valve.cc b/src/algorithms/libs/gnss_sdr_valve.cc index 3b8b3a56d..c8d0e1385 100644 --- a/src/algorithms/libs/gnss_sdr_valve.cc +++ b/src/algorithms/libs/gnss_sdr_valve.cc @@ -40,13 +40,14 @@ gnss_sdr_valve::gnss_sdr_valve(size_t sizeof_stream_item, unsigned long long nitems, - gr::msg_queue::sptr queue, bool stop_flowgraph) : gr::sync_block("valve", - gr::io_signature::make(1, 1, sizeof_stream_item), - gr::io_signature::make(1, 1, sizeof_stream_item)), - d_nitems(nitems), - d_ncopied_items(0), - d_queue(queue), - d_stop_flowgraph(stop_flowgraph) + gr::msg_queue::sptr queue, + bool stop_flowgraph) : gr::sync_block("valve", + gr::io_signature::make(1, 1, sizeof_stream_item), + gr::io_signature::make(1, 1, sizeof_stream_item)), + d_nitems(nitems), + d_ncopied_items(0), + d_queue(queue), + d_stop_flowgraph(stop_flowgraph) { d_open_valve = false; } @@ -58,16 +59,20 @@ boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, unsi return valve_; } + boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, unsigned long long nitems, gr::msg_queue::sptr queue) { - boost::shared_ptr valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, queue, false)); + boost::shared_ptr valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, queue, true)); return valve_; } + void gnss_sdr_valve::open_valve() { d_open_valve = true; } + + int gnss_sdr_valve::work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) @@ -87,7 +92,7 @@ int gnss_sdr_valve::work(int noutput_items, else { usleep(1000000); - return 0; //do not produce or consume + return 0; // do not produce or consume } } unsigned long long n = std::min(d_nitems - d_ncopied_items, static_cast(noutput_items)); diff --git a/src/algorithms/libs/gnss_sdr_valve.h b/src/algorithms/libs/gnss_sdr_valve.h index 32d17fd89..8fe7140b6 100644 --- a/src/algorithms/libs/gnss_sdr_valve.h +++ b/src/algorithms/libs/gnss_sdr_valve.h @@ -41,10 +41,12 @@ boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, unsigned long long nitems, gr::msg_queue::sptr queue); + boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, unsigned long long nitems, gr::msg_queue::sptr queue, bool stop_flowgraph); + /*! * \brief Implementation of a GNU Radio block that sends a STOP message to the * control queue right after a specific number of samples have passed through it. @@ -59,7 +61,6 @@ class gnss_sdr_valve : public gr::sync_block gr::msg_queue::sptr queue, bool stop_flowgraph); - unsigned long long d_nitems; unsigned long long d_ncopied_items; gr::msg_queue::sptr d_queue; From 6d043fc854e837e1bf75d874be1aa615b08572a4 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 18 Nov 2018 19:25:13 +0100 Subject: [PATCH 094/143] Fix for ArchLinux --- src/utils/rinex2assist/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index b7db9e90f..e778c9f3f 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -18,7 +18,12 @@ find_package(GPSTK QUIET) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) - set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} ) + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} ) + endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}") + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib64/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib64/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} ) + endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib64/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}") set(GPSTK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include ) endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) From 6fc26b8e5d8553e3b54b4707647d926a1afb5b22 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 18 Nov 2018 20:05:42 +0100 Subject: [PATCH 095/143] Simplify GPSTK part --- src/tests/CMakeLists.txt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 3978f1b71..ec884c78b 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -260,19 +260,15 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) endif(CMAKE_VERSION VERSION_LESS 3.2) set(GPSTK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers") - add_library(gpstk UNKNOWN IMPORTED) - set_property(TARGET gpstk PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) - add_dependencies(gpstk gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) set(GPSTK_BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/ ) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") - set(gpstk_libs gpstk) + set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) set(OWN_GPSTK True) # else(NOT ENABLE_FPGA) # message(STATUS "GPSTk has not been found, try to install it on target.") # message(STATUS "Some extra tests requiring GPSTk will not be built.") # endif(NOT ENABLE_FPGA) else(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) - set(gpstk_libs ${GPSTK_LIBRARIES}) set(GPSTK_INCLUDE_DIRS ${GPSTK_INCLUDE_DIR}) set(GPSTK_BINDIR ${GPSTK_LIBRARY}/../bin/ ) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") @@ -281,7 +277,7 @@ endif(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) if (ENABLE_UNIT_TESTING_EXTRA) - set(GNSS_SDR_TEST_OPTIONAL_LIBS ${GNSS_SDR_TEST_OPTIONAL_LIBS} ${gpstk_libs}) + set(GNSS_SDR_TEST_OPTIONAL_LIBS ${GNSS_SDR_TEST_OPTIONAL_LIBS} ${GPSTK_LIBRARY}) set(GNSS_SDR_TEST_OPTIONAL_HEADERS ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ${GPSTK_INCLUDE_DIRS} ${GPSTK_INCLUDE_DIRS}/gpstk) endif (ENABLE_UNIT_TESTING_EXTRA) @@ -526,7 +522,7 @@ if(ENABLE_SYSTEM_TESTING) #if(GPSTK_FOUND OR OWN_GPSTK) ## OBS_SYSTEM_TEST and OBS_GPS_L1_SYSTEM_TEST # set(OPT_LIBS_ ${GFlags_LIBS} ${GLOG_LIBRARIES} ${GTEST_LIBRARIES} - # gnss_sp_libs gnss_rx ${gpstk_libs} ) + # gnss_sp_libs gnss_rx ${GPSTK_LIBRARY} ) # set(OPT_INCLUDES_ ${GPSTK_INCLUDE_DIRS} ${GPSTK_INCLUDE_DIRS}/gpstk) # add_system_test(obs_gps_l1_system_test) # add_system_test(obs_system_test) From 61b9a008271e3ccc39b2b1e8bb7268bfbddab9fe Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 18 Nov 2018 20:46:38 +0100 Subject: [PATCH 096/143] Fix GPSTK building in systems that use lib64 --- src/tests/CMakeLists.txt | 47 ++++++++++++--------------- src/utils/rinex2assist/CMakeLists.txt | 8 ++--- 2 files changed, 23 insertions(+), 32 deletions(-) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index ec884c78b..53a87d88b 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -229,13 +229,13 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) find_package(GPSTK) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) message(STATUS "GPSTk v${GNSSSDR_GPSTK_LOCAL_VERSION} will be automatically downloaded and built when doing 'make'.") - if ("${TOOLCHAIN_ARG}" STREQUAL "") - set(TOOLCHAIN_ARG "-DCMAKE_CXX_FLAGS=\"-Wno-deprecated\"") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") - endif("${TOOLCHAIN_ARG}" STREQUAL "") - # if(NOT ENABLE_FPGA) - if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( + if ("${TOOLCHAIN_ARG}" STREQUAL "") + set(TOOLCHAIN_ARG "-DCMAKE_CXX_FLAGS=\"-Wno-deprecated\"") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") + endif("${TOOLCHAIN_ARG}" STREQUAL "") + include(GNUInstallDirs) + if(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add( gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} GIT_REPOSITORY https://github.com/SGL-UT/GPSTk GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION} @@ -244,34 +244,29 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF UPDATE_COMMAND "" PATCH_COMMAND "" - ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( + ) + else(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add( gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} GIT_REPOSITORY https://github.com/SGL-UT/GPSTk GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF - BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} UPDATE_COMMAND "" PATCH_COMMAND "" - ) - endif(CMAKE_VERSION VERSION_LESS 3.2) - - set(GPSTK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers") - set(GPSTK_BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/ ) - add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") - set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(OWN_GPSTK True) -# else(NOT ENABLE_FPGA) -# message(STATUS "GPSTk has not been found, try to install it on target.") -# message(STATUS "Some extra tests requiring GPSTk will not be built.") -# endif(NOT ENABLE_FPGA) + ) + endif(CMAKE_VERSION VERSION_LESS 3.2) + set(GPSTK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers") + set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(GPSTK_BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/ ) + add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") + set(OWN_GPSTK True) else(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) - set(GPSTK_INCLUDE_DIRS ${GPSTK_INCLUDE_DIR}) - set(GPSTK_BINDIR ${GPSTK_LIBRARY}/../bin/ ) - add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") + set(GPSTK_INCLUDE_DIRS ${GPSTK_INCLUDE_DIR}) + set(GPSTK_BINDIR ${GPSTK_LIBRARY}/../bin/ ) + add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) endif(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index e778c9f3f..0fb8db8d1 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -18,12 +18,8 @@ find_package(GPSTK QUIET) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) - if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}") - set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} ) - endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}") - if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib64/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}") - set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib64/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} ) - endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib64/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}") + include(GNUInstallDirs) + set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} ) set(GPSTK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include ) endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) From 8857d3938eb35c463d438ac6c67b489eb7471e91 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 18 Nov 2018 20:57:21 +0100 Subject: [PATCH 097/143] Apply some cleaning --- cmake/Modules/FindGFlags.cmake | 1 - cmake/Modules/FindGLOG.cmake | 2 +- cmake/Modules/FindGPSTK.cmake | 2 +- cmake/Modules/FindGnssSimulator.cmake | 2 +- cmake/Modules/FindGperftools.cmake | 2 +- cmake/Modules/FindGrDbfcttc.cmake | 2 +- cmake/Modules/FindGrOsmoSDR.cmake | 4 ++-- cmake/Modules/FindLibOsmoSDR.cmake | 2 +- cmake/Modules/FindLog4cpp.cmake | 2 +- cmake/Modules/FindMATIO.cmake | 16 ++++++++-------- cmake/Modules/FindORC.cmake | 2 +- cmake/Modules/FindOpenBLAS.cmake | 24 ++++++++++++------------ cmake/Modules/FindPCAP.cmake | 20 ++++++++++---------- cmake/Modules/FindPugiXML.cmake | 2 +- cmake/Modules/FindVolkGnssSdr.cmake | 2 +- cmake/Modules/TestForARM.cmake | 6 +++--- 16 files changed, 45 insertions(+), 46 deletions(-) diff --git a/cmake/Modules/FindGFlags.cmake b/cmake/Modules/FindGFlags.cmake index a0ca5ac79..d8279ba00 100644 --- a/cmake/Modules/FindGFlags.cmake +++ b/cmake/Modules/FindGFlags.cmake @@ -99,4 +99,3 @@ ELSE(GFlags_ROOT_DIR) MESSAGE(STATUS "Cannot find gflags") SET(GFlags_FOUND false) ENDIF(GFlags_ROOT_DIR) - diff --git a/cmake/Modules/FindGLOG.cmake b/cmake/Modules/FindGLOG.cmake index 7c50d8805..112f2c39d 100644 --- a/cmake/Modules/FindGLOG.cmake +++ b/cmake/Modules/FindGLOG.cmake @@ -41,7 +41,7 @@ endif(MSVC) macro(_FIND_GLOG_LIBRARIES _var) find_library(${_var} NAMES ${ARGN} - PATHS ${LIB_PATHS} + PATHS ${LIB_PATHS} /usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu diff --git a/cmake/Modules/FindGPSTK.cmake b/cmake/Modules/FindGPSTK.cmake index 137a34b5b..810bda0d8 100644 --- a/cmake/Modules/FindGPSTK.cmake +++ b/cmake/Modules/FindGPSTK.cmake @@ -35,7 +35,7 @@ FIND_LIBRARY(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} /usr/local/lib /opt/local/lib ) -# handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if +# handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if # all listed variables are TRUE INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR) diff --git a/cmake/Modules/FindGnssSimulator.cmake b/cmake/Modules/FindGnssSimulator.cmake index 56bccc709..88e6c2d27 100644 --- a/cmake/Modules/FindGnssSimulator.cmake +++ b/cmake/Modules/FindGnssSimulator.cmake @@ -25,4 +25,4 @@ find_program(SW_GENERATOR_BIN gnss_sim INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNSS-SIMULATOR DEFAULT_MSG SW_GENERATOR_BIN) -MARK_AS_ADVANCED(SW_GENERATOR_BIN) \ No newline at end of file +MARK_AS_ADVANCED(SW_GENERATOR_BIN) diff --git a/cmake/Modules/FindGperftools.cmake b/cmake/Modules/FindGperftools.cmake index 6e4d955b7..2dc57430e 100644 --- a/cmake/Modules/FindGperftools.cmake +++ b/cmake/Modules/FindGperftools.cmake @@ -66,4 +66,4 @@ mark_as_advanced( GPERFTOOLS_PROFILER GPERFTOOLS_TCMALLOC_AND_PROFILER GPERFTOOLS_LIBRARIES - GPERFTOOLS_INCLUDE_DIR) \ No newline at end of file + GPERFTOOLS_INCLUDE_DIR) diff --git a/cmake/Modules/FindGrDbfcttc.cmake b/cmake/Modules/FindGrDbfcttc.cmake index 0245514d8..9f4da77f8 100644 --- a/cmake/Modules/FindGrDbfcttc.cmake +++ b/cmake/Modules/FindGrDbfcttc.cmake @@ -28,7 +28,7 @@ FIND_PATH( HINTS $ENV{GR_DBFCTTC_DIR}/include ${PC_GR_DBFCTTC_INCLUDEDIR} PATHS ${CMAKE_INSTALL_PREFIX}/include - /usr/include + /usr/include /usr/local/include ) diff --git a/cmake/Modules/FindGrOsmoSDR.cmake b/cmake/Modules/FindGrOsmoSDR.cmake index 254fecef1..ae637846a 100644 --- a/cmake/Modules/FindGrOsmoSDR.cmake +++ b/cmake/Modules/FindGrOsmoSDR.cmake @@ -36,7 +36,7 @@ if(NOT GROSMOSDR_FOUND) pkg_check_modules (GROSMOSDR_PKG gnuradio-osmosdr) - find_path(GROSMOSDR_INCLUDE_DIR + find_path(GROSMOSDR_INCLUDE_DIR NAMES osmosdr/source.h osmosdr/api.h PATHS @@ -45,7 +45,7 @@ if(NOT GROSMOSDR_FOUND) /usr/local/include ) - find_library(GROSMOSDR_LIBRARIES + find_library(GROSMOSDR_LIBRARIES NAMES gnuradio-osmosdr PATHS ${GROSMOSDR_PKG_LIBRARY_DIRS} diff --git a/cmake/Modules/FindLibOsmoSDR.cmake b/cmake/Modules/FindLibOsmoSDR.cmake index fc7a28b06..d0dff5360 100644 --- a/cmake/Modules/FindLibOsmoSDR.cmake +++ b/cmake/Modules/FindLibOsmoSDR.cmake @@ -25,7 +25,7 @@ # Variables defined by this module: # # LIBOSMOSDR_FOUND System has libosmosdr libs/headers -# LIBOSMOSDR_LIBRARIES The libosmosdr libraries +# LIBOSMOSDR_LIBRARIES The libosmosdr libraries # LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers diff --git a/cmake/Modules/FindLog4cpp.cmake b/cmake/Modules/FindLog4cpp.cmake index 3b1e7560e..96ea923f6 100644 --- a/cmake/Modules/FindLog4cpp.cmake +++ b/cmake/Modules/FindLog4cpp.cmake @@ -92,4 +92,4 @@ else () message(STATUS "Looked for LOG4CPP libraries named ${LOG4CPPS_NAMES}.") message(FATAL_ERROR "Could NOT find LOG4CPP library") endif () -endif () \ No newline at end of file +endif () diff --git a/cmake/Modules/FindMATIO.cmake b/cmake/Modules/FindMATIO.cmake index 2bac55ede..e27ed1f86 100644 --- a/cmake/Modules/FindMATIO.cmake +++ b/cmake/Modules/FindMATIO.cmake @@ -25,26 +25,26 @@ # MATIO_LIBRARIES - MATIO libraries. # MATIO_INCLUDE_DIRS - where to find matio.h, etc.. # MATIO_VERSION_STRING - version number as a string (e.g.: "1.3.4") -# +# #============================================================================= # Copyright 2015 Avtech Scientific -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: -# +# # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. -# +# # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# +# # * Neither the names of Kitware, Inc., the Insight Software Consortium, # nor the names of their contributors may be used to endorse or promote # products derived from this software without specific prior written # permission. -# +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -103,7 +103,7 @@ endif () mark_as_advanced(MATIO_INCLUDE_DIR MATIO_LIBRARY) -# handle the QUIETLY and REQUIRED arguments and set MATIO_FOUND to TRUE if +# handle the QUIETLY and REQUIRED arguments and set MATIO_FOUND to TRUE if # all listed variables are TRUE include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(MATIO REQUIRED_VARS MATIO_LIBRARY MATIO_INCLUDE_DIR VERSION_VAR MATIO_VERSION_STRING) @@ -114,4 +114,4 @@ if(MATIO_FOUND) else(MATIO_FOUND) set(MATIO_LIBRARIES) set(MATIO_INCLUDE_DIRS) -endif(MATIO_FOUND) \ No newline at end of file +endif(MATIO_FOUND) diff --git a/cmake/Modules/FindORC.cmake b/cmake/Modules/FindORC.cmake index 2751494ba..24249b08c 100644 --- a/cmake/Modules/FindORC.cmake +++ b/cmake/Modules/FindORC.cmake @@ -63,4 +63,4 @@ SET(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR}) INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE) -mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE) \ No newline at end of file +mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE) diff --git a/cmake/Modules/FindOpenBLAS.cmake b/cmake/Modules/FindOpenBLAS.cmake index 133de9b63..d9ce2a333 100644 --- a/cmake/Modules/FindOpenBLAS.cmake +++ b/cmake/Modules/FindOpenBLAS.cmake @@ -17,21 +17,21 @@ # - Try to find OpenBLAS library (not headers!) # -# The following environment variable is optionally searched +# The following environment variable is optionally searched # OPENBLAS_HOME: Base directory where all OpenBlas components are found -SET(OPEN_BLAS_SEARCH_PATHS /lib/ - /lib64/ - /usr/lib - /usr/lib64 - /usr/local/lib - /usr/local/lib64 - /opt/OpenBLAS/lib - /opt/local/lib - /usr/lib/openblas-base - $ENV{OPENBLAS_HOME}/lib +SET(OPEN_BLAS_SEARCH_PATHS /lib/ + /lib64/ + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + /opt/OpenBLAS/lib + /opt/local/lib + /usr/lib/openblas-base + $ENV{OPENBLAS_HOME}/lib ) - + FIND_LIBRARY(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS}) IF (OPENBLAS) diff --git a/cmake/Modules/FindPCAP.cmake b/cmake/Modules/FindPCAP.cmake index 3be89420e..679d8ef08 100644 --- a/cmake/Modules/FindPCAP.cmake +++ b/cmake/Modules/FindPCAP.cmake @@ -37,16 +37,16 @@ # Find the PCAP includes and library # http://www.tcpdump.org/ # -# The environment variable PCAPDIR allows to specficy where to find +# The environment variable PCAPDIR allows to specficy where to find # libpcap in non standard location. -# +# # PCAP_INCLUDE_DIRS - where to find pcap.h, etc. # PCAP_LIBRARIES - List of libraries when using pcap. # PCAP_FOUND - True if pcap found. IF(EXISTS $ENV{PCAPDIR}) - FIND_PATH(PCAP_INCLUDE_DIR + FIND_PATH(PCAP_INCLUDE_DIR NAMES pcap/pcap.h pcap.h @@ -54,28 +54,28 @@ IF(EXISTS $ENV{PCAPDIR}) $ENV{PCAPDIR} NO_DEFAULT_PATH ) - + FIND_LIBRARY(PCAP_LIBRARY - NAMES + NAMES pcap PATHS $ENV{PCAPDIR} NO_DEFAULT_PATH ) - + ELSE(EXISTS $ENV{PCAPDIR}) - FIND_PATH(PCAP_INCLUDE_DIR + FIND_PATH(PCAP_INCLUDE_DIR NAMES pcap/pcap.h pcap.h ) - + FIND_LIBRARY(PCAP_LIBRARY - NAMES + NAMES pcap ) - + ENDIF(EXISTS $ENV{PCAPDIR}) SET(PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR}) diff --git a/cmake/Modules/FindPugiXML.cmake b/cmake/Modules/FindPugiXML.cmake index e1e8df872..a2b546179 100644 --- a/cmake/Modules/FindPugiXML.cmake +++ b/cmake/Modules/FindPugiXML.cmake @@ -66,4 +66,4 @@ else (PUGIXML_FOUND) message (STATUS "PugiXML not found.") endif(PUGIXML_FOUND) -mark_as_advanced (PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR) \ No newline at end of file +mark_as_advanced (PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR) diff --git a/cmake/Modules/FindVolkGnssSdr.cmake b/cmake/Modules/FindVolkGnssSdr.cmake index 6225f38a0..ecc12685a 100644 --- a/cmake/Modules/FindVolkGnssSdr.cmake +++ b/cmake/Modules/FindVolkGnssSdr.cmake @@ -46,4 +46,4 @@ FIND_LIBRARY( INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(VOLK_GNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) -MARK_AS_ADVANCED(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) \ No newline at end of file +MARK_AS_ADVANCED(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) diff --git a/cmake/Modules/TestForARM.cmake b/cmake/Modules/TestForARM.cmake index 9a5445287..254c5bc41 100644 --- a/cmake/Modules/TestForARM.cmake +++ b/cmake/Modules/TestForARM.cmake @@ -16,7 +16,7 @@ # along with GNSS-SDR. If not, see . ############################################################################## -# check if the compiler defines the architecture as ARM and set the +# check if the compiler defines the architecture as ARM and set the # version, if found. # # - Anthony Arnold @@ -89,9 +89,9 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") else (ARM_VERSION STREQUAL "") message(STATUS "ARM version ${ARM_VERSION} detected") endif (ARM_VERSION STREQUAL "") - + else (NOT ARM_FOUND STREQUAL "") - message(STATUS "System is not ARM") + message(STATUS "System is not ARM") endif(NOT ARM_FOUND STREQUAL "") else (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") From e94b2f89900527ca69bbb7766bad46d09c6e06b4 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 18 Nov 2018 21:24:54 +0100 Subject: [PATCH 098/143] Remove blanks --- CMakeLists.txt | 8 +++++--- src/algorithms/PVT/libs/CMakeLists.txt | 15 ++++++++------- src/algorithms/acquisition/CMakeLists.txt | 1 - .../acquisition/adapters/CMakeLists.txt | 8 ++++---- src/algorithms/channel/CMakeLists.txt | 2 +- src/algorithms/channel/libs/CMakeLists.txt | 13 ++++++------- src/algorithms/conditioner/CMakeLists.txt | 1 - .../conditioner/adapters/CMakeLists.txt | 6 +++--- src/algorithms/data_type_adapter/CMakeLists.txt | 1 - .../data_type_adapter/adapters/CMakeLists.txt | 12 ++++++------ .../gnuradio_blocks/CMakeLists.txt | 4 ++-- src/algorithms/input_filter/CMakeLists.txt | 2 +- .../input_filter/adapters/CMakeLists.txt | 4 ++-- src/algorithms/observables/CMakeLists.txt | 2 +- src/algorithms/resampler/CMakeLists.txt | 2 +- .../resampler/gnuradio_blocks/CMakeLists.txt | 6 +++--- .../signal_generator/adapters/CMakeLists.txt | 8 ++++---- .../signal_source/adapters/CMakeLists.txt | 2 +- .../signal_source/gnuradio_blocks/CMakeLists.txt | 6 +++--- src/algorithms/signal_source/libs/CMakeLists.txt | 2 +- src/algorithms/telemetry_decoder/CMakeLists.txt | 2 +- .../telemetry_decoder/adapters/CMakeLists.txt | 8 ++++---- .../libs/libswiftcnav/CMakeLists.txt | 10 +++++----- src/algorithms/tracking/adapters/CMakeLists.txt | 6 +++--- .../tracking/gnuradio_blocks/CMakeLists.txt | 4 ++-- src/core/libs/CMakeLists.txt | 6 +++--- src/core/libs/supl/CMakeLists.txt | 8 +++----- src/core/monitor/CMakeLists.txt | 6 +++--- src/utils/front-end-cal/CMakeLists.txt | 4 ++-- 29 files changed, 78 insertions(+), 81 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9caeece66..53daece1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -354,15 +354,17 @@ set(GNSSSDR_GPSTK_LOCAL_VERSION "2.10.6") set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.13") set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.9") -if(CMAKE_VERSION VERSION_LESS "3.0.2") +if(CMAKE_VERSION VERSION_LESS "3.0.2") # Fix for CentOS 7 set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.1") endif(CMAKE_VERSION VERSION_LESS "3.0.2") + + ################################################################################ -# Check cmake version +# Check CMake version ################################################################################ if(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION}) - message(STATUS "Your CMake version is too old and does not support some features required by GNSS-SDR. CMake version must be at least ${GNSSSDR_CMAKE_MIN_VERSION}.") # For more information check https://github.com/joakimkarlsson/bandit/issues/40 + message(STATUS "Your CMake version is too old and does not support some features required by GNSS-SDR. CMake version must be at least ${GNSSSDR_CMAKE_MIN_VERSION}.") message(FATAL_ERROR "Fatal error: CMake >= ${GNSSSDR_CMAKE_MIN_VERSION} required.") endif(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION}) diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index 6807e9602..ed69cabab 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -18,28 +18,28 @@ add_definitions( -DGNSS_SDR_VERSION="${VERSION}" ) -set(PVT_LIB_SOURCES +set(PVT_LIB_SOURCES pvt_solution.cc ls_pvt.cc hybrid_ls_pvt.cc kml_printer.cc gpx_printer.cc rinex_printer.cc - nmea_printer.cc + nmea_printer.cc rtcm_printer.cc geojson_printer.cc rtklib_solver.cc pvt_conf.cc ) -set(PVT_LIB_HEADERS +set(PVT_LIB_HEADERS pvt_solution.h ls_pvt.h hybrid_ls_pvt.h kml_printer.h gpx_printer.h rinex_printer.h - nmea_printer.h + nmea_printer.h rtcm_printer.h geojson_printer.h rtklib_solver.h @@ -75,11 +75,12 @@ else(MATIO_FOUND) endif(MATIO_FOUND) target_link_libraries( - pvt_lib + pvt_lib rtklib_lib gnss_sdr_flags - ${Boost_LIBRARIES} - ${GLOG_LIBRARIES} + gnss_sp_libs + ${Boost_LIBRARIES} + ${GLOG_LIBRARIES} ${ARMADILLO_LIBRARIES} ${BLAS} ${LAPACK} diff --git a/src/algorithms/acquisition/CMakeLists.txt b/src/algorithms/acquisition/CMakeLists.txt index 5cf06e3e8..96259341c 100644 --- a/src/algorithms/acquisition/CMakeLists.txt +++ b/src/algorithms/acquisition/CMakeLists.txt @@ -19,4 +19,3 @@ add_subdirectory(adapters) add_subdirectory(gnuradio_blocks) add_subdirectory(libs) - diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index b44f7d6f2..b27cb9cb3 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -57,19 +57,19 @@ set(ACQ_ADAPTER_HEADERS if(ENABLE_FPGA) - set(ACQ_ADAPTER_SOURCES ${ACQ_ADAPTER_SOURCES} gps_l1_ca_pcps_acquisition_fpga.cc + set(ACQ_ADAPTER_SOURCES ${ACQ_ADAPTER_SOURCES} gps_l1_ca_pcps_acquisition_fpga.cc gps_l2_m_pcps_acquisition_fpga.cc galileo_e1_pcps_ambiguous_acquisition_fpga.cc galileo_e5a_pcps_acquisition_fpga.cc gps_l5i_pcps_acquisition_fpga.cc) - set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} gps_l1_ca_pcps_acquisition_fpga.h + set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} gps_l1_ca_pcps_acquisition_fpga.h gps_l2_m_pcps_acquisition_fpga.h galileo_e1_pcps_ambiguous_acquisition_fpga.h galileo_e5a_pcps_acquisition_fpga.h - gps_l5i_pcps_acquisition_fpga.h) + gps_l5i_pcps_acquisition_fpga.h) endif(ENABLE_FPGA) - + if(OPENCL_FOUND) set(ACQ_ADAPTER_SOURCES ${ACQ_ADAPTER_SOURCES} gps_l1_ca_pcps_opencl_acquisition.cc) set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} gps_l1_ca_pcps_opencl_acquisition.h) diff --git a/src/algorithms/channel/CMakeLists.txt b/src/algorithms/channel/CMakeLists.txt index 077b74808..cd5604218 100644 --- a/src/algorithms/channel/CMakeLists.txt +++ b/src/algorithms/channel/CMakeLists.txt @@ -17,4 +17,4 @@ # add_subdirectory(adapters) -add_subdirectory(libs) \ No newline at end of file +add_subdirectory(libs) diff --git a/src/algorithms/channel/libs/CMakeLists.txt b/src/algorithms/channel/libs/CMakeLists.txt index 308e97833..7965cea70 100644 --- a/src/algorithms/channel/libs/CMakeLists.txt +++ b/src/algorithms/channel/libs/CMakeLists.txt @@ -16,15 +16,15 @@ # along with GNSS-SDR. If not, see . # -set(CHANNEL_FSM_SOURCES - channel_fsm.cc +set(CHANNEL_FSM_SOURCES + channel_fsm.cc channel_msg_receiver_cc.cc ) - -set(CHANNEL_FSM_HEADERS - channel_fsm.h + +set(CHANNEL_FSM_HEADERS + channel_fsm.h channel_msg_receiver_cc.h - ) + ) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -46,4 +46,3 @@ source_group(Headers FILES ${CHANNEL_FSM_HEADERS}) add_dependencies(channel_fsm glog-${glog_RELEASE}) target_link_libraries(channel_fsm gnss_rx) - diff --git a/src/algorithms/conditioner/CMakeLists.txt b/src/algorithms/conditioner/CMakeLists.txt index de941b536..166f27d36 100644 --- a/src/algorithms/conditioner/CMakeLists.txt +++ b/src/algorithms/conditioner/CMakeLists.txt @@ -17,4 +17,3 @@ # add_subdirectory(adapters) -#add_subdirectory(gnuradio_blocks) \ No newline at end of file diff --git a/src/algorithms/conditioner/adapters/CMakeLists.txt b/src/algorithms/conditioner/adapters/CMakeLists.txt index fea88dd0a..def069263 100644 --- a/src/algorithms/conditioner/adapters/CMakeLists.txt +++ b/src/algorithms/conditioner/adapters/CMakeLists.txt @@ -17,12 +17,12 @@ # -set(COND_ADAPTER_SOURCES +set(COND_ADAPTER_SOURCES signal_conditioner.cc array_signal_conditioner.cc ) -set(COND_ADAPTER_HEADERS +set(COND_ADAPTER_HEADERS signal_conditioner.h array_signal_conditioner.h ) @@ -44,4 +44,4 @@ list(SORT COND_ADAPTER_SOURCES) add_library(conditioner_adapters ${COND_ADAPTER_SOURCES} ${COND_ADAPTER_HEADERS}) source_group(Headers FILES ${COND_ADAPTER_HEADERS}) -add_dependencies(conditioner_adapters glog-${glog_RELEASE}) \ No newline at end of file +add_dependencies(conditioner_adapters glog-${glog_RELEASE}) diff --git a/src/algorithms/data_type_adapter/CMakeLists.txt b/src/algorithms/data_type_adapter/CMakeLists.txt index 6037ad61f..1c15cc0ca 100644 --- a/src/algorithms/data_type_adapter/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/CMakeLists.txt @@ -19,4 +19,3 @@ add_subdirectory(adapters) add_subdirectory(gnuradio_blocks) - diff --git a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt index 26eb01b83..419e1a271 100644 --- a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt @@ -17,23 +17,23 @@ # -set(DATATYPE_ADAPTER_SOURCES +set(DATATYPE_ADAPTER_SOURCES byte_to_short.cc ibyte_to_cbyte.cc ibyte_to_complex.cc ibyte_to_cshort.cc ishort_to_cshort.cc - ishort_to_complex.cc + ishort_to_complex.cc ) - -set(DATATYPE_ADAPTER_HEADERS + +set(DATATYPE_ADAPTER_HEADERS byte_to_short.h ibyte_to_cbyte.h ibyte_to_complex.h ibyte_to_cshort.h ishort_to_cshort.h - ishort_to_complex.h -) + ishort_to_complex.h +) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt index 1bb51014b..2253ce5f8 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt @@ -17,13 +17,13 @@ # -set(DATA_TYPE_GR_BLOCKS_SOURCES +set(DATA_TYPE_GR_BLOCKS_SOURCES interleaved_byte_to_complex_byte.cc interleaved_short_to_complex_short.cc interleaved_byte_to_complex_short.cc ) -set(DATA_TYPE_GR_BLOCKS_HEADERS +set(DATA_TYPE_GR_BLOCKS_HEADERS interleaved_byte_to_complex_byte.h interleaved_short_to_complex_short.h interleaved_byte_to_complex_short.h diff --git a/src/algorithms/input_filter/CMakeLists.txt b/src/algorithms/input_filter/CMakeLists.txt index 64cb2a571..1841d3dfc 100644 --- a/src/algorithms/input_filter/CMakeLists.txt +++ b/src/algorithms/input_filter/CMakeLists.txt @@ -17,4 +17,4 @@ # add_subdirectory(adapters) -add_subdirectory(gnuradio_blocks) \ No newline at end of file +add_subdirectory(gnuradio_blocks) diff --git a/src/algorithms/input_filter/adapters/CMakeLists.txt b/src/algorithms/input_filter/adapters/CMakeLists.txt index a2520bf39..959c1ba88 100644 --- a/src/algorithms/input_filter/adapters/CMakeLists.txt +++ b/src/algorithms/input_filter/adapters/CMakeLists.txt @@ -16,7 +16,7 @@ # along with GNSS-SDR. If not, see . # -set(INPUT_FILTER_ADAPTER_SOURCES +set(INPUT_FILTER_ADAPTER_SOURCES fir_filter.cc freq_xlating_fir_filter.cc beamformer_filter.cc @@ -25,7 +25,7 @@ set(INPUT_FILTER_ADAPTER_SOURCES notch_filter_lite.cc ) -set(INPUT_FILTER_ADAPTER_HEADERS +set(INPUT_FILTER_ADAPTER_HEADERS fir_filter.h freq_xlating_fir_filter.h beamformer_filter.h diff --git a/src/algorithms/observables/CMakeLists.txt b/src/algorithms/observables/CMakeLists.txt index 64cb2a571..1841d3dfc 100644 --- a/src/algorithms/observables/CMakeLists.txt +++ b/src/algorithms/observables/CMakeLists.txt @@ -17,4 +17,4 @@ # add_subdirectory(adapters) -add_subdirectory(gnuradio_blocks) \ No newline at end of file +add_subdirectory(gnuradio_blocks) diff --git a/src/algorithms/resampler/CMakeLists.txt b/src/algorithms/resampler/CMakeLists.txt index 64cb2a571..1841d3dfc 100644 --- a/src/algorithms/resampler/CMakeLists.txt +++ b/src/algorithms/resampler/CMakeLists.txt @@ -17,4 +17,4 @@ # add_subdirectory(adapters) -add_subdirectory(gnuradio_blocks) \ No newline at end of file +add_subdirectory(gnuradio_blocks) diff --git a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt index 81c9e3deb..26233f3fd 100644 --- a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt @@ -17,13 +17,13 @@ # -set(RESAMPLER_GR_BLOCKS_SOURCES +set(RESAMPLER_GR_BLOCKS_SOURCES direct_resampler_conditioner_cc.cc direct_resampler_conditioner_cs.cc direct_resampler_conditioner_cb.cc ) -set(RESAMPLER_GR_BLOCKS_HEADERS +set(RESAMPLER_GR_BLOCKS_HEADERS direct_resampler_conditioner_cc.h direct_resampler_conditioner_cs.h direct_resampler_conditioner_cb.h @@ -42,4 +42,4 @@ list(SORT RESAMPLER_GR_BLOCKS_SOURCES) add_library(resampler_gr_blocks ${RESAMPLER_GR_BLOCKS_SOURCES} ${RESAMPLER_GR_BLOCKS_HEADERS}) source_group(Headers FILES ${RESAMPLER_GR_BLOCKS_HEADERS}) -add_dependencies(resampler_gr_blocks glog-${glog_RELEASE}) \ No newline at end of file +add_dependencies(resampler_gr_blocks glog-${glog_RELEASE}) diff --git a/src/algorithms/signal_generator/adapters/CMakeLists.txt b/src/algorithms/signal_generator/adapters/CMakeLists.txt index 6562a410c..c248171d9 100644 --- a/src/algorithms/signal_generator/adapters/CMakeLists.txt +++ b/src/algorithms/signal_generator/adapters/CMakeLists.txt @@ -33,9 +33,9 @@ include_directories( add_library(signal_generator_adapters ${SIGNAL_GENERATOR_ADAPTER_SOURCES} ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) source_group(Headers FILES ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) -target_link_libraries(signal_generator_adapters gnss_sp_libs - signal_generator_blocks - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} +target_link_libraries(signal_generator_adapters gnss_sp_libs + signal_generator_blocks + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ) diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index 7d37b139f..6fc6b11ed 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -202,7 +202,7 @@ if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) two_bit_packed_file_signal_source.cc ) set(SIGNAL_SOURCE_ADAPTER_HEADERS ${SIGNAL_SOURCE_ADAPTER_HEADERS} two_bit_cpx_file_signal_source.h - two_bit_packed_file_signal_source.h ) + two_bit_packed_file_signal_source.h ) endif(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) include_directories( diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index 5c16fac07..9f9c174c7 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -70,9 +70,9 @@ list(SORT SIGNAL_SOURCE_GR_BLOCKS_SOURCES) add_library(signal_source_gr_blocks ${SIGNAL_SOURCE_GR_BLOCKS_SOURCES} ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS}) source_group(Headers FILES ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS}) -target_link_libraries(signal_source_gr_blocks - signal_source_lib - ${GNURADIO_RUNTIME_LIBRARIES} +target_link_libraries(signal_source_gr_blocks + signal_source_lib + ${GNURADIO_RUNTIME_LIBRARIES} ${Boost_LIBRARIES} ${OPT_LIBRARIES} ) diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index a7e5c8495..ef15705fe 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -70,7 +70,7 @@ set(SIGNAL_SOURCE_LIB_SOURCES rtl_tcp_dongle_info.cc ${OPT_SIGNAL_SOURCE_LIB_SOURCES} ) - + set(SIGNAL_SOURCE_LIB_HEADERS rtl_tcp_commands.h rtl_tcp_dongle_info.h diff --git a/src/algorithms/telemetry_decoder/CMakeLists.txt b/src/algorithms/telemetry_decoder/CMakeLists.txt index ea74d8ec3..96259341c 100644 --- a/src/algorithms/telemetry_decoder/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/CMakeLists.txt @@ -18,4 +18,4 @@ add_subdirectory(adapters) add_subdirectory(gnuradio_blocks) -add_subdirectory(libs) \ No newline at end of file +add_subdirectory(libs) diff --git a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt index db68a7cce..7c4e4b53a 100644 --- a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt @@ -20,23 +20,23 @@ set(TELEMETRY_DECODER_ADAPTER_SOURCES gps_l1_ca_telemetry_decoder.cc gps_l2c_telemetry_decoder.cc - gps_l5_telemetry_decoder.cc + gps_l5_telemetry_decoder.cc galileo_e1b_telemetry_decoder.cc sbas_l1_telemetry_decoder.cc galileo_e5a_telemetry_decoder.cc glonass_l1_ca_telemetry_decoder.cc - glonass_l2_ca_telemetry_decoder.cc + glonass_l2_ca_telemetry_decoder.cc ) set(TELEMETRY_DECODER_ADAPTER_HEADERS gps_l1_ca_telemetry_decoder.h gps_l2c_telemetry_decoder.h - gps_l5_telemetry_decoder.h + gps_l5_telemetry_decoder.h galileo_e1b_telemetry_decoder.h sbas_l1_telemetry_decoder.h galileo_e5a_telemetry_decoder.h glonass_l1_ca_telemetry_decoder.h - glonass_l2_ca_telemetry_decoder.h + glonass_l2_ca_telemetry_decoder.h ) include_directories( diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt index 8dba92115..ad356be81 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt @@ -16,19 +16,19 @@ # along with GNSS-SDR. If not, see . # -set(TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES +set(TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES cnav_msg.c bits.c edc.c - viterbi27.c + viterbi27.c ) -set(TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS +set(TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS cnav_msg.h bits.h edc.h - swift_common.h - fec.h + swift_common.h + fec.h ) include_directories( diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index e8d12d844..5ac4ec00b 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -23,19 +23,19 @@ if(ENABLE_CUDA) endif(ENABLE_CUDA) if(ENABLE_FPGA) - set(OPT_TRACKING_ADAPTERS_SOURCES ${OPT_TRACKING_ADAPTERS_SOURCES} + set(OPT_TRACKING_ADAPTERS_SOURCES ${OPT_TRACKING_ADAPTERS_SOURCES} gps_l1_ca_dll_pll_tracking_fpga.cc gps_l2_m_dll_pll_tracking_fpga.cc galileo_e1_dll_pll_veml_tracking_fpga.cc galileo_e5a_dll_pll_tracking_fpga.cc gps_l5_dll_pll_tracking_fpga.cc) - set(OPT_TRACKING_ADAPTERS_HEADERS ${OPT_TRACKING_ADAPTERS_HEADERS} + set(OPT_TRACKING_ADAPTERS_HEADERS ${OPT_TRACKING_ADAPTERS_HEADERS} gps_l1_ca_dll_pll_tracking_fpga.h gps_l2_m_dll_pll_tracking_fpga.h galileo_e1_dll_pll_veml_tracking_fpga.h galileo_e5a_dll_pll_tracking_fpga.h - gps_l5_dll_pll_tracking_fpga.h) + gps_l5_dll_pll_tracking_fpga.h) endif(ENABLE_FPGA) set(TRACKING_ADAPTER_SOURCES diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index d31676a64..9ac1a4e26 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -36,7 +36,7 @@ set(TRACKING_GR_BLOCKS_SOURCES glonass_l1_ca_dll_pll_tracking_cc.cc glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc - gps_l1_ca_kf_tracking_cc.cc + gps_l1_ca_kf_tracking_cc.cc glonass_l2_ca_dll_pll_tracking_cc.cc glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -52,7 +52,7 @@ set(TRACKING_GR_BLOCKS_HEADERS glonass_l1_ca_dll_pll_tracking_cc.h glonass_l1_ca_dll_pll_c_aid_tracking_cc.h glonass_l1_ca_dll_pll_c_aid_tracking_sc.h - gps_l1_ca_kf_tracking_cc.h + gps_l1_ca_kf_tracking_cc.h glonass_l2_ca_dll_pll_tracking_cc.h glonass_l2_ca_dll_pll_c_aid_tracking_cc.h glonass_l2_ca_dll_pll_c_aid_tracking_sc.h diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index 45c7477ab..0c6bbd4c2 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -22,20 +22,20 @@ if(OPENSSL_FOUND) add_definitions( -DUSE_OPENSSL_FALLBACK=1 ) endif(OPENSSL_FOUND) -set(CORE_LIBS_SOURCES +set(CORE_LIBS_SOURCES ini.cc INIReader.cc string_converter.cc gnss_sdr_supl_client.cc ) -set(CORE_LIBS_HEADERS +set(CORE_LIBS_HEADERS ini.h INIReader.h string_converter.h gnss_sdr_supl_client.h ) - + include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/core/system_parameters diff --git a/src/core/libs/supl/CMakeLists.txt b/src/core/libs/supl/CMakeLists.txt index 6d0edd576..4faecafda 100644 --- a/src/core/libs/supl/CMakeLists.txt +++ b/src/core/libs/supl/CMakeLists.txt @@ -39,13 +39,11 @@ include_directories( if(CMAKE_C_COMPILER_ID MATCHES "Clang") if(CMAKE_BUILD_TYPE MATCHES "Release") - set(MY_C_FLAGS "${MY_C_FLAGS} -Wno-parentheses-equality") + set(MY_C_FLAGS "${MY_C_FLAGS} -Wno-parentheses-equality") endif(CMAKE_BUILD_TYPE MATCHES "Release") -endif(CMAKE_C_COMPILER_ID MATCHES "Clang") +endif(CMAKE_C_COMPILER_ID MATCHES "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS}") add_library (supl_library STATIC ${ASN_RRLP_SOURCES} ${ASN_SUPL_SOURCES} ${SUPL_SOURCES}) -target_link_libraries (supl_library ${GNUTLS_LIBRARIES} ${GNUTLS_OPENSSL_LIBRARY} gnss_system_parameters) +target_link_libraries (supl_library ${GNUTLS_LIBRARIES} ${GNUTLS_OPENSSL_LIBRARY} gnss_system_parameters) set_target_properties(supl_library PROPERTIES LINKER_LANGUAGE C) - - diff --git a/src/core/monitor/CMakeLists.txt b/src/core/monitor/CMakeLists.txt index ccbdd9f44..8bba7c587 100644 --- a/src/core/monitor/CMakeLists.txt +++ b/src/core/monitor/CMakeLists.txt @@ -17,12 +17,12 @@ # -set(CORE_MONITOR_LIBS_SOURCES +set(CORE_MONITOR_LIBS_SOURCES gnss_synchro_monitor.cc gnss_synchro_udp_sink.cc ) -set(CORE_MONITOR_LIBS_HEADERS +set(CORE_MONITOR_LIBS_HEADERS gnss_synchro_monitor.h gnss_synchro_udp_sink.h ) @@ -42,5 +42,5 @@ list(SORT CORE_MONITOR_LIBS_SOURCES) add_library(core_monitor_lib ${CORE_MONITOR_LIBS_SOURCES} ${CORE_MONITOR_LIBS_HEADERS}) source_group(Headers FILES ${CORE_MONITOR_LIBS_HEADERS}) -target_link_libraries(core_monitor_lib ${Boost_LIBRARIES}) +target_link_libraries(core_monitor_lib ${Boost_LIBRARIES}) add_dependencies(core_monitor_lib glog-${glog_RELEASE}) diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index a9d1d455a..252131884 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -67,7 +67,7 @@ target_link_libraries(front_end_cal_lib ${MAC_LIBRARIES} gnss_rx channel_fsm ) - + add_dependencies(front_end_cal_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE}) add_definitions( -DGNSS_SDR_VERSION="${VERSION}" ) @@ -96,7 +96,7 @@ target_link_libraries(front-end-cal ${MAC_LIBRARIES} front_end_cal_lib ) - + install(TARGETS front-end-cal RUNTIME DESTINATION bin COMPONENT "front-end-cal" From f582a5adba08ce141c79d1cfdde6021ddb7630f7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 19 Nov 2018 08:51:05 +0100 Subject: [PATCH 099/143] Fix some CMake style issues --- CMakeLists.txt | 1443 +++++++++++++++++++------------------- src/tests/CMakeLists.txt | 637 +++++++++-------- 2 files changed, 1033 insertions(+), 1047 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 53daece1f..8f57d6c41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,18 +98,17 @@ set(THIS_IS_A_RELEASE OFF) # only related to version name, no further implicat if(NOT ${THIS_IS_A_RELEASE}) # Get the current working branch execute_process( - COMMAND git rev-parse --abbrev-ref HEAD - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - OUTPUT_VARIABLE GIT_BRANCH - OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND git rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_BRANCH + OUTPUT_STRIP_TRAILING_WHITESPACE ) - # Get the latest abbreviated commit hash of the working branch execute_process( - COMMAND git log -1 --format=%h - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - OUTPUT_VARIABLE GIT_COMMIT_HASH - OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND git log -1 --format=%h + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_COMMIT_HASH + OUTPUT_STRIP_TRAILING_WHITESPACE ) endif(NOT ${THIS_IS_A_RELEASE}) @@ -131,7 +130,7 @@ set(VERSION ${VERSION_INFO_MAJOR_VERSION}.${VERSION_INFO_API_COMPAT}.${VERSION_I include(ExternalProject) # Detect 64-bits machine if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) - set(ARCH_64BITS TRUE) + set(ARCH_64BITS TRUE) endif( CMAKE_SIZEOF_VOID_P EQUAL 8 ) set(OS_IS_MACOSX "") @@ -139,85 +138,85 @@ set(OS_IS_LINUX "") # Detect Linux Distribution if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - set(OperatingSystem "Linux") - set(OS_IS_LINUX TRUE) - if(ARCH_64BITS) - set(ARCH_ "(64 bits)") - else(ARCH_64BITS) - set(ARCH_ "(32 bits)") - endif(ARCH_64BITS) - if(EXISTS "/etc/lsb-release") - execute_process(COMMAND cat /etc/lsb-release - COMMAND grep DISTRIB_ID - COMMAND awk -F= "{ print $2 }" - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE LINUX_DISTRIBUTION - RESULT_VARIABLE LINUX_ID_RESULT - ) - execute_process(COMMAND cat /etc/lsb-release - COMMAND grep DISTRIB_RELEASE - COMMAND awk -F= "{ print $2 }" - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE LINUX_VER - RESULT_VARIABLE LINUX_VER_RESULT - ) - endif(EXISTS "/etc/lsb-release") - if(NOT LINUX_DISTRIBUTION) - if(EXISTS "/etc/linuxmint/info") - set(LINUX_DISTRIBUTION "LinuxMint") - execute_process(COMMAND cat /etc/linuxmint/info - COMMAND grep -m1 RELEASE - COMMAND awk -F= "{ print $2 }" - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE LINUX_VER - RESULT_VARIABLE LINUX_VER_RESULT - ) - endif(EXISTS "/etc/linuxmint/info") - endif(NOT LINUX_DISTRIBUTION) - if(NOT LINUX_DISTRIBUTION) - if(EXISTS "/etc/os-release") - execute_process(COMMAND cat /etc/os-release - COMMAND grep -m1 NAME - COMMAND awk -F= "{ print $2 }" - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE LINUX_DISTRIBUTION - RESULT_VARIABLE LINUX_ID_RESULT - ) - execute_process(COMMAND cat /etc/os-release - COMMAND grep VERSION_ID - COMMAND awk -F= "{ print $2 }" - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE LINUX_VER - RESULT_VARIABLE LINUX_VER_RESULT - ) - if(${LINUX_DISTRIBUTION} MATCHES "Debian") - set(LINUX_DISTRIBUTION "Debian") - file(READ /etc/debian_version LINUX_VER) - endif(${LINUX_DISTRIBUTION} MATCHES "Debian") - endif(EXISTS "/etc/os-release") - endif(NOT LINUX_DISTRIBUTION) - if(NOT LINUX_DISTRIBUTION) - if(EXISTS "/etc/redhat-release") - set(LINUX_DISTRIBUTION "Red Hat") - file (READ /etc/redhat-release LINUX_VER) - endif(EXISTS "/etc/redhat-release") - endif(NOT LINUX_DISTRIBUTION) - if(NOT LINUX_DISTRIBUTION) - if(EXISTS "/etc/debian_version") - set(LINUX_DISTRIBUTION "Debian") - file (READ /etc/debian_version LINUX_VER) - endif(EXISTS "/etc/debian_version") - endif(NOT LINUX_DISTRIBUTION) - if(NOT LINUX_DISTRIBUTION) - set(LINUX_DISTRIBUTION "Generic") - set(LINUX_VER "Unknown") - endif(NOT LINUX_DISTRIBUTION) - message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on ${LINUX_DISTRIBUTION} GNU/Linux Release ${LINUX_VER} ${ARCH_}") + set(OperatingSystem "Linux") + set(OS_IS_LINUX TRUE) + if(ARCH_64BITS) + set(ARCH_ "(64 bits)") + else(ARCH_64BITS) + set(ARCH_ "(32 bits)") + endif(ARCH_64BITS) + if(EXISTS "/etc/lsb-release") + execute_process(COMMAND cat /etc/lsb-release + COMMAND grep DISTRIB_ID + COMMAND awk -F= "{ print $2 }" + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE LINUX_DISTRIBUTION + RESULT_VARIABLE LINUX_ID_RESULT + ) + execute_process(COMMAND cat /etc/lsb-release + COMMAND grep DISTRIB_RELEASE + COMMAND awk -F= "{ print $2 }" + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE LINUX_VER + RESULT_VARIABLE LINUX_VER_RESULT + ) + endif(EXISTS "/etc/lsb-release") + if(NOT LINUX_DISTRIBUTION) + if(EXISTS "/etc/linuxmint/info") + set(LINUX_DISTRIBUTION "LinuxMint") + execute_process(COMMAND cat /etc/linuxmint/info + COMMAND grep -m1 RELEASE + COMMAND awk -F= "{ print $2 }" + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE LINUX_VER + RESULT_VARIABLE LINUX_VER_RESULT + ) + endif(EXISTS "/etc/linuxmint/info") + endif(NOT LINUX_DISTRIBUTION) + if(NOT LINUX_DISTRIBUTION) + if(EXISTS "/etc/os-release") + execute_process(COMMAND cat /etc/os-release + COMMAND grep -m1 NAME + COMMAND awk -F= "{ print $2 }" + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE LINUX_DISTRIBUTION + RESULT_VARIABLE LINUX_ID_RESULT + ) + execute_process(COMMAND cat /etc/os-release + COMMAND grep VERSION_ID + COMMAND awk -F= "{ print $2 }" + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE LINUX_VER + RESULT_VARIABLE LINUX_VER_RESULT + ) + if(${LINUX_DISTRIBUTION} MATCHES "Debian") + set(LINUX_DISTRIBUTION "Debian") + file(READ /etc/debian_version LINUX_VER) + endif(${LINUX_DISTRIBUTION} MATCHES "Debian") + endif(EXISTS "/etc/os-release") + endif(NOT LINUX_DISTRIBUTION) + if(NOT LINUX_DISTRIBUTION) + if(EXISTS "/etc/redhat-release") + set(LINUX_DISTRIBUTION "Red Hat") + file(READ /etc/redhat-release LINUX_VER) + endif(EXISTS "/etc/redhat-release") + endif(NOT LINUX_DISTRIBUTION) + if(NOT LINUX_DISTRIBUTION) + if(EXISTS "/etc/debian_version") + set(LINUX_DISTRIBUTION "Debian") + file(READ /etc/debian_version LINUX_VER) + endif(EXISTS "/etc/debian_version") + endif(NOT LINUX_DISTRIBUTION) + if(NOT LINUX_DISTRIBUTION) + set(LINUX_DISTRIBUTION "Generic") + set(LINUX_VER "Unknown") + endif(NOT LINUX_DISTRIBUTION) + message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on ${LINUX_DISTRIBUTION} GNU/Linux Release ${LINUX_VER} ${ARCH_}") endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") if(NOT LINUX_DISTRIBUTION) set(LINUX_DISTRIBUTION "Unknown") @@ -225,56 +224,56 @@ endif(NOT LINUX_DISTRIBUTION) # Detect macOS / Mac OS X Version if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set(OperatingSystem "Mac OS X") - set(OS_IS_MACOSX TRUE) - execute_process(COMMAND uname -v OUTPUT_VARIABLE DARWIN_VERSION) - string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION}) - if(${DARWIN_VERSION} MATCHES "18") - set(MACOS_MOJAVE TRUE) - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") - message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS Mojave 10.14") - endif(${DARWIN_VERSION} MATCHES "18") - if(${DARWIN_VERSION} MATCHES "17") - set(MACOS_HIGH_SIERRA TRUE) - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") - message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS High Sierra 10.13") - endif(${DARWIN_VERSION} MATCHES "17") - if(${DARWIN_VERSION} MATCHES "16") - set(MACOS_SIERRA TRUE) - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") - message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS Sierra 10.12") - endif(${DARWIN_VERSION} MATCHES "16") - if(${DARWIN_VERSION} MATCHES "15") - set(MACOSX_EL_CAPITAN TRUE) - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") - message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.11 El Capitan") - endif(${DARWIN_VERSION} MATCHES "15") - if(${DARWIN_VERSION} MATCHES "14") - set(MACOSX_YOSEMITE TRUE) - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") - message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.10 Yosemite") - endif(${DARWIN_VERSION} MATCHES "14") - if(${DARWIN_VERSION} MATCHES "13") - set(MACOSX_MAVERICKS TRUE) - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") - set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION="com.apple.compilers.llvm.clang.1_0") - message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.9 Mavericks") - endif(${DARWIN_VERSION} MATCHES "13") - if(${DARWIN_VERSION} MATCHES "12") - message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.8 Mountain Lion") - endif(${DARWIN_VERSION} MATCHES "12") - if(${DARWIN_VERSION} MATCHES "11") - message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.7 Lion") - endif(${DARWIN_VERSION} MATCHES "11") - if(${DARWIN_VERSION} MATCHES "10") - message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.6 Snow Leopard") - endif(${DARWIN_VERSION} MATCHES "10") + set(OperatingSystem "Mac OS X") + set(OS_IS_MACOSX TRUE) + execute_process(COMMAND uname -v OUTPUT_VARIABLE DARWIN_VERSION) + string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION}) + if(${DARWIN_VERSION} MATCHES "18") + set(MACOS_MOJAVE TRUE) + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") + message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS Mojave 10.14") + endif(${DARWIN_VERSION} MATCHES "18") + if(${DARWIN_VERSION} MATCHES "17") + set(MACOS_HIGH_SIERRA TRUE) + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") + message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS High Sierra 10.13") + endif(${DARWIN_VERSION} MATCHES "17") + if(${DARWIN_VERSION} MATCHES "16") + set(MACOS_SIERRA TRUE) + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") + message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS Sierra 10.12") + endif(${DARWIN_VERSION} MATCHES "16") + if(${DARWIN_VERSION} MATCHES "15") + set(MACOSX_EL_CAPITAN TRUE) + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") + message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.11 El Capitan") + endif(${DARWIN_VERSION} MATCHES "15") + if(${DARWIN_VERSION} MATCHES "14") + set(MACOSX_YOSEMITE TRUE) + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") + message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.10 Yosemite") + endif(${DARWIN_VERSION} MATCHES "14") + if(${DARWIN_VERSION} MATCHES "13") + set(MACOSX_MAVERICKS TRUE) + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") + set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION="com.apple.compilers.llvm.clang.1_0") + message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.9 Mavericks") + endif(${DARWIN_VERSION} MATCHES "13") + if(${DARWIN_VERSION} MATCHES "12") + message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.8 Mountain Lion") + endif(${DARWIN_VERSION} MATCHES "12") + if(${DARWIN_VERSION} MATCHES "11") + message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.7 Lion") + endif(${DARWIN_VERSION} MATCHES "11") + if(${DARWIN_VERSION} MATCHES "10") + message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.6 Snow Leopard") + endif(${DARWIN_VERSION} MATCHES "10") endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Define extra build types and select Release by default to get optimization flags @@ -291,36 +290,33 @@ include(GnsssdrBuildTypes) # - O3WithASM: -O3 -g -save-temps # - ASAN: -Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer if(NOT CMAKE_BUILD_TYPE) - if(ENABLE_GPERFTOOLS OR ENABLE_GPROF) - set(CMAKE_BUILD_TYPE "RelWithDebInfo") - message(STATUS "Build type not specified: defaulting to RelWithDebInfo.") - else(ENABLE_GPERFTOOLS OR ENABLE_GPROF) - set(CMAKE_BUILD_TYPE "Release") - message(STATUS "Build type not specified: defaulting to Release.") - endif(ENABLE_GPERFTOOLS OR ENABLE_GPROF) + if(ENABLE_GPERFTOOLS OR ENABLE_GPROF) + set(CMAKE_BUILD_TYPE "RelWithDebInfo") + message(STATUS "Build type not specified: defaulting to RelWithDebInfo.") + else(ENABLE_GPERFTOOLS OR ENABLE_GPROF) + set(CMAKE_BUILD_TYPE "Release") + message(STATUS "Build type not specified: defaulting to Release.") + endif(ENABLE_GPERFTOOLS OR ENABLE_GPROF) else(NOT CMAKE_BUILD_TYPE) - message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.") + message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.") endif(NOT CMAKE_BUILD_TYPE) GNSSSDR_CHECK_BUILD_TYPE(${CMAKE_BUILD_TYPE}) set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") # allow 'large' files in 32 bit builds if(UNIX) - add_definitions( -D_LARGEFILE_SOURCE - -D_FILE_OFFSET_BITS=64 - -D_LARGE_FILES - ) + add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES) endif(UNIX) # Determine if we are using make or ninja if(CMAKE_MAKE_PROGRAM MATCHES "make") - set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "make") + set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "make") endif(CMAKE_MAKE_PROGRAM MATCHES "make") if(CMAKE_MAKE_PROGRAM MATCHES "ninja") - set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "ninja") + set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "ninja") endif(CMAKE_MAKE_PROGRAM MATCHES "ninja") if(NOT CMAKE_MAKE_PROGRAM_PRETTY_NAME) - set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "${CMAKE_MAKE_PROGRAM}") + set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "${CMAKE_MAKE_PROGRAM}") endif(NOT CMAKE_MAKE_PROGRAM_PRETTY_NAME) @@ -355,7 +351,7 @@ set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.13") set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.9") if(CMAKE_VERSION VERSION_LESS "3.0.2") # Fix for CentOS 7 - set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.1") + set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.1") endif(CMAKE_VERSION VERSION_LESS "3.0.2") @@ -364,8 +360,8 @@ endif(CMAKE_VERSION VERSION_LESS "3.0.2") # Check CMake version ################################################################################ if(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION}) - message(STATUS "Your CMake version is too old and does not support some features required by GNSS-SDR. CMake version must be at least ${GNSSSDR_CMAKE_MIN_VERSION}.") - message(FATAL_ERROR "Fatal error: CMake >= ${GNSSSDR_CMAKE_MIN_VERSION} required.") + message(STATUS "Your CMake version is too old and does not support some features required by GNSS-SDR. CMake version must be at least ${GNSSSDR_CMAKE_MIN_VERSION}.") + message(FATAL_ERROR "Fatal error: CMake >= ${GNSSSDR_CMAKE_MIN_VERSION} required.") endif(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION}) @@ -374,10 +370,10 @@ endif(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION}) # Check compiler version ################################################################################ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION}) - message(STATUS "Your GCC version is too old and does not support some C++ features required by GNSS-SDR. GCC version must be at least ${GNSSSDR_GCC_MIN_VERSION}") - message(FATAL_ERROR "Fatal error: GCC >= ${GNSSSDR_GCC_MIN_VERSION} required.") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION}) + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION}) + message(STATUS "Your GCC version is too old and does not support some C++ features required by GNSS-SDR. GCC version must be at least ${GNSSSDR_GCC_MIN_VERSION}") + message(FATAL_ERROR "Fatal error: GCC >= ${GNSSSDR_GCC_MIN_VERSION} required.") + endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION}) endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") @@ -389,20 +385,20 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # output is in error stream string(REGEX MATCH "^Apple.*" IS_APPLE ${_err}) if("${IS_APPLE}" STREQUAL "") - set(MIN_VERSION ${GNSSSDR_CLANG_MIN_VERSION}) - set(APPLE_STR "") - # retrieve the compiler's version from it - string(REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${_err}) - string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_OTHER_VERSION}) + set(MIN_VERSION ${GNSSSDR_CLANG_MIN_VERSION}) + set(APPLE_STR "") + # retrieve the compiler's version from it + string(REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${_err}) + string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_OTHER_VERSION}) else("${IS_APPLE}" STREQUAL "") - set(MIN_VERSION ${GNSSSDR_APPLECLANG_MIN_VERSION}) - set(APPLE_STR "Apple ") - # retrieve the compiler's version from it - string(REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${_err}) - string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_APPLE_VERSION}) + set(MIN_VERSION ${GNSSSDR_APPLECLANG_MIN_VERSION}) + set(APPLE_STR "Apple ") + # retrieve the compiler's version from it + string(REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${_err}) + string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_APPLE_VERSION}) endif("${IS_APPLE}" STREQUAL "") if(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}") - message(WARNING "\nThe compiler selected to build GNSS-SDR (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") + message(WARNING "\nThe compiler selected to build GNSS-SDR (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") endif(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}") else(${_res} STREQUAL "0") message(WARNING "\nCannot determine the version of the compiler selected to build GNSS-SDR (${APPLE_STR}Clang : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") @@ -428,7 +424,7 @@ endif(NOT OS_IS_MACOSX) # Check for availability of SSE ################################################################################ if(NOT ENABLE_GENERIC_ARCH) - include(TestForSSE) + include(TestForSSE) endif(NOT ENABLE_GENERIC_ARCH) @@ -463,21 +459,21 @@ if(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) if(GTEST_DIR) message(STATUS "Googletest root folder set at ${GTEST_DIR}") find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS ${GTEST_DIR}) - if(LIBGTEST_DEV_DIR) - message (STATUS "Googletest has been found.") - else(LIBGTEST_DEV_DIR) - message (FATAL_ERROR " Googletest source code has not been found at ${GTEST_DIR}.") - endif(LIBGTEST_DEV_DIR) + if(LIBGTEST_DEV_DIR) + message(STATUS "Googletest has been found.") + else(LIBGTEST_DEV_DIR) + message(FATAL_ERROR " Googletest source code has not been found at ${GTEST_DIR}.") + endif(LIBGTEST_DEV_DIR) find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS ${GTEST_DIR}/include) else(GTEST_DIR) - find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS /usr/src/googletest/googletest /usr/src/gtest /usr/include/gtest /opt/local/src/gtest-1.7.0 ) + find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS /usr/src/googletest/googletest /usr/src/gtest /usr/include/gtest /opt/local/src/gtest-1.7.0) find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS /usr/include /opt/local/src/gtest-1.7.0/include) if(LIBGTEST_DEV_DIR) - message (STATUS "Googletest package has been found.") + message(STATUS "Googletest package has been found.") else(LIBGTEST_DEV_DIR) - message (STATUS " Googletest has not been found.") - message (STATUS " Googletest v${GNSSSDR_GTEST_LOCAL_VERSION} will be downloaded and built automatically ") - message (STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") + message(STATUS " Googletest has not been found.") + message(STATUS " Googletest v${GNSSSDR_GTEST_LOCAL_VERSION} will be downloaded and built automatically ") + message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") endif(LIBGTEST_DEV_DIR) endif(GTEST_DIR) endif(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) @@ -498,12 +494,13 @@ set(Boost_ADDITIONAL_VERSIONS "1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69" "1.70.0" "1.70" "1.71.0" "1.71" "1.72.0" "1.72" "1.73.0" "1.73" "1.74.0" "1.74" "1.75.0" "1.75" "1.76.0" "1.76" "1.77.0" "1.77" "1.78.0" "1.78" "1.79.0" "1.79" + "1.80.0" "1.80" "1.81.0" "1.81" "1.82.0" "1.82" "1.83.0" "1.83" "1.84.0" "1.84" ) set(Boost_USE_MULTITHREAD ON) set(Boost_USE_STATIC_LIBS OFF) find_package(Boost COMPONENTS date_time system filesystem thread serialization chrono REQUIRED) if(NOT Boost_FOUND) - message(FATAL_ERROR "Fatal error: Boost (version >=${GNSSSDR_BOOST_MIN_VERSION}) required.") + message(FATAL_ERROR "Fatal error: Boost (version >=${GNSSSDR_BOOST_MIN_VERSION}) required.") endif(NOT Boost_FOUND) @@ -514,25 +511,25 @@ endif(NOT Boost_FOUND) set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS FFT FILTER PMT) find_package(Gnuradio) if(PC_GNURADIO_RUNTIME_VERSION) - if(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION}) - set(GNURADIO_RUNTIME_FOUND) - message(STATUS "The GNU Radio version installed in your system is too old.") - endif(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION}) + if(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION}) + set(GNURADIO_RUNTIME_FOUND) + message(STATUS "The GNU Radio version installed in your system is too old.") + endif(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION}) endif(PC_GNURADIO_RUNTIME_VERSION) if(NOT GNURADIO_RUNTIME_FOUND) - message(STATUS "CMake cannot find GNU Radio >= ${GNSSSDR_GNURADIO_MIN_VERSION}") - if(OS_IS_LINUX) - message("Go to https://github.com/gnuradio/pybombs") - message("and follow the instructions to install GNU Radio in your system.") - message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") - endif(OS_IS_LINUX) - if(OS_IS_MACOSX) - message("You can install it easily via Macports:") - message(" sudo port install gnuradio ") - message("Alternatively, you can use homebrew:") - message(" brew install gnuradio" ) - message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") - endif(OS_IS_MACOSX) + message(STATUS "CMake cannot find GNU Radio >= ${GNSSSDR_GNURADIO_MIN_VERSION}") + if(OS_IS_LINUX) + message("Go to https://github.com/gnuradio/pybombs") + message("and follow the instructions to install GNU Radio in your system.") + message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") + endif(OS_IS_LINUX) + if(OS_IS_MACOSX) + message("You can install it easily via Macports:") + message(" sudo port install gnuradio ") + message("Alternatively, you can use homebrew:") + message(" brew install gnuradio") + message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") + endif(OS_IS_MACOSX) endif(NOT GNURADIO_RUNTIME_FOUND) if(NOT GNURADIO_ANALOG_FOUND) @@ -600,11 +597,11 @@ if(NOT VOLK_GNSSSDR_FOUND) message(STATUS "Mako template library not found. See http://www.makotemplates.org/ ") message(STATUS " You can try to install it by typing:") if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(STATUS " sudo yum install ${PYTHON_NAME}-mako") + message(STATUS " sudo yum install ${PYTHON_NAME}-mako") elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(STATUS " sudo zypper install ${PYTHON_NAME}-Mako") + message(STATUS " sudo zypper install ${PYTHON_NAME}-Mako") else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(STATUS " sudo apt-get install ${PYTHON_NAME}-mako") + message(STATUS " sudo apt-get install ${PYTHON_NAME}-mako") endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") message(FATAL_ERROR "Mako templates required to build VOLK_GNSSSDR") endif(NOT MAKO_FOUND) @@ -614,11 +611,11 @@ if(NOT VOLK_GNSSSDR_FOUND) message(STATUS "python-six not found. See https://pythonhosted.org/six/ ") message(STATUS " You can try to install it by typing:") if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(STATUS " sudo yum install ${PYTHON_NAME}-six") + message(STATUS " sudo yum install ${PYTHON_NAME}-six") elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(STATUS " sudo zypper install ${PYTHON_NAME}-six") + message(STATUS " sudo zypper install ${PYTHON_NAME}-six") else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(STATUS " sudo apt-get install ${PYTHON_NAME}-six") + message(STATUS " sudo apt-get install ${PYTHON_NAME}-six") endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") message(FATAL_ERROR "six - python 2 and 3 compatibility library required to build VOLK_GNSSSDR") endif(NOT SIX_FOUND) @@ -626,10 +623,10 @@ if(NOT VOLK_GNSSSDR_FOUND) set(READ_ENVIRO "") if(ENABLE_PACKAGING) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) - set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON -DCMAKE_VERBOSE_MAKEFILE=ON") + set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON -DCMAKE_VERBOSE_MAKEFILE=ON") endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if(NOT DEFINED ENV{PROTECT_PASSWORDS}) - set(READ_ENVIRO ${CMAKE_COMMAND} -E environment) + set(READ_ENVIRO ${CMAKE_COMMAND} -E environment) endif(NOT DEFINED ENV{PROTECT_PASSWORDS}) endif(ENABLE_PACKAGING) @@ -639,7 +636,7 @@ if(NOT VOLK_GNSSSDR_FOUND) endif(PYTHON_EXECUTABLE) if(OS_IS_MACOSX) if(CMAKE_GENERATOR STREQUAL Xcode) - set(VOLK_GNSSSDR_BUILD_COMMAND "xcodebuild" "-configuration" "Debug" "-target") + set(VOLK_GNSSSDR_BUILD_COMMAND "xcodebuild" "-configuration" "Debug" "-target") endif(CMAKE_GENERATOR STREQUAL Xcode) endif(OS_IS_MACOSX) @@ -649,49 +646,49 @@ if(NOT VOLK_GNSSSDR_FOUND) set(VOLK_GNSSSDR_COMPILER -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}) endif(CMAKE_CROSSCOMPILING) set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_COMPILER} - -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install - -DENABLE_STATIC_LIBS=ON - -DENABLE_PROFILING=${ENABLE_PROFILING} - -DCMAKE_INCLUDE_PATH=${Boost_INCLUDE_DIR} - -DENABLE_ORC=OFF - ${STRIP_VOLK_GNSSSDR_PROFILE} - ${USE_THIS_PYTHON} ) + -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install + -DENABLE_STATIC_LIBS=ON + -DENABLE_PROFILING=${ENABLE_PROFILING} + -DCMAKE_INCLUDE_PATH=${Boost_INCLUDE_DIR} + -DENABLE_ORC=OFF + ${STRIP_VOLK_GNSSSDR_PROFILE} + ${USE_THIS_PYTHON}) if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} - -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake - -DCROSSCOMPILE_MULTILIB=TRUE ) + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake + -DCROSSCOMPILE_MULTILIB=TRUE) endif(EXISTS $ENV{OECORE_TARGET_SYSROOT}) if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add(volk_gnsssdr_module - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build - CMAKE_ARGS ${READ_ENVIRO} ${VOLK_GNSSSDR_CMAKE_ARGS} - DOWNLOAD_COMMAND "" - UPDATE_COMMAND "" - PATCH_COMMAND "" - BUILD_COMMAND ${READ_ENVIRO} ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile - INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install - ) + ExternalProject_Add(volk_gnsssdr_module + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build + CMAKE_ARGS ${READ_ENVIRO} ${VOLK_GNSSSDR_CMAKE_ARGS} + DOWNLOAD_COMMAND "" + UPDATE_COMMAND "" + PATCH_COMMAND "" + BUILD_COMMAND ${READ_ENVIRO} ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install + ) else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add(volk_gnsssdr_module - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build - CMAKE_ARGS ${READ_ENVIRO} ${VOLK_GNSSSDR_CMAKE_ARGS} - DOWNLOAD_COMMAND "" - UPDATE_COMMAND "" - PATCH_COMMAND "" - BUILD_COMMAND ${READ_ENVIRO} ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile - INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install - ) + ExternalProject_Add(volk_gnsssdr_module + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build + CMAKE_ARGS ${READ_ENVIRO} ${VOLK_GNSSSDR_CMAKE_ARGS} + DOWNLOAD_COMMAND "" + UPDATE_COMMAND "" + PATCH_COMMAND "" + BUILD_COMMAND ${READ_ENVIRO} ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install + ) endif(CMAKE_VERSION VERSION_LESS 3.2) find_package(ORC) if(NOT ORC_FOUND) - set(ORC_LIBRARIES "") - set(ORC_INCLUDE_DIRS "") + set(ORC_LIBRARIES "") + set(ORC_INCLUDE_DIRS "") endif(NOT ORC_FOUND) add_library(volk_gnsssdr UNKNOWN IMPORTED) @@ -700,13 +697,13 @@ if(NOT VOLK_GNSSSDR_FOUND) set(VOLK_GNSSSDR_LIBRARIES volk_gnsssdr ${ORC_LIBRARIES}) if(CMAKE_VERSION VERSION_LESS 3.2) - add_custom_command(TARGET volk_gnsssdr_module POST_BUILD + add_custom_command(TARGET volk_gnsssdr_module POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile - ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile) + ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile) else(CMAKE_VERSION VERSION_LESS 3.2) - add_custom_command(TARGET volk_gnsssdr_module POST_BUILD + add_custom_command(TARGET volk_gnsssdr_module POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile - ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile + ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile BYPRODUCTS ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile) endif(CMAKE_VERSION VERSION_LESS 3.2) @@ -722,57 +719,57 @@ endif(NOT VOLK_GNSSSDR_FOUND) ################################################################################ set(LOCAL_GFLAGS false) find_package(GFlags) -if (NOT GFlags_FOUND) - message (STATUS " gflags library has not been found.") - message (STATUS " gflags v${GNSSSDR_GFLAGS_LOCAL_VERSION} will be downloaded and built automatically ") - message (STATUS " when doing 'make'. ") +if(NOT GFlags_FOUND) + message(STATUS " gflags library has not been found.") + message(STATUS " gflags v${GNSSSDR_GFLAGS_LOCAL_VERSION} will be downloaded and built automatically ") + message(STATUS " when doing 'make'. ") - if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - GIT_REPOSITORY git://github.com/gflags/gflags.git - GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} - UPDATE_COMMAND "" - PATCH_COMMAND "" - INSTALL_COMMAND "" - ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - GIT_REPOSITORY git://github.com/gflags/gflags.git - GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} - UPDATE_COMMAND "" - PATCH_COMMAND "" - INSTALL_COMMAND "" - ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + if(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add( + gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + GIT_REPOSITORY git://github.com/gflags/gflags.git + GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" + ) + else(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add( + gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + GIT_REPOSITORY git://github.com/gflags/gflags.git + GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" + ) + endif(CMAKE_VERSION VERSION_LESS 3.2) - set(GFlags_INCLUDE_DIRS - ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include CACHE PATH "Local Gflags headers" - ) + set(GFlags_INCLUDE_DIRS + ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include CACHE PATH "Local Gflags headers" + ) - add_library(gflags UNKNOWN IMPORTED) - set_property(TARGET gflags PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}) - add_dependencies(gflags gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) - set(GFlags_LIBS gflags) - file(GLOB GFlags_SHARED_LIBS "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_SHARED_LIBRARY_SUFFIX}*") - set(GFlags_LIBRARY gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) - set(GFlags_LIBRARY_PATH ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib ) - link_directories(${GFlags_LIBRARY_PATH}) - set(GFlags_lib ${GFlags_LIBS} CACHE FILEPATH "Local Gflags library") - set(GFlags_LIBRARY_PATH ${GFlags_LIBS}) - set(LOCAL_GFLAGS true CACHE STRING "GFlags downloaded and built automatically" FORCE) + add_library(gflags UNKNOWN IMPORTED) + set_property(TARGET gflags PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}) + add_dependencies(gflags gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) + set(GFlags_LIBS gflags) + file(GLOB GFlags_SHARED_LIBS "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_SHARED_LIBRARY_SUFFIX}*") + set(GFlags_LIBRARY gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) + set(GFlags_LIBRARY_PATH ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib) + link_directories(${GFlags_LIBRARY_PATH}) + set(GFlags_lib ${GFlags_LIBS} CACHE FILEPATH "Local Gflags library") + set(GFlags_LIBRARY_PATH ${GFlags_LIBS}) + set(LOCAL_GFLAGS true CACHE STRING "GFlags downloaded and built automatically" FORCE) endif(NOT GFlags_FOUND) @@ -781,34 +778,34 @@ endif(NOT GFlags_FOUND) # glog - https://github.com/google/glog ################################################################################ if(NOT ${ENABLE_OWN_GLOG}) - find_package(GLOG) - if(GLOG_INCLUDE_DIRS) + find_package(GLOG) + if(GLOG_INCLUDE_DIRS) set(GLOG_FOUND ON) - endif(GLOG_INCLUDE_DIRS) + endif(GLOG_INCLUDE_DIRS) endif(NOT ${ENABLE_OWN_GLOG}) set(glog_RELEASE ${GNSSSDR_GLOG_LOCAL_VERSION}) -if (NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) - message (STATUS " glog library has not been found") - if(NOT GFlags_FOUND) - message(STATUS " or it is likely not linked to gflags.") - endif(NOT GFlags_FOUND) - message (STATUS " glog v${GNSSSDR_GLOG_LOCAL_VERSION} will be downloaded and built automatically ") - message (STATUS " when doing 'make'. ") - if(NOT ${LOCAL_GFLAGS}) - add_library(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} UNKNOWN IMPORTED) - set_property(TARGET gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GFlags_LIBS}") - endif(NOT ${LOCAL_GFLAGS}) - set(TARGET_GFLAGS gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) - if(${LOCAL_GFLAGS}) - set(GFLAGS_LIBRARIES_TO_LINK ${GFlags_SHARED_LIBS}) - set(GFLAGS_LIBRARY_DIR_TO_LINK ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib) - else(${LOCAL_GFLAGS}) - set(GFLAGS_LIBRARIES_TO_LINK ${GFlags_LIBS}) - set(GFLAGS_LIBRARY_DIR_TO_LINK ${GFlags_LIBRARY_DIRS}) - endif(${LOCAL_GFLAGS}) +if(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) + message(STATUS " glog library has not been found") + if(NOT GFlags_FOUND) + message(STATUS " or it is likely not linked to gflags.") + endif(NOT GFlags_FOUND) + message(STATUS " glog v${GNSSSDR_GLOG_LOCAL_VERSION} will be downloaded and built automatically ") + message(STATUS " when doing 'make'. ") + if(NOT ${LOCAL_GFLAGS}) + add_library(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} UNKNOWN IMPORTED) + set_property(TARGET gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GFlags_LIBS}") + endif(NOT ${LOCAL_GFLAGS}) + set(TARGET_GFLAGS gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) + if(${LOCAL_GFLAGS}) + set(GFLAGS_LIBRARIES_TO_LINK ${GFlags_SHARED_LIBS}) + set(GFLAGS_LIBRARY_DIR_TO_LINK ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib) + else(${LOCAL_GFLAGS}) + set(GFLAGS_LIBRARIES_TO_LINK ${GFlags_LIBS}) + set(GFLAGS_LIBRARY_DIR_TO_LINK ${GFlags_LIBRARY_DIRS}) + endif(${LOCAL_GFLAGS}) - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags "#!/bin/sh export CPPFLAGS=-I${GFlags_INCLUDE_DIRS} export LDFLAGS=-L${GFLAGS_LIBRARY_DIR_TO_LINK} @@ -823,8 +820,8 @@ autoreconf -vfi cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure") - else(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags + else(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags "#!/bin/sh export CPPFLAGS=-I${GFlags_INCLUDE_DIRS} export LDFLAGS=-L${GFLAGS_LIBRARY_DIR_TO_LINK} @@ -835,97 +832,96 @@ automake --add-missing autoreconf -vfi cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure") + endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + file(COPY ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ + GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - file(COPY ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags - DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} - FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ - GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + set(GLOG_CONFIGURE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure_with_gflags) - set(GLOG_CONFIGURE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure_with_gflags) + # Ensure that aclocal and libtool are present + if(OS_IS_LINUX) + if(EXISTS "/usr/bin/libtoolize") + if(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") + # Everything ok, we can move on + else(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") + message(" aclocal has not been found.") + message(" You can try to install it by typing:") + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo yum groupinstall 'Development Tools'") + elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") + message(" sudo zypper install automake") + else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo apt-get install automake") + endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(FATAL_ERROR "aclocal is required to build glog from source") + endif(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") + else(EXISTS "/usr/bin/libtoolize") + message(" libtool has not been found.") + message(" You can try to install it by typing:") + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo yum groupinstall 'Development Tools'") + elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") + message(" sudo zypper install libtoool") + else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo apt-get install libtool") + endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(FATAL_ERROR "libtool is required to build glog from source") + endif(EXISTS "/usr/bin/libtoolize") + endif(OS_IS_LINUX) - # Ensure that aclocal and libtool are present - if(OS_IS_LINUX) - if(EXISTS "/usr/bin/libtoolize") - if(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - # Everything ok, we can move on - else(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - message(" aclocal has not been found.") - message(" You can try to install it by typing:") - if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum groupinstall 'Development Tools'") - elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(" sudo zypper install automake") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install automake") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(FATAL_ERROR "aclocal is required to build glog from source") - endif(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - else(EXISTS "/usr/bin/libtoolize") - message(" libtool has not been found.") - message(" You can try to install it by typing:") - if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum groupinstall 'Development Tools'") - elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(" sudo zypper install libtoool") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install libtool") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(FATAL_ERROR "libtool is required to build glog from source") - endif(EXISTS "/usr/bin/libtoolize") - endif(OS_IS_LINUX) + if(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add( + glog-${GNSSSDR_GLOG_LOCAL_VERSION} + DEPENDS ${TARGET_GFLAGS} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + GIT_REPOSITORY https://github.com/google/glog/ + GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix= + BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}" + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" + ) + else(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add( + glog-${GNSSSDR_GLOG_LOCAL_VERSION} + DEPENDS ${TARGET_GFLAGS} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + GIT_REPOSITORY https://github.com/google/glog/ + GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix= + BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}" + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" + ) + endif(CMAKE_VERSION VERSION_LESS 3.2) - if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - glog-${GNSSSDR_GLOG_LOCAL_VERSION} - DEPENDS ${TARGET_GFLAGS} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} - GIT_REPOSITORY https://github.com/google/glog/ - GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} - CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix= - BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}" - UPDATE_COMMAND "" - PATCH_COMMAND "" - INSTALL_COMMAND "" - ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - glog-${GNSSSDR_GLOG_LOCAL_VERSION} - DEPENDS ${TARGET_GFLAGS} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} - GIT_REPOSITORY https://github.com/google/glog/ - GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} - CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix= - BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}" - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} - UPDATE_COMMAND "" - PATCH_COMMAND "" - INSTALL_COMMAND "" - ) - endif(CMAKE_VERSION VERSION_LESS 3.2) - - # Set up variables - set(GLOG_INCLUDE_DIRS - ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src/ - ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src - ) - set(GLOG_LIBRARIES - ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} - ) - set(LOCAL_GLOG true CACHE STRING "Glog downloaded and built automatically" FORCE) + # Set up variables + set(GLOG_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src/ + ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src + ) + set(GLOG_LIBRARIES + ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + ) + set(LOCAL_GLOG true CACHE STRING "Glog downloaded and built automatically" FORCE) else(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) - add_library(glog-${GNSSSDR_GLOG_LOCAL_VERSION} UNKNOWN IMPORTED) - set_property(TARGET glog-${GNSSSDR_GLOG_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GLOG_LIBRARIES}") + add_library(glog-${GNSSSDR_GLOG_LOCAL_VERSION} UNKNOWN IMPORTED) + set_property(TARGET glog-${GNSSSDR_GLOG_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GLOG_LIBRARIES}") endif(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) if(NOT ENABLE_LOG) - message(STATUS "Logging is not enabled") - add_definitions(-DGOOGLE_STRIP_LOG=1) + message(STATUS "Logging is not enabled") + add_definitions(-DGOOGLE_STRIP_LOG=1) endif(NOT ENABLE_LOG) @@ -980,76 +976,76 @@ if(ARMADILLO_FOUND) endif(ARMADILLO_FOUND) if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) - message(STATUS " Armadillo has not been found.") - message(STATUS " Armadillo ${GNSSSDR_ARMADILLO_LOCAL_VERSION} will be downloaded and built automatically") - message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") - set(armadillo_BRANCH ${GNSSSDR_ARMADILLO_LOCAL_VERSION}) - set(armadillo_RELEASE ${armadillo_BRANCH}) + message(STATUS " Armadillo has not been found.") + message(STATUS " Armadillo ${GNSSSDR_ARMADILLO_LOCAL_VERSION} will be downloaded and built automatically") + message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") + set(armadillo_BRANCH ${GNSSSDR_ARMADILLO_LOCAL_VERSION}) + set(armadillo_RELEASE ${armadillo_BRANCH}) - ############################################# - # Check if GFORTRAN is found in the system - ############################################# - if(NOT OS_IS_MACOSX) - find_package(GFORTRAN) - if(NOT GFORTRAN) - message(STATUS "The gfortran library has not been found.") - message(STATUS " You can try to install it by typing:") - if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(STATUS " sudo yum install gcc-fortran") - elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(STATUS " sudo zypper install gcc-fortran") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(STATUS " sudo apt-get install gfortran") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(FATAL_ERROR "gfortran is required to build gnss-sdr") - endif(NOT GFORTRAN) - endif(NOT OS_IS_MACOSX) + ############################################# + # Check if GFORTRAN is found in the system + ############################################# + if(NOT OS_IS_MACOSX) + find_package(GFORTRAN) + if(NOT GFORTRAN) + message(STATUS "The gfortran library has not been found.") + message(STATUS " You can try to install it by typing:") + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(STATUS " sudo yum install gcc-fortran") + elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") + message(STATUS " sudo zypper install gcc-fortran") + else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(STATUS " sudo apt-get install gfortran") + endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(FATAL_ERROR "gfortran is required to build gnss-sdr") + endif(NOT GFORTRAN) + endif(NOT OS_IS_MACOSX) - ############################################# - # Download and build Armadillo - ############################################# - if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - armadillo-${armadillo_RELEASE} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} - GIT_REPOSITORY https://gitlab.com/conradsnicta/armadillo-code.git - GIT_TAG ${armadillo_BRANCH} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} - CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS=-std=c++11 - BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} - UPDATE_COMMAND "" - INSTALL_COMMAND "" - ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - armadillo-${armadillo_RELEASE} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} - GIT_REPOSITORY https://gitlab.com/conradsnicta/armadillo-code.git - GIT_TAG ${armadillo_BRANCH} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} - CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS=-std=c++11 - BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX} - UPDATE_COMMAND "" - INSTALL_COMMAND "" - ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + ############################################# + # Download and build Armadillo + ############################################# + if(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add( + armadillo-${armadillo_RELEASE} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} + GIT_REPOSITORY https://gitlab.com/conradsnicta/armadillo-code.git + GIT_TAG ${armadillo_BRANCH} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} + CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS=-std=c++11 + BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} + UPDATE_COMMAND "" + INSTALL_COMMAND "" + ) + else(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add( + armadillo-${armadillo_RELEASE} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} + GIT_REPOSITORY https://gitlab.com/conradsnicta/armadillo-code.git + GIT_TAG ${armadillo_BRANCH} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} + CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS=-std=c++11 + BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX} + UPDATE_COMMAND "" + INSTALL_COMMAND "" + ) + endif(CMAKE_VERSION VERSION_LESS 3.2) - # Set up variables - ExternalProject_Get_Property(armadillo-${armadillo_RELEASE} binary_dir) - set(ARMADILLO_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include ) - if(NOT GFORTRAN) - set(GFORTRAN "") - endif(NOT GFORTRAN) - set(ARMADILLO_LIBRARIES ${BLAS} ${LAPACK} ${GFORTRAN} ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}) - set(LOCAL_ARMADILLO true CACHE STRING "Armadillo downloaded and built automatically" FORCE) - set(ARMADILLO_VERSION_STRING ${armadillo_RELEASE}) + # Set up variables + ExternalProject_Get_Property(armadillo-${armadillo_RELEASE} binary_dir) + set(ARMADILLO_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include) + if(NOT GFORTRAN) + set(GFORTRAN "") + endif(NOT GFORTRAN) + set(ARMADILLO_LIBRARIES ${BLAS} ${LAPACK} ${GFORTRAN} ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(LOCAL_ARMADILLO true CACHE STRING "Armadillo downloaded and built automatically" FORCE) + set(ARMADILLO_VERSION_STRING ${armadillo_RELEASE}) else(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) - set(armadillo_RELEASE ${ARMADILLO_VERSION_STRING}) - add_library(armadillo-${armadillo_RELEASE} UNKNOWN IMPORTED) - set_property(TARGET armadillo-${armadillo_RELEASE} PROPERTY IMPORTED_LOCATION "${ARMADILLO_LIBRARIES}") + set(armadillo_RELEASE ${ARMADILLO_VERSION_STRING}) + add_library(armadillo-${armadillo_RELEASE} UNKNOWN IMPORTED) + set_property(TARGET armadillo-${armadillo_RELEASE} PROPERTY IMPORTED_LOCATION "${ARMADILLO_LIBRARIES}") endif(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) @@ -1087,31 +1083,30 @@ find_library(GNUTLS_OPENSSL_LIBRARY NAMES gnutls-openssl libgnutls-openssl.so.27 /usr/lib/s390x-linux-gnu /usr/lib/sparc64-linux-gnu /usr/lib/x86_64-linux-gnux32 - /usr/lib/sh4-linux-gnu - ) + /usr/lib/sh4-linux-gnu) if(NOT GNUTLS_OPENSSL_LIBRARY) - message(STATUS "Looking for OpenSSL instead...") - find_package(OpenSSL) - if(OPENSSL_FOUND) + message(STATUS "Looking for OpenSSL instead...") + find_package(OpenSSL) + if(OPENSSL_FOUND) set(GNUTLS_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR}) set(GNUTLS_LIBRARIES "") set(GNUTLS_OPENSSL_LIBRARY ${OPENSSL_SSL_LIBRARY}) - else(OPENSSL_FOUND) - message(" The GnuTLS library with openssl compatibility enabled has not been found.") - message(" You can try to install the required libraries by typing:") - if(OS_IS_LINUX) - if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum install openssl-devel") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install libgnutls-openssl-dev") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - endif(OS_IS_LINUX) - if(OS_IS_MACOSX) - message(" sudo port install gnutls") - endif(OS_IS_MACOSX) - message(FATAL_ERROR "GnuTLS libraries with openssl compatibility are required to build gnss-sdr") - endif(OPENSSL_FOUND) + else(OPENSSL_FOUND) + message(" The GnuTLS library with openssl compatibility enabled has not been found.") + message(" You can try to install the required libraries by typing:") + if(OS_IS_LINUX) + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo yum install openssl-devel") + else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo apt-get install libgnutls-openssl-dev") + endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + endif(OS_IS_LINUX) + if(OS_IS_MACOSX) + message(" sudo port install gnutls") + endif(OS_IS_MACOSX) + message(FATAL_ERROR "GnuTLS libraries with openssl compatibility are required to build gnss-sdr") + endif(OPENSSL_FOUND) endif(NOT GNUTLS_OPENSSL_LIBRARY) @@ -1122,7 +1117,7 @@ endif(NOT GNUTLS_OPENSSL_LIBRARY) find_package(MATIO) if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERSION}) if(MATIO_FOUND) - message(STATUS " Matio installed version (${MATIO_VERSION_STRING}) is too old (>= ${GNSSSDR_MATIO_MIN_VERSION} is required).") + message(STATUS " Matio installed version (${MATIO_VERSION_STRING}) is too old (>= ${GNSSSDR_MATIO_MIN_VERSION} is required).") endif(MATIO_FOUND) message(STATUS " Matio v${GNSSSDR_MATIO_LOCAL_VERSION} will be downloaded and built automatically") message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") @@ -1130,85 +1125,85 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS if(ZLIB_FOUND) get_filename_component(ZLIB_BASE_DIR ${ZLIB_INCLUDE_DIRS} DIRECTORY) if(OS_IS_LINUX) - if(NOT EXISTS "/usr/bin/libtoolize") - message(" libtool has not been found.") - message(" You can try to install it by typing:") - if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum groupinstall 'Development Tools'") - elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(" sudo zypper install libtoool") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install libtool") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(FATAL_ERROR "libtool is required to build matio from source") - endif(NOT EXISTS "/usr/bin/libtoolize") - if(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - message(STATUS "Automake found.") - else(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - message(" aclocal has not been found.") - message(" You can try to install it by typing:") - if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum groupinstall 'Development Tools'") - elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(" sudo zypper install automake") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install automake") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(FATAL_ERROR "aclocal is required to build matio from source") - endif(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") + if(NOT EXISTS "/usr/bin/libtoolize") + message(" libtool has not been found.") + message(" You can try to install it by typing:") + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo yum groupinstall 'Development Tools'") + elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") + message(" sudo zypper install libtoool") + else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo apt-get install libtool") + endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(FATAL_ERROR "libtool is required to build matio from source") + endif(NOT EXISTS "/usr/bin/libtoolize") + if(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") + message(STATUS "Automake found.") + else(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") + message(" aclocal has not been found.") + message(" You can try to install it by typing:") + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo yum groupinstall 'Development Tools'") + elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") + message(" sudo zypper install automake") + else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo apt-get install automake") + endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(FATAL_ERROR "aclocal is required to build matio from source") + endif(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") endif(OS_IS_LINUX) find_package(HDF5) if(HDF5_FOUND) - list(GET HDF5_LIBRARIES 0 HDF5_FIRST_DIR) - get_filename_component(HDF5_BASE_DIR2 ${HDF5_FIRST_DIR} DIRECTORY) - get_filename_component(HDF5_BASE_DIR ${HDF5_BASE_DIR2} DIRECTORY) - if(OS_IS_MACOSX) - if(EXISTS /opt/local/include/hdf5.h) - set(HDF5_BASE_DIR /opt/local) - endif(EXISTS /opt/local/include/hdf5.h) - if(EXISTS /usr/local/include/hdf5.h) - set(HDF5_BASE_DIR /usr/local) - endif(EXISTS /usr/local/include/hdf5.h) - endif(OS_IS_MACOSX) - if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - matio-${GNSSSDR_MATIO_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio - GIT_REPOSITORY https://github.com/tbeu/matio - GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} - UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= - BUILD_COMMAND make - ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - matio-${GNSSSDR_MATIO_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio - GIT_REPOSITORY https://github.com/tbeu/matio - GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} - UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= - BUILD_COMMAND make - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} - ) - endif(CMAKE_VERSION VERSION_LESS 3.2) - set(MATIO_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} ${HDF5_LIBRARIES} ${ZLIB_LIBRARIES} ) - set(MATIO_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/matio/include ) - set(MATIO_LOCAL true) + list(GET HDF5_LIBRARIES 0 HDF5_FIRST_DIR) + get_filename_component(HDF5_BASE_DIR2 ${HDF5_FIRST_DIR} DIRECTORY) + get_filename_component(HDF5_BASE_DIR ${HDF5_BASE_DIR2} DIRECTORY) + if(OS_IS_MACOSX) + if(EXISTS /opt/local/include/hdf5.h) + set(HDF5_BASE_DIR /opt/local) + endif(EXISTS /opt/local/include/hdf5.h) + if(EXISTS /usr/local/include/hdf5.h) + set(HDF5_BASE_DIR /usr/local) + endif(EXISTS /usr/local/include/hdf5.h) + endif(OS_IS_MACOSX) + if(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add( + matio-${GNSSSDR_MATIO_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio + GIT_REPOSITORY https://github.com/tbeu/matio + GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} + UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh + CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= + BUILD_COMMAND make + ) + else(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add( + matio-${GNSSSDR_MATIO_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio + GIT_REPOSITORY https://github.com/tbeu/matio + GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} + UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh + CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= + BUILD_COMMAND make + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} + ) + endif(CMAKE_VERSION VERSION_LESS 3.2) + set(MATIO_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} ${HDF5_LIBRARIES} ${ZLIB_LIBRARIES}) + set(MATIO_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/matio/include) + set(MATIO_LOCAL true) else(HDF5_FOUND) - message(STATUS " The hdf5 library has not been found in your system.") - message(STATUS " Please try to install it by doing:") - if(OS_IS_MACOSX) - message(STATUS " $ sudo port install hdf5") - message(STATUS " or") - message(STATUS " $ brew install hdf5") - endif(OS_IS_MACOSX) - if(OS_IS_LINUX) - message(STATUS " $ sudo apt-get install libhdf5-dev") - endif(OS_IS_LINUX) - message(FATAL_ERROR "*** The hdf5 library is required to build gnss-sdr") + message(STATUS " The hdf5 library has not been found in your system.") + message(STATUS " Please try to install it by doing:") + if(OS_IS_MACOSX) + message(STATUS " $ sudo port install hdf5") + message(STATUS " or") + message(STATUS " $ brew install hdf5") + endif(OS_IS_MACOSX) + if(OS_IS_LINUX) + message(STATUS " $ sudo apt-get install libhdf5-dev") + endif(OS_IS_LINUX) + message(FATAL_ERROR "*** The hdf5 library is required to build gnss-sdr") endif(HDF5_FOUND) else(ZLIB_FOUND) message(FATAL_ERROR "*** The zlib library is required to build gnss-sdr") @@ -1216,6 +1211,7 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS endif(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERSION}) + ################################################################################ # PugiXML - https://pugixml.org/ ################################################################################ @@ -1232,34 +1228,34 @@ else(PugiXML_FOUND) endif(EXISTS $ENV{OECORE_TARGET_SYSROOT}) if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add( - pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - GIT_REPOSITORY https://github.com/zeux/pugixml - GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - CMAKE_ARGS ${PUGIXML_COMPILER} ${TOOLCHAIN_ARG} - UPDATE_COMMAND "" - PATCH_COMMAND "" - INSTALL_COMMAND "" + pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + GIT_REPOSITORY https://github.com/zeux/pugixml + GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + CMAKE_ARGS ${PUGIXML_COMPILER} ${TOOLCHAIN_ARG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" ) else(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add( - pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - GIT_REPOSITORY https://github.com/zeux/pugixml - GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - CMAKE_ARGS ${PUGIXML_COMPILER} ${TOOLCHAIN_ARG} - UPDATE_COMMAND "" - PATCH_COMMAND "" - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} - INSTALL_COMMAND "" + pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + GIT_REPOSITORY https://github.com/zeux/pugixml + GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + CMAKE_ARGS ${PUGIXML_COMPILER} ${TOOLCHAIN_ARG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + INSTALL_COMMAND "" ) endif(CMAKE_VERSION VERSION_LESS 3.2) - set(PUGIXML_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} ) - set(PUGIXML_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src ) + set(PUGIXML_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(PUGIXML_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src) set(PUGIXML_LOCAL true) endif(PugiXML_FOUND) @@ -1286,61 +1282,61 @@ endif(ENABLE_UHD) ################################################################################ find_package(Doxygen) if(DOXYGEN_FOUND) - message(STATUS "Doxygen found.") - message(STATUS "You can build the documentation with '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'." ) - message(STATUS "When done, point your browser to ${CMAKE_BINARY_DIR}/html/index.html") - set(HAVE_DOT ${DOXYGEN_DOT_FOUND}) - file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir) - file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} top_builddir) - find_package(LATEX) - if (PDFLATEX_COMPILER) - set(GENERATE_PDF_DOCUMENTATION "YES") - set(GNSSSDR_USE_MATHJAX "NO") - else(PDFLATEX_COMPILER) - set(GENERATE_PDF_DOCUMENTATION "NO") - set(GNSSSDR_USE_MATHJAX "YES") - endif(PDFLATEX_COMPILER) - configure_file(${CMAKE_SOURCE_DIR}/docs/doxygen/Doxyfile.in - ${CMAKE_BINARY_DIR}/docs/doxygen/Doxyfile - @ONLY - ) - add_custom_target(doc - ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/docs/doxygen/Doxyfile - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - COMMENT "Generating API documentation with Doxygen." VERBATIM - ) - if(LATEX_COMPILER) - message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} pdfmanual' will generate a manual at ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf") - add_custom_target(pdfmanual - COMMAND ${CMAKE_MAKE_PROGRAM} - COMMAND ${CMAKE_COMMAND} -E copy refman.pdf ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf - COMMAND ${CMAKE_MAKE_PROGRAM} clean - DEPENDS doc - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/docs/latex - COMMENT "Generating PDF manual with Doxygen." VERBATIM - ) - endif(LATEX_COMPILER) - message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.") - add_custom_target(doc-clean - COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/html - COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/latex - COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf - COMMENT "Cleaning documentation." VERBATIM - ) + message(STATUS "Doxygen found.") + message(STATUS "You can build the documentation with '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'.") + message(STATUS "When done, point your browser to ${CMAKE_BINARY_DIR}/html/index.html") + set(HAVE_DOT ${DOXYGEN_DOT_FOUND}) + file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir) + file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} top_builddir) + find_package(LATEX) + if(PDFLATEX_COMPILER) + set(GENERATE_PDF_DOCUMENTATION "YES") + set(GNSSSDR_USE_MATHJAX "NO") + else(PDFLATEX_COMPILER) + set(GENERATE_PDF_DOCUMENTATION "NO") + set(GNSSSDR_USE_MATHJAX "YES") + endif(PDFLATEX_COMPILER) + configure_file(${CMAKE_SOURCE_DIR}/docs/doxygen/Doxyfile.in + ${CMAKE_BINARY_DIR}/docs/doxygen/Doxyfile + @ONLY + ) + add_custom_target(doc + ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/docs/doxygen/Doxyfile + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen." VERBATIM + ) + if(LATEX_COMPILER) + message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} pdfmanual' will generate a manual at ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf") + add_custom_target(pdfmanual + COMMAND ${CMAKE_MAKE_PROGRAM} + COMMAND ${CMAKE_COMMAND} -E copy refman.pdf ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf + COMMAND ${CMAKE_MAKE_PROGRAM} clean + DEPENDS doc + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/docs/latex + COMMENT "Generating PDF manual with Doxygen." VERBATIM + ) + endif(LATEX_COMPILER) + message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.") + add_custom_target(doc-clean + COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/html + COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/latex + COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf + COMMENT "Cleaning documentation." VERBATIM + ) else(DOXYGEN_FOUND) - message(STATUS " Doxygen has not been found in your system.") - message(STATUS " You can get nice code documentation by using it!") - message(STATUS " Get it from http://www.stack.nl/~dimitri/doxygen/index.html") - if(OS_IS_LINUX) - if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(STATUS " or simply by doing 'sudo yum install doxygen-latex'.") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(STATUS " or simply by doing 'sudo apt-get install doxygen-latex'.") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - endif(OS_IS_LINUX) - if(OS_IS_MACOSX) - message(STATUS " or simply by doing 'sudo port install doxygen +latex'.") - endif(OS_IS_MACOSX) + message(STATUS " Doxygen has not been found in your system.") + message(STATUS " You can get nice code documentation by using it!") + message(STATUS " Get it from http://www.stack.nl/~dimitri/doxygen/index.html") + if(OS_IS_LINUX) + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(STATUS " or simply by doing 'sudo yum install doxygen-latex'.") + else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(STATUS " or simply by doing 'sudo apt-get install doxygen-latex'.") + endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + endif(OS_IS_LINUX) + if(OS_IS_MACOSX) + message(STATUS " or simply by doing 'sudo port install doxygen +latex'.") + endif(OS_IS_MACOSX) endif(DOXYGEN_FOUND) @@ -1357,8 +1353,8 @@ if(ENABLE_OPENCL) set(OPENCL_FOUND FALSE) else(DISABLE_OPENCL) if(OPENCL_FOUND) - message(STATUS "OpenCL has been found and will be used by some processing blocks") - message(STATUS "You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ../' ") + message(STATUS "OpenCL has been found and will be used by some processing blocks") + message(STATUS "You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ../' ") endif(OPENCL_FOUND) endif(DISABLE_OPENCL) if(ENABLE_GENERIC_ARCH) @@ -1378,28 +1374,28 @@ endif(ENABLE_OPENCL) # CUDA (OPTIONAL) ############################################################################### if($ENV{CUDA_GPU_ACCEL}) - message(STATUS "CUDA_GPU_ACCEL environment variable found." ) + message(STATUS "CUDA_GPU_ACCEL environment variable found.") set(ENABLE_CUDA ON) endif($ENV{CUDA_GPU_ACCEL}) if(ENABLE_CUDA) FIND_PACKAGE(CUDA REQUIRED) - message(STATUS "NVIDIA CUDA GPU Acceleration will be enabled." ) - message(STATUS "You can disable it with 'cmake -DENABLE_CUDA=OFF ../'" ) + message(STATUS "NVIDIA CUDA GPU Acceleration will be enabled.") + message(STATUS "You can disable it with 'cmake -DENABLE_CUDA=OFF ../'") else(ENABLE_CUDA) - message(STATUS "NVIDIA CUDA GPU Acceleration will be not enabled." ) - message(STATUS "Enable it with 'cmake -DENABLE_CUDA=ON ../' to add support for GPU-based acceleration using CUDA." ) + message(STATUS "NVIDIA CUDA GPU Acceleration will be not enabled.") + message(STATUS "Enable it with 'cmake -DENABLE_CUDA=ON ../' to add support for GPU-based acceleration using CUDA.") endif(ENABLE_CUDA) ############################################################################### # CUSTOM UDP PACKET SOURCE (OPTIONAL) ############################################################################### if(ENABLE_RAW_UDP) - message(STATUS "High-optimized custom UDP ip packet source will be enabled." ) - message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'" ) + message(STATUS "High-optimized custom UDP ip packet source will be enabled.") + message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'") else(ENABLE_RAW_UDP) - message(STATUS "High-optimized custom UDP ip packet source will be enabled." ) - message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'" ) + message(STATUS "High-optimized custom UDP ip packet source will be enabled.") + message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'") endif(ENABLE_RAW_UDP) @@ -1407,11 +1403,11 @@ endif(ENABLE_RAW_UDP) # FPGA (OPTIONAL) ############################################################################### if(ENABLE_FPGA) - message(STATUS "FPGA Acceleration will be enabled." ) - message(STATUS "You can disable it with 'cmake -DENABLE_FPGA=OFF ../'" ) + message(STATUS "FPGA Acceleration will be enabled.") + message(STATUS "You can disable it with 'cmake -DENABLE_FPGA=OFF ../'") else(ENABLE_FPGA) - message(STATUS "Fpga Acceleration will be not enabled." ) - message(STATUS "Enable it with 'cmake -DENABLE_FPGA=ON ../' to add support for GPU-based acceleration using the FPGA." ) + message(STATUS "Fpga Acceleration will be not enabled.") + message(STATUS "Enable it with 'cmake -DENABLE_FPGA=ON ../' to add support for GPU-based acceleration using the FPGA.") endif(ENABLE_FPGA) @@ -1420,22 +1416,22 @@ endif(ENABLE_FPGA) # Setup of optional drivers ################################################################################ if($ENV{GN3S_DRIVER}) - message(STATUS "GN3S_DRIVER environment variable found." ) + message(STATUS "GN3S_DRIVER environment variable found.") set(ENABLE_GN3S ON) endif($ENV{GN3S_DRIVER}) if(GN3S_DRIVER) set(ENABLE_GN3S ON) endif(GN3S_DRIVER) if(ENABLE_GN3S) - message(STATUS "The GN3S driver will be compiled.") - message(STATUS "You can disable it with 'cmake -DENABLE_GN3S=OFF ../'" ) + message(STATUS "The GN3S driver will be compiled.") + message(STATUS "You can disable it with 'cmake -DENABLE_GN3S=OFF ../'") else(ENABLE_GN3S) - message(STATUS "The (optional and experimental) GN3S driver is not enabled." ) - message(STATUS "Enable it with 'cmake -DENABLE_GN3S=ON ../' to add support for the GN3S dongle." ) + message(STATUS "The (optional and experimental) GN3S driver is not enabled.") + message(STATUS "Enable it with 'cmake -DENABLE_GN3S=ON ../' to add support for the GN3S dongle.") endif(ENABLE_GN3S) if($ENV{RAW_ARRAY_DRIVER}) - message(STATUS "RAW_ARRAY_DRIVER environment variable found." ) + message(STATUS "RAW_ARRAY_DRIVER environment variable found.") set(ENABLE_ARRAY ON) endif($ENV{RAW_ARRAY_DRIVER}) @@ -1444,39 +1440,39 @@ if(RAW_ARRAY_DRIVER) endif(RAW_ARRAY_DRIVER) if(ENABLE_ARRAY) - message(STATUS "CTTC's Antenna Array front-end driver will be compiled." ) - message(STATUS "You can disable it with 'cmake -DENABLE_ARRAY=OFF ../'" ) + message(STATUS "CTTC's Antenna Array front-end driver will be compiled.") + message(STATUS "You can disable it with 'cmake -DENABLE_ARRAY=OFF ../'") # copy firmware to install folder # Build project gr-dbfcttc else(ENABLE_ARRAY) - message(STATUS "The (optional) CTTC's Antenna Array front-end driver is not enabled." ) - message(STATUS "Enable it with 'cmake -DENABLE_ARRAY=ON ../' to add support for the CTTC experimental array front-end." ) + message(STATUS "The (optional) CTTC's Antenna Array front-end driver is not enabled.") + message(STATUS "Enable it with 'cmake -DENABLE_ARRAY=ON ../' to add support for the CTTC experimental array front-end.") endif(ENABLE_ARRAY) if($ENV{RTLSDR_DRIVER}) - message(STATUS "RTLSDR_DRIVER environment variable found." ) + message(STATUS "RTLSDR_DRIVER environment variable found.") set(ENABLE_OSMOSDR ON) endif($ENV{RTLSDR_DRIVER}) if(ENABLE_OSMOSDR) find_package(GrOsmoSDR) if(GROSMOSDR_FOUND) - message(STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled." ) - message(STATUS "You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ../'" ) + message(STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled.") + message(STATUS "You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ../'") else(GROSMOSDR_FOUND) if(ENABLE_PACKAGING) - message(WARNING "gr-osmosdr has not been found. Source blocks depending on it will NOT be built.") + message(WARNING "gr-osmosdr has not been found. Source blocks depending on it will NOT be built.") else(ENABLE_PACKAGING) - message(FATAL_ERROR "gr-osmosdr required to build gnss-sdr with the optional OSMOSDR driver") + message(FATAL_ERROR "gr-osmosdr required to build gnss-sdr with the optional OSMOSDR driver") endif(ENABLE_PACKAGING) endif(GROSMOSDR_FOUND) else(ENABLE_OSMOSDR) - message(STATUS "The (optional) driver for OsmoSDR and related front-ends is not enabled." ) - message(STATUS "Enable it with 'cmake -DENABLE_OSMOSDR=ON ../' to add support for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based USB dongles, etc.)" ) + message(STATUS "The (optional) driver for OsmoSDR and related front-ends is not enabled.") + message(STATUS "Enable it with 'cmake -DENABLE_OSMOSDR=ON ../' to add support for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based USB dongles, etc.)") endif(ENABLE_OSMOSDR) if($ENV{FLEXIBAND_DRIVER}) - message(STATUS "FLEXIBAND_DRIVER environment variable found." ) + message(STATUS "FLEXIBAND_DRIVER environment variable found.") set(ENABLE_FLEXIBAND ON) endif($ENV{FLEXIBAND_DRIVER}) @@ -1485,11 +1481,11 @@ if(FLEXIBAND_DRIVER) endif(FLEXIBAND_DRIVER) if(ENABLE_FLEXIBAND) - message(STATUS "The Teleorbit Flexiband front-end source will be compiled." ) - message(STATUS "You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ../'" ) + message(STATUS "The Teleorbit Flexiband front-end source will be compiled.") + message(STATUS "You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ../'") else(ENABLE_FLEXIBAND) - message(STATUS "The (optional) Teleorbit Flexiband front-end driver adapter is not enabled." ) - message(STATUS "Enable it with 'cmake -DENABLE_FLEXIBAND=ON ../' to add support for the Teleorbit Flexiband front-end." ) + message(STATUS "The (optional) Teleorbit Flexiband front-end driver adapter is not enabled.") + message(STATUS "Enable it with 'cmake -DENABLE_FLEXIBAND=ON ../' to add support for the Teleorbit Flexiband front-end.") endif(ENABLE_FLEXIBAND) @@ -1499,24 +1495,24 @@ endif(ENABLE_FLEXIBAND) ################################################################################ if(ENABLE_GPERFTOOLS) find_package(Gperftools) - if ( NOT GPERFTOOLS_FOUND ) + if(NOT GPERFTOOLS_FOUND) message(STATUS "Although ENABLE_GPERFTOOLS has been set to ON, GPerftools has not been found.") message(STATUS "Binaries will be compiled without 'tcmalloc' and 'profiler' libraries.") message(STATUS "You can install GPerftools from https://github.com/gperftools/gperftools") - else( NOT GPERFTOOLS_FOUND ) - message(STATUS "GPerftools libraries found." ) + else(NOT GPERFTOOLS_FOUND) + message(STATUS "GPerftools libraries found.") message(STATUS "Binaries will be compiled with 'tcmalloc' and 'profiler' libraries.") - endif( NOT GPERFTOOLS_FOUND ) + endif(NOT GPERFTOOLS_FOUND) endif(ENABLE_GPERFTOOLS) if(ENABLE_GPERFTOOLS) # Set GPerftools related flags if it is available # See https://github.com/gperftools/gperftools/blob/master/README if(GPERFTOOLS_FOUND) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free") + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free") endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin") + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin") endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif(GPERFTOOLS_FOUND) endif(ENABLE_GPERFTOOLS) @@ -1527,11 +1523,9 @@ endif(ENABLE_GPERFTOOLS) # GNU gprof (OPTIONAL) - https://sourceware.org/binutils/docs/gprof/ ######################################################################## if(ENABLE_GPROF) - #if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -pg") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg") - #endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -pg") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg") endif(ENABLE_GPROF) @@ -1561,23 +1555,23 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(OS_IS_MACOSX) # See https://trac.macports.org/wiki/XcodeVersionInfo for Apple Clang version equivalences if(CLANG_VERSION VERSION_LESS "600") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") else(CLANG_VERSION VERSION_LESS "600") - # if(CLANG_VERSION VERSION_LESS "900") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - # else(CLANG_VERSION VERSION_LESS "900") - # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") - # endif(CLANG_VERSION VERSION_LESS "900") + # if(CLANG_VERSION VERSION_LESS "900") + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") + # else(CLANG_VERSION VERSION_LESS "900") + # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") + # endif(CLANG_VERSION VERSION_LESS "900") endif(CLANG_VERSION VERSION_LESS "600") else(OS_IS_MACOSX) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - # if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - # else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") - # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") - # endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") + # if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") + # else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") + # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") + # endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") endif(OS_IS_MACOSX) @@ -1595,30 +1589,29 @@ endif(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT (CMAKE_CXX_COMPILER_ID # Processor-architecture related flags # See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html -if (NOT ARCH_COMPILER_FLAGS) +if(NOT ARCH_COMPILER_FLAGS) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) - if(OS_IS_MACOSX) - set(ARCH_COMPILER_FLAGS "-march=corei7 -mfpmath=sse") - else(OS_IS_MACOSX) - if(NOT ${ENABLE_GENERIC_ARCH}) - if(IS_ARM) # ARM-specific options (https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html) - if(NOT CMAKE_CROSSCOMPILING) - if(ARM_VERSION STREQUAL "arm") - # Unknown arm version - try our best to detect - set(ARCH_COMPILER_FLAGS "-mcpu=native") - else(ARM_VERSION STREQUAL "arm") - set(ARCH_COMPILER_FLAGS "-march=${ARM_VERSION}") - endif(ARM_VERSION STREQUAL "arm") - endif(NOT CMAKE_CROSSCOMPILING) - else(IS_ARM) - set(ARCH_COMPILER_FLAGS "-march=native -mfpmath=sse") - endif(IS_ARM) - endif(NOT ${ENABLE_GENERIC_ARCH}) - endif(OS_IS_MACOSX) + if(OS_IS_MACOSX) + set(ARCH_COMPILER_FLAGS "-march=corei7 -mfpmath=sse") + else(OS_IS_MACOSX) + if(NOT ${ENABLE_GENERIC_ARCH}) + if(IS_ARM) # ARM-specific options (https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html) + if(NOT CMAKE_CROSSCOMPILING) + if(ARM_VERSION STREQUAL "arm") + # Unknown arm version - try our best to detect + set(ARCH_COMPILER_FLAGS "-mcpu=native") + else(ARM_VERSION STREQUAL "arm") + set(ARCH_COMPILER_FLAGS "-march=${ARM_VERSION}") + endif(ARM_VERSION STREQUAL "arm") + endif(NOT CMAKE_CROSSCOMPILING) + else(IS_ARM) + set(ARCH_COMPILER_FLAGS "-march=native -mfpmath=sse") + endif(IS_ARM) + endif(NOT ${ENABLE_GENERIC_ARCH}) + endif(OS_IS_MACOSX) endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) -endif (NOT ARCH_COMPILER_FLAGS) +endif(NOT ARCH_COMPILER_FLAGS) set(MY_CXX_FLAGS "${MY_CXX_FLAGS} ${ARCH_COMPILER_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS}") if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 53a87d88b..98c69c627 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -24,7 +24,7 @@ add_subdirectory(system-tests/libs) # Google Test - https://github.com/google/googletest ################################################################################ if(EXISTS $ENV{GTEST_DIR}) - set(GTEST_DIR_LOCAL $ENV{GTEST_DIR}) + set(GTEST_DIR_LOCAL $ENV{GTEST_DIR}) endif(EXISTS $ENV{GTEST_DIR}) if(GTEST_DIR) set(GTEST_DIR_LOCAL ${GTEST_DIR}) @@ -47,69 +47,69 @@ if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) endif(EXISTS $ENV{OECORE_TARGET_SYSROOT}) if(NOT ${GTEST_DIR_LOCAL}) - # if GTEST_DIR is not defined, we download and build it - if(CMAKE_VERSION VERSION_LESS 3.2) + # if GTEST_DIR is not defined, we download and build it + if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add( - gtest-${GNSSSDR_GTEST_LOCAL_VERSION} - GIT_REPOSITORY https://github.com/google/googletest - GIT_TAG release-${GNSSSDR_GTEST_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION} - CMAKE_ARGS ${GTEST_COMPILER} -DINSTALL_GTEST=OFF -DBUILD_GMOCK=OFF ${TOOLCHAIN_ARG} - UPDATE_COMMAND "" - PATCH_COMMAND "" - INSTALL_COMMAND "" + gtest-${GNSSSDR_GTEST_LOCAL_VERSION} + GIT_REPOSITORY https://github.com/google/googletest + GIT_TAG release-${GNSSSDR_GTEST_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION} + CMAKE_ARGS ${GTEST_COMPILER} -DINSTALL_GTEST=OFF -DBUILD_GMOCK=OFF ${TOOLCHAIN_ARG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" ) - else(CMAKE_VERSION VERSION_LESS 3.2) + else(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add( - gtest-${GNSSSDR_GTEST_LOCAL_VERSION} - GIT_REPOSITORY https://github.com/google/googletest - GIT_TAG release-${GNSSSDR_GTEST_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION} - CMAKE_ARGS ${GTEST_COMPILER} -DINSTALL_GTEST=OFF -DBUILD_GMOCK=OFF ${TOOLCHAIN_ARG} - UPDATE_COMMAND "" - PATCH_COMMAND "" - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} - INSTALL_COMMAND "" + gtest-${GNSSSDR_GTEST_LOCAL_VERSION} + GIT_REPOSITORY https://github.com/google/googletest + GIT_TAG release-${GNSSSDR_GTEST_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION} + CMAKE_ARGS ${GTEST_COMPILER} -DINSTALL_GTEST=OFF -DBUILD_GMOCK=OFF ${TOOLCHAIN_ARG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} + INSTALL_COMMAND "" ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + endif(CMAKE_VERSION VERSION_LESS 3.2) - # Set up variables - # Set recently downloaded and build Googletest root folder - set(GTEST_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest") - # Source code - ExternalProject_Get_Property(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} source_dir) - set(GTEST_INCLUDE_DIR ${source_dir}/googletest/include) - set(GTEST_INCLUDE_DIRECTORIES ${GTEST_DIR}/include ${GTEST_DIR} ${GTEST_DIR}/src) - # Library - ExternalProject_Get_Property(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} binary_dir) - if(OS_IS_MACOSX) - if(CMAKE_GENERATOR STREQUAL Xcode) - set(binary_dir "${binary_dir}/Debug") - endif(CMAKE_GENERATOR STREQUAL Xcode) - endif(OS_IS_MACOSX) - set(GTEST_LIBRARY_PATH "${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX};${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(GTEST_LIBRARY gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - set(GTEST_LIBRARIES - ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} - ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} - ${THREAD_LIBRARIES} ) - set(GTEST_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest") + # Set up variables + # Set recently downloaded and build Googletest root folder + set(GTEST_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest") + # Source code + ExternalProject_Get_Property(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} source_dir) + set(GTEST_INCLUDE_DIR ${source_dir}/googletest/include) + set(GTEST_INCLUDE_DIRECTORIES ${GTEST_DIR}/include ${GTEST_DIR} ${GTEST_DIR}/src) + # Library + ExternalProject_Get_Property(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} binary_dir) + if(OS_IS_MACOSX) + if(CMAKE_GENERATOR STREQUAL Xcode) + set(binary_dir "${binary_dir}/Debug") + endif(CMAKE_GENERATOR STREQUAL Xcode) + endif(OS_IS_MACOSX) + set(GTEST_LIBRARY_PATH "${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX};${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(GTEST_LIBRARY gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) + set(GTEST_LIBRARIES + ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} + ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} + ${THREAD_LIBRARIES}) + set(GTEST_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest") else(NOT ${GTEST_DIR_LOCAL}) - if(GTEST_INCLUDE_DIRS) - set(GTEST_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIRS} ${LIBGTEST_DEV_DIR}) - add_library(gtest ${LIBGTEST_DEV_DIR}/src/gtest-all.cc ${LIBGTEST_DEV_DIR}/src/gtest_main.cc) - set(GTEST_LIBRARIES gtest) - else(GTEST_INCLUDE_DIRS) - # If the variable GTEST_DIR is defined, we use the existing Googletest - set(GTEST_DIR $ENV{GTEST_DIR}) - set(GTEST_INCLUDE_DIRECTORIES ${GTEST_DIR}/include ${GTEST_DIR} ${GTEST_DIR}/src) - add_library(gtest ${GTEST_DIR}/src/gtest-all.cc ${GTEST_DIR}/src/gtest_main.cc) - set(GTEST_LIBRARIES gtest) - endif(GTEST_INCLUDE_DIRS) - target_link_libraries(gtest ${THREAD_LIBRARIES}) + if(GTEST_INCLUDE_DIRS) + set(GTEST_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIRS} ${LIBGTEST_DEV_DIR}) + add_library(gtest ${LIBGTEST_DEV_DIR}/src/gtest-all.cc ${LIBGTEST_DEV_DIR}/src/gtest_main.cc) + set(GTEST_LIBRARIES gtest) + else(GTEST_INCLUDE_DIRS) + # If the variable GTEST_DIR is defined, we use the existing Googletest + set(GTEST_DIR $ENV{GTEST_DIR}) + set(GTEST_INCLUDE_DIRECTORIES ${GTEST_DIR}/include ${GTEST_DIR} ${GTEST_DIR}/src) + add_library(gtest ${GTEST_DIR}/src/gtest-all.cc ${GTEST_DIR}/src/gtest_main.cc) + set(GTEST_LIBRARIES gtest) + endif(GTEST_INCLUDE_DIRS) + target_link_libraries(gtest ${THREAD_LIBRARIES}) endif(NOT ${GTEST_DIR_LOCAL}) @@ -134,20 +134,20 @@ if(ENABLE_GPERFTOOLS) endif(ENABLE_GPERFTOOLS) if(Boost_VERSION LESS 105000) - add_definitions(-DOLD_BOOST=1) + add_definitions(-DOLD_BOOST=1) endif(Boost_VERSION LESS 105000) -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) - add_definitions( -DGR_GREATER_38=1 ) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + add_definitions( -DGR_GREATER_38=1) +endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") if(OPENSSL_FOUND) - add_definitions( -DUSE_OPENSSL_FALLBACK=1 ) + add_definitions(-DUSE_OPENSSL_FALLBACK=1) endif(OPENSSL_FOUND) if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(OS_IS_MACOSX) - set(CLANG_FLAGS "-stdlib=libc++ -lc++") + set(CLANG_FLAGS "-stdlib=libc++ -lc++") endif(OS_IS_MACOSX) endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") @@ -168,9 +168,9 @@ if(GNUPLOT_FOUND) add_definitions(-DGNUPLOT_EXECUTABLE="${GNUPLOT_EXECUTABLE}") endif(GNUPLOT_FOUND) -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.15" ) - add_definitions( -DGR_GREATER_38=1 ) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.15" ) +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.15") + add_definitions(-DGR_GREATER_38=1) +endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.15") if(ENABLE_UNIT_TESTING_MINIMAL) add_definitions(-DUNIT_TESTING_MINIMAL=1) @@ -182,194 +182,187 @@ endif(ENABLE_UNIT_TESTING_MINIMAL) ################################################################################ option(ENABLE_GNSS_SIM_INSTALL "Enable the installation of gnss_sim on the fly" ON) if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) - if(ENABLE_FPGA) + if(ENABLE_FPGA) set(CROSS_INSTALL_DIR "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) set(CROSS_INSTALL_DIR "${CROSS_INSTALL_DIR} -DBOOST_ROOT=$ENV{OECORE_TARGET_SYSROOT}/usr") endif(EXISTS $ENV{OECORE_TARGET_SYSROOT}) - else(ENABLE_FPGA) + else(ENABLE_FPGA) set(CROSS_INSTALL_DIR "") - endif(ENABLE_FPGA) - find_package(GnssSimulator QUIET) - if(GNSS-SIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) + endif(ENABLE_FPGA) + find_package(GnssSimulator QUIET) + if(GNSS-SIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n") add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv") - else(GNSS-SIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) + else(GNSS-SIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) ExternalProject_Add( - gnss-sim - GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator - GIT_TAG ${GNSSSDR_GNSS_SIM_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gnss-sim - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim - CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} ${CROSS_INSTALL_DIR} - UPDATE_COMMAND "" - PATCH_COMMAND "" - INSTALL_COMMAND "" + gnss-sim + GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator + GIT_TAG ${GNSSSDR_GNSS_SIM_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gnss-sim + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim + CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} ${CROSS_INSTALL_DIR} + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" ) if(ENABLE_INSTALL_TESTS) - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/gnss_sim DESTINATION bin) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n DESTINATION share/gnss-sim) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv DESTINATION share/gnss-sim) - set(SW_GENERATOR_BIN ${CMAKE_INSTALL_PREFIX}/bin/gnss_sim) - add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") - add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n") - add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv") + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/gnss_sim DESTINATION bin) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n DESTINATION share/gnss-sim) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv DESTINATION share/gnss-sim) + set(SW_GENERATOR_BIN ${CMAKE_INSTALL_PREFIX}/bin/gnss_sim) + add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") + add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n") + add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv") else(ENABLE_INSTALL_TESTS) - set(SW_GENERATOR_BIN ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/gnss_sim) - add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") - add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n") - add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv") + set(SW_GENERATOR_BIN ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/gnss_sim) + add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") + add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n") + add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv") endif(ENABLE_INSTALL_TESTS) - endif(GNSS-SIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) + endif(GNSS-SIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) - ################################################################################ - # Local installation of GPSTk http://www.gpstk.org/ - ################################################################################ - find_package(GPSTK) - if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) + ################################################################################ + # Local installation of GPSTk http://www.gpstk.org/ + ################################################################################ + find_package(GPSTK) + if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) message(STATUS "GPSTk v${GNSSSDR_GPSTK_LOCAL_VERSION} will be automatically downloaded and built when doing 'make'.") if ("${TOOLCHAIN_ARG}" STREQUAL "") - set(TOOLCHAIN_ARG "-DCMAKE_CXX_FLAGS=\"-Wno-deprecated\"") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") + set(TOOLCHAIN_ARG "-DCMAKE_CXX_FLAGS=\"-Wno-deprecated\"") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") endif("${TOOLCHAIN_ARG}" STREQUAL "") include(GNUInstallDirs) if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} - GIT_REPOSITORY https://github.com/SGL-UT/GPSTk - GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} - CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF - UPDATE_COMMAND "" - PATCH_COMMAND "" - ) + ExternalProject_Add( + gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} + GIT_REPOSITORY https://github.com/SGL-UT/GPSTk + GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} + CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF + UPDATE_COMMAND "" + PATCH_COMMAND "" + ) else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} - GIT_REPOSITORY https://github.com/SGL-UT/GPSTk - GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} - CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF - BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} - UPDATE_COMMAND "" - PATCH_COMMAND "" - ) + ExternalProject_Add( + gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} + GIT_REPOSITORY https://github.com/SGL-UT/GPSTk + GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} + CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF + BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} + UPDATE_COMMAND "" + PATCH_COMMAND "" + ) endif(CMAKE_VERSION VERSION_LESS 3.2) set(GPSTK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers") set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(GPSTK_BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/ ) + set(GPSTK_BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") set(OWN_GPSTK True) - else(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) + else(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) set(GPSTK_INCLUDE_DIRS ${GPSTK_INCLUDE_DIR}) - set(GPSTK_BINDIR ${GPSTK_LIBRARY}/../bin/ ) + set(GPSTK_BINDIR ${GPSTK_LIBRARY}/../bin/) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") - endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) + endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) endif(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) if (ENABLE_UNIT_TESTING_EXTRA) - set(GNSS_SDR_TEST_OPTIONAL_LIBS ${GNSS_SDR_TEST_OPTIONAL_LIBS} ${GPSTK_LIBRARY}) - set(GNSS_SDR_TEST_OPTIONAL_HEADERS ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ${GPSTK_INCLUDE_DIRS} ${GPSTK_INCLUDE_DIRS}/gpstk) + set(GNSS_SDR_TEST_OPTIONAL_LIBS ${GNSS_SDR_TEST_OPTIONAL_LIBS} ${GPSTK_LIBRARY}) + set(GNSS_SDR_TEST_OPTIONAL_HEADERS ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ${GPSTK_INCLUDE_DIRS} ${GPSTK_INCLUDE_DIRS}/gpstk) endif (ENABLE_UNIT_TESTING_EXTRA) if(ENABLE_UNIT_TESTING_EXTRA) - add_definitions(-DEXTRA_TESTS) - if(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat) + add_definitions(-DEXTRA_TESTS) + if(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat) message(STATUS "Downloading some data files for testing...") file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/gps_l2c_m_prn7_5msps.dat ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat - SHOW_PROGRESS - EXPECTED_HASH MD5=a6fcbefe155137945d3c33c5ef7bd0f9 ) - endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat) - if(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat) + SHOW_PROGRESS + EXPECTED_HASH MD5=a6fcbefe155137945d3c33c5ef7bd0f9) + endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat) + if(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat) message(STATUS "Downloading some data files for testing...") file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat - SHOW_PROGRESS - EXPECTED_HASH MD5=ffb72fc63c116be58d5e5ccb1daaed3a ) - endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat) - # if(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/NT1065_GLONASS_L2_20160831_fs6625e6_if0e3_4ms.bin) - # message(STATUS "Downloading some data files for testing...") - # file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/NT1065_GLONASS_L2_20160831_fs6625e6_if0e3_4ms.bin ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/NT1065_GLONASS_L2_20160831_fs6625e6_if0e3_4ms.bin - # SHOW_PROGRESS - # EXPECTED_HASH MD5=d7055fc1dc931872b547a148af50a09b ) - # endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/NT1065_GLONASS_L2_20160831_fs6625e6_if0e3_4ms.bin) - if(ENABLE_INSTALL_TESTS) + SHOW_PROGRESS + EXPECTED_HASH MD5=ffb72fc63c116be58d5e5ccb1daaed3a) + endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat) + if(ENABLE_INSTALL_TESTS) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat DESTINATION share/gnss-sdr/signal_samples) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat DESTINATION share/gnss-sdr/signal_samples) - # install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/NT1065_GLONASS_L2_20160831_fs6625e6_if0e3_4ms.bin DESTINATION share/gnss-sdr/signal_samples) - endif(ENABLE_INSTALL_TESTS) + endif(ENABLE_INSTALL_TESTS) endif(ENABLE_UNIT_TESTING_EXTRA) if(ENABLE_INSTALL_TESTS) - install(FILES ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat DESTINATION share/gnss-sdr/signal_samples) - install(FILES ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat DESTINATION share/gnss-sdr/signal_samples) - install(FILES ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat DESTINATION share/gnss-sdr/signal_samples) - install(FILES ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin DESTINATION share/gnss-sdr/signal_samples) - install(FILES ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/obs_test1.xml DESTINATION share/gnss-sdr/data/rtklib_test) - install(FILES ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION share/gnss-sdr/data/rtklib_test) - add_definitions(-DTEST_PATH="${CMAKE_INSTALL_PREFIX}/share/gnss-sdr/") + install(FILES ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/obs_test1.xml DESTINATION share/gnss-sdr/data/rtklib_test) + install(FILES ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION share/gnss-sdr/data/rtklib_test) + add_definitions(-DTEST_PATH="${CMAKE_INSTALL_PREFIX}/share/gnss-sdr/") else(ENABLE_INSTALL_TESTS) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/obs_test1.xml DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/data/rtklib_test) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/data/rtklib_test) - add_definitions(-DTEST_PATH="${CMAKE_SOURCE_DIR}/thirdparty/") + file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) + file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) + file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) + file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) + file(COPY ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/obs_test1.xml DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/data/rtklib_test) + file(COPY ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/data/rtklib_test) + add_definitions(-DTEST_PATH="${CMAKE_SOURCE_DIR}/thirdparty/") endif(ENABLE_INSTALL_TESTS) set(LIST_INCLUDE_DIRS - ${GTEST_INCLUDE_DIRECTORIES} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/core/libs - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${CMAKE_SOURCE_DIR}/src/core/monitor - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_generator/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_generator/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/tests/unit-tests/signal-processing-blocks/libs - ${CMAKE_SOURCE_DIR}/src/tests/system-tests/libs - ${CMAKE_SOURCE_DIR}/src/tests/common-files - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} - ${GNSS_SDR_TEST_OPTIONAL_HEADERS} + ${GTEST_INCLUDE_DIRECTORIES} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/core/libs + ${CMAKE_SOURCE_DIR}/src/core/libs/supl + ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp + ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl + ${CMAKE_SOURCE_DIR}/src/core/monitor + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib + ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/observables/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_generator/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_generator/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs + ${CMAKE_SOURCE_DIR}/src/tests/unit-tests/signal-processing-blocks/libs + ${CMAKE_SOURCE_DIR}/src/tests/system-tests/libs + ${CMAKE_SOURCE_DIR}/src/tests/common-files + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${ARMADILLO_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${MATIO_INCLUDE_DIRS} + ${PUGIXML_INCLUDE_DIR} + ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ) include_directories(${LIST_INCLUDE_DIRS}) @@ -415,34 +408,34 @@ if(ENABLE_UNIT_TESTING) install(TARGETS run_tests RUNTIME DESTINATION bin COMPONENT "run_tests") else(ENABLE_INSTALL_TESTS) add_custom_command(TARGET run_tests POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$) + COMMAND ${CMAKE_COMMAND} -E copy $ + ${CMAKE_SOURCE_DIR}/install/$) endif(ENABLE_INSTALL_TESTS) endif(ENABLE_UNIT_TESTING) if(ENABLE_FPGA) add_executable(gps_l1_ca_dll_pll_tracking_test_fpga - ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc ) + ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc) target_link_libraries(gps_l1_ca_dll_pll_tracking_test_fpga - ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_LIBRARIES} - ${MATIO_LIBRARIES} - channel_fsm - gnss_sp_libs - gnss_rx - gnss_system_parameters - signal_processing_testing_lib - ) + ${Boost_LIBRARIES} + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${GTEST_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${ARMADILLO_LIBRARIES} + ${VOLK_LIBRARIES} + ${MATIO_LIBRARIES} + channel_fsm + gnss_sp_libs + gnss_rx + gnss_system_parameters + signal_processing_testing_lib + ) install(TARGETS gps_l1_ca_dll_pll_tracking_test_fpga RUNTIME DESTINATION bin - COMPONENT "fpga-test" ) + COMPONENT "fpga-test") endif(ENABLE_FPGA) @@ -461,13 +454,13 @@ function(add_system_test executable) add_executable(${executable} ${SYSTEM_TEST_SOURCES}) if(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(${executable} gtest-${GNSSSDR_GTEST_LOCAL_VERSION} ) + add_dependencies(${executable} gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) else(NOT ${GTEST_DIR_LOCAL}) add_dependencies(${executable} gtest) endif(NOT ${GTEST_DIR_LOCAL}) include_directories(${OPT_INCLUDES_}) - target_link_libraries(${executable} ${OPT_LIBS_} ) + target_link_libraries(${executable} ${OPT_LIBS_}) if(ENABLE_INSTALL_TESTS) if(EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) @@ -476,8 +469,8 @@ function(add_system_test executable) install(TARGETS ${executable} RUNTIME DESTINATION bin COMPONENT "${executable}_test") else(ENABLE_INSTALL_TESTS) add_custom_command(TARGET ${executable} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ ) + COMMAND ${CMAKE_COMMAND} -E copy $ + ${CMAKE_SOURCE_DIR}/install/$) endif(ENABLE_INSTALL_TESTS) endfunction(add_system_test) @@ -499,7 +492,7 @@ if(ENABLE_SYSTEM_TESTING) ${GNURADIO_RUNTIME_LIBRARIES} ${GTEST_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} gnss_sp_libs - gnss_rx gnss_system_parameters ) + gnss_rx gnss_system_parameters) add_system_test(ttff) @@ -517,7 +510,7 @@ if(ENABLE_SYSTEM_TESTING) #if(GPSTK_FOUND OR OWN_GPSTK) ## OBS_SYSTEM_TEST and OBS_GPS_L1_SYSTEM_TEST # set(OPT_LIBS_ ${GFlags_LIBS} ${GLOG_LIBRARIES} ${GTEST_LIBRARIES} - # gnss_sp_libs gnss_rx ${GPSTK_LIBRARY} ) + # gnss_sp_libs gnss_rx ${GPSTK_LIBRARY}) # set(OPT_INCLUDES_ ${GPSTK_INCLUDE_DIRS} ${GPSTK_INCLUDE_DIRS}/gpstk) # add_system_test(obs_gps_l1_system_test) # add_system_test(obs_system_test) @@ -525,13 +518,13 @@ if(ENABLE_SYSTEM_TESTING) else(ENABLE_SYSTEM_TESTING_EXTRA) # Avoid working with old executables if they were switched ON and then OFF if(EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) - file(REMOVE ${CMAKE_SOURCE_DIR}/install/position_test) + file(REMOVE ${CMAKE_SOURCE_DIR}/install/position_test) endif(EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) endif(ENABLE_SYSTEM_TESTING_EXTRA) else(ENABLE_SYSTEM_TESTING) # Avoid working with old executables if they were switched ON and then OFF if(EXISTS ${CMAKE_SOURCE_DIR}/install/ttff) - file(REMOVE ${CMAKE_SOURCE_DIR}/install/ttff) + file(REMOVE ${CMAKE_SOURCE_DIR}/install/ttff) endif(EXISTS ${CMAKE_SOURCE_DIR}/install/ttff) if(EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) file(REMOVE ${CMAKE_SOURCE_DIR}/install/position_test) @@ -546,17 +539,17 @@ set(CMAKE_CTEST_COMMAND ctest -V) add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) add_executable(flowgraph_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_flowgraph_test.cc ) + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_flowgraph_test.cc) target_link_libraries(flowgraph_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GTEST_LIBRARIES} - gnss_sp_libs - gnss_rx - gnss_system_parameters - ${VOLK_GNSSSDR_LIBRARIES} ) + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GTEST_LIBRARIES} + gnss_sp_libs + gnss_rx + gnss_system_parameters + ${VOLK_GNSSSDR_LIBRARIES}) add_test(flowgraph_test flowgraph_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(flowgraph_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) @@ -568,26 +561,26 @@ set_property(TEST flowgraph_test PROPERTY TIMEOUT 30) ######################################################### add_executable(gnss_block_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/adapter_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_block_factory_test.cc ) + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/adapter_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_block_factory_test.cc) target_link_libraries(gnss_block_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} - gnss_sp_libs - gnss_rx - gnss_system_parameters - ${VOLK_GNSSSDR_LIBRARIES} ) + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${GTEST_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + ${GNURADIO_ANALOG_LIBRARIES} + gnss_sp_libs + gnss_rx + gnss_system_parameters + ${VOLK_GNSSSDR_LIBRARIES}) add_test(gnss_block_test gnss_block_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(gnss_block_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) @@ -599,19 +592,19 @@ set_property(TEST gnss_block_test PROPERTY TIMEOUT 60) ######################################################### add_executable(gnuradio_block_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc ) + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc) target_link_libraries(gnuradio_block_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} - gnss_sp_libs - gnss_rx - gnss_system_parameters - ${VOLK_GNSSSDR_LIBRARIES} ) + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${GTEST_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + ${GNURADIO_ANALOG_LIBRARIES} + gnss_sp_libs + gnss_rx + gnss_system_parameters + ${VOLK_GNSSSDR_LIBRARIES}) add_test(gnuradio_block_test gnuradio_block_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(gnuradio_block_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) @@ -623,14 +616,14 @@ set_property(TEST gnuradio_block_test PROPERTY TIMEOUT 30) ######################################################### add_executable(matio_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/arithmetic/matio_test.cc ) + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/arithmetic/matio_test.cc) target_link_libraries(matio_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${MATIO_LIBRARIES} - gnss_system_parameters ) + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${GTEST_LIBRARIES} + ${MATIO_LIBRARIES} + gnss_system_parameters) add_test(matio_test matio_test) if(NOT ${GTEST_DIR_LOCAL}) if(MATIO_FOUND) @@ -639,7 +632,7 @@ if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(matio_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION} matio-${GNSSSDR_MATIO_LOCAL_VERSION}) endif(MATIO_FOUND) else(NOT ${GTEST_DIR_LOCAL}) - if(MATIO_FOUND) + if(MATIO_FOUND) add_dependencies(matio_test gtest) else(MATIO_FOUND) add_dependencies(matio_test gtest matio-${GNSSSDR_MATIO_LOCAL_VERSION}) @@ -650,22 +643,22 @@ set_property(TEST matio_test PROPERTY TIMEOUT 30) ######################################################### add_executable(acq_test - ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc ) + ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc) target_link_libraries(acq_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} - gnss_sp_libs - gnss_rx - gnss_system_parameters - signal_generator_blocks - signal_processing_testing_lib - ${VOLK_GNSSSDR_LIBRARIES} ) + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${GTEST_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + ${GNURADIO_ANALOG_LIBRARIES} + gnss_sp_libs + gnss_rx + gnss_system_parameters + signal_generator_blocks + signal_processing_testing_lib + ${VOLK_GNSSSDR_LIBRARIES}) add_test(acq_test acq_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(acq_test acq_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) @@ -677,24 +670,24 @@ set_property(TEST acq_test PROPERTY TIMEOUT 30) ######################################################### add_executable(trk_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/tracking_loop_filter_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc ) + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/tracking_loop_filter_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc) target_link_libraries(trk_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} - gnss_sp_libs - gnss_rx - gnss_system_parameters - signal_generator_blocks - ${VOLK_GNSSSDR_LIBRARIES} ) + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${GTEST_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + ${GNURADIO_ANALOG_LIBRARIES} + gnss_sp_libs + gnss_rx + gnss_system_parameters + signal_generator_blocks + ${VOLK_GNSSSDR_LIBRARIES}) add_test(trk_test trk_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(trk_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) @@ -708,14 +701,14 @@ set_property(TEST trk_test PROPERTY TIMEOUT 30) if(NOT ENABLE_PACKAGING) add_executable(control_thread_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_message_factory_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_thread_test.cc ) + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_message_factory_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_thread_test.cc) target_link_libraries(control_thread_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - gnss_rx ) + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${GTEST_LIBRARIES} + gnss_rx) add_test(control_thread_test control_thread_test) if(NOT ${GTEST_DIR_LOCAL}) @@ -730,8 +723,8 @@ endif(NOT ENABLE_PACKAGING) if(ENABLE_PACKAGING) add_dependencies(check flowgraph_test gnss_block_test - gnuradio_block_test acq_test trk_test matio_test) + gnuradio_block_test acq_test trk_test matio_test) else(ENABLE_PACKAGING) add_dependencies(check control_thread_test flowgraph_test gnss_block_test - gnuradio_block_test acq_test trk_test matio_test) + gnuradio_block_test acq_test trk_test matio_test) endif(ENABLE_PACKAGING) From e400319e7e3402596dc6a69a0d5cec4633ae2ea2 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Mon, 19 Nov 2018 17:40:49 +0100 Subject: [PATCH 100/143] Adding an automatic low pass filter for the rational resampler --- .../adapters/mmse_resampler_conditioner.cc | 23 +++++++++++++++---- .../adapters/mmse_resampler_conditioner.h | 5 ++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc index 696ccefea..c59179534 100644 --- a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc +++ b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc @@ -63,6 +63,17 @@ MmseResamplerConditioner::MmseResamplerConditioner( if (item_type_.compare("gr_complex") == 0) { item_size_ = sizeof(gr_complex); + + + //create a FIR low pass filter + std::vector taps = gr::filter::firdes::low_pass(1.0, + sample_freq_in_, + sample_freq_out_ / 2.1, + sample_freq_out_ / 10, + gr::filter::firdes::win_type::WIN_HAMMING); + std::cout << "Enabled fractional resampler low pass filter with " << taps.size() << " taps" << std::endl; + fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(1, taps); + #ifdef GR_GREATER_38 resampler_ = gr::filter::mmse_resampler_cc::make(0.0, sample_freq_in_ / sample_freq_out_); #else @@ -96,18 +107,17 @@ MmseResamplerConditioner::MmseResamplerConditioner( MmseResamplerConditioner::~MmseResamplerConditioner() {} - - void MmseResamplerConditioner::connect(gr::top_block_sptr top_block) { if (dump_) { + top_block->connect(fir_filter_ccf_, 0, resampler_, 0); top_block->connect(resampler_, 0, file_sink_, 0); DLOG(INFO) << "connected resampler to file sink"; } else { - DLOG(INFO) << "nothing to connect internally"; + top_block->connect(fir_filter_ccf_, 0, resampler_, 0); } } @@ -116,14 +126,19 @@ void MmseResamplerConditioner::disconnect(gr::top_block_sptr top_block) { if (dump_) { + top_block->disconnect(fir_filter_ccf_, 0, resampler_, 0); top_block->disconnect(resampler_, 0, file_sink_, 0); } + else + { + top_block->disconnect(fir_filter_ccf_, 0, resampler_, 0); + } } gr::basic_block_sptr MmseResamplerConditioner::get_left_block() { - return resampler_; + return fir_filter_ccf_; } diff --git a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h index b5c20c846..462e49e88 100644 --- a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h +++ b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h @@ -36,9 +36,13 @@ #include "gnss_block_interface.h" #ifdef GR_GREATER_38 #include +#include #else #include +#include #endif + +#include #include class ConfigurationInterface; @@ -91,6 +95,7 @@ private: #else gr::filter::fractional_resampler_cc::sptr resampler_; #endif + gr::filter::fir_filter_ccf::sptr fir_filter_ccf_; gr::block_sptr file_sink_; }; From ea59abee77f17df7642ed6f5aa72a49b1f244114 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 20 Nov 2018 09:28:47 +0100 Subject: [PATCH 101/143] Add work on warm start --- src/core/libs/gnss_sdr_supl_client.cc | 4 +- src/core/libs/gnss_sdr_supl_client.h | 12 ++-- src/core/receiver/control_thread.cc | 60 ++++++++++++++++--- src/core/receiver/control_thread.h | 5 ++ src/core/system_parameters/CMakeLists.txt | 8 +-- ..._ref_location.cc => agnss_ref_location.cc} | 8 +-- ...ps_ref_location.h => agnss_ref_location.h} | 14 ++--- .../{gps_ref_time.cc => agnss_ref_time.cc} | 8 +-- .../{gps_ref_time.h => agnss_ref_time.h} | 14 ++--- src/tests/single_test_main.cc | 4 +- 10 files changed, 94 insertions(+), 43 deletions(-) rename src/core/system_parameters/{gps_ref_location.cc => agnss_ref_location.cc} (86%) rename src/core/system_parameters/{gps_ref_location.h => agnss_ref_location.h} (86%) rename src/core/system_parameters/{gps_ref_time.cc => agnss_ref_time.cc} (88%) rename src/core/system_parameters/{gps_ref_time.h => agnss_ref_time.h} (87%) diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index 1b9646de0..f2a6be3f2 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -996,7 +996,7 @@ bool gnss_sdr_supl_client::load_ref_time_xml(const std::string file_name) } -bool gnss_sdr_supl_client::save_ref_time_map_xml(const std::string file_name, std::map ref_time_map) +bool gnss_sdr_supl_client::save_ref_time_map_xml(const std::string file_name, std::map ref_time_map) { if (ref_time_map.empty() == false) { @@ -1043,7 +1043,7 @@ bool gnss_sdr_supl_client::load_ref_location_xml(const std::string file_name) } -bool gnss_sdr_supl_client::save_ref_location_map_xml(const std::string file_name, std::map ref_location_map) +bool gnss_sdr_supl_client::save_ref_location_map_xml(const std::string file_name, std::map ref_location_map) { if (ref_location_map.empty() == false) { diff --git a/src/core/libs/gnss_sdr_supl_client.h b/src/core/libs/gnss_sdr_supl_client.h index d20779d33..548e4484a 100644 --- a/src/core/libs/gnss_sdr_supl_client.h +++ b/src/core/libs/gnss_sdr_supl_client.h @@ -38,6 +38,8 @@ extern "C" { #include "supl.h" } +#include "agnss_ref_location.h" +#include "agnss_ref_time.h" #include "GPS_L1_CA.h" #include "gps_ephemeris.h" #include "gps_iono.h" @@ -45,8 +47,6 @@ extern "C" #include "gps_utc_model.h" #include "gps_cnav_utc_model.h" #include "gps_acq_assist.h" -#include "gps_ref_time.h" -#include "gps_ref_location.h" #include "gps_cnav_ephemeris.h" #include "galileo_ephemeris.h" #include "galileo_utc_model.h" @@ -98,14 +98,14 @@ public: Gps_Iono gps_iono; Galileo_Iono gal_iono; // reference time - Gps_Ref_Time gps_time; + Agnss_Ref_Time gps_time; // UTC model Gps_Utc_Model gps_utc; Galileo_Utc_Model gal_utc; Gps_CNAV_Utc_Model gps_cnav_utc; Glonass_Gnav_Utc_Model glo_gnav_utc; // reference location - Gps_Ref_Location gps_ref_loc; + Agnss_Ref_Location gps_ref_loc; // Acquisition Assistance map std::map gps_acq_map; @@ -257,7 +257,7 @@ public: * \brief Save ref time map to XML file */ bool save_ref_time_map_xml(const std::string file_name, - std::map ref_time_map); + std::map ref_time_map); /*! * \brief Read ref location from XML file @@ -268,7 +268,7 @@ public: * \brief Save ref location map to XML file */ bool save_ref_location_map_xml(std::string file_name, - std::map ref_location_map); + std::map ref_location_map); /* * Prints SUPL data to std::cout. Use it for debug purposes only. diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index e4e6ce91d..ca570eca9 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -422,7 +422,7 @@ bool ControlThread::read_assistance_from_XML() if (supl_client_acquisition_.load_ref_time_xml(ref_time_xml_filename) == true) { LOG(INFO) << "SUPL: Read XML Ref Time"; - std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_time); + std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_time); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } else @@ -434,7 +434,7 @@ bool ControlThread::read_assistance_from_XML() if (supl_client_acquisition_.load_ref_location_xml(ref_location_xml_filename) == true) { LOG(INFO) << "SUPL: Read XML Ref Location"; - std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_ref_loc); + std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_ref_loc); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } else @@ -618,13 +618,15 @@ void ControlThread::assist_GNSS() if (supl_client_acquisition_.gps_ref_loc.valid == true) { std::cout << "SUPL: Received Ref Location data (Acquisition Assistance)" << std::endl; - std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_ref_loc); + agnss_ref_location_ = supl_client_acquisition_.gps_ref_loc; + std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_ref_loc); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } if (supl_client_acquisition_.gps_time.valid == true) { std::cout << "SUPL: Received Ref Time data (Acquisition Assistance)" << std::endl; - std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_time); + agnss_ref_time_ = supl_client_acquisition_.gps_time; + std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_time); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } } @@ -645,6 +647,25 @@ void ControlThread::assist_GNSS() std::cout << "GNSS assistance data loaded from local XML file(s)." << std::endl; } } + + // If we have enough AGNSS data, make use of it + if (agnss_ref_location_.valid == true) // and agnss_ref_time_.valid == true and we have AGNSS data + { + // Set the receiver in Standby mode + flowgraph_->apply_action(0, 10); + // Get the list of visible satellites + arma::vec ref_LLH = arma::zeros(1, 3); + ref_LLH(0) = agnss_ref_location_.lat; + ref_LLH(1) = agnss_ref_location_.lon; + time_t ref_rx_utc_time = 0; + std::vector> visible_sats = get_visible_sats(ref_rx_utc_time, ref_LLH); + // Set the receiver in Standby mode + flowgraph_->apply_action(0, 10); + // Give priority to visible satellites in the search list + flowgraph_->priorize_satellites(visible_sats); + // Warm Start + flowgraph_->apply_action(0, 13); + } } @@ -670,6 +691,31 @@ void ControlThread::init() supl_lac = 0; supl_ci = 0; msqid = -1; + agnss_ref_location_ = Agnss_Ref_Location(); + agnss_ref_time_ = Agnss_Ref_Time(); + + std::string empty_string = ""; + std::string ref_location_str = configuration_->property("GNSS-SDR.AGNSS_ref_location", empty_string); + std::string ref_time_str = configuration_->property("GNSS-SDR.AGNSS_ref_utc_time", empty_string); + if (ref_location_str.compare(empty_string) != 0) + { + // fill agnss_ref_location_ + agnss_ref_location_.lat = 0.0; // fill + agnss_ref_location_.lon = 0.0; // fill + agnss_ref_location_.valid = true; + } + if (ref_time_str.compare(empty_string) == 0) + { + // Make and educated guess with local system time? Implies timezones, etc. + } + else + { + // fill agnss_ref_time_ + agnss_ref_time_.d_TOW = 0.0; // fill + agnss_ref_time_.d_Week = 0; // fill + agnss_ref_time_.d_tv_sec = 0; // fill + agnss_ref_time_.valid = true; + } } @@ -744,7 +790,7 @@ void ControlThread::apply_action(unsigned int what) visible_satellites = get_visible_sats(cmd_interface_.get_utc_time(), cmd_interface_.get_LLH()); //reorder the satellite queue to acquire first those visible satellites flowgraph_->priorize_satellites(visible_satellites); - //start again the satellite acquisitions (done in chained applyaction to flowgraph) + //start again the satellite acquisitions (done in chained apply_action to flowgraph) break; case 13: LOG(INFO) << "Receiver action WARMSTART"; @@ -754,11 +800,11 @@ void ControlThread::apply_action(unsigned int what) //load the ephemeris and the almanac from XML files (receiver assistance) read_assistance_from_XML(); //call here the function that computes the set of visible satellites and its elevation - //for the date and time specified by the warmstart command and the assisted position + //for the date and time specified by the warm start command and the assisted position get_visible_sats(cmd_interface_.get_utc_time(), cmd_interface_.get_LLH()); //reorder the satellite queue to acquire first those visible satellites flowgraph_->priorize_satellites(visible_satellites); - //start again the satellite acquisitions (done in chained applyaction to flowgraph) + //start again the satellite acquisitions (done in chained apply_action to flowgraph) break; default: LOG(INFO) << "Unrecognized action."; diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index 50bdc06c0..bf78028c1 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -41,6 +41,8 @@ #include "tcp_cmd_interface.h" #include "gnss_flowgraph.h" #include "configuration_interface.h" +#include "agnss_ref_location.h" +#include "agnss_ref_time.h" #include #include #include @@ -189,6 +191,9 @@ private: const std::string glo_utc_default_xml_filename = "./glo_utc_model.xml"; const std::string gal_almanac_default_xml_filename = "./gal_almanac.xml"; const std::string gps_almanac_default_xml_filename = "./gps_almanac.xml"; + + Agnss_Ref_Location agnss_ref_location_; + Agnss_Ref_Time agnss_ref_time_; }; #endif /*GNSS_SDR_CONTROL_THREAD_H_*/ diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index 9561d7c72..29fc91399 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -25,8 +25,8 @@ set(SYSTEM_PARAMETERS_SOURCES gps_almanac.cc gps_utc_model.cc gps_acq_assist.cc - gps_ref_time.cc - gps_ref_location.cc + agnss_ref_time.cc + agnss_ref_location.cc galileo_utc_model.cc galileo_ephemeris.cc galileo_almanac.cc @@ -55,8 +55,8 @@ set(SYSTEM_PARAMETERS_HEADERS gps_almanac.h gps_utc_model.h gps_acq_assist.h - gps_ref_time.h - gps_ref_location.h + agnss_ref_time.h + agnss_ref_location.h galileo_utc_model.h galileo_ephemeris.h galileo_almanac.h diff --git a/src/core/system_parameters/gps_ref_location.cc b/src/core/system_parameters/agnss_ref_location.cc similarity index 86% rename from src/core/system_parameters/gps_ref_location.cc rename to src/core/system_parameters/agnss_ref_location.cc index a72d42da3..c59f8fbc4 100644 --- a/src/core/system_parameters/gps_ref_location.cc +++ b/src/core/system_parameters/agnss_ref_location.cc @@ -1,6 +1,6 @@ /*! - * \file gps_ref_location.cc - * \brief Interface of a GPS REFERENCE LOCATION storage + * \file agnss_ref_location.cc + * \brief Interface of an Assisted GNSS REFERENCE LOCATION storage * * \author Javier Arribas, 2013. jarribas(at)cttc.es * @@ -29,9 +29,9 @@ * ------------------------------------------------------------------------- */ -#include "gps_ref_location.h" +#include "agnss_ref_location.h" -Gps_Ref_Location::Gps_Ref_Location() +Agnss_Ref_Location::Agnss_Ref_Location() { valid = false; lat = 0.0; diff --git a/src/core/system_parameters/gps_ref_location.h b/src/core/system_parameters/agnss_ref_location.h similarity index 86% rename from src/core/system_parameters/gps_ref_location.h rename to src/core/system_parameters/agnss_ref_location.h index f00448ce2..083305987 100644 --- a/src/core/system_parameters/gps_ref_location.h +++ b/src/core/system_parameters/agnss_ref_location.h @@ -1,6 +1,6 @@ /*! - * \file gps_ref_location.h - * \brief Interface of a GPS REFERENCE LOCATION storage + * \file agnss_ref_location.h + * \brief Interface of an Assisted GNSS REFERENCE LOCATION storage * \author Javier Arribas, 2013. jarribas(at)cttc.es * * ------------------------------------------------------------------------- @@ -29,18 +29,18 @@ */ -#ifndef GNSS_SDR_GPS_REF_LOCATION_H_ -#define GNSS_SDR_GPS_REF_LOCATION_H_ +#ifndef GNSS_SDR_AGNSS_REF_LOCATION_H_ +#define GNSS_SDR_AGNSS_REF_LOCATION_H_ #include #include /*! - * \brief Interface of a GPS REFERENCE LOCATION storage + * \brief Interface of an Assisted GNSS REFERENCE LOCATION storage * */ -class Gps_Ref_Location +class Agnss_Ref_Location { public: bool valid; @@ -50,7 +50,7 @@ public: /*! * Default constructor */ - Gps_Ref_Location(); + Agnss_Ref_Location(); template diff --git a/src/core/system_parameters/gps_ref_time.cc b/src/core/system_parameters/agnss_ref_time.cc similarity index 88% rename from src/core/system_parameters/gps_ref_time.cc rename to src/core/system_parameters/agnss_ref_time.cc index b663abab7..0d1e8c687 100644 --- a/src/core/system_parameters/gps_ref_time.cc +++ b/src/core/system_parameters/agnss_ref_time.cc @@ -1,6 +1,6 @@ /*! - * \file gps_ref_time.cc - * \brief Interface of a GPS REFERENCE TIME storage + * \file agnss_ref_time.cc + * \brief Interface of an Assisted GNSS REFERENCE TIME storage * * \author Javier Arribas, 2013. jarribas(at)cttc.es * @@ -29,9 +29,9 @@ * ------------------------------------------------------------------------- */ -#include "gps_ref_time.h" +#include "agnss_ref_time.h" -Gps_Ref_Time::Gps_Ref_Time() +Agnss_Ref_Time::Agnss_Ref_Time() { valid = false; d_TOW = 0.0; diff --git a/src/core/system_parameters/gps_ref_time.h b/src/core/system_parameters/agnss_ref_time.h similarity index 87% rename from src/core/system_parameters/gps_ref_time.h rename to src/core/system_parameters/agnss_ref_time.h index 84af6d973..574d9106a 100644 --- a/src/core/system_parameters/gps_ref_time.h +++ b/src/core/system_parameters/agnss_ref_time.h @@ -1,6 +1,6 @@ /*! - * \file gps_ref_time.h - * \brief Interface of a GPS REFERENCE TIME storage + * \file agnss_ref_time.h + * \brief Interface of an Assisted GNSS REFERENCE TIME storage * \author Javier Arribas, 2013. jarribas(at)cttc.es * * ------------------------------------------------------------------------- @@ -29,18 +29,18 @@ */ -#ifndef GNSS_SDR_GPS_REF_TIME_H_ -#define GNSS_SDR_GPS_REF_TIME_H_ +#ifndef GNSS_SDR_AGNSS_REF_TIME_H_ +#define GNSS_SDR_AGNSS_REF_TIME_H_ #include #include /*! - * \brief Interface of a GPS REFERENCE TIME storage + * \brief Interface of an Assisted GNSS REFERENCE TIME storage * */ -class Gps_Ref_Time +class Agnss_Ref_Time { public: bool valid; @@ -51,7 +51,7 @@ public: /*! * Default constructor */ - Gps_Ref_Time(); + Agnss_Ref_Time(); template diff --git a/src/tests/single_test_main.cc b/src/tests/single_test_main.cc index 5dbfee8f9..d539f2563 100644 --- a/src/tests/single_test_main.cc +++ b/src/tests/single_test_main.cc @@ -29,6 +29,8 @@ * ------------------------------------------------------------------------- */ +#include "agnss_ref_location.h" +#include "agnss_ref_time.h" #include "concurrent_queue.h" #include "concurrent_map.h" #include "gps_navigation_message.h" @@ -36,8 +38,6 @@ #include "gps_cnav_ephemeris.h" #include "gps_cnav_iono.h" #include "gps_acq_assist.h" -#include "gps_ref_location.h" -#include "gps_ref_time.h" #include "galileo_navigation_message.h" #include #include From 37841bc89ec364bf918502e42bd9ab719981601e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 20 Nov 2018 10:52:40 +0100 Subject: [PATCH 102/143] Store AGNSS reference location and time provided by SUPL --- src/core/libs/gnss_sdr_supl_client.cc | 21 ++++++++++----------- src/core/libs/gnss_sdr_supl_client.h | 8 ++++---- src/core/receiver/control_thread.cc | 2 ++ 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index f2a6be3f2..ef52f88c4 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -984,7 +984,7 @@ bool gnss_sdr_supl_client::load_ref_time_xml(const std::string file_name) { ifs.open(file_name.c_str(), std::ifstream::binary | std::ifstream::in); boost::archive::xml_iarchive xml(ifs); - xml >> boost::serialization::make_nvp("GNSS-SDR_ref_time_map", this->gps_time); + xml >> boost::serialization::make_nvp("GNSS-SDR_ref_time", this->gps_time); LOG(INFO) << "Loaded Ref Time data"; } catch (std::exception& e) @@ -996,17 +996,16 @@ bool gnss_sdr_supl_client::load_ref_time_xml(const std::string file_name) } -bool gnss_sdr_supl_client::save_ref_time_map_xml(const std::string file_name, std::map ref_time_map) +bool gnss_sdr_supl_client::save_ref_time_xml(const std::string file_name, Agnss_Ref_Time& ref_time) { - if (ref_time_map.empty() == false) + if (ref_time.valid == true) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_ref_time_map", ref_time_map); - + xml << boost::serialization::make_nvp("GNSS-SDR_ref_time", ref_time); LOG(INFO) << "Saved Ref Time data"; } catch (std::exception& e) @@ -1017,7 +1016,7 @@ bool gnss_sdr_supl_client::save_ref_time_map_xml(const std::string file_name, st } else { - LOG(WARNING) << "Failed to save Ref Time, map is empty"; + LOG(WARNING) << "Failed to save Ref Time"; return false; } return true; @@ -1031,7 +1030,7 @@ bool gnss_sdr_supl_client::load_ref_location_xml(const std::string file_name) { ifs.open(file_name.c_str(), std::ifstream::binary | std::ifstream::in); boost::archive::xml_iarchive xml(ifs); - xml >> boost::serialization::make_nvp("GNSS-SDR_ref_location_map", this->gps_ref_loc); + xml >> boost::serialization::make_nvp("GNSS-SDR_ref_location", this->gps_ref_loc); LOG(INFO) << "Loaded Ref Location data"; } catch (std::exception& e) @@ -1043,16 +1042,16 @@ bool gnss_sdr_supl_client::load_ref_location_xml(const std::string file_name) } -bool gnss_sdr_supl_client::save_ref_location_map_xml(const std::string file_name, std::map ref_location_map) +bool gnss_sdr_supl_client::save_ref_location_xml(const std::string file_name, Agnss_Ref_Location& ref_location) { - if (ref_location_map.empty() == false) + if (ref_location.valid == true) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_ref_location_map", ref_location_map); + xml << boost::serialization::make_nvp("GNSS-SDR_ref_location", ref_location); LOG(INFO) << "Saved Ref Location data"; } catch (std::exception& e) @@ -1063,7 +1062,7 @@ bool gnss_sdr_supl_client::save_ref_location_map_xml(const std::string file_name } else { - LOG(WARNING) << "Failed to save Ref Location, map is empty"; + LOG(WARNING) << "Failed to save Ref Location"; return false; } return true; diff --git a/src/core/libs/gnss_sdr_supl_client.h b/src/core/libs/gnss_sdr_supl_client.h index 548e4484a..2fd599bdf 100644 --- a/src/core/libs/gnss_sdr_supl_client.h +++ b/src/core/libs/gnss_sdr_supl_client.h @@ -256,8 +256,8 @@ public: /*! * \brief Save ref time map to XML file */ - bool save_ref_time_map_xml(const std::string file_name, - std::map ref_time_map); + bool save_ref_time_xml(const std::string file_name, + Agnss_Ref_Time& ref_time_map); /*! * \brief Read ref location from XML file @@ -267,8 +267,8 @@ public: /*! * \brief Save ref location map to XML file */ - bool save_ref_location_map_xml(std::string file_name, - std::map ref_location_map); + bool save_ref_location_xml(std::string file_name, + Agnss_Ref_Location& ref_location); /* * Prints SUPL data to std::cout. Use it for debug purposes only. diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index ca570eca9..0f97e3a2b 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -621,6 +621,7 @@ void ControlThread::assist_GNSS() agnss_ref_location_ = supl_client_acquisition_.gps_ref_loc; std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_ref_loc); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); + supl_client_acquisition_.save_ref_location_xml("agnss_ref_location.xml", agnss_ref_location_); } if (supl_client_acquisition_.gps_time.valid == true) { @@ -628,6 +629,7 @@ void ControlThread::assist_GNSS() agnss_ref_time_ = supl_client_acquisition_.gps_time; std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_time); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); + supl_client_acquisition_.save_ref_time_xml("agnss_ref_time.xml", agnss_ref_time_); } } else From d4ede85fd7399cf35528d21e4562ee9e67a3bf8c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 20 Nov 2018 12:46:38 +0100 Subject: [PATCH 103/143] Read reference location from configuration if available --- src/core/receiver/control_thread.cc | 43 ++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 0f97e3a2b..2044dad61 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -619,7 +619,7 @@ void ControlThread::assist_GNSS() { std::cout << "SUPL: Received Ref Location data (Acquisition Assistance)" << std::endl; agnss_ref_location_ = supl_client_acquisition_.gps_ref_loc; - std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_ref_loc); + std::shared_ptr tmp_obj = std::make_shared(agnss_ref_location_); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); supl_client_acquisition_.save_ref_location_xml("agnss_ref_location.xml", agnss_ref_location_); } @@ -627,7 +627,7 @@ void ControlThread::assist_GNSS() { std::cout << "SUPL: Received Ref Time data (Acquisition Assistance)" << std::endl; agnss_ref_time_ = supl_client_acquisition_.gps_time; - std::shared_ptr tmp_obj = std::make_shared(supl_client_acquisition_.gps_time); + std::shared_ptr tmp_obj = std::make_shared(agnss_ref_time_); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); supl_client_acquisition_.save_ref_time_xml("agnss_ref_time.xml", agnss_ref_time_); } @@ -653,20 +653,23 @@ void ControlThread::assist_GNSS() // If we have enough AGNSS data, make use of it if (agnss_ref_location_.valid == true) // and agnss_ref_time_.valid == true and we have AGNSS data { - // Set the receiver in Standby mode - flowgraph_->apply_action(0, 10); // Get the list of visible satellites - arma::vec ref_LLH = arma::zeros(1, 3); + arma::vec ref_LLH = arma::zeros(3, 1); ref_LLH(0) = agnss_ref_location_.lat; ref_LLH(1) = agnss_ref_location_.lon; time_t ref_rx_utc_time = 0; + if (agnss_ref_time_.valid == true) + { + ref_rx_utc_time = agnss_ref_time_.d_tv_sec; + } + std::vector> visible_sats = get_visible_sats(ref_rx_utc_time, ref_LLH); // Set the receiver in Standby mode flowgraph_->apply_action(0, 10); // Give priority to visible satellites in the search list flowgraph_->priorize_satellites(visible_sats); - // Warm Start - flowgraph_->apply_action(0, 13); + // Hot Start + flowgraph_->apply_action(0, 12); } } @@ -701,20 +704,34 @@ void ControlThread::init() std::string ref_time_str = configuration_->property("GNSS-SDR.AGNSS_ref_utc_time", empty_string); if (ref_location_str.compare(empty_string) != 0) { + std::vector vect; + std::stringstream ss(ref_location_str); + double d; + while (ss >> d) + { + vect.push_back(d); + if (ss.peek() == ',') + ss.ignore(); + } // fill agnss_ref_location_ - agnss_ref_location_.lat = 0.0; // fill - agnss_ref_location_.lon = 0.0; // fill - agnss_ref_location_.valid = true; + if (vect.size() >= 2) + { + agnss_ref_location_.lat = vect[0]; + agnss_ref_location_.lon = vect[1]; + agnss_ref_location_.valid = true; + } } if (ref_time_str.compare(empty_string) == 0) { - // Make and educated guess with local system time? Implies timezones, etc. + // Make an educated guess + time_t rawtime; + time(&rawtime); + agnss_ref_time_.d_tv_sec = rawtime; + agnss_ref_time_.valid = true; } else { // fill agnss_ref_time_ - agnss_ref_time_.d_TOW = 0.0; // fill - agnss_ref_time_.d_Week = 0; // fill agnss_ref_time_.d_tv_sec = 0; // fill agnss_ref_time_.valid = true; } From 571738f090059f65a20bec3e635565bcf2cab818 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 20 Nov 2018 16:52:51 +0100 Subject: [PATCH 104/143] Fix reporting of Galileo almanac data --- src/core/receiver/control_thread.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 2044dad61..3d537c43e 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -563,6 +563,7 @@ void ControlThread::assist_GNSS() std::shared_ptr tmp_obj = std::make_shared(gps_alm_iter->second); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); } + supl_client_ephemeris_.save_gps_almanac_xml("gps_almanac_map.xml", supl_client_ephemeris_.gps_almanac_map); if (supl_client_ephemeris_.gps_iono.valid == true) { std::cout << "SUPL: Received GPS Ionosphere model parameters" << std::endl; @@ -937,11 +938,10 @@ std::vector> ControlThread::get_visible_sats(time arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec dx = r_sat_eb_e - r_eb_e; topocent(&Az, &El, &dist_m, r_eb_e, dx); - std::cout << "Using Galileo Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; // push sat if (El > 0) { - std::cout << "Using GPS Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using Galileo Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); } From 4810bdd0a5295f3060664c418e2011f7d35af654 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Tue, 20 Nov 2018 17:46:06 +0100 Subject: [PATCH 105/143] Adding missing parameters to Galileo broadcast ephemeris serializer --- .../system_parameters/galileo_ephemeris.h | 66 +++++++++++++------ 1 file changed, 45 insertions(+), 21 deletions(-) diff --git a/src/core/system_parameters/galileo_ephemeris.h b/src/core/system_parameters/galileo_ephemeris.h index f057d1c25..d2555790c 100644 --- a/src/core/system_parameters/galileo_ephemeris.h +++ b/src/core/system_parameters/galileo_ephemeris.h @@ -119,30 +119,54 @@ public: */ inline void serialize(Archive& archive, const uint32_t version) { - using boost::serialization::make_nvp; if (version) { }; - archive& make_nvp("i_satellite_PRN", i_satellite_PRN); - archive& make_nvp("M0_1", M0_1); - archive& make_nvp("e_1", e_1); - archive& make_nvp("A_1", A_1); - archive& make_nvp("OMEGA_0_2", OMEGA_0_2); - archive& make_nvp("i_0_2", i_0_2); - archive& make_nvp("omega_2", omega_2); - archive& make_nvp("OMEGA_dot_3", OMEGA_dot_3); - archive& make_nvp("iDot_2", iDot_2); - archive& make_nvp("C_uc_3", C_uc_3); - archive& make_nvp("C_us_3", C_us_3); - archive& make_nvp("C_rc_3", C_rc_3); - archive& make_nvp("C_rs_3", C_rs_3); - archive& make_nvp("C_ic_4", C_ic_4); - archive& make_nvp("C_is_4", C_is_4); - archive& make_nvp("t0e_1", t0e_1); - archive& make_nvp("t0c_4", t0c_4); - archive& make_nvp("af0_4", af0_4); - archive& make_nvp("af1_4", af1_4); - archive& make_nvp("af2_4", af2_4); + + archive& BOOST_SERIALIZATION_NVP(flag_all_ephemeris); + archive& BOOST_SERIALIZATION_NVP(IOD_ephemeris); + archive& BOOST_SERIALIZATION_NVP(IOD_nav_1); + archive& BOOST_SERIALIZATION_NVP(SV_ID_PRN_4); + + archive& BOOST_SERIALIZATION_NVP(M0_1); + archive& BOOST_SERIALIZATION_NVP(delta_n_3); + archive& BOOST_SERIALIZATION_NVP(e_1); + archive& BOOST_SERIALIZATION_NVP(A_1); + archive& BOOST_SERIALIZATION_NVP(OMEGA_0_2); + archive& BOOST_SERIALIZATION_NVP(i_0_2); + archive& BOOST_SERIALIZATION_NVP(omega_2); + archive& BOOST_SERIALIZATION_NVP(OMEGA_dot_3); + archive& BOOST_SERIALIZATION_NVP(iDot_2); + archive& BOOST_SERIALIZATION_NVP(C_uc_3); + archive& BOOST_SERIALIZATION_NVP(C_us_3); + archive& BOOST_SERIALIZATION_NVP(C_rc_3); + archive& BOOST_SERIALIZATION_NVP(C_rs_3); + archive& BOOST_SERIALIZATION_NVP(C_ic_4); + archive& BOOST_SERIALIZATION_NVP(C_is_4); + archive& BOOST_SERIALIZATION_NVP(t0e_1); + + archive& BOOST_SERIALIZATION_NVP(t0c_4); + archive& BOOST_SERIALIZATION_NVP(af0_4); + archive& BOOST_SERIALIZATION_NVP(af1_4); + archive& BOOST_SERIALIZATION_NVP(af2_4); + + archive& BOOST_SERIALIZATION_NVP(WN_5); + archive& BOOST_SERIALIZATION_NVP(TOW_5); + archive& BOOST_SERIALIZATION_NVP(Galileo_satClkDrift); + archive& BOOST_SERIALIZATION_NVP(Galileo_dtr); + + archive& BOOST_SERIALIZATION_NVP(SISA_3); + archive& BOOST_SERIALIZATION_NVP(E5a_HS); + archive& BOOST_SERIALIZATION_NVP(E5b_HS_5); + archive& BOOST_SERIALIZATION_NVP(E1B_HS_5); + archive& BOOST_SERIALIZATION_NVP(E5a_DVS); + archive& BOOST_SERIALIZATION_NVP(E5b_DVS_5); + archive& BOOST_SERIALIZATION_NVP(E1B_DVS_5); + + archive& BOOST_SERIALIZATION_NVP(BGD_E1E5a_5); + archive& BOOST_SERIALIZATION_NVP(BGD_E1E5b_5); + + archive& BOOST_SERIALIZATION_NVP(i_satellite_PRN); } }; From c69b877c44a2f7239c663b06796c075794d53a9e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 20 Nov 2018 21:53:53 +0100 Subject: [PATCH 106/143] Fix reading of Galileo almanac --- src/core/libs/gnss_sdr_supl_client.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index ef52f88c4..f3774379d 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -877,7 +877,7 @@ bool gnss_sdr_supl_client::read_gal_almanac_from_gsa(const std::string file_name gal_alm.i_WNa = std::stoi(almanac.child("almanac").child_value("wna")); gal_alm.i_IODa = std::stoi(almanac.child("almanac").child_value("iod")); gal_alm.d_Delta_i = std::stod(almanac.child("almanac").child_value("deltai")); - gal_alm.d_M_0 = std::stod(almanac.child("almanac").child_value("deltai")); + gal_alm.d_M_0 = std::stod(almanac.child("almanac").child_value("m0")); gal_alm.d_e_eccentricity = std::stod(almanac.child("almanac").child_value("ecc")); gal_alm.d_Delta_sqrt_A = std::stod(almanac.child("almanac").child_value("aSqRoot")); gal_alm.d_OMEGA0 = std::stod(almanac.child("almanac").child_value("omega0")); From 05b6c03344b830defb85af95e0d1b382de4bbd97 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 20 Nov 2018 21:56:35 +0100 Subject: [PATCH 107/143] Fix typo --- src/core/receiver/gnss_flowgraph.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index ab15b1084..e00fe7847 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -1046,8 +1046,8 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) } } break; - case 10: //request stanby mode - LOG(INFO) << "TC request stanby mode"; + case 10: // request standby mode + LOG(INFO) << "TC request standby mode"; for (size_t n = 0; n < channels_.size(); n++) { if (channels_state_[n] == 1 or channels_state_[n] == 2) //channel in acquisition or in tracking @@ -1100,9 +1100,9 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) channels_state_[n] = 0; } } - acq_channels_count_ = 0; //all channels are in stanby now + acq_channels_count_ = 0; // all channels are in standby now break; - case 11: //request coldstart mode + case 11: // request coldstart mode LOG(INFO) << "TC request flowgraph coldstart"; //start again the satellite acquisitions for (unsigned int i = 0; i < channels_count_; i++) @@ -1131,7 +1131,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) DLOG(INFO) << "Channel " << ch_index << " in state " << channels_state_[ch_index]; } break; - case 12: //request hotstart mode + case 12: // request hotstart mode LOG(INFO) << "TC request flowgraph hotstart"; for (unsigned int i = 0; i < channels_count_; i++) { @@ -1159,7 +1159,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) DLOG(INFO) << "Channel " << ch_index << " in state " << channels_state_[ch_index]; } break; - case 13: //request warmstart mode + case 13: // request warmstart mode LOG(INFO) << "TC request flowgraph warmstart"; //start again the satellite acquisitions for (unsigned int i = 0; i < channels_count_; i++) From f8f235f7ddbca897cfc76ae01759047c58d040ca Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 20 Nov 2018 21:57:59 +0100 Subject: [PATCH 108/143] Replace time.h by ctime include --- src/core/receiver/tcp_cmd_interface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/receiver/tcp_cmd_interface.h b/src/core/receiver/tcp_cmd_interface.h index fa039116a..2323e357d 100644 --- a/src/core/receiver/tcp_cmd_interface.h +++ b/src/core/receiver/tcp_cmd_interface.h @@ -44,7 +44,7 @@ #include #include #include -#include +#include class TcpCmdInterface { From df0021cfb071c2db5db4cda2149d856dafa55d46 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 20 Nov 2018 22:01:48 +0100 Subject: [PATCH 109/143] Remove warnings --- src/core/receiver/tcp_cmd_interface.cc | 41 ++++++++++++++++---------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 5913034b5..9d3591488 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -39,16 +39,21 @@ void TcpCmdInterface::set_pvt(std::shared_ptr PVT_sptr) { PVT_sptr_ = PVT_sptr; } + + time_t TcpCmdInterface::get_utc_time() { return receiver_utc_time_; } + arma::vec TcpCmdInterface::get_LLH() { return arma::vec{rx_latitude_, rx_longitude_, rx_altitude_}; } -std::string TcpCmdInterface::reset(const std::vector &commandLine) + + +std::string TcpCmdInterface::reset(const std::vector &commandLine __attribute__((unused))) { std::string response; std::unique_ptr cmf(new ControlMessageFactory()); @@ -65,7 +70,8 @@ std::string TcpCmdInterface::reset(const std::vector &commandLine) return response; } -std::string TcpCmdInterface::standby(const std::vector &commandLine) + +std::string TcpCmdInterface::standby(const std::vector &commandLine __attribute__((unused))) { std::string response; std::unique_ptr cmf(new ControlMessageFactory()); @@ -81,7 +87,8 @@ std::string TcpCmdInterface::standby(const std::vector &commandLine return response; } -std::string TcpCmdInterface::status(const std::vector &commandLine) + +std::string TcpCmdInterface::status(const std::vector &commandLine __attribute__((unused))) { std::stringstream str_stream; //todo: implement the receiver status report @@ -130,18 +137,18 @@ std::string TcpCmdInterface::status(const std::vector &commandLine) return str_stream.str(); } + std::string TcpCmdInterface::hotstart(const std::vector &commandLine) { std::string response; if (commandLine.size() > 5) { - //read commandline time parameter + // Read commandline time parameter struct tm tm; strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm); receiver_utc_time_ = timegm(&tm); - - //read latitude, longitude, and height + // Read latitude, longitude, and height rx_latitude_ = std::stod(commandLine.at(3).c_str()); rx_longitude_ = std::stod(commandLine.at(4).c_str()); rx_altitude_ = std::stod(commandLine.at(5).c_str()); @@ -166,24 +173,25 @@ std::string TcpCmdInterface::hotstart(const std::vector &commandLin } else { - response = "ERROR: time parameter not found, please use hotstart %d/%m/%Y %H:%M:%S\n"; + response = "ERROR: time parameter not found, please use hotstart %d/%m/%Y %H:%M:%S Lat Long H\n"; } return response; } + std::string TcpCmdInterface::warmstart(const std::vector &commandLine) { std::string response; if (commandLine.size() > 5) { std::string tmp_str; - //read commandline time parameter + // Read commandline time parameter struct tm tm; tmp_str = commandLine.at(1) + commandLine.at(2); strptime(tmp_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm); receiver_utc_time_ = timegm(&tm); - //read latitude, longitude, and height + // Read latitude, longitude, and height rx_latitude_ = std::stod(commandLine.at(3).c_str()); rx_longitude_ = std::stod(commandLine.at(4).c_str()); rx_altitude_ = std::stod(commandLine.at(5).c_str()); @@ -196,7 +204,7 @@ std::string TcpCmdInterface::warmstart(const std::vector &commandLi std::unique_ptr cmf(new ControlMessageFactory()); if (control_queue_ != nullptr) { - control_queue_->handle(cmf->GetQueueMessage(300, 13)); //send the standby message (who=300,what=13) + control_queue_->handle(cmf->GetQueueMessage(300, 13)); // send the warmstart message (who=300,what=13) response = "OK\n"; } else @@ -213,13 +221,13 @@ std::string TcpCmdInterface::warmstart(const std::vector &commandLi } -std::string TcpCmdInterface::coldstart(const std::vector &commandLine) +std::string TcpCmdInterface::coldstart(const std::vector &commandLine __attribute__((unused))) { std::string response; std::unique_ptr cmf(new ControlMessageFactory()); if (control_queue_ != nullptr) { - control_queue_->handle(cmf->GetQueueMessage(300, 11)); //send the standby message (who=300,what=11) + control_queue_->handle(cmf->GetQueueMessage(300, 11)); // send the coldstart message (who=300,what=11) response = "OK\n"; } else @@ -229,7 +237,8 @@ std::string TcpCmdInterface::coldstart(const std::vector &commandLi return response; } -std::string TcpCmdInterface::set_ch_satellite(const std::vector &commandLine) + +std::string TcpCmdInterface::set_ch_satellite(const std::vector &commandLine __attribute__((unused))) { std::string response; //todo: implement the set satellite command @@ -266,6 +275,8 @@ void TcpCmdInterface::set_msg_queue(gr::msg_queue::sptr control_queue) { control_queue_ = control_queue; } + + void TcpCmdInterface::run_cmd_server(int tcp_port) { // Get the port from the parameters @@ -315,7 +326,7 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) if (cmd_vector.at(0).compare("exit") == 0) { error = boost::asio::error::eof; - //send cmd response + // send cmd response socket.write_some(boost::asio::buffer("OK\n"), not_throw); } else @@ -337,7 +348,7 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) response = "ERROR: empty command\n"; } - //send cmd response + // send cmd response socket.write_some(boost::asio::buffer(response), not_throw); if (not_throw) { From 73ece1e5334c7ba79a0c2f85d1347aca3c5f2679 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 21 Nov 2018 08:28:50 +0100 Subject: [PATCH 110/143] Uniformize style of CMake modules --- CMakeLists.txt | 36 +-- cmake/Modules/CMakeParseArgumentsCopy.cmake | 138 ---------- cmake/Modules/FindGFLAGS.cmake | 102 +++++++ cmake/Modules/FindGFORTRAN.cmake | 260 +++++++++--------- cmake/Modules/FindGFlags.cmake | 101 ------- cmake/Modules/FindGLOG.cmake | 97 ++++--- ...imulator.cmake => FindGNSSSIMULATOR.cmake} | 17 +- ...{FindGnuradio.cmake => FindGNURADIO.cmake} | 113 ++++---- ...dGperftools.cmake => FindGPERFTOOLS.cmake} | 4 +- cmake/Modules/FindGPSTK.cmake | 31 +-- ...indGrDbfcttc.cmake => FindGRDBFCTTC.cmake} | 14 +- .../{FindGrGN3S.cmake => FindGRGN3S.cmake} | 14 +- .../{FindGriio.cmake => FindGRIIO.cmake} | 14 +- ...indGrOsmoSDR.cmake => FindGROSMOSDR.cmake} | 43 ++- .../{Findlibiio.cmake => FindLIBIIO.cmake} | 14 +- ...dLibOsmoSDR.cmake => FindLIBOSMOSDR.cmake} | 34 +-- .../{FindLog4cpp.cmake => FindLOG4CPP.cmake} | 23 +- cmake/Modules/FindMATIO.cmake | 62 ++--- ...{FindOpenBLAS.cmake => FindOPENBLAS.cmake} | 16 +- cmake/Modules/FindOPENCL.cmake | 110 ++++++++ cmake/Modules/FindORC.cmake | 74 ++--- cmake/Modules/FindOpenCL.cmake | 116 -------- cmake/Modules/FindPCAP.cmake | 80 +++--- cmake/Modules/FindPUGIXML.cmake | 67 +++++ cmake/Modules/FindPugiXML.cmake | 69 ----- ...indTeleorbit.cmake => FindTELEORBIT.cmake} | 14 +- cmake/Modules/FindUHD.cmake | 14 +- .../{FindVolk.cmake => FindVOLK.cmake} | 15 +- ...olkGnssSdr.cmake => FindVOLKGNSSSDR.cmake} | 14 +- cmake/Modules/GnsssdrBuildTypes.cmake | 26 +- cmake/Modules/SetupPython.cmake | 62 ++--- cmake/Modules/TestForARM.cmake | 35 ++- cmake/Modules/TestForSSE.cmake | 19 +- .../signal_source/adapters/CMakeLists.txt | 30 +- .../signal_source/libs/CMakeLists.txt | 8 +- src/tests/CMakeLists.txt | 8 +- 36 files changed, 848 insertions(+), 1046 deletions(-) delete mode 100644 cmake/Modules/CMakeParseArgumentsCopy.cmake create mode 100644 cmake/Modules/FindGFLAGS.cmake delete mode 100644 cmake/Modules/FindGFlags.cmake rename cmake/Modules/{FindGnssSimulator.cmake => FindGNSSSIMULATOR.cmake} (69%) rename cmake/Modules/{FindGnuradio.cmake => FindGNURADIO.cmake} (66%) rename cmake/Modules/{FindGperftools.cmake => FindGPERFTOOLS.cmake} (98%) rename cmake/Modules/{FindGrDbfcttc.cmake => FindGRDBFCTTC.cmake} (82%) rename cmake/Modules/{FindGrGN3S.cmake => FindGRGN3S.cmake} (83%) rename cmake/Modules/{FindGriio.cmake => FindGRIIO.cmake} (88%) rename cmake/Modules/{FindGrOsmoSDR.cmake => FindGROSMOSDR.cmake} (70%) rename cmake/Modules/{Findlibiio.cmake => FindLIBIIO.cmake} (89%) rename cmake/Modules/{FindLibOsmoSDR.cmake => FindLIBOSMOSDR.cmake} (70%) rename cmake/Modules/{FindLog4cpp.cmake => FindLOG4CPP.cmake} (86%) rename cmake/Modules/{FindOpenBLAS.cmake => FindOPENBLAS.cmake} (81%) create mode 100644 cmake/Modules/FindOPENCL.cmake delete mode 100644 cmake/Modules/FindOpenCL.cmake create mode 100644 cmake/Modules/FindPUGIXML.cmake delete mode 100644 cmake/Modules/FindPugiXML.cmake rename cmake/Modules/{FindTeleorbit.cmake => FindTELEORBIT.cmake} (83%) rename cmake/Modules/{FindVolk.cmake => FindVOLK.cmake} (89%) rename cmake/Modules/{FindVolkGnssSdr.cmake => FindVOLKGNSSSDR.cmake} (82%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f57d6c41..7366593ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -509,7 +509,7 @@ endif(NOT Boost_FOUND) # GNU Radio - https://gnuradio.org ################################################################################ set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS FFT FILTER PMT) -find_package(Gnuradio) +find_package(GNURADIO) if(PC_GNURADIO_RUNTIME_VERSION) if(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION}) set(GNURADIO_RUNTIME_FOUND) @@ -553,7 +553,7 @@ endif() ################################################################################ # VOLK - Vector-Optimized Library of Kernels ################################################################################ -find_package(Volk) +find_package(VOLK) if(NOT VOLK_FOUND) message(FATAL_ERROR "*** VOLK is required to build gnss-sdr") endif() @@ -563,7 +563,7 @@ endif() ################################################################################ # Log4cpp - http://log4cpp.sourceforge.net/ ################################################################################ -find_package(Log4cpp) +find_package(LOG4CPP) if(NOT LOG4CPP_FOUND) message(FATAL_ERROR "*** Log4cpp is required to build gnss-sdr") endif() @@ -573,9 +573,9 @@ endif() ################################################################################ # volk_gnsssdr module - GNSS-SDR's own VOLK library ################################################################################ -find_package(VolkGnssSdr) +find_package(VOLKGNSSSDR) -if(NOT VOLK_GNSSSDR_FOUND) +if(NOT VOLKGNSSSDR_FOUND) message(STATUS " volk_gnsssdr will be built along with gnss-sdr when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'") ############################### # Find Python required modules @@ -710,7 +710,7 @@ if(NOT VOLK_GNSSSDR_FOUND) add_custom_command(TARGET volk_gnsssdr_module POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr-config-info ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr-config-info) -endif(NOT VOLK_GNSSSDR_FOUND) +endif(NOT VOLKGNSSSDR_FOUND) @@ -718,8 +718,8 @@ endif(NOT VOLK_GNSSSDR_FOUND) # gflags - https://github.com/gflags/gflags ################################################################################ set(LOCAL_GFLAGS false) -find_package(GFlags) -if(NOT GFlags_FOUND) +find_package(GFLAGS) +if(NOT GFLAGS_FOUND) message(STATUS " gflags library has not been found.") message(STATUS " gflags v${GNSSSDR_GFLAGS_LOCAL_VERSION} will be downloaded and built automatically ") message(STATUS " when doing 'make'. ") @@ -770,7 +770,7 @@ if(NOT GFlags_FOUND) set(GFlags_lib ${GFlags_LIBS} CACHE FILEPATH "Local Gflags library") set(GFlags_LIBRARY_PATH ${GFlags_LIBS}) set(LOCAL_GFLAGS true CACHE STRING "GFlags downloaded and built automatically" FORCE) -endif(NOT GFlags_FOUND) +endif(NOT GFLAGS_FOUND) @@ -786,9 +786,9 @@ endif(NOT ${ENABLE_OWN_GLOG}) set(glog_RELEASE ${GNSSSDR_GLOG_LOCAL_VERSION}) if(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) message(STATUS " glog library has not been found") - if(NOT GFlags_FOUND) + if(NOT GFLAGS_FOUND) message(STATUS " or it is likely not linked to gflags.") - endif(NOT GFlags_FOUND) + endif(NOT GFLAGS_FOUND) message(STATUS " glog v${GNSSSDR_GLOG_LOCAL_VERSION} will be downloaded and built automatically ") message(STATUS " when doing 'make'. ") if(NOT ${LOCAL_GFLAGS}) @@ -1215,10 +1215,10 @@ endif(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_V ################################################################################ # PugiXML - https://pugixml.org/ ################################################################################ -find_package(PugiXML QUIET) -if(PugiXML_FOUND) +find_package(PUGIXML QUIET) +if(PUGIXML_FOUND) message(STATUS "PugiXML has been found. Reading of GSA Galileo almanac XML files enabled.") -else(PugiXML_FOUND) +else(PUGIXML_FOUND) message(STATUS " PugiXML v${GNSSSDR_PUGIXML_LOCAL_VERSION} will be downloaded and built automatically when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'.") set(PUGIXML_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}) set(TOOLCHAIN_ARG "") @@ -1257,7 +1257,7 @@ else(PugiXML_FOUND) set(PUGIXML_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}) set(PUGIXML_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src) set(PUGIXML_LOCAL true) -endif(PugiXML_FOUND) +endif(PUGIXML_FOUND) ################################################################################ @@ -1345,7 +1345,7 @@ endif(DOXYGEN_FOUND) # OpenCL (OPTIONAL) ############################################################################### if(ENABLE_OPENCL) - find_package(OpenCL) + find_package(OPENCL) if($ENV{DISABLE_OPENCL}) set(DISABLE_OPENCL TRUE) endif($ENV{DISABLE_OPENCL}) @@ -1455,7 +1455,7 @@ if($ENV{RTLSDR_DRIVER}) endif($ENV{RTLSDR_DRIVER}) if(ENABLE_OSMOSDR) - find_package(GrOsmoSDR) + find_package(GROSMOSDR) if(GROSMOSDR_FOUND) message(STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled.") message(STATUS "You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ../'") @@ -1494,7 +1494,7 @@ endif(ENABLE_FLEXIBAND) # GPerftools - https://github.com/gperftools/gperftools (OPTIONAL) ################################################################################ if(ENABLE_GPERFTOOLS) - find_package(Gperftools) + find_package(GPERFTOOLS) if(NOT GPERFTOOLS_FOUND) message(STATUS "Although ENABLE_GPERFTOOLS has been set to ON, GPerftools has not been found.") message(STATUS "Binaries will be compiled without 'tcmalloc' and 'profiler' libraries.") diff --git a/cmake/Modules/CMakeParseArgumentsCopy.cmake b/cmake/Modules/CMakeParseArgumentsCopy.cmake deleted file mode 100644 index 7ce4c49ae..000000000 --- a/cmake/Modules/CMakeParseArgumentsCopy.cmake +++ /dev/null @@ -1,138 +0,0 @@ -# CMAKE_PARSE_ARGUMENTS( args...) -# -# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for -# parsing the arguments given to that macro or function. -# It processes the arguments and defines a set of variables which hold the -# values of the respective options. -# -# The argument contains all options for the respective macro, -# i.e. keywords which can be used when calling the macro without any value -# following, like e.g. the OPTIONAL keyword of the install() command. -# -# The argument contains all keywords for this macro -# which are followed by one value, like e.g. DESTINATION keyword of the -# install() command. -# -# The argument contains all keywords for this macro -# which can be followed by more than one value, like e.g. the TARGETS or -# FILES keywords of the install() command. -# -# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the -# keywords listed in , and -# a variable composed of the given -# followed by "_" and the name of the respective keyword. -# These variables will then hold the respective value from the argument list. -# For the keywords this will be TRUE or FALSE. -# -# All remaining arguments are collected in a variable -# _UNPARSED_ARGUMENTS, this can be checked afterwards to see whether -# your macro was called with unrecognized parameters. -# -# As an example here a my_install() macro, which takes similar arguments as the -# real install() command: -# -# function(MY_INSTALL) -# set(options OPTIONAL FAST) -# set(oneValueArgs DESTINATION RENAME) -# set(multiValueArgs TARGETS CONFIGURATIONS) -# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) -# ... -# -# Assume my_install() has been called like this: -# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub) -# -# After the cmake_parse_arguments() call the macro will have set the following -# variables: -# MY_INSTALL_OPTIONAL = TRUE -# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install() -# MY_INSTALL_DESTINATION = "bin" -# MY_INSTALL_RENAME = "" (was not used) -# MY_INSTALL_TARGETS = "foo;bar" -# MY_INSTALL_CONFIGURATIONS = "" (was not used) -# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL" -# -# You can the continue and process these variables. -# -# Keywords terminate lists of values, e.g. if directly after a one_value_keyword -# another recognized keyword follows, this is interpreted as the beginning of -# the new option. -# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in -# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would -# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor. - -#============================================================================= -# Copyright 2010 Alexander Neundorf -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - - -if(__CMAKE_PARSE_ARGUMENTS_INCLUDED) - return() -endif() -set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE) - - -function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames) - # first set all result variables to empty/FALSE - foreach(arg_name ${_singleArgNames} ${_multiArgNames}) - set(${prefix}_${arg_name}) - endforeach(arg_name) - - foreach(option ${_optionNames}) - set(${prefix}_${option} FALSE) - endforeach(option) - - set(${prefix}_UNPARSED_ARGUMENTS) - - set(insideValues FALSE) - set(currentArgName) - - # now iterate over all arguments and fill the result variables - foreach(currentArg ${ARGN}) - list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword - list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword - list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword - - if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1) - if(insideValues) - if("${insideValues}" STREQUAL "SINGLE") - set(${prefix}_${currentArgName} ${currentArg}) - set(insideValues FALSE) - elseif("${insideValues}" STREQUAL "MULTI") - list(APPEND ${prefix}_${currentArgName} ${currentArg}) - endif() - else(insideValues) - list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg}) - endif(insideValues) - else() - if(NOT ${optionIndex} EQUAL -1) - set(${prefix}_${currentArg} TRUE) - set(insideValues FALSE) - elseif(NOT ${singleArgIndex} EQUAL -1) - set(currentArgName ${currentArg}) - set(${prefix}_${currentArgName}) - set(insideValues "SINGLE") - elseif(NOT ${multiArgIndex} EQUAL -1) - set(currentArgName ${currentArg}) - set(${prefix}_${currentArgName}) - set(insideValues "MULTI") - endif() - endif() - - endforeach(currentArg) - - # propagate the result variables to the caller: - foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames}) - set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE) - endforeach(arg_name) - set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE) - -endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs) diff --git a/cmake/Modules/FindGFLAGS.cmake b/cmake/Modules/FindGFLAGS.cmake new file mode 100644 index 000000000..76a832ca5 --- /dev/null +++ b/cmake/Modules/FindGFLAGS.cmake @@ -0,0 +1,102 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# - Try to find GFlags +# +# The following variables are optionally searched for defaults +# GFlags_ROOT_DIR: Base directory where all GFlags components are found +# +# The following are set after configuration is done: +# GFlags_FOUND +# GFlags_INCLUDE_DIRS +# GFlags_LIBS +# GFlags_LIBRARY_DIRS + +if(APPLE) + find_path(GFlags_ROOT_DIR + libgflags.dylib + PATHS + /opt/local/lib + /usr/local/lib + ) +else() + find_path(GFlags_ROOT_DIR + libgflags.so + HINTS + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + /usr/lib + ) +endif() + +if(GFlags_ROOT_DIR) + # We are testing only a couple of files in the include directories + find_path(GFlags_INCLUDE_DIRS + gflags/gflags.h + HINTS + /opt/local/include + /usr/local/include + /usr/include + ${GFlags_ROOT_DIR}/src + ) + + # Find the libraries + set(GFlags_LIBRARY_DIRS ${GFlags_ROOT_DIR}) + + find_library(GFlags_lib gflags ${GFlags_LIBRARY_DIRS}) + if(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h) + set(GFLAGS_GREATER_20 TRUE) + else() + set(GFLAGS_GREATER_20 FALSE) + endif() + # set up include and link directory + include_directories(${GFlags_INCLUDE_DIRS}) + link_directories(${GFlags_LIBRARY_DIRS}) + message(STATUS "gflags library found at ${GFlags_lib}") + set(GFlags_LIBS ${GFlags_lib}) + set(GFlags_FOUND true) + mark_as_advanced(GFlags_INCLUDE_DIRS) +else() + message(STATUS "Cannot find gflags") + set(GFlags_FOUND false) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GFLAGS DEFAULT_MSG GFlags_LIBS GFlags_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index baeaad1fd..f3299fefb 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -15,134 +15,134 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . - find_library(GFORTRAN NAMES gfortran - PATHS /usr/lib - /usr/lib64 - /usr/local/lib - /usr/local/lib/i386 - /usr/lib/gcc/x86_64-linux-gnu - /usr/lib/gcc/i686-linux-gnu - /usr/lib/gcc/i386-linux-gnu - /usr/lib/gcc/x86_64-linux-gnu/4.6 # Ubuntu 12.04 - /usr/lib/gcc/i686-linux-gnu/4.6 - /usr/lib/gcc/x86_64-linux-gnu/4.7 - /usr/lib/gcc/i686-linux-gnu/4.7 - /usr/lib/gcc/x86_64-linux-gnu/4.8 - /usr/lib/gcc/i686-linux-gnu/4.8 - /usr/lib/gcc/x86_64-linux-gnu/4.9 - /usr/lib/gcc/i686-linux-gnu/4.9 - /usr/lib/gcc/x86_64-redhat-linux/4.7.2 # Fedora 18 - /usr/lib/gcc/i686-redhat-linux/4.7.2 - /usr/lib/gcc/x86_64-redhat-linux/4.8.1 # Fedora 19 - /usr/lib/gcc/x86_64-redhat-linux/4.8.3 # Fedora 20 - /usr/lib/gcc/x86_64-redhat-linux/4.9.1 # Fedora 21 - /usr/lib/gcc/i686-redhat-linux/4.8.1 - /usr/lib/gcc/i686-redhat-linux/4.8.3 - /usr/lib/gcc/i686-redhat-linux/4.9.1 - /usr/lib/gcc/x86_64-redhat-linux/4.4.4 # CentOS 6 - /usr/lib/gcc/i686-redhat-linux/4.4.4 - /usr/lib/gcc/x86_64-redhat-linux/4.8.2 - /usr/lib/gcc/i686-redhat-linux/4.8.2 - /usr/lib/gcc/x86_64-redhat-linux/7 - /usr/lib/gcc/i686-redhat-linux/7 - /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/7 - /usr/lib/gcc/aarch64-redhat-linux/7 - /usr/lib/gcc/i586-suse-linux/4.8 # OpenSUSE 13.1 - /usr/lib/gcc/i586-suse-linux/4.9 - /usr/lib/gcc/x86_64-suse-linux/4.8 - /usr/lib/gcc/x86_64-suse-linux/4.9 - /usr/lib/gcc/i486-linux-gnu # Debian 7 - /usr/lib/gcc/i486-linux-gnu/4.4 - /usr/lib/gcc/i486-linux-gnu/4.6 - /usr/lib/gcc/i486-linux-gnu/4.7 - /usr/lib/gcc/i486-linux-gnu/4.8 - /usr/lib/gcc/i486-linux-gnu/4.9 - /usr/lib/gcc/i586-linux-gnu/4.9 - /usr/lib/gcc/arm-linux-gnueabihf/4.4 # Debian armhf - /usr/lib/gcc/arm-linux-gnueabihf/4.5 - /usr/lib/gcc/arm-linux-gnueabihf/4.6 - /usr/lib/gcc/arm-linux-gnueabihf/4.7 - /usr/lib/gcc/arm-linux-gnueabihf/4.8 - /usr/lib/gcc/arm-linux-gnueabihf/4.9 - /usr/lib/gcc/aarch64-linux-gnu/4.9 # Debian arm64 - /usr/lib/gcc/arm-linux-gnueabi/4.7 # Debian armel - /usr/lib/gcc/arm-linux-gnueabi/4.9 - /usr/lib/gcc/x86_64-linux-gnu/5 - /usr/lib/gcc/i686-linux-gnu/5 - /usr/lib/gcc/arm-linux-gnueabi/5 - /usr/lib/gcc/arm-linux-gnueabihf/5 - /usr/lib/gcc/aarch64-linux-gnu/5 - /usr/lib/gcc/x86_64-linux-gnu/6 # Ubuntu 16.10 - /usr/lib/gcc/alpha-linux-gnu/6 - /usr/lib/gcc/aarch64-linux-gnu/6 - /usr/lib/gcc/arm-linux-gnueabi/6 - /usr/lib/gcc/arm-linux-gnueabihf/6 - /usr/lib/gcc/hppa-linux-gnu/6 - /usr/lib/gcc/i686-gnu/6 - /usr/lib/gcc/i686-linux-gnu/6 - /usr/lib/gcc/x86_64-kfreebsd-gnu/6 - /usr/lib/gcc/i686-kfreebsd-gnu/6 - /usr/lib/gcc/m68k-linux-gnu/6 - /usr/lib/gcc/mips-linux-gnu/6 - /usr/lib/gcc/mips64el-linux-gnuabi64/6 - /usr/lib/gcc/mipsel-linux-gnu/6 - /usr/lib/gcc/powerpc-linux-gnu/6 - /usr/lib/gcc/powerpc-linux-gnuspe/6 - /usr/lib/gcc/powerpc64-linux-gnu/6 - /usr/lib/gcc/powerpc64le-linux-gnu/6 - /usr/lib/gcc/s390x-linux-gnu/6 - /usr/lib/gcc/sparc64-linux-gnu/6 - /usr/lib/gcc/x86_64-linux-gnux32/6 - /usr/lib/gcc/sh4-linux-gnu/6 - /usr/lib/gcc/x86_64-linux-gnu/7 # Debian 9 Buster - /usr/lib/gcc/alpha-linux-gnu/7 - /usr/lib/gcc/aarch64-linux-gnu/7 - /usr/lib/gcc/arm-linux-gnueabi/7 - /usr/lib/gcc/arm-linux-gnueabihf/7 - /usr/lib/gcc/hppa-linux-gnu/7 - /usr/lib/gcc/i686-gnu/7 - /usr/lib/gcc/i686-linux-gnu/7 - /usr/lib/gcc/x86_64-kfreebsd-gnu/7 - /usr/lib/gcc/i686-kfreebsd-gnu/7 - /usr/lib/gcc/m68k-linux-gnu/7 - /usr/lib/gcc/mips-linux-gnu/7 - /usr/lib/gcc/mips64el-linux-gnuabi64/7 - /usr/lib/gcc/mipsel-linux-gnu/7 - /usr/lib/gcc/powerpc-linux-gnu/7 - /usr/lib/gcc/powerpc-linux-gnuspe/7 - /usr/lib/gcc/powerpc64-linux-gnu/7 - /usr/lib/gcc/powerpc64le-linux-gnu/7 - /usr/lib/gcc/s390x-linux-gnu/7 - /usr/lib/gcc/sparc64-linux-gnu/7 - /usr/lib/gcc/x86_64-linux-gnux32/7 - /usr/lib/gcc/sh4-linux-gnu/7 - /usr/lib/x86_64-linux-gnu # libgfortran4 - /usr/lib/i386-linux-gnu - /usr/lib/arm-linux-gnueabi - /usr/lib/arm-linux-gnueabihf - /usr/lib/aarch64-linux-gnu - /usr/lib/i386-gnu - /usr/lib/x86_64-kfreebsd-gnu - /usr/lib/i386-kfreebsd-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/mipsel-linux-gnu - /usr/lib/powerpc-linux-gnu - /usr/lib/powerpc64-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/lib/sh4-linux-gnu - /usr/lib/sparc64-linux-gnu - /usr/lib/x86_64-linux-gnux32 - /usr/lib/alpha-linux-gnu - /usr/lib/gcc/x86_64-linux-gnu/8 # libgfortran8 - /usr/lib/gcc/aarch64-linux-gnu/8 - /usr/lib/gcc/arm-linux-gnueabihf/8 - /usr/lib/gcc/i686-linux-gnu/8 - /usr/lib/gcc/powerpc64le-linux-gnu/8 - /usr/lib/gcc/s390x-linux-gnu/8 - /usr/lib/gcc/alpha-linux-gnu/8 - ) +find_library(GFORTRAN NAMES gfortran + PATHS /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib/i386 + /usr/lib/gcc/x86_64-linux-gnu + /usr/lib/gcc/i686-linux-gnu + /usr/lib/gcc/i386-linux-gnu + /usr/lib/gcc/x86_64-linux-gnu/4.6 # Ubuntu 12.04 + /usr/lib/gcc/i686-linux-gnu/4.6 + /usr/lib/gcc/x86_64-linux-gnu/4.7 + /usr/lib/gcc/i686-linux-gnu/4.7 + /usr/lib/gcc/x86_64-linux-gnu/4.8 + /usr/lib/gcc/i686-linux-gnu/4.8 + /usr/lib/gcc/x86_64-linux-gnu/4.9 + /usr/lib/gcc/i686-linux-gnu/4.9 + /usr/lib/gcc/x86_64-redhat-linux/4.7.2 # Fedora 18 + /usr/lib/gcc/i686-redhat-linux/4.7.2 + /usr/lib/gcc/x86_64-redhat-linux/4.8.1 # Fedora 19 + /usr/lib/gcc/x86_64-redhat-linux/4.8.3 # Fedora 20 + /usr/lib/gcc/x86_64-redhat-linux/4.9.1 # Fedora 21 + /usr/lib/gcc/i686-redhat-linux/4.8.1 + /usr/lib/gcc/i686-redhat-linux/4.8.3 + /usr/lib/gcc/i686-redhat-linux/4.9.1 + /usr/lib/gcc/x86_64-redhat-linux/4.4.4 # CentOS 6 + /usr/lib/gcc/i686-redhat-linux/4.4.4 + /usr/lib/gcc/x86_64-redhat-linux/4.8.2 + /usr/lib/gcc/i686-redhat-linux/4.8.2 + /usr/lib/gcc/x86_64-redhat-linux/7 + /usr/lib/gcc/i686-redhat-linux/7 + /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/7 + /usr/lib/gcc/aarch64-redhat-linux/7 + /usr/lib/gcc/i586-suse-linux/4.8 # OpenSUSE 13.1 + /usr/lib/gcc/i586-suse-linux/4.9 + /usr/lib/gcc/x86_64-suse-linux/4.8 + /usr/lib/gcc/x86_64-suse-linux/4.9 + /usr/lib/gcc/i486-linux-gnu # Debian 7 + /usr/lib/gcc/i486-linux-gnu/4.4 + /usr/lib/gcc/i486-linux-gnu/4.6 + /usr/lib/gcc/i486-linux-gnu/4.7 + /usr/lib/gcc/i486-linux-gnu/4.8 + /usr/lib/gcc/i486-linux-gnu/4.9 + /usr/lib/gcc/i586-linux-gnu/4.9 + /usr/lib/gcc/arm-linux-gnueabihf/4.4 # Debian armhf + /usr/lib/gcc/arm-linux-gnueabihf/4.5 + /usr/lib/gcc/arm-linux-gnueabihf/4.6 + /usr/lib/gcc/arm-linux-gnueabihf/4.7 + /usr/lib/gcc/arm-linux-gnueabihf/4.8 + /usr/lib/gcc/arm-linux-gnueabihf/4.9 + /usr/lib/gcc/aarch64-linux-gnu/4.9 # Debian arm64 + /usr/lib/gcc/arm-linux-gnueabi/4.7 # Debian armel + /usr/lib/gcc/arm-linux-gnueabi/4.9 + /usr/lib/gcc/x86_64-linux-gnu/5 + /usr/lib/gcc/i686-linux-gnu/5 + /usr/lib/gcc/arm-linux-gnueabi/5 + /usr/lib/gcc/arm-linux-gnueabihf/5 + /usr/lib/gcc/aarch64-linux-gnu/5 + /usr/lib/gcc/x86_64-linux-gnu/6 # Ubuntu 16.10 + /usr/lib/gcc/alpha-linux-gnu/6 + /usr/lib/gcc/aarch64-linux-gnu/6 + /usr/lib/gcc/arm-linux-gnueabi/6 + /usr/lib/gcc/arm-linux-gnueabihf/6 + /usr/lib/gcc/hppa-linux-gnu/6 + /usr/lib/gcc/i686-gnu/6 + /usr/lib/gcc/i686-linux-gnu/6 + /usr/lib/gcc/x86_64-kfreebsd-gnu/6 + /usr/lib/gcc/i686-kfreebsd-gnu/6 + /usr/lib/gcc/m68k-linux-gnu/6 + /usr/lib/gcc/mips-linux-gnu/6 + /usr/lib/gcc/mips64el-linux-gnuabi64/6 + /usr/lib/gcc/mipsel-linux-gnu/6 + /usr/lib/gcc/powerpc-linux-gnu/6 + /usr/lib/gcc/powerpc-linux-gnuspe/6 + /usr/lib/gcc/powerpc64-linux-gnu/6 + /usr/lib/gcc/powerpc64le-linux-gnu/6 + /usr/lib/gcc/s390x-linux-gnu/6 + /usr/lib/gcc/sparc64-linux-gnu/6 + /usr/lib/gcc/x86_64-linux-gnux32/6 + /usr/lib/gcc/sh4-linux-gnu/6 + /usr/lib/gcc/x86_64-linux-gnu/7 # Debian 9 Buster + /usr/lib/gcc/alpha-linux-gnu/7 + /usr/lib/gcc/aarch64-linux-gnu/7 + /usr/lib/gcc/arm-linux-gnueabi/7 + /usr/lib/gcc/arm-linux-gnueabihf/7 + /usr/lib/gcc/hppa-linux-gnu/7 + /usr/lib/gcc/i686-gnu/7 + /usr/lib/gcc/i686-linux-gnu/7 + /usr/lib/gcc/x86_64-kfreebsd-gnu/7 + /usr/lib/gcc/i686-kfreebsd-gnu/7 + /usr/lib/gcc/m68k-linux-gnu/7 + /usr/lib/gcc/mips-linux-gnu/7 + /usr/lib/gcc/mips64el-linux-gnuabi64/7 + /usr/lib/gcc/mipsel-linux-gnu/7 + /usr/lib/gcc/powerpc-linux-gnu/7 + /usr/lib/gcc/powerpc-linux-gnuspe/7 + /usr/lib/gcc/powerpc64-linux-gnu/7 + /usr/lib/gcc/powerpc64le-linux-gnu/7 + /usr/lib/gcc/s390x-linux-gnu/7 + /usr/lib/gcc/sparc64-linux-gnu/7 + /usr/lib/gcc/x86_64-linux-gnux32/7 + /usr/lib/gcc/sh4-linux-gnu/7 + /usr/lib/x86_64-linux-gnu # libgfortran4 + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/aarch64-linux-gnu + /usr/lib/i386-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib/gcc/x86_64-linux-gnu/8 # libgfortran8 + /usr/lib/gcc/aarch64-linux-gnu/8 + /usr/lib/gcc/arm-linux-gnueabihf/8 + /usr/lib/gcc/i686-linux-gnu/8 + /usr/lib/gcc/powerpc64le-linux-gnu/8 + /usr/lib/gcc/s390x-linux-gnu/8 + /usr/lib/gcc/alpha-linux-gnu/8 +) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GFORTRAN DEFAULT_MSG GFORTRAN) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GFORTRAN DEFAULT_MSG GFORTRAN) diff --git a/cmake/Modules/FindGFlags.cmake b/cmake/Modules/FindGFlags.cmake deleted file mode 100644 index d8279ba00..000000000 --- a/cmake/Modules/FindGFlags.cmake +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) -# -# This file is part of GNSS-SDR. -# -# GNSS-SDR is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# GNSS-SDR is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNSS-SDR. If not, see . - -# - Try to find GFlags -# -# The following variables are optionally searched for defaults -# GFlags_ROOT_DIR: Base directory where all GFlags components are found -# -# The following are set after configuration is done: -# GFlags_FOUND -# GFlags_INCLUDE_DIRS -# GFlags_LIBS -# GFlags_LIBRARY_DIRS - -cmake_minimum_required(VERSION 2.6) - -if(APPLE) - FIND_PATH(GFlags_ROOT_DIR - libgflags.dylib - PATHS - /opt/local/lib - /usr/local/lib - ) -else(APPLE) - FIND_PATH(GFlags_ROOT_DIR - libgflags.so - HINTS - /usr/local/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/i386-linux-gnu - /usr/lib/arm-linux-gnueabihf - /usr/lib/arm-linux-gnueabi - /usr/lib/aarch64-linux-gnu - /usr/lib/mipsel-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/powerpc-linux-gnu - /usr/lib/powerpc64-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/powerpc-linux-gnuspe - /usr/lib/hppa-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/lib/i386-gnu - /usr/lib/hppa-linux-gnu - /usr/lib/x86_64-kfreebsd-gnu - /usr/lib/i386-kfreebsd-gnu - /usr/lib/m68k-linux-gnu - /usr/lib/sh4-linux-gnu - /usr/lib/sparc64-linux-gnu - /usr/lib/x86_64-linux-gnux32 - /usr/lib/alpha-linux-gnu - /usr/lib64 - /usr/lib - ) -endif(APPLE) - -IF(GFlags_ROOT_DIR) - # We are testing only a couple of files in the include directories - FIND_PATH(GFlags_INCLUDE_DIRS - gflags/gflags.h - HINTS - /opt/local/include - /usr/local/include - /usr/include - ${GFlags_ROOT_DIR}/src - ) - - # Find the libraries - SET(GFlags_LIBRARY_DIRS ${GFlags_ROOT_DIR}) - - FIND_LIBRARY(GFlags_lib gflags ${GFlags_LIBRARY_DIRS}) - if(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h) - set(GFLAGS_GREATER_20 TRUE) - else(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h) - set(GFLAGS_GREATER_20 FALSE) - endif(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h) - # set up include and link directory - include_directories(${GFlags_INCLUDE_DIRS}) - link_directories(${GFlags_LIBRARY_DIRS}) - message(STATUS "gflags library found at ${GFlags_lib}") - SET(GFlags_LIBS ${GFlags_lib}) - SET(GFlags_FOUND true) - MARK_AS_ADVANCED(GFlags_INCLUDE_DIRS) -ELSE(GFlags_ROOT_DIR) - MESSAGE(STATUS "Cannot find gflags") - SET(GFlags_FOUND false) -ENDIF(GFlags_ROOT_DIR) diff --git a/cmake/Modules/FindGLOG.cmake b/cmake/Modules/FindGLOG.cmake index 112f2c39d..50231f585 100644 --- a/cmake/Modules/FindGLOG.cmake +++ b/cmake/Modules/FindGLOG.cmake @@ -28,19 +28,19 @@ # GLOG_ROOT - Can be set to Glog install path or Windows build path # -if (NOT DEFINED GLOG_ROOT) - set (GLOG_ROOT /usr /usr/local) -endif (NOT DEFINED GLOG_ROOT) +if(NOT DEFINED GLOG_ROOT) + set(GLOG_ROOT /usr /usr/local) +endif() if(MSVC) - set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/Release) -else(MSVC) - set (LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/lib) -endif(MSVC) + set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/Release) +else() + set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/lib) +endif() macro(_FIND_GLOG_LIBRARIES _var) - find_library(${_var} - NAMES ${ARGN} + find_library(${_var} + NAMES ${ARGN} PATHS ${LIB_PATHS} /usr/local/lib /usr/lib/x86_64-linux-gnu @@ -70,46 +70,46 @@ macro(_FIND_GLOG_LIBRARIES _var) /usr/lib PATH_SUFFIXES lib ) - mark_as_advanced(${_var}) + mark_as_advanced(${_var}) endmacro() macro(_GLOG_APPEND_LIBRARIES _list _release) set(_debug ${_release}_DEBUG) if(${_debug}) - set(${_list} ${${_list}} optimized ${${_release}} debug ${${_debug}}) + set(${_list} ${${_list}} optimized ${${_release}} debug ${${_debug}}) else() - set(${_list} ${${_list}} ${${_release}}) + set(${_list} ${${_list}} ${${_release}}) endif() endmacro() if(MSVC) - find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h - PATHS - ${GLOG_ROOT}/src/windows - ${GLOG_ROOT}/src/windows/glog - ) -else(MSVC) - # Linux/OS X builds - find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h - PATHS - ${GLOG_ROOT}/include/glog - /usr/include/glog - /opt/local/include/glog # default location in Macports - ) -endif(MSVC) + find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h + PATHS + ${GLOG_ROOT}/src/windows + ${GLOG_ROOT}/src/windows/glog + ) +else() + # Linux/OS X builds + find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h + PATHS + ${GLOG_ROOT}/include/glog + /usr/include/glog + /opt/local/include/glog # default location in Macports + ) +endif() # Find the libraries if(MSVC) - _FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.lib) -else(MSVC) - # Linux/OS X builds - if(UNIX) - _FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.so) - endif(UNIX) - if(APPLE) - _FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.dylib) - endif(APPLE) -endif(MSVC) + _find_glog_libraries(GLOG_LIBRARIES libglog.lib) +else() + # Linux/OS X builds + if(UNIX) + _find_glog_libraries(GLOG_LIBRARIES libglog.so) + endif() + if(APPLE) + _find_glog_libraries(GLOG_LIBRARIES libglog.dylib) + endif() +endif() if(GLOG_FOUND) message(STATUS "glog library found at ${GLOG_LIBRARIES}") @@ -117,21 +117,20 @@ endif() # handle the QUIETLY and REQUIRED arguments and set GLOG_FOUND to TRUE if # all listed variables are TRUE -include("${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake") -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Glog DEFAULT_MSG - GLOG_LIBRARIES) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GLOG DEFAULT_MSG GLOG_LIBRARIES) if(MSVC) - string(REGEX REPLACE "/glog$" "" VAR_WITHOUT ${GLOG_INCLUDE_DIR}) - string(REGEX REPLACE "/windows$" "" VAR_WITHOUT ${VAR_WITHOUT}) - set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS} "${VAR_WITHOUT}") - string(REGEX REPLACE "/libglog.lib" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) -else(MSVC) - # Linux/OS X builds - set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR}) - string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) -endif(MSVC) + string(REGEX REPLACE "/glog$" "" VAR_WITHOUT ${GLOG_INCLUDE_DIR}) + string(REGEX REPLACE "/windows$" "" VAR_WITHOUT ${VAR_WITHOUT}) + set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS} "${VAR_WITHOUT}") + string(REGEX REPLACE "/libglog.lib" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) +else() + # Linux/OS X builds + set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR}) + string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) +endif() if(GLOG_FOUND) - # _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES) + # _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES) endif() diff --git a/cmake/Modules/FindGnssSimulator.cmake b/cmake/Modules/FindGNSSSIMULATOR.cmake similarity index 69% rename from cmake/Modules/FindGnssSimulator.cmake rename to cmake/Modules/FindGNSSSIMULATOR.cmake index 88e6c2d27..5d4294548 100644 --- a/cmake/Modules/FindGnssSimulator.cmake +++ b/cmake/Modules/FindGNSSSIMULATOR.cmake @@ -15,14 +15,13 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . - find_program(SW_GENERATOR_BIN gnss_sim - PATHS /usr/bin - /usr/local/bin - /opt/local/bin - ${CMAKE_INSTALL_PREFIX}/bin - PATH_SUFFIXES bin ) + PATHS /usr/bin + /usr/local/bin + /opt/local/bin + ${CMAKE_INSTALL_PREFIX}/bin + PATH_SUFFIXES bin) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNSS-SIMULATOR DEFAULT_MSG SW_GENERATOR_BIN) -MARK_AS_ADVANCED(SW_GENERATOR_BIN) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GNSSSIMULATOR DEFAULT_MSG SW_GENERATOR_BIN) +mark_as_advanced(SW_GENERATOR_BIN) diff --git a/cmake/Modules/FindGnuradio.cmake b/cmake/Modules/FindGNURADIO.cmake similarity index 66% rename from cmake/Modules/FindGnuradio.cmake rename to cmake/Modules/FindGNURADIO.cmake index 0205d5d82..c6811ba7f 100644 --- a/cmake/Modules/FindGnuradio.cmake +++ b/cmake/Modules/FindGNURADIO.cmake @@ -19,15 +19,14 @@ # Find GNU Radio ######################################################################## -INCLUDE(FindPkgConfig) -INCLUDE(FindPackageHandleStandardArgs) +include(FindPkgConfig) +include(FindPackageHandleStandardArgs) # if GR_REQUIRED_COMPONENTS is not defined, it will be set to the following list if(NOT GR_REQUIRED_COMPONENTS) set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS DIGITAL FFT FILTER PMT FEC TRELLIS UHD) endif() - # Allows us to use all .cmake files in this directory list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_LIST_DIR}) @@ -35,18 +34,17 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_LIST_DIR}) set(GNURADIO_ALL_LIBRARIES "") set(GNURADIO_ALL_INCLUDE_DIRS "") -MACRO(LIST_CONTAINS var value) - SET(${var}) - FOREACH(value2 ${ARGN}) - IF (${value} STREQUAL ${value2}) - SET(${var} TRUE) - ENDIF(${value} STREQUAL ${value2}) - ENDFOREACH(value2) -ENDMACRO(LIST_CONTAINS) +macro(LIST_CONTAINS var value) + set(${var}) + foreach(value2 ${ARGN}) + if(${value} STREQUAL ${value2}) + set(${var} TRUE) + endif() + endforeach() +endmacro() function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) - - LIST_CONTAINS(REQUIRED_MODULE ${EXTVAR} ${GR_REQUIRED_COMPONENTS}) + list_contains(REQUIRED_MODULE ${EXTVAR} ${GR_REQUIRED_COMPONENTS}) if(NOT REQUIRED_MODULE) #message("Ignoring GNU Radio Module ${EXTVAR}") return() @@ -55,7 +53,7 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) message(STATUS "Checking for GNU Radio Module: ${EXTVAR}") # check for .pc hints - PKG_CHECK_MODULES(PC_GNURADIO_${EXTVAR} ${PCNAME}) + pkg_check_modules(PC_GNURADIO_${EXTVAR} ${PCNAME}) if(NOT PC_GNURADIO_${EXTVAR}_FOUND) set(PC_GNURADIO_${EXTVAR}_LIBRARIES ${LIBFILE}) @@ -67,7 +65,7 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) set(PC_LIBDIR ${PC_GNURADIO_${EXTVAR}_LIBDIR}) # look for include files - FIND_PATH( + find_path( ${INCVAR_NAME} NAMES ${INCFILE} HINTS $ENV{GNURADIO_RUNTIME_DIR}/include @@ -81,7 +79,7 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) # look for libs foreach(libname ${PC_GNURADIO_${EXTVAR}_LIBRARIES}) - FIND_LIBRARY( + find_library( ${LIBVAR_NAME}_${libname} NAMES ${libname} ${libname}-${PC_GNURADIO_RUNTIME_VERSION} HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib @@ -118,8 +116,8 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) /usr/lib ${GNURADIO_INSTALL_PREFIX}/lib ) - list(APPEND ${LIBVAR_NAME} ${${LIBVAR_NAME}_${libname}}) - endforeach(libname) + list(APPEND ${LIBVAR_NAME} ${${LIBVAR_NAME}_${libname}}) + endforeach() set(${LIBVAR_NAME} ${${LIBVAR_NAME}} PARENT_SCOPE) @@ -131,43 +129,42 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) set(GNURADIO_ALL_INCLUDE_DIRS ${GNURADIO_ALL_INCLUDE_DIRS} ${GNURADIO_${EXTVAR}_INCLUDE_DIRS} PARENT_SCOPE) set(GNURADIO_ALL_LIBRARIES ${GNURADIO_ALL_LIBRARIES} ${GNURADIO_${EXTVAR}_LIBRARIES} PARENT_SCOPE) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_${EXTVAR} DEFAULT_MSG GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS) + find_package_handle_standard_args(GNURADIO_${EXTVAR} DEFAULT_MSG GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS) message(STATUS "GNURADIO_${EXTVAR}_FOUND = ${GNURADIO_${EXTVAR}_FOUND}") set(GNURADIO_${EXTVAR}_FOUND ${GNURADIO_${EXTVAR}_FOUND} PARENT_SCOPE) # generate an error if the module is missing if(NOT GNURADIO_${EXTVAR}_FOUND) - message(STATUS "Required GNU Radio Component: ${EXTVAR} missing!") + message(STATUS "Required GNU Radio Component: ${EXTVAR} missing!") endif() - MARK_AS_ADVANCED(GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS) - + mark_as_advanced(GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS) endfunction() -GR_MODULE(RUNTIME gnuradio-runtime gnuradio/top_block.h gnuradio-runtime) -GR_MODULE(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog) -GR_MODULE(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio) -GR_MODULE(BLOCKS gnuradio-blocks gnuradio/blocks/api.h gnuradio-blocks) -GR_MODULE(CHANNELS gnuradio-channels gnuradio/channels/api.h gnuradio-channels) -GR_MODULE(DIGITAL gnuradio-digital gnuradio/digital/api.h gnuradio-digital) -GR_MODULE(FCD gnuradio-fcd gnuradio/fcd_api.h gnuradio-fcd) -GR_MODULE(FEC gnuradio-fec gnuradio/fec/api.h gnuradio-fec) -GR_MODULE(FFT gnuradio-fft gnuradio/fft/api.h gnuradio-fft) -GR_MODULE(FILTER gnuradio-filter gnuradio/filter/api.h gnuradio-filter) -GR_MODULE(NOAA gnuradio-noaa gnuradio/noaa/api.h gnuradio-noaa) -GR_MODULE(PAGER gnuradio-pager gnuradio/pager/api.h gnuradio-pager) -GR_MODULE(QTGUI gnuradio-qtgui gnuradio/qtgui/api.h gnuradio-qtgui) -GR_MODULE(TRELLIS gnuradio-trellis gnuradio/trellis/api.h gnuradio-trellis) -GR_MODULE(UHD gnuradio-uhd gnuradio/uhd/api.h gnuradio-uhd) -GR_MODULE(VOCODER gnuradio-vocoder gnuradio/vocoder/api.h gnuradio-vocoder) -GR_MODULE(WAVELET gnuradio-wavelet gnuradio/wavelet/api.h gnuradio-wavelet) -GR_MODULE(WXGUI gnuradio-wxgui gnuradio/wxgui/api.h gnuradio-wxgui) -GR_MODULE(PMT gnuradio-runtime pmt/pmt.h gnuradio-pmt) +gr_module(RUNTIME gnuradio-runtime gnuradio/top_block.h gnuradio-runtime) +gr_module(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog) +gr_module(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio) +gr_module(BLOCKS gnuradio-blocks gnuradio/blocks/api.h gnuradio-blocks) +gr_module(CHANNELS gnuradio-channels gnuradio/channels/api.h gnuradio-channels) +gr_module(DIGITAL gnuradio-digital gnuradio/digital/api.h gnuradio-digital) +gr_module(FCD gnuradio-fcd gnuradio/fcd_api.h gnuradio-fcd) +gr_module(FEC gnuradio-fec gnuradio/fec/api.h gnuradio-fec) +gr_module(FFT gnuradio-fft gnuradio/fft/api.h gnuradio-fft) +gr_module(FILTER gnuradio-filter gnuradio/filter/api.h gnuradio-filter) +gr_module(NOAA gnuradio-noaa gnuradio/noaa/api.h gnuradio-noaa) +gr_module(PAGER gnuradio-pager gnuradio/pager/api.h gnuradio-pager) +gr_module(QTGUI gnuradio-qtgui gnuradio/qtgui/api.h gnuradio-qtgui) +gr_module(TRELLIS gnuradio-trellis gnuradio/trellis/api.h gnuradio-trellis) +gr_module(UHD gnuradio-uhd gnuradio/uhd/api.h gnuradio-uhd) +gr_module(VOCODER gnuradio-vocoder gnuradio/vocoder/api.h gnuradio-vocoder) +gr_module(WAVELET gnuradio-wavelet gnuradio/wavelet/api.h gnuradio-wavelet) +gr_module(WXGUI gnuradio-wxgui gnuradio/wxgui/api.h gnuradio-wxgui) +gr_module(PMT gnuradio-runtime pmt/pmt.h gnuradio-pmt) list(REMOVE_DUPLICATES GNURADIO_ALL_INCLUDE_DIRS) list(REMOVE_DUPLICATES GNURADIO_ALL_LIBRARIES) - # Trick to find out that GNU Radio is >= 3.7.4 if pkgconfig is not present +# Trick to find out that GNU Radio is >= 3.7.4 if pkgconfig is not present if(NOT PC_GNURADIO_RUNTIME_VERSION) find_file(GNURADIO_VERSION_GREATER_THAN_373 NAMES gnuradio/blocks/tsb_vector_sink_f.h @@ -178,20 +175,20 @@ if(NOT PC_GNURADIO_RUNTIME_VERSION) /usr/include ${GNURADIO_INSTALL_PREFIX}/include ) - if(GNURADIO_VERSION_GREATER_THAN_373) - set(PC_GNURADIO_RUNTIME_VERSION "3.7.4+") - endif(GNURADIO_VERSION_GREATER_THAN_373) + if(GNURADIO_VERSION_GREATER_THAN_373) + set(PC_GNURADIO_RUNTIME_VERSION "3.7.4+") + endif() - find_file(GNURADIO_VERSION_GREATER_THAN_38 - NAMES gnuradio/filter/mmse_resampler_cc.h - HINTS $ENV{GNURADIO_RUNTIME_DIR}/include - ${CMAKE_INSTALL_PREFIX}/include - ${GNURADIO_INSTALL_PREFIX}/include - PATHS /usr/local/include - /usr/include - ${GNURADIO_INSTALL_PREFIX}/include - ) - if(GNURADIO_VERSION_GREATER_THAN_38) - set(PC_GNURADIO_RUNTIME_VERSION "3.8.0+") - endif(GNURADIO_VERSION_GREATER_THAN_38) -endif(NOT PC_GNURADIO_RUNTIME_VERSION) + find_file(GNURADIO_VERSION_GREATER_THAN_38 + NAMES gnuradio/filter/mmse_resampler_cc.h + HINTS $ENV{GNURADIO_RUNTIME_DIR}/include + ${CMAKE_INSTALL_PREFIX}/include + ${GNURADIO_INSTALL_PREFIX}/include + PATHS /usr/local/include + /usr/include + ${GNURADIO_INSTALL_PREFIX}/include + ) + if(GNURADIO_VERSION_GREATER_THAN_38) + set(PC_GNURADIO_RUNTIME_VERSION "3.8.0+") + endif() +endif() diff --git a/cmake/Modules/FindGperftools.cmake b/cmake/Modules/FindGPERFTOOLS.cmake similarity index 98% rename from cmake/Modules/FindGperftools.cmake rename to cmake/Modules/FindGPERFTOOLS.cmake index 2dc57430e..3278caf92 100644 --- a/cmake/Modules/FindGperftools.cmake +++ b/cmake/Modules/FindGPERFTOOLS.cmake @@ -19,7 +19,7 @@ # # Usage of this module as follows: # -# find_package(Gperftools) +# find_package(GPERFTOOLS) # # Variables used by this module, they can change the default behaviour and need # to be set before calling find_package: @@ -54,7 +54,7 @@ set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args( - Gperftools + GPERFTOOLS DEFAULT_MSG GPERFTOOLS_LIBRARIES GPERFTOOLS_INCLUDE_DIR diff --git a/cmake/Modules/FindGPSTK.cmake b/cmake/Modules/FindGPSTK.cmake index 810bda0d8..c3270a6eb 100644 --- a/cmake/Modules/FindGPSTK.cmake +++ b/cmake/Modules/FindGPSTK.cmake @@ -19,29 +19,22 @@ # Find the native gpstk includes and library # This module defines # GPSTK_INCLUDE_DIR, where to find Rinex3ObsBase.hpp, etc. -# GPSTK_LIBRARIES, libraries to link against to use GPSTK. # GPSTK_FOUND, If false, do not try to use GPSTK. -# also defined, but not for general use are # GPSTK_LIBRARY, where to find the GPSTK library. -FIND_PATH(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp - HINTS /usr/include - /usr/local/include - /opt/local/include ) +find_path(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp + HINTS /usr/include + /usr/local/include + /opt/local/include) -SET(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk) -FIND_LIBRARY(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} - HINTS /usr/lib - /usr/local/lib - /opt/local/lib ) +set(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk) +find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} + HINTS /usr/lib + /usr/local/lib + /opt/local/lib) # handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if # all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR) - -IF(GPSTK_FOUND) - SET( GPSTK_LIBRARIES ${GPSTK_LIBRARY} ) -ENDIF(GPSTK_FOUND) - -MARK_AS_ADVANCED(GPSTK_INCLUDE_DIR GPSTK_LIBRARY) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR) +mark_as_advanced(GPSTK_INCLUDE_DIR GPSTK_LIBRARY GPSTK_INCLUDE_DIR) diff --git a/cmake/Modules/FindGrDbfcttc.cmake b/cmake/Modules/FindGRDBFCTTC.cmake similarity index 82% rename from cmake/Modules/FindGrDbfcttc.cmake rename to cmake/Modules/FindGRDBFCTTC.cmake index 9f4da77f8..4b99f3702 100644 --- a/cmake/Modules/FindGrDbfcttc.cmake +++ b/cmake/Modules/FindGRDBFCTTC.cmake @@ -19,10 +19,10 @@ # Find GR-DBFCTTC Module ######################################################################## -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_GR_DBFCTTC gr-dbfcttc) +include(FindPkgConfig) +pkg_check_modules(PC_GR_DBFCTTC gr-dbfcttc) -FIND_PATH( +find_path( GR_DBFCTTC_INCLUDE_DIRS NAMES dbfcttc/api.h HINTS $ENV{GR_DBFCTTC_DIR}/include @@ -32,7 +32,7 @@ FIND_PATH( /usr/local/include ) -FIND_LIBRARY( +find_library( GR_DBFCTTC_LIBRARIES NAMES gnuradio-dbfcttc HINTS $ENV{GR_DBFCTTC_DIR}/lib @@ -45,6 +45,6 @@ FIND_LIBRARY( /usr/local/lib64 ) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GR_DBFCTTC DEFAULT_MSG GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) -MARK_AS_ADVANCED(GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GRDBFCTTC DEFAULT_MSG GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) +mark_as_advanced(GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGrGN3S.cmake b/cmake/Modules/FindGRGN3S.cmake similarity index 83% rename from cmake/Modules/FindGrGN3S.cmake rename to cmake/Modules/FindGRGN3S.cmake index a1340d4a7..119a75eed 100644 --- a/cmake/Modules/FindGrGN3S.cmake +++ b/cmake/Modules/FindGRGN3S.cmake @@ -19,10 +19,10 @@ # Find GR-GN3S Module ######################################################################## -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_GR_GN3S gr-gn3s) +include(FindPkgConfig) +pkg_check_modules(PC_GR_GN3S gr-gn3s) -FIND_PATH( +find_path( GR_GN3S_INCLUDE_DIRS NAMES gn3s/gn3s_api.h HINTS $ENV{GR_GN3S_DIR}/include @@ -32,7 +32,7 @@ FIND_PATH( /usr/include ) -FIND_LIBRARY( +find_library( GR_GN3S_LIBRARIES NAMES gr-gn3s HINTS $ENV{GR_GN3S_DIR}/lib @@ -45,6 +45,6 @@ FIND_LIBRARY( /usr/lib64 ) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GR_GN3S DEFAULT_MSG GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) -MARK_AS_ADVANCED(GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GRGN3S DEFAULT_MSG GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) +mark_as_advanced(GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGriio.cmake b/cmake/Modules/FindGRIIO.cmake similarity index 88% rename from cmake/Modules/FindGriio.cmake rename to cmake/Modules/FindGRIIO.cmake index 69ee780ec..5575e3122 100644 --- a/cmake/Modules/FindGriio.cmake +++ b/cmake/Modules/FindGRIIO.cmake @@ -15,10 +15,10 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_IIO gnuradio-iio) +include(FindPkgConfig) +pkg_check_modules(PC_IIO gnuradio-iio) -FIND_PATH( +find_path( IIO_INCLUDE_DIRS NAMES gnuradio/iio/api.h HINTS $ENV{IIO_DIR}/include @@ -28,7 +28,7 @@ FIND_PATH( /usr/include ) -FIND_LIBRARY( +find_library( IIO_LIBRARIES NAMES gnuradio-iio HINTS $ENV{IIO_DIR}/lib @@ -63,6 +63,6 @@ FIND_LIBRARY( /usr/lib/sh4-linux-gnu ) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(IIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS) -MARK_AS_ADVANCED(IIO_LIBRARIES IIO_INCLUDE_DIRS) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GRIIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS) +mark_as_advanced(IIO_LIBRARIES IIO_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGrOsmoSDR.cmake b/cmake/Modules/FindGROSMOSDR.cmake similarity index 70% rename from cmake/Modules/FindGrOsmoSDR.cmake rename to cmake/Modules/FindGROSMOSDR.cmake index ae637846a..e78541806 100644 --- a/cmake/Modules/FindGrOsmoSDR.cmake +++ b/cmake/Modules/FindGROSMOSDR.cmake @@ -19,7 +19,7 @@ # # Usage of this module as follows: # -# find_package(GrOsmoSDR) +# find_package(GROSMOSDR) # # Variables used by this module, they can change the default behaviour and need # to be set before calling find_package: @@ -34,20 +34,19 @@ # GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr) # GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers -if(NOT GROSMOSDR_FOUND) - pkg_check_modules (GROSMOSDR_PKG gnuradio-osmosdr) - find_path(GROSMOSDR_INCLUDE_DIR - NAMES osmosdr/source.h - osmosdr/api.h - PATHS - ${GROSMOSDR_PKG_INCLUDE_DIRS} - /usr/include - /usr/local/include - ) +pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr) +find_path(GROSMOSDR_INCLUDE_DIR + NAMES osmosdr/source.h + osmosdr/api.h + PATHS + ${GROSMOSDR_PKG_INCLUDE_DIRS} + /usr/include + /usr/local/include +) - find_library(GROSMOSDR_LIBRARIES - NAMES gnuradio-osmosdr - PATHS +find_library(GROSMOSDR_LIBRARIES + NAMES gnuradio-osmosdr + PATHS ${GROSMOSDR_PKG_LIBRARY_DIRS} /usr/lib /usr/local/lib @@ -75,16 +74,8 @@ if(NOT GROSMOSDR_FOUND) /usr/lib/x86_64-linux-gnux32 /usr/lib/alpha-linux-gnu /usr/lib64 - ) +) - if(GROSMOSDR_INCLUDE_DIR AND GROSMOSDR_LIBRARIES) - set(GROSMOSDR_FOUND TRUE CACHE INTERNAL "gnuradio-osmosdr found") - message(STATUS "Found gnuradio-osmosdr: ${GROSMOSDR_INCLUDE_DIR}, ${GROSMOSDR_LIBRARIES}") - else(GROSMOSDR_INCLUDE_DIR AND GROSMOSDR_LIBRARIES) - set(GROSMOSDR_FOUND FALSE CACHE INTERNAL "gnuradio-osmosdr found") - message(STATUS "gnuradio-osmosdr not found.") - endif(GROSMOSDR_INCLUDE_DIR AND GROSMOSDR_LIBRARIES) - -mark_as_advanced(GROSMOSDR_INCLUDE_DIR GROSMOSDR_LIBRARIES) - -endif(NOT GROSMOSDR_FOUND) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GROSMOSDR DEFAULT_MSG GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR) +mark_as_advanced(GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR) diff --git a/cmake/Modules/Findlibiio.cmake b/cmake/Modules/FindLIBIIO.cmake similarity index 89% rename from cmake/Modules/Findlibiio.cmake rename to cmake/Modules/FindLIBIIO.cmake index e96d420ce..f8b6d10b9 100644 --- a/cmake/Modules/Findlibiio.cmake +++ b/cmake/Modules/FindLIBIIO.cmake @@ -15,10 +15,10 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_LIBIIO libiio) +include(FindPkgConfig) +pkg_check_modules(PC_LIBIIO libiio) -FIND_PATH( +find_path( LIBIIO_INCLUDE_DIRS NAMES iio.h HINTS $ENV{LIBIIO_DIR}/include @@ -29,7 +29,7 @@ FIND_PATH( /opt/local/include ) -FIND_LIBRARY( +find_library( LIBIIO_LIBRARIES NAMES iio libiio.so.0 HINTS $ENV{LIBIIO_DIR}/lib @@ -65,6 +65,6 @@ FIND_LIBRARY( /Library/Frameworks/iio.framework/ ) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) -MARK_AS_ADVANCED(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) +mark_as_advanced(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) diff --git a/cmake/Modules/FindLibOsmoSDR.cmake b/cmake/Modules/FindLIBOSMOSDR.cmake similarity index 70% rename from cmake/Modules/FindLibOsmoSDR.cmake rename to cmake/Modules/FindLIBOSMOSDR.cmake index d0dff5360..72f459e72 100644 --- a/cmake/Modules/FindLibOsmoSDR.cmake +++ b/cmake/Modules/FindLIBOSMOSDR.cmake @@ -19,7 +19,7 @@ # # Usage of this module as follows: # -# find_package(LibOsmoSDR) +# find_package(LIBOSMOSDR) # # # Variables defined by this module: @@ -28,18 +28,16 @@ # LIBOSMOSDR_LIBRARIES The libosmosdr libraries # LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers +pkg_check_modules(LIBOSMOSDR_PKG libosmosdr) +find_path(LIBOSMOSDR_INCLUDE_DIR NAMES osmosdr.h + PATHS + ${LIBOSMOSDR_PKG_INCLUDE_DIRS} + /usr/include + /usr/local/include +) -if(NOT LIBOSMOSDR_FOUND) - pkg_check_modules (LIBOSMOSDR_PKG libosmosdr) - find_path(LIBOSMOSDR_INCLUDE_DIR NAMES osmosdr.h - PATHS - ${LIBOSMOSDR_PKG_INCLUDE_DIRS} - /usr/include - /usr/local/include - ) - - find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr - PATHS +find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr + PATHS ${LIBOSMOSDR_PKG_LIBRARY_DIRS} /usr/lib /usr/local/lib @@ -69,14 +67,6 @@ if(NOT LIBOSMOSDR_FOUND) /usr/lib64 ) - if(LIBOSMOSDR_INCLUDE_DIR AND LIBOSMOSDR_LIBRARIES) - set(LIBOSMOSDR_FOUND TRUE CACHE INTERNAL "libosmosdr found") - message(STATUS "Found libosmosdr: ${LIBOSMOSDR_INCLUDE_DIR}, ${LIBOSMOSDR_LIBRARIES}") - else(LIBOSMOSDR_INCLUDE_DIR AND LIBOSMOSDR_LIBRARIES) - set(LIBOSMOSDR_FOUND FALSE CACHE INTERNAL "libosmosdr found") - message(STATUS "libosmosdr not found.") - endif(LIBOSMOSDR_INCLUDE_DIR AND LIBOSMOSDR_LIBRARIES) - +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LIBOSMOSDR DEFAULT_MSG LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) mark_as_advanced(LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) - -endif(NOT LIBOSMOSDR_FOUND) diff --git a/cmake/Modules/FindLog4cpp.cmake b/cmake/Modules/FindLOG4CPP.cmake similarity index 86% rename from cmake/Modules/FindLog4cpp.cmake rename to cmake/Modules/FindLOG4CPP.cmake index 96ea923f6..b14ac009a 100644 --- a/cmake/Modules/FindLog4cpp.cmake +++ b/cmake/Modules/FindLOG4CPP.cmake @@ -23,10 +23,10 @@ # LOG4CPP_FOUND - True if LOG4CPP found. -if (LOG4CPP_INCLUDE_DIR) +if(LOG4CPP_INCLUDE_DIR) # Already in cache, be silent set(LOG4CPP_FIND_QUIETLY TRUE) -endif () +endif() find_path(LOG4CPP_INCLUDE_DIR log4cpp/Category.hh /opt/local/include @@ -70,26 +70,17 @@ find_library(LOG4CPP_LIBRARY /opt/local/lib ) - -if (LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY) +if(LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY) set(LOG4CPP_FOUND TRUE) set(LOG4CPP_LIBRARIES ${LOG4CPP_LIBRARY} CACHE INTERNAL "" FORCE) set(LOG4CPP_INCLUDE_DIRS ${LOG4CPP_INCLUDE_DIR} CACHE INTERNAL "" FORCE) -else () +else() set(LOG4CPP_FOUND FALSE CACHE INTERNAL "" FORCE) set(LOG4CPP_LIBRARY "" CACHE INTERNAL "" FORCE) set(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE) set(LOG4CPP_INCLUDE_DIR "" CACHE INTERNAL "" FORCE) set(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE) -endif () +endif() -if (LOG4CPP_FOUND) - if (NOT LOG4CPP_FIND_QUIETLY) - message(STATUS "Found LOG4CPP: ${LOG4CPP_LIBRARIES}") - endif () -else () - if (LOG4CPP_FIND_REQUIRED) - message(STATUS "Looked for LOG4CPP libraries named ${LOG4CPPS_NAMES}.") - message(FATAL_ERROR "Could NOT find LOG4CPP library") - endif () -endif () +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LOG4CPP DEFAULT_MSG LOG4CPP_INCLUDE_DIRS LOG4CPP_LIBRARIES) diff --git a/cmake/Modules/FindMATIO.cmake b/cmake/Modules/FindMATIO.cmake index e27ed1f86..e9d66c65b 100644 --- a/cmake/Modules/FindMATIO.cmake +++ b/cmake/Modules/FindMATIO.cmake @@ -21,8 +21,8 @@ # # Once done this will define: # -# MATIO_FOUND - True if MATIO found. -# MATIO_LIBRARIES - MATIO libraries. +# MATIO_FOUND - True if MATIO found. +# MATIO_LIBRARIES - MATIO libraries. # MATIO_INCLUDE_DIRS - where to find matio.h, etc.. # MATIO_VERSION_STRING - version number as a string (e.g.: "1.3.4") # @@ -66,52 +66,50 @@ find_path(MATIO_INCLUDE_DIR NAMES matio.h DOC "The MATIO include directory") find_library(MATIO_LIBRARY NAMES matio DOC "The MATIO library") if(MATIO_INCLUDE_DIR) - # --------------------------------------------------- - # Extract version information from MATIO - # --------------------------------------------------- + # --------------------------------------------------- + # Extract version information from MATIO + # --------------------------------------------------- - # If the file is missing, set all values to 0 - set(MATIO_MAJOR_VERSION 0) - set(MATIO_MINOR_VERSION 0) - set(MATIO_RELEASE_LEVEL 0) + # If the file is missing, set all values to 0 + set(MATIO_MAJOR_VERSION 0) + set(MATIO_MINOR_VERSION 0) + set(MATIO_RELEASE_LEVEL 0) - # new versions of MATIO have `matio_pubconf.h` - if(EXISTS ${MATIO_INCLUDE_DIR}/matio_pubconf.h) - set(MATIO_CONFIG_FILE "matio_pubconf.h") - else() - set(MATIO_CONFIG_FILE "matioConfig.h") - endif() + # new versions of MATIO have `matio_pubconf.h` + if(EXISTS ${MATIO_INCLUDE_DIR}/matio_pubconf.h) + set(MATIO_CONFIG_FILE "matio_pubconf.h") + else() + set(MATIO_CONFIG_FILE "matioConfig.h") + endif() - if(MATIO_CONFIG_FILE) + if(MATIO_CONFIG_FILE) - # Read and parse MATIO config header file for version number - file(STRINGS "${MATIO_INCLUDE_DIR}/${MATIO_CONFIG_FILE}" _matio_HEADER_CONTENTS REGEX "#define MATIO_((MAJOR|MINOR)_VERSION)|(RELEASE_LEVEL) ") + # Read and parse MATIO config header file for version number + file(STRINGS "${MATIO_INCLUDE_DIR}/${MATIO_CONFIG_FILE}" _matio_HEADER_CONTENTS REGEX "#define MATIO_((MAJOR|MINOR)_VERSION)|(RELEASE_LEVEL) ") - foreach(line ${_matio_HEADER_CONTENTS}) - if(line MATCHES "#define ([A-Z_]+) ([0-9]+)") - set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif() - endforeach() + foreach(line ${_matio_HEADER_CONTENTS}) + if(line MATCHES "#define ([A-Z_]+) ([0-9]+)") + set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + endif() + endforeach() - unset(_matio_HEADER_CONTENTS) - endif() + unset(_matio_HEADER_CONTENTS) + endif() - set(MATIO_VERSION_STRING "${MATIO_MAJOR_VERSION}.${MATIO_MINOR_VERSION}.${MATIO_RELEASE_LEVEL}") -endif () - -#================== + set(MATIO_VERSION_STRING "${MATIO_MAJOR_VERSION}.${MATIO_MINOR_VERSION}.${MATIO_RELEASE_LEVEL}") +endif() mark_as_advanced(MATIO_INCLUDE_DIR MATIO_LIBRARY) # handle the QUIETLY and REQUIRED arguments and set MATIO_FOUND to TRUE if # all listed variables are TRUE include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(MATIO REQUIRED_VARS MATIO_LIBRARY MATIO_INCLUDE_DIR VERSION_VAR MATIO_VERSION_STRING) +find_package_handle_standard_args(MATIO REQUIRED_VARS MATIO_LIBRARY MATIO_INCLUDE_DIR VERSION_VAR MATIO_VERSION_STRING) if(MATIO_FOUND) set(MATIO_LIBRARIES ${MATIO_LIBRARY}) set(MATIO_INCLUDE_DIRS ${MATIO_INCLUDE_DIR}) -else(MATIO_FOUND) +else() set(MATIO_LIBRARIES) set(MATIO_INCLUDE_DIRS) -endif(MATIO_FOUND) +endif() diff --git a/cmake/Modules/FindOpenBLAS.cmake b/cmake/Modules/FindOPENBLAS.cmake similarity index 81% rename from cmake/Modules/FindOpenBLAS.cmake rename to cmake/Modules/FindOPENBLAS.cmake index d9ce2a333..0704a9681 100644 --- a/cmake/Modules/FindOpenBLAS.cmake +++ b/cmake/Modules/FindOPENBLAS.cmake @@ -20,7 +20,7 @@ # The following environment variable is optionally searched # OPENBLAS_HOME: Base directory where all OpenBlas components are found -SET(OPEN_BLAS_SEARCH_PATHS /lib/ +set(OPEN_BLAS_SEARCH_PATHS /lib/ /lib64/ /usr/lib /usr/lib64 @@ -32,11 +32,13 @@ SET(OPEN_BLAS_SEARCH_PATHS /lib/ $ENV{OPENBLAS_HOME}/lib ) -FIND_LIBRARY(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS}) +find_library(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS}) -IF (OPENBLAS) - SET(OPENBLAS_FOUND ON) - MESSAGE(STATUS "Found OpenBLAS") -ENDIF (OPENBLAS) +if(OPENBLAS) + set(OPENBLAS_FOUND ON) + message(STATUS "Found OpenBLAS") +endif() -MARK_AS_ADVANCED(OPENBLAS) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OPENBLAS DEFAULT_MSG OPENBLAS) +mark_as_advanced(OPENBLAS) diff --git a/cmake/Modules/FindOPENCL.cmake b/cmake/Modules/FindOPENCL.cmake new file mode 100644 index 000000000..988360c29 --- /dev/null +++ b/cmake/Modules/FindOPENCL.cmake @@ -0,0 +1,110 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# +# This file taken from FindOpenCL project @ http://gitorious.com/findopencl +# +# - Try to find OpenCL +# This module tries to find an OpenCL implementation on your system. It supports +# AMD / ATI, Apple and NVIDIA implementations, but shoudl work, too. +# +# Once done this will define +# OPENCL_FOUND - system has OpenCL +# OPENCL_INCLUDE_DIRS - the OpenCL include directory +# OPENCL_LIBRARIES - link these to use OpenCL +# +# WIN32 should work, but is untested + +include(FindPackageHandleStandardArgs) + +set(OPENCL_VERSION_STRING "0.1.0") +set(OPENCL_VERSION_MAJOR 0) +set(OPENCL_VERSION_MINOR 1) +set(OPENCL_VERSION_PATCH 0) + +if(APPLE) + find_library(OPENCL_LIBRARIES OpenCL DOC "OpenCL lib for OSX") + find_path(OPENCL_INCLUDE_DIRS OpenCL/cl.h DOC "Include for OpenCL on OSX") + find_path(_OPENCL_CPP_INCLUDE_DIRS OpenCL/cl.hpp DOC "Include for OpenCL CPP bindings on OSX") + +else() + if(WIN32) + find_path(OPENCL_INCLUDE_DIRS CL/cl.h) + find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp) + + # The AMD SDK currently installs both x86 and x86_64 libraries + # This is only a hack to find out architecture + if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64") + set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86_64") + set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86_64") + else() + set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86") + set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86") + endif() + + # find out if the user asked for a 64-bit build, and use the corresponding + # 64 or 32 bit NVIDIA library paths to the search: + string(REGEX MATCH "Win64" ISWIN64 ${CMAKE_GENERATOR}) + if("${ISWIN64}" STREQUAL "Win64") + find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/x64) + else() + find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/Win32) + endif() + + get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) + + # On Win32 search relative to the library + find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include) + find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include) + + else() + # Unix style platforms + find_library(OPENCL_LIBRARIES OpenCL + ENV LD_LIBRARY_PATH + ) + + get_filename_component(OPENCL_LIB_DIR ${OPENCL_LIBRARIES} PATH) + get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) + + # The AMD SDK currently does not place its headers + # in /usr/include, therefore also search relative + # to the library + find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include") + find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include") + endif() +endif() + +find_package_handle_standard_args(OPENCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS) + +if(_OPENCL_CPP_INCLUDE_DIRS) + set(OPENCL_HAS_CPP_BINDINGS TRUE) + list(APPEND OPENCL_INCLUDE_DIRS ${_OPENCL_CPP_INCLUDE_DIRS}) + # This is often the same, so clean up + list(REMOVE_DUPLICATES OPENCL_INCLUDE_DIRS) +endif() + +mark_as_advanced( + OPENCL_INCLUDE_DIRS +) + +if(OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES) + set( OPENCL_FOUND TRUE ) + add_definitions( -DOPENCL=1 ) +else() + set( OPENCL_FOUND FALSE ) + add_definitions( -DOPENCL=0 ) +endif() diff --git a/cmake/Modules/FindORC.cmake b/cmake/Modules/FindORC.cmake index 24249b08c..7bd013e67 100644 --- a/cmake/Modules/FindORC.cmake +++ b/cmake/Modules/FindORC.cmake @@ -15,52 +15,52 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . -FIND_PACKAGE(PkgConfig) -PKG_CHECK_MODULES(PC_ORC "orc-0.4 > 0.4.22") +find_package(PkgConfig) +pkg_check_modules(PC_ORC "orc-0.4 > 0.4.22") -FIND_PROGRAM(ORCC_EXECUTABLE orcc - HINTS ${PC_ORC_TOOLSDIR} - PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin) +find_program(ORCC_EXECUTABLE orcc + HINTS ${PC_ORC_TOOLSDIR} + PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin) -FIND_PATH(ORC_INCLUDE_DIR NAMES orc/orc.h - HINTS ${PC_ORC_INCLUDEDIR} - PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4) +find_path(ORC_INCLUDE_DIR NAMES orc/orc.h + HINTS ${PC_ORC_INCLUDEDIR} + PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4) -FIND_PATH(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} - HINTS ${PC_ORC_LIBDIR} - /usr/local/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/i386-linux-gnu - /usr/lib/arm-linux-gnueabihf - /usr/lib/arm-linux-gnueabi - /usr/lib/aarch64-linux-gnu - /usr/lib/mipsel-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/powerpc-linux-gnu - /usr/lib/powerpc64-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/hppa-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/lib64 - /usr/lib - PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) +find_path(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} + HINTS ${PC_ORC_LIBDIR} + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib64 + /usr/lib + PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) -FIND_LIBRARY(ORC_LIB orc-0.4 - HINTS ${PC_ORC_LIBRARY_DIRS} - PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) +find_library(ORC_LIB orc-0.4 + HINTS ${PC_ORC_LIBRARY_DIRS} + PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) -LIST(APPEND ORC_LIBRARY - ${ORC_LIB} +list(APPEND ORC_LIBRARY + ${ORC_LIB} ) -SET(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) -SET(ORC_LIBRARIES ${ORC_LIBRARY}) -SET(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR}) +set(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) +set(ORC_LIBRARIES ${ORC_LIBRARY}) +set(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR}) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE) mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE) diff --git a/cmake/Modules/FindOpenCL.cmake b/cmake/Modules/FindOpenCL.cmake deleted file mode 100644 index 7b2d3f1dd..000000000 --- a/cmake/Modules/FindOpenCL.cmake +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) -# -# This file is part of GNSS-SDR. -# -# GNSS-SDR is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# GNSS-SDR is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNSS-SDR. If not, see . - -# -# This file taken from FindOpenCL project @ http://gitorious.com/findopencl -# -# - Try to find OpenCL -# This module tries to find an OpenCL implementation on your system. It supports -# AMD / ATI, Apple and NVIDIA implementations, but shoudl work, too. -# -# Once done this will define -# OPENCL_FOUND - system has OpenCL -# OPENCL_INCLUDE_DIRS - the OpenCL include directory -# OPENCL_LIBRARIES - link these to use OpenCL -# -# WIN32 should work, but is untested - -FIND_PACKAGE( PackageHandleStandardArgs ) - -SET (OPENCL_VERSION_STRING "0.1.0") -SET (OPENCL_VERSION_MAJOR 0) -SET (OPENCL_VERSION_MINOR 1) -SET (OPENCL_VERSION_PATCH 0) - -IF (APPLE) - - FIND_LIBRARY(OPENCL_LIBRARIES OpenCL DOC "OpenCL lib for OSX") - FIND_PATH(OPENCL_INCLUDE_DIRS OpenCL/cl.h DOC "Include for OpenCL on OSX") - FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS OpenCL/cl.hpp DOC "Include for OpenCL CPP bindings on OSX") - -ELSE (APPLE) - - IF (WIN32) - - FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h) - FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp) - - # The AMD SDK currently installs both x86 and x86_64 libraries - # This is only a hack to find out architecture - IF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" ) - SET(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86_64") - SET(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86_64") - ELSE (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64") - SET(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86") - SET(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86") - ENDIF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" ) - - # find out if the user asked for a 64-bit build, and use the corresponding - # 64 or 32 bit NVIDIA library paths to the search: - STRING(REGEX MATCH "Win64" ISWIN64 ${CMAKE_GENERATOR}) - IF("${ISWIN64}" STREQUAL "Win64") - FIND_LIBRARY(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/x64) - ELSE("${ISWIN64}" STREQUAL "Win64") - FIND_LIBRARY(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/Win32) - ENDIF("${ISWIN64}" STREQUAL "Win64") - - GET_FILENAME_COMPONENT(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) - - # On Win32 search relative to the library - FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include) - FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include) - - ELSE (WIN32) - - # Unix style platforms - FIND_LIBRARY(OPENCL_LIBRARIES OpenCL - ENV LD_LIBRARY_PATH - ) - - GET_FILENAME_COMPONENT(OPENCL_LIB_DIR ${OPENCL_LIBRARIES} PATH) - GET_FILENAME_COMPONENT(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) - - # The AMD SDK currently does not place its headers - # in /usr/include, therefore also search relative - # to the library - FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include") - FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include") - - ENDIF (WIN32) - -ENDIF (APPLE) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS( OpenCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS ) - -IF( _OPENCL_CPP_INCLUDE_DIRS ) - SET( OPENCL_HAS_CPP_BINDINGS TRUE ) - LIST( APPEND OPENCL_INCLUDE_DIRS ${_OPENCL_CPP_INCLUDE_DIRS} ) - # This is often the same, so clean up - LIST( REMOVE_DUPLICATES OPENCL_INCLUDE_DIRS ) -ENDIF( _OPENCL_CPP_INCLUDE_DIRS ) - -MARK_AS_ADVANCED( - OPENCL_INCLUDE_DIRS -) - -IF( OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES ) - SET( OPENCL_FOUND TRUE ) - add_definitions( -DOPENCL=1 ) -ELSE( OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES ) - SET( OPENCL_FOUND FALSE ) - add_definitions( -DOPENCL=0 ) -ENDIF( OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES ) diff --git a/cmake/Modules/FindPCAP.cmake b/cmake/Modules/FindPCAP.cmake index 679d8ef08..d91524ff4 100644 --- a/cmake/Modules/FindPCAP.cmake +++ b/cmake/Modules/FindPCAP.cmake @@ -45,8 +45,8 @@ # PCAP_FOUND - True if pcap found. -IF(EXISTS $ENV{PCAPDIR}) - FIND_PATH(PCAP_INCLUDE_DIR +if(EXISTS $ENV{PCAPDIR}) + find_path(PCAP_INCLUDE_DIR NAMES pcap/pcap.h pcap.h @@ -54,68 +54,60 @@ IF(EXISTS $ENV{PCAPDIR}) $ENV{PCAPDIR} NO_DEFAULT_PATH ) - - FIND_LIBRARY(PCAP_LIBRARY + find_library(PCAP_LIBRARY NAMES pcap PATHS $ENV{PCAPDIR} NO_DEFAULT_PATH ) - - -ELSE(EXISTS $ENV{PCAPDIR}) - FIND_PATH(PCAP_INCLUDE_DIR +else() + find_path(PCAP_INCLUDE_DIR NAMES pcap/pcap.h pcap.h ) - FIND_LIBRARY(PCAP_LIBRARY + find_library(PCAP_LIBRARY NAMES pcap ) +endif() -ENDIF(EXISTS $ENV{PCAPDIR}) +set(PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR}) +set(PCAP_LIBRARIES ${PCAP_LIBRARY}) -SET(PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR}) -SET(PCAP_LIBRARIES ${PCAP_LIBRARY}) +if(PCAP_INCLUDE_DIRS) + message(STATUS "Pcap include dirs set to ${PCAP_INCLUDE_DIRS}") +else() + message(FATAL " Pcap include dirs cannot be found") +endif() -IF(PCAP_INCLUDE_DIRS) - MESSAGE(STATUS "Pcap include dirs set to ${PCAP_INCLUDE_DIRS}") -ELSE(PCAP_INCLUDE_DIRS) - MESSAGE(FATAL " Pcap include dirs cannot be found") -ENDIF(PCAP_INCLUDE_DIRS) - -IF(PCAP_LIBRARIES) - MESSAGE(STATUS "Pcap library set to ${PCAP_LIBRARIES}") -ELSE(PCAP_LIBRARIES) - MESSAGE(FATAL "Pcap library cannot be found") -ENDIF(PCAP_LIBRARIES) +if(PCAP_LIBRARIES) + message(STATUS "Pcap library set to ${PCAP_LIBRARIES}") +else() + message(FATAL "Pcap library cannot be found") +endif() #Functions -INCLUDE(CheckFunctionExists) -SET(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS}) -SET(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES}) -CHECK_FUNCTION_EXISTS("pcap_breakloop" HAVE_PCAP_BREAKLOOP) -CHECK_FUNCTION_EXISTS("pcap_datalink_name_to_val" HAVE_PCAP_DATALINK_NAME_TO_VAL) -CHECK_FUNCTION_EXISTS("pcap_datalink_val_to_name" HAVE_PCAP_DATALINK_VAL_TO_NAME) -CHECK_FUNCTION_EXISTS("pcap_findalldevs" HAVE_PCAP_FINDALLDEVS) -CHECK_FUNCTION_EXISTS("pcap_freecode" HAVE_PCAP_FREECODE) -CHECK_FUNCTION_EXISTS("pcap_get_selectable_fd" HAVE_PCAP_GET_SELECTABLE_FD) -CHECK_FUNCTION_EXISTS("pcap_lib_version" HAVE_PCAP_LIB_VERSION) -CHECK_FUNCTION_EXISTS("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS) -CHECK_FUNCTION_EXISTS("pcap_open_dead" HAVE_PCAP_OPEN_DEAD) -CHECK_FUNCTION_EXISTS("pcap_set_datalink" HAVE_PCAP_SET_DATALINK) +include(CheckFunctionExists) +set(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS}) +set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES}) +check_function_exists("pcap_breakloop" HAVE_PCAP_BREAKLOOP) +check_function_exists("pcap_datalink_name_to_val" HAVE_PCAP_DATALINK_NAME_TO_VAL) +check_function_exists("pcap_datalink_val_to_name" HAVE_PCAP_DATALINK_VAL_TO_NAME) +check_function_exists("pcap_findalldevs" HAVE_PCAP_FINDALLDEVS) +check_function_exists("pcap_freecode" HAVE_PCAP_FREECODE) +check_function_exists("pcap_get_selectable_fd" HAVE_PCAP_GET_SELECTABLE_FD) +check_function_exists("pcap_lib_version" HAVE_PCAP_LIB_VERSION) +check_function_exists("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS) +check_function_exists("pcap_open_dead" HAVE_PCAP_OPEN_DEAD) +check_function_exists("pcap_set_datalink" HAVE_PCAP_SET_DATALINK) - -#Is pcap found ? -IF(PCAP_INCLUDE_DIRS AND PCAP_LIBRARIES) - SET( PCAP_FOUND true ) -ENDIF(PCAP_INCLUDE_DIRS AND PCAP_LIBRARIES) - - -MARK_AS_ADVANCED( +mark_as_advanced( PCAP_LIBRARIES PCAP_INCLUDE_DIRS ) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES) diff --git a/cmake/Modules/FindPUGIXML.cmake b/cmake/Modules/FindPUGIXML.cmake new file mode 100644 index 000000000..da7de4188 --- /dev/null +++ b/cmake/Modules/FindPUGIXML.cmake @@ -0,0 +1,67 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# Find the pugixml XML parsing library. +# +# Sets the usual variables expected for find_package scripts: +# +# PUGIXML_INCLUDE_DIR - header location +# PUGIXML_LIBRARIES - library to link against +# PUGIXML_FOUND - true if pugixml was found. + +find_path(PUGIXML_INCLUDE_DIR + NAMES pugixml.hpp + PATHS ${PUGIXML_HOME}/include + /usr/include + /usr/local/include + /opt/local/include) + +find_library(PUGIXML_LIBRARY + NAMES pugixml + PATHS ${PUGIXML_HOME}/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/i386-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/local/lib + /opt/local/lib + /usr/lib + /usr/lib64 + /usr/local/lib64) + +# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found. +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PUGIXML DEFAULT_MSG PUGIXML_LIBRARY + PUGIXML_INCLUDE_DIR) + +if(PUGIXML_FOUND) + set(PUGIXML_LIBRARIES ${PUGIXML_LIBRARY}) + if(NOT PUGIXML_FIND_QUIETLY) + message(STATUS "PugiXML include = ${PUGIXML_INCLUDE_DIR}") + message(STATUS "PugiXML library = ${PUGIXML_LIBRARY}") + endif() +else() + message(STATUS "PugiXML not found.") +endif() + +mark_as_advanced(PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR) diff --git a/cmake/Modules/FindPugiXML.cmake b/cmake/Modules/FindPugiXML.cmake deleted file mode 100644 index a2b546179..000000000 --- a/cmake/Modules/FindPugiXML.cmake +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) -# -# This file is part of GNSS-SDR. -# -# GNSS-SDR is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# GNSS-SDR is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNSS-SDR. If not, see . - - -# Find the pugixml XML parsing library. -# -# Sets the usual variables expected for find_package scripts: -# -# PUGIXML_INCLUDE_DIR - header location -# PUGIXML_LIBRARIES - library to link against -# PUGIXML_FOUND - true if pugixml was found. - - -find_path (PUGIXML_INCLUDE_DIR - NAMES pugixml.hpp - PATHS ${PUGIXML_HOME}/include - /usr/include - /usr/local/include - /opt/local/include) - -find_library (PUGIXML_LIBRARY - NAMES pugixml - PATHS ${PUGIXML_HOME}/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/aarch64-linux-gnu - /usr/lib/arm-linux-gnueabi - /usr/lib/arm-linux-gnueabihf - /usr/lib/i386-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/mipsel-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/local/lib - /opt/local/lib - /usr/lib - /usr/lib64 - /usr/local/lib64 ) - -# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found. -include (FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS (PugiXML DEFAULT_MSG PUGIXML_LIBRARY - PUGIXML_INCLUDE_DIR) - -if (PUGIXML_FOUND) - set (PUGIXML_LIBRARIES ${PUGIXML_LIBRARY}) - if (NOT PugiXML_FIND_QUIETLY) - message (STATUS "PugiXML include = ${PUGIXML_INCLUDE_DIR}") - message (STATUS "PugiXML library = ${PUGIXML_LIBRARY}") - endif (NOT PugiXML_FIND_QUIETLY) -else (PUGIXML_FOUND) - message (STATUS "PugiXML not found.") -endif(PUGIXML_FOUND) - -mark_as_advanced (PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR) diff --git a/cmake/Modules/FindTeleorbit.cmake b/cmake/Modules/FindTELEORBIT.cmake similarity index 83% rename from cmake/Modules/FindTeleorbit.cmake rename to cmake/Modules/FindTELEORBIT.cmake index e7fdbf5fc..0f78ed339 100644 --- a/cmake/Modules/FindTeleorbit.cmake +++ b/cmake/Modules/FindTELEORBIT.cmake @@ -15,10 +15,10 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_TELEORBIT teleorbit) +include(FindPkgConfig) +pkg_check_modules(PC_TELEORBIT teleorbit) -FIND_PATH( +find_path( TELEORBIT_INCLUDE_DIRS NAMES teleorbit/api.h HINTS $ENV{TELEORBIT_DIR}/include @@ -28,7 +28,7 @@ FIND_PATH( /usr/include ) -FIND_LIBRARY( +find_library( TELEORBIT_LIBRARIES NAMES gnuradio-teleorbit HINTS $ENV{TELEORBIT_DIR}/lib @@ -41,6 +41,6 @@ FIND_LIBRARY( /usr/lib64 ) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) -MARK_AS_ADVANCED(TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) +mark_as_advanced(TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) diff --git a/cmake/Modules/FindUHD.cmake b/cmake/Modules/FindUHD.cmake index 3a245f8a2..fc12a9cdd 100644 --- a/cmake/Modules/FindUHD.cmake +++ b/cmake/Modules/FindUHD.cmake @@ -19,10 +19,10 @@ # Find the library for the USRP Hardware Driver ######################################################################## -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_UHD uhd) +include(FindPkgConfig) +pkg_check_modules(PC_UHD uhd) -FIND_PATH( +find_path( UHD_INCLUDE_DIRS NAMES uhd/config.hpp HINTS $ENV{UHD_DIR}/include @@ -32,7 +32,7 @@ FIND_PATH( ${GNURADIO_INSTALL_PREFIX}/include ) -FIND_LIBRARY( +find_library( UHD_LIBRARIES NAMES uhd HINTS $ENV{UHD_DIR}/lib @@ -66,6 +66,6 @@ FIND_LIBRARY( ${GNURADIO_INSTALL_PREFIX}/lib ) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS) -MARK_AS_ADVANCED(UHD_LIBRARIES UHD_INCLUDE_DIRS) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS) +mark_as_advanced(UHD_LIBRARIES UHD_INCLUDE_DIRS) diff --git a/cmake/Modules/FindVolk.cmake b/cmake/Modules/FindVOLK.cmake similarity index 89% rename from cmake/Modules/FindVolk.cmake rename to cmake/Modules/FindVOLK.cmake index 994ce6e7d..d491c08b0 100644 --- a/cmake/Modules/FindVolk.cmake +++ b/cmake/Modules/FindVOLK.cmake @@ -19,10 +19,10 @@ # Find VOLK (Vector-Optimized Library of Kernels) ######################################################################## -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_VOLK volk) +include(FindPkgConfig) +pkg_check_modules(PC_VOLK volk) -FIND_PATH( +find_path( VOLK_INCLUDE_DIRS NAMES volk/volk.h HINTS $ENV{VOLK_DIR}/include @@ -32,7 +32,7 @@ FIND_PATH( ${CMAKE_INSTALL_PREFIX}/include ) -FIND_LIBRARY( +find_library( VOLK_LIBRARIES NAMES volk HINTS $ENV{VOLK_DIR}/lib @@ -67,7 +67,6 @@ FIND_LIBRARY( ${CMAKE_INSTALL_PREFIX}/lib ) - -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS) -MARK_AS_ADVANCED(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS) +mark_as_advanced(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION) diff --git a/cmake/Modules/FindVolkGnssSdr.cmake b/cmake/Modules/FindVOLKGNSSSDR.cmake similarity index 82% rename from cmake/Modules/FindVolkGnssSdr.cmake rename to cmake/Modules/FindVOLKGNSSSDR.cmake index ecc12685a..cd5cac918 100644 --- a/cmake/Modules/FindVolkGnssSdr.cmake +++ b/cmake/Modules/FindVOLKGNSSSDR.cmake @@ -19,10 +19,10 @@ # Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library ######################################################################## -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_VOLK_GNSSSDR volk_gnsssdr) +include(FindPkgConfig) +pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr) -FIND_PATH( +find_path( VOLK_GNSSSDR_INCLUDE_DIRS NAMES volk_gnsssdr/volk_gnsssdr.h HINTS $ENV{VOLK_GNSSSDR_DIR}/include @@ -32,7 +32,7 @@ FIND_PATH( ${GNURADIO_INSTALL_PREFIX}/include ) -FIND_LIBRARY( +find_library( VOLK_GNSSSDR_LIBRARIES NAMES volk_gnsssdr HINTS $ENV{VOLK_GNSSSDR_DIR}/lib @@ -44,6 +44,6 @@ FIND_LIBRARY( ${GNURADIO_INSTALL_PREFIX}/lib ) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(VOLK_GNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) -MARK_AS_ADVANCED(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) +mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) diff --git a/cmake/Modules/GnsssdrBuildTypes.cmake b/cmake/Modules/GnsssdrBuildTypes.cmake index ae618b758..a80cd0c6b 100644 --- a/cmake/Modules/GnsssdrBuildTypes.cmake +++ b/cmake/Modules/GnsssdrBuildTypes.cmake @@ -56,11 +56,11 @@ function(GNSSSDR_CHECK_BUILD_TYPE settype) string(TOUPPER ${btype} _btype) if(${_settype} STREQUAL ${_btype}) return() # found it; exit cleanly - endif(${_settype} STREQUAL ${_btype}) - endforeach(btype) + endif() + endforeach() # Build type not found; error out message(FATAL_ERROR "Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}") -endfunction(GNSSSDR_CHECK_BUILD_TYPE) +endfunction() ######################################################################## @@ -86,12 +86,12 @@ if(NOT WIN32) "-W" CACHE STRING "Flags used by the shared lib linker during Coverage builds." FORCE) - MARK_AS_ADVANCED( + mark_as_advanced( CMAKE_CXX_FLAGS_COVERAGE CMAKE_C_FLAGS_COVERAGE CMAKE_EXE_LINKER_FLAGS_COVERAGE CMAKE_SHARED_LINKER_FLAGS_COVERAGE) -endif(NOT WIN32) +endif() ######################################################################## @@ -117,12 +117,12 @@ if(NOT WIN32) "-W" CACHE STRING "Flags used by the shared lib linker during NoOptWithASM builds." FORCE) - MARK_AS_ADVANCED( + mark_as_advanced( CMAKE_CXX_FLAGS_NOOPTWITHASM CMAKE_C_FLAGS_NOOPTWITHASM CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM) -endif(NOT WIN32) +endif() @@ -150,12 +150,12 @@ if(NOT WIN32) "-W" CACHE STRING "Flags used by the shared lib linker during O2WithASM builds." FORCE) - MARK_AS_ADVANCED( + mark_as_advanced( CMAKE_CXX_FLAGS_O2WITHASM CMAKE_C_FLAGS_O2WITHASM CMAKE_EXE_LINKER_FLAGS_O2WITHASM CMAKE_SHARED_LINKER_FLAGS_O2WITHASM) -endif(NOT WIN32) +endif() ######################################################################## @@ -182,12 +182,12 @@ if(NOT WIN32) "-W" CACHE STRING "Flags used by the shared lib linker during O3WithASM builds." FORCE) - MARK_AS_ADVANCED( + mark_as_advanced( CMAKE_CXX_FLAGS_O3WITHASM CMAKE_C_FLAGS_O3WITHASM CMAKE_EXE_LINKER_FLAGS_O3WITHASM CMAKE_SHARED_LINKER_FLAGS_O3WITHASM) -endif(NOT WIN32) +endif() ######################################################################## @@ -211,9 +211,9 @@ if(NOT WIN32) "-W" CACHE STRING "Flags used by the shared lib linker during Address Sanitized builds." FORCE) - MARK_AS_ADVANCED( + mark_as_advanced( CMAKE_CXX_FLAGS_ASAN CMAKE_C_FLAGS_ASAN CMAKE_EXE_LINKER_FLAGS_ASAN CMAKE_SHARED_LINKER_ASAN) -endif(NOT WIN32) +endif() diff --git a/cmake/Modules/SetupPython.cmake b/cmake/Modules/SetupPython.cmake index d8bde9efd..f3d59c900 100644 --- a/cmake/Modules/SetupPython.cmake +++ b/cmake/Modules/SetupPython.cmake @@ -36,10 +36,10 @@ macro(GNSSSDR_PYTHON_CHECK_MODULE_RAW desc python_code have) message(STATUS "Python checking for ${desc} - not found") set(${have} FALSE) endif() -endmacro(GNSSSDR_PYTHON_CHECK_MODULE_RAW) +endmacro() macro(GNSSSDR_PYTHON_CHECK_MODULE desc mod cmd have) - GNSSSDR_PYTHON_CHECK_MODULE_RAW( + gnsssdr_python_check_module_raw( "${desc}" " ######################################### try: @@ -49,7 +49,7 @@ except (ImportError, AssertionError): exit(-1) except: pass #########################################" "${have}") -endmacro(GNSSSDR_PYTHON_CHECK_MODULE) +endmacro() ######################################################################## @@ -64,58 +64,56 @@ if(CMAKE_VERSION VERSION_LESS 3.12) string(FIND "${PYTHON_EXECUTABLE}" "python3" IS_PYTHON3) if(IS_PYTHON3 EQUAL -1) find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION} REQUIRED) - else(IS_PYTHON3 EQUAL -1) + else() find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED) - endif(IS_PYTHON3 EQUAL -1) - GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) - GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) - GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) - else(PYTHON_EXECUTABLE) + endif() + gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) + gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) + gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) + else() message(STATUS "PYTHON_EXECUTABLE not set - trying by default python2") message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python3 to build for python3.") find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION}) if(NOT PYTHONINTERP_FOUND) message(STATUS "python2 not found - trying with python3") find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED) - endif(NOT PYTHONINTERP_FOUND) - GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) - GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) - GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) - endif(PYTHON_EXECUTABLE) + endif() + gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) + gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) + gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) + endif() find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT) -else(CMAKE_VERSION VERSION_LESS 3.12) - find_package (Python3 COMPONENTS Interpreter) +else() + find_package(Python3 COMPONENTS Interpreter) if(Python3_FOUND) set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR}) - GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) - GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) - GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) - endif(Python3_FOUND) + gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) + gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) + gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) + endif() if(NOT Python3_FOUND OR NOT MAKO_FOUND OR NOT SIX_FOUND) find_package(Python2 COMPONENTS Interpreter) if(Python2_FOUND) set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE}) set(PYTHON_VERSION_MAJOR ${Python2_VERSION_MAJOR}) - GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) - GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) - GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) - endif(Python2_FOUND) - endif(NOT Python3_FOUND OR NOT MAKO_FOUND OR NOT SIX_FOUND) -endif(CMAKE_VERSION VERSION_LESS 3.12) + gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) + gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) + gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) + endif() + endif() +endif() if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3) set(PYTHON3 TRUE) -endif(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3) - +endif() if(CMAKE_CROSSCOMPILING) set(QA_PYTHON_EXECUTABLE "/usr/bin/python") -else(CMAKE_CROSSCOMPILING) +else() set(QA_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}) -endif(CMAKE_CROSSCOMPILING) +endif() - -#make the path to the executable appear in the cmake gui +# make the path to the executable appear in the cmake gui set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter") set(QA_PYTHON_EXECUTABLE ${QA_PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter for QA tests") diff --git a/cmake/Modules/TestForARM.cmake b/cmake/Modules/TestForARM.cmake index 254c5bc41..05a5c172e 100644 --- a/cmake/Modules/TestForARM.cmake +++ b/cmake/Modules/TestForARM.cmake @@ -22,8 +22,8 @@ # - Anthony Arnold ############################################################################## -if (__TEST_FOR_ARM_INCLUDED) - return () +if(__TEST_FOR_ARM_INCLUDED) + return() endif() set(__TEST_FOR_ARM_INCLUDED TRUE) @@ -31,27 +31,27 @@ set(__TEST_FOR_ARM_INCLUDED TRUE) # output variable if found. function(check_arm_version ppdef input_string version output_var) string(REGEX MATCH "${ppdef}" _VERSION_MATCH "${input_string}") - if (NOT _VERSION_MATCH STREQUAL "") + if(NOT _VERSION_MATCH STREQUAL "") set(${output_var} "${version}" PARENT_SCOPE) - endif(NOT _VERSION_MATCH STREQUAL "") + endif() endfunction() message(STATUS "Checking for ARM") -set (IS_ARM NO) -set (ARM_VERSION "") +set(IS_ARM NO) +set(ARM_VERSION "") -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") execute_process(COMMAND echo "int main(){}" COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dM -E - OUTPUT_VARIABLE TEST_FOR_ARM_RESULTS) string(REGEX MATCH "__arm" ARM_FOUND "${TEST_FOR_ARM_RESULTS}") if(ARM_FOUND STREQUAL "") - string(REGEX MATCH "__aarch64" ARM_FOUND "${TEST_FOR_ARM_RESULTS}") - endif(ARM_FOUND STREQUAL "") + string(REGEX MATCH "__aarch64" ARM_FOUND "${TEST_FOR_ARM_RESULTS}") + endif() - if (NOT ARM_FOUND STREQUAL "") + if(NOT ARM_FOUND STREQUAL "") set(IS_ARM YES) message(STATUS "ARM system detected") @@ -83,22 +83,21 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") check_arm_version("__ARM_ARCH_8A" ${TEST_FOR_ARM_RESULTS} "armv8-a" ARM_VERSION) # anything else just define as arm - if (ARM_VERSION STREQUAL "") + if(ARM_VERSION STREQUAL "") message(STATUS "Couldn't detect ARM version. Setting to 'arm'") set(ARM_VERSION "arm") - else (ARM_VERSION STREQUAL "") + else() message(STATUS "ARM version ${ARM_VERSION} detected") - endif (ARM_VERSION STREQUAL "") - - else (NOT ARM_FOUND STREQUAL "") + endif() + else() message(STATUS "System is not ARM") - endif(NOT ARM_FOUND STREQUAL "") + endif() -else (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +else() # TODO: Other compilers message(STATUS "Not detecting ARM on non-GNUCXX compiler. Defaulting to false") message(STATUS "If you are compiling for ARM, set IS_ARM=ON manually") -endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +endif() set(IS_ARM ${IS_ARM} CACHE BOOL "Compiling for ARM") set(ARM_VERSION ${ARM_VERSION} CACHE STRING "ARM version") diff --git a/cmake/Modules/TestForSSE.cmake b/cmake/Modules/TestForSSE.cmake index 135a434ef..23b2d16a8 100644 --- a/cmake/Modules/TestForSSE.cmake +++ b/cmake/Modules/TestForSSE.cmake @@ -22,21 +22,20 @@ # - Anthony Arnold ############################################################################### - -function (test_for_sse h_file result_var name) - if (NOT DEFINED ${result_var}) +function(test_for_sse h_file result_var name) + if(NOT DEFINED ${result_var}) execute_process(COMMAND echo "#include <${h_file}>" - COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -c -x c++ - - RESULT_VARIABLE COMPILE_RESULT - OUTPUT_QUIET ERROR_QUIET) + COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -c -x c++ - + RESULT_VARIABLE COMPILE_RESULT + OUTPUT_QUIET ERROR_QUIET) set(detected 0) - if (COMPILE_RESULT EQUAL 0) + if(COMPILE_RESULT EQUAL 0) message(STATUS "Detected ${name}") set(detected 1) - endif(COMPILE_RESULT EQUAL 0) + endif() set(${result_var} ${detected} CACHE INTERNAL "${name} Available") - endif (NOT DEFINED ${result_var}) -endfunction(test_for_sse) + endif() +endfunction() message(STATUS "Testing for SIMD extensions") diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index 6fc6b11ed..d7cde103e 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -32,21 +32,21 @@ if(ENABLE_RAW_UDP) endif(ENABLE_RAW_UDP) if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) - find_package(Griio REQUIRED) - if(NOT IIO_FOUND) + find_package(GRIIO REQUIRED) + if(NOT GRIIO_FOUND) message(STATUS "gnuradio-iio not found, its installation is required.") message(STATUS "Please build and install the following projects:") message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled.") - endif(NOT IIO_FOUND) + endif(NOT GRIIO_FOUND) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) if(ENABLE_AD9361) - find_package(libiio REQUIRED) + find_package(LIBIIO REQUIRED) if(NOT LIBIIO_FOUND) message(STATUS "libiio not found, its installation is required.") message(STATUS "Please build and install the following projects:") @@ -64,10 +64,10 @@ if(ENABLE_PLUTOSDR) ############################################## # ADALM-PLUTO (Analog Devices Inc.) ############################################## - if(IIO_FOUND) + if(GRIIO_FOUND) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} plutosdr_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} plutosdr_signal_source.h) - endif(IIO_FOUND) + endif(GRIIO_FOUND) endif(ENABLE_PLUTOSDR) @@ -75,10 +75,10 @@ if(ENABLE_FMCOMMS2) ############################################### # FMCOMMS2 based SDR Hardware ############################################### - if(IIO_FOUND) + if(GRIIO_FOUND) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} fmcomms2_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} fmcomms2_signal_source.h) - endif(IIO_FOUND) + endif(GRIIO_FOUND) endif(ENABLE_FMCOMMS2) if(ENABLE_AD9361) @@ -97,11 +97,11 @@ if(ENABLE_GN3S) ############################################## # GN3S (USB dongle) ############################################## - find_package(GrGN3S REQUIRED) - if(NOT GR_GN3S_FOUND) + find_package(GRGN3S REQUIRED) + if(NOT GRGN3S_FOUND) message(" gr-gn3s not found, install it from https://github.com/gnss-sdr/gr-gn3s ") message(FATAL_ERROR "gr-gn3s required for building gnss-sdr with this option enabled") - endif(NOT GR_GN3S_FOUND) + endif(NOT GRGN3S_FOUND) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_GN3S_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_GN3S_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gn3s_signal_source.cc) @@ -113,7 +113,7 @@ if(ENABLE_FLEXIBAND) ############################################## # TELEORBIT FLEXIBAND FRONTEND ADAPTER ############################################## - find_package(Teleorbit REQUIRED) + find_package(TELEORBIT REQUIRED) if(NOT TELEORBIT_FOUND) message(FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter") endif(NOT TELEORBIT_FOUND) @@ -134,11 +134,11 @@ if(ENABLE_ARRAY) ############################################## # DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE ############################################## - find_package(GrDbfcttc REQUIRED) - if(NOT GR_DBFCTTC_FOUND) + find_package(GRDBFCTTC REQUIRED) + if(NOT GRDBFCTTC_FOUND) message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc ") message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled") - endif(NOT GR_DBFCTTC_FOUND) + endif(NOT GRDBFCTTC_FOUND) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_DBFCTTC_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_DBFCTTC_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc) diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index ef15705fe..759858e08 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -17,21 +17,21 @@ # if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) - find_package(Griio REQUIRED) - if(NOT IIO_FOUND) + find_package(GRIIO REQUIRED) + if(NOT GRIIO_FOUND) message(STATUS "gnuradio-iio not found, its installation is required.") message(STATUS "Please build and install the following projects:") message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled") - endif(NOT IIO_FOUND) + endif(NOT GRIIO_FOUND) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) - find_package(libiio REQUIRED) + find_package(LIBIIO REQUIRED) if(NOT LIBIIO_FOUND) message(STATUS "libiio not found, its installation is required.") message(STATUS "Please build and install the following projects:") diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 98c69c627..f1d5efef3 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -190,12 +190,12 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) else(ENABLE_FPGA) set(CROSS_INSTALL_DIR "") endif(ENABLE_FPGA) - find_package(GnssSimulator QUIET) - if(GNSS-SIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) + find_package(GNSSSIMULATOR QUIET) + if(GNSSSIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n") add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv") - else(GNSS-SIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) + else(GNSSSIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) ExternalProject_Add( gnss-sim GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator @@ -221,7 +221,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n") add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv") endif(ENABLE_INSTALL_TESTS) - endif(GNSS-SIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) + endif(GNSSSIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) ################################################################################ # Local installation of GPSTk http://www.gpstk.org/ From 6ae19e35c9a015b7cd000d3640d15d650533b6ae Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 21 Nov 2018 10:59:19 +0100 Subject: [PATCH 111/143] Fix warning (unused variable) --- src/core/receiver/control_thread.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 3d537c43e..12148d811 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -911,7 +911,6 @@ std::vector> ControlThread::get_visible_sats(time alm_t rtklib_alm = alm_to_rtklib(it->second); double r_sat[3]; double clock_bias_s; - double sat_pos_variance_m2; alm2pos(gps_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); double Az, El, dist_m; arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; @@ -932,7 +931,6 @@ std::vector> ControlThread::get_visible_sats(time alm_t rtklib_alm = alm_to_rtklib(it->second); double r_sat[3]; double clock_bias_s; - double sat_pos_variance_m2; alm2pos(gps_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); double Az, El, dist_m; arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; From 19fffc1e5ae5ca609aa36def6b6dc7a56dfce410 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 21 Nov 2018 15:28:17 +0100 Subject: [PATCH 112/143] Fix building in some Debian-based distributions --- src/tests/CMakeLists.txt | 5 +++-- src/utils/rinex2assist/CMakeLists.txt | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index f1d5efef3..0d8dec6f8 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -234,6 +234,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") endif("${TOOLCHAIN_ARG}" STREQUAL "") include(GNUInstallDirs) + string(REGEX REPLACE /[^/]*$ "" LIBDIR ${CMAKE_INSTALL_LIBDIR}) if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add( gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} @@ -253,13 +254,13 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF - BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} UPDATE_COMMAND "" PATCH_COMMAND "" ) endif(CMAKE_VERSION VERSION_LESS 3.2) set(GPSTK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers") - set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) set(GPSTK_BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") set(OWN_GPSTK True) diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 0fb8db8d1..01c888381 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -19,7 +19,8 @@ find_package(GPSTK QUIET) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) include(GNUInstallDirs) - set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} ) + string(REGEX REPLACE /[^/]*$ "" LIBDIR ${CMAKE_INSTALL_LIBDIR}) + set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} ) set(GPSTK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include ) endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) From b0ba2469346aec76fb022f36b855fa31f2103b3a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 22 Nov 2018 00:35:21 +0100 Subject: [PATCH 113/143] Apply some style rules to CMake scripts --- src/algorithms/PVT/adapters/CMakeLists.txt | 40 ++-- .../PVT/gnuradio_blocks/CMakeLists.txt | 30 +-- src/algorithms/PVT/libs/CMakeLists.txt | 80 ++++--- .../acquisition/adapters/CMakeLists.txt | 73 +++--- .../gnuradio_blocks/CMakeLists.txt | 57 +++-- .../acquisition/libs/CMakeLists.txt | 40 ++-- .../channel/adapters/CMakeLists.txt | 34 ++- src/algorithms/channel/libs/CMakeLists.txt | 22 +- .../conditioner/adapters/CMakeLists.txt | 26 +-- .../data_type_adapter/adapters/CMakeLists.txt | 34 +-- .../gnuradio_blocks/CMakeLists.txt | 30 ++- .../input_filter/adapters/CMakeLists.txt | 62 ++--- .../gnuradio_blocks/CMakeLists.txt | 38 +-- src/algorithms/libs/CMakeLists.txt | 120 +++++----- src/algorithms/libs/rtklib/CMakeLists.txt | 87 ++++--- .../observables/adapters/CMakeLists.txt | 24 +- .../gnuradio_blocks/CMakeLists.txt | 49 ++-- .../resampler/adapters/CMakeLists.txt | 38 +-- .../resampler/gnuradio_blocks/CMakeLists.txt | 29 ++- .../signal_generator/adapters/CMakeLists.txt | 38 +-- .../gnuradio_blocks/CMakeLists.txt | 36 +-- .../signal_source/adapters/CMakeLists.txt | 130 +++++------ .../gnuradio_blocks/CMakeLists.txt | 51 ++-- .../signal_source/libs/CMakeLists.txt | 84 +++---- .../telemetry_decoder/adapters/CMakeLists.txt | 35 +-- .../gnuradio_blocks/CMakeLists.txt | 65 +++--- .../telemetry_decoder/libs/CMakeLists.txt | 29 ++- .../libs/libswiftcnav/CMakeLists.txt | 30 ++- .../tracking/adapters/CMakeLists.txt | 139 ++++++----- .../tracking/gnuradio_blocks/CMakeLists.txt | 123 ++++++---- src/algorithms/tracking/libs/CMakeLists.txt | 98 ++++---- src/core/libs/CMakeLists.txt | 2 +- src/core/libs/supl/CMakeLists.txt | 14 +- src/core/monitor/CMakeLists.txt | 17 +- src/core/receiver/CMakeLists.txt | 219 +++++++++--------- src/core/system_parameters/CMakeLists.txt | 156 +++++++------ src/main/CMakeLists.txt | 110 ++++----- src/utils/front-end-cal/CMakeLists.txt | 93 ++++---- src/utils/rinex2assist/CMakeLists.txt | 16 +- 39 files changed, 1322 insertions(+), 1076 deletions(-) diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt index cc63d7032..74ef5d92a 100644 --- a/src/algorithms/PVT/adapters/CMakeLists.txt +++ b/src/algorithms/PVT/adapters/CMakeLists.txt @@ -18,33 +18,39 @@ if(Boost_VERSION LESS 105800) - add_definitions(-DOLD_BOOST=1) + add_definitions(-DOLD_BOOST=1) endif(Boost_VERSION LESS 105800) set(PVT_ADAPTER_SOURCES - rtklib_pvt.cc + rtklib_pvt.cc ) set(PVT_ADAPTER_HEADERS - rtklib_pvt.h + rtklib_pvt.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${ARMADILLO_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) add_library(pvt_adapters ${PVT_ADAPTER_SOURCES} ${PVT_ADAPTER_HEADERS}) + source_group(Headers FILES ${PVT_ADAPTER_HEADERS}) -target_link_libraries(pvt_adapters pvt_gr_blocks ${ARMADILLO_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES}) + +target_link_libraries(pvt_adapters + pvt_gr_blocks + ${ARMADILLO_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} +) diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt index adaac0125..bbe9ed19d 100644 --- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt @@ -18,30 +18,30 @@ if(Boost_VERSION LESS 105800) - add_definitions(-DOLD_BOOST=1) + add_definitions(-DOLD_BOOST=1) endif(Boost_VERSION LESS 105800) set(PVT_GR_BLOCKS_SOURCES - rtklib_pvt_cc.cc + rtklib_pvt_cc.cc ) set(PVT_GR_BLOCKS_HEADERS - rtklib_pvt_cc.h + rtklib_pvt_cc.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${ARMADILLO_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) add_library(pvt_gr_blocks ${PVT_GR_BLOCKS_SOURCES} ${PVT_GR_BLOCKS_HEADERS}) diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index ed69cabab..ad1944c21 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -19,47 +19,46 @@ add_definitions( -DGNSS_SDR_VERSION="${VERSION}" ) set(PVT_LIB_SOURCES - pvt_solution.cc - ls_pvt.cc - hybrid_ls_pvt.cc - kml_printer.cc - gpx_printer.cc - rinex_printer.cc - nmea_printer.cc - rtcm_printer.cc - geojson_printer.cc - rtklib_solver.cc - pvt_conf.cc + pvt_solution.cc + ls_pvt.cc + hybrid_ls_pvt.cc + kml_printer.cc + gpx_printer.cc + rinex_printer.cc + nmea_printer.cc + rtcm_printer.cc + geojson_printer.cc + rtklib_solver.cc + pvt_conf.cc ) set(PVT_LIB_HEADERS - pvt_solution.h - ls_pvt.h - hybrid_ls_pvt.h - kml_printer.h - gpx_printer.h - rinex_printer.h - nmea_printer.h - rtcm_printer.h - geojson_printer.h - rtklib_solver.h - pvt_conf.h + pvt_solution.h + ls_pvt.h + hybrid_ls_pvt.h + kml_printer.h + gpx_printer.h + rinex_printer.h + nmea_printer.h + rtcm_printer.h + geojson_printer.h + rtklib_solver.h + pvt_conf.h ) - include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${Boost_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib + ${Boost_INCLUDE_DIRS} + ${ARMADILLO_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${MATIO_INCLUDE_DIRS} ) list(SORT PVT_LIB_HEADERS) @@ -69,9 +68,16 @@ add_library(pvt_lib ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS}) source_group(Headers FILES ${PVT_LIB_HEADERS}) if(MATIO_FOUND) - add_dependencies(pvt_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE}) + add_dependencies(pvt_lib + glog-${glog_RELEASE} + armadillo-${armadillo_RELEASE} + ) else(MATIO_FOUND) - add_dependencies(pvt_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} matio-${GNSSSDR_MATIO_LOCAL_VERSION}) + add_dependencies(pvt_lib + glog-${glog_RELEASE} + armadillo-${armadillo_RELEASE} + matio-${GNSSSDR_MATIO_LOCAL_VERSION} + ) endif(MATIO_FOUND) target_link_libraries( diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index b27cb9cb3..f1e21185d 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -55,45 +55,60 @@ set(ACQ_ADAPTER_HEADERS glonass_l2_ca_pcps_acquisition.h ) - if(ENABLE_FPGA) - set(ACQ_ADAPTER_SOURCES ${ACQ_ADAPTER_SOURCES} gps_l1_ca_pcps_acquisition_fpga.cc - gps_l2_m_pcps_acquisition_fpga.cc - galileo_e1_pcps_ambiguous_acquisition_fpga.cc - galileo_e5a_pcps_acquisition_fpga.cc - gps_l5i_pcps_acquisition_fpga.cc) - - set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} gps_l1_ca_pcps_acquisition_fpga.h - gps_l2_m_pcps_acquisition_fpga.h - galileo_e1_pcps_ambiguous_acquisition_fpga.h - galileo_e5a_pcps_acquisition_fpga.h - gps_l5i_pcps_acquisition_fpga.h) + set(ACQ_ADAPTER_SOURCES ${ACQ_ADAPTER_SOURCES} + gps_l1_ca_pcps_acquisition_fpga.cc + gps_l2_m_pcps_acquisition_fpga.cc + galileo_e1_pcps_ambiguous_acquisition_fpga.cc + galileo_e5a_pcps_acquisition_fpga.cc + gps_l5i_pcps_acquisition_fpga.cc + ) + set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} + gps_l1_ca_pcps_acquisition_fpga.h + gps_l2_m_pcps_acquisition_fpga.h + galileo_e1_pcps_ambiguous_acquisition_fpga.h + galileo_e5a_pcps_acquisition_fpga.h + gps_l5i_pcps_acquisition_fpga.h + ) endif(ENABLE_FPGA) if(OPENCL_FOUND) - set(ACQ_ADAPTER_SOURCES ${ACQ_ADAPTER_SOURCES} gps_l1_ca_pcps_opencl_acquisition.cc) - set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} gps_l1_ca_pcps_opencl_acquisition.h) + set(ACQ_ADAPTER_SOURCES + ${ACQ_ADAPTER_SOURCES} + gps_l1_ca_pcps_opencl_acquisition.cc + ) + set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} + gps_l1_ca_pcps_opencl_acquisition.h + ) endif(OPENCL_FOUND) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${GNURADIO_BLOCKS_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${ARMADILLO_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${GNURADIO_BLOCKS_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} ) list(SORT ACQ_ADAPTER_HEADERS) list(SORT ACQ_ADAPTER_SOURCES) add_library(acq_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS}) source_group(Headers FILES ${ACQ_ADAPTER_HEADERS}) -target_link_libraries(acq_adapters acquisition_lib gnss_sp_libs gnss_sdr_flags acq_gr_blocks ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES}) +target_link_libraries(acq_adapters + acquisition_lib + gnss_sp_libs + gnss_sdr_flags + acq_gr_blocks + ${Boost_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} +) diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index bd1800d35..a6d5f6a45 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -50,28 +50,27 @@ if(OPENCL_FOUND) endif(OPENCL_FOUND) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${ARMADILLO_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${MATIO_INCLUDE_DIRS} ) - if(OPENCL_FOUND) - include_directories( ${OPENCL_INCLUDE_DIRS} ) + include_directories(${OPENCL_INCLUDE_DIRS}) if(OS_IS_MACOSX) - set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") + set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") else(OS_IS_MACOSX) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) endif(OS_IS_MACOSX) endif(OPENCL_FOUND) @@ -81,9 +80,29 @@ add_library(acq_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS}) source_group(Headers FILES ${ACQ_GR_BLOCKS_HEADERS}) if(ENABLE_FPGA) - target_link_libraries(acq_gr_blocks acquisition_lib gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES}) + target_link_libraries(acq_gr_blocks + acquisition_lib + gnss_sp_libs + gnss_system_parameters + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${VOLK_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${OPT_LIBRARIES} + ${OPT_ACQUISITION_LIBRARIES} + ) else(ENABLE_FPGA) - target_link_libraries(acq_gr_blocks gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES} ${MATIO_LIBRARIES}) + target_link_libraries(acq_gr_blocks + gnss_sp_libs + gnss_system_parameters + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${VOLK_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${OPT_LIBRARIES} + ${MATIO_LIBRARIES} + ${OPT_ACQUISITION_LIBRARIES} + ) endif(ENABLE_FPGA) if(NOT VOLK_GNSSSDR_FOUND) diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt index c8720e226..9ffc0e07a 100644 --- a/src/algorithms/acquisition/libs/CMakeLists.txt +++ b/src/algorithms/acquisition/libs/CMakeLists.txt @@ -17,19 +17,19 @@ # if(ENABLE_FPGA) - set(ACQUISITION_LIB_SOURCES fpga_acquisition.cc ) - set(ACQUISITION_LIB_HEADERS fpga_acquisition.h ) - include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${VOLK_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ) + set(ACQUISITION_LIB_SOURCES fpga_acquisition.cc) + set(ACQUISITION_LIB_HEADERS fpga_acquisition.h) + include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${VOLK_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} + ) endif(ENABLE_FPGA) set(ACQUISITION_LIB_HEADERS ${ACQUISITION_LIB_HEADERS} acq_conf.h) @@ -38,9 +38,19 @@ set(ACQUISITION_LIB_SOURCES ${ACQUISITION_LIB_SOURCES} acq_conf.cc) list(SORT ACQUISITION_LIB_HEADERS) list(SORT ACQUISITION_LIB_SOURCES) -add_library(acquisition_lib ${ACQUISITION_LIB_SOURCES} ${ACQUISITION_LIB_HEADERS}) +add_library(acquisition_lib + ${ACQUISITION_LIB_SOURCES} + ${ACQUISITION_LIB_HEADERS} +) + source_group(Headers FILES ${ACQUISITION_LIB_HEADERS}) -target_link_libraries(acquisition_lib ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES}) + +target_link_libraries(acquisition_lib + ${VOLK_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} +) + if(VOLK_GNSSSDR_FOUND) add_dependencies(acquisition_lib glog-${glog_RELEASE}) else(VOLK_GNSSSDR_FOUND) diff --git a/src/algorithms/channel/adapters/CMakeLists.txt b/src/algorithms/channel/adapters/CMakeLists.txt index d3b754e97..65591834c 100644 --- a/src/algorithms/channel/adapters/CMakeLists.txt +++ b/src/algorithms/channel/adapters/CMakeLists.txt @@ -20,18 +20,28 @@ set(CHANNEL_ADAPTER_SOURCES channel.cc) set(CHANNEL_ADAPTER_HEADERS channel.h) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} +) + +add_library(channel_adapters + ${CHANNEL_ADAPTER_SOURCES} + ${CHANNEL_ADAPTER_HEADERS} ) -add_library(channel_adapters ${CHANNEL_ADAPTER_SOURCES} ${CHANNEL_ADAPTER_HEADERS}) source_group(Headers FILES ${CHANNEL_ADAPTER_HEADERS}) -target_link_libraries(channel_adapters channel_fsm ${GNURADIO_RUNTIME_LIBRARIES} ${Boost_LIBRARIES} gnss_sdr_flags) + +target_link_libraries(channel_adapters + channel_fsm + ${GNURADIO_RUNTIME_LIBRARIES} + ${Boost_LIBRARIES} + gnss_sdr_flags +) diff --git a/src/algorithms/channel/libs/CMakeLists.txt b/src/algorithms/channel/libs/CMakeLists.txt index 7965cea70..70bee59f9 100644 --- a/src/algorithms/channel/libs/CMakeLists.txt +++ b/src/algorithms/channel/libs/CMakeLists.txt @@ -19,23 +19,23 @@ set(CHANNEL_FSM_SOURCES channel_fsm.cc channel_msg_receiver_cc.cc - ) +) set(CHANNEL_FSM_HEADERS channel_fsm.h channel_msg_receiver_cc.h - ) +) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) list(SORT CHANNEL_FSM_HEADERS) diff --git a/src/algorithms/conditioner/adapters/CMakeLists.txt b/src/algorithms/conditioner/adapters/CMakeLists.txt index def069263..38d606824 100644 --- a/src/algorithms/conditioner/adapters/CMakeLists.txt +++ b/src/algorithms/conditioner/adapters/CMakeLists.txt @@ -18,25 +18,25 @@ set(COND_ADAPTER_SOURCES - signal_conditioner.cc - array_signal_conditioner.cc + signal_conditioner.cc + array_signal_conditioner.cc ) set(COND_ADAPTER_HEADERS - signal_conditioner.h - array_signal_conditioner.h + signal_conditioner.h + array_signal_conditioner.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) list(SORT COND_ADAPTER_HEADERS) diff --git a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt index 419e1a271..1977f7a5a 100644 --- a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt @@ -23,7 +23,7 @@ set(DATATYPE_ADAPTER_SOURCES ibyte_to_complex.cc ibyte_to_cshort.cc ishort_to_cshort.cc - ishort_to_complex.cc + ishort_to_complex.cc ) set(DATATYPE_ADAPTER_HEADERS @@ -32,25 +32,33 @@ set(DATATYPE_ADAPTER_HEADERS ibyte_to_complex.h ibyte_to_cshort.h ishort_to_cshort.h - ishort_to_complex.h + ishort_to_complex.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} ) list(SORT DATATYPE_ADAPTER_HEADERS) list(SORT DATATYPE_ADAPTER_SOURCES) -add_library(datatype_adapters ${DATATYPE_ADAPTER_SOURCES} ${DATATYPE_ADAPTER_HEADERS}) +add_library(datatype_adapters + ${DATATYPE_ADAPTER_SOURCES} + ${DATATYPE_ADAPTER_HEADERS} +) + source_group(Headers FILES ${DATATYPE_ADAPTER_HEADERS}) add_dependencies(datatype_adapters glog-${glog_RELEASE}) -target_link_libraries(datatype_adapters data_type_gr_blocks ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES}) +target_link_libraries(datatype_adapters + data_type_gr_blocks + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} +) diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt index 2253ce5f8..b4f429db9 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt @@ -18,26 +18,34 @@ set(DATA_TYPE_GR_BLOCKS_SOURCES - interleaved_byte_to_complex_byte.cc - interleaved_short_to_complex_short.cc - interleaved_byte_to_complex_short.cc + interleaved_byte_to_complex_byte.cc + interleaved_short_to_complex_short.cc + interleaved_byte_to_complex_short.cc ) set(DATA_TYPE_GR_BLOCKS_HEADERS - interleaved_byte_to_complex_byte.h - interleaved_short_to_complex_short.h - interleaved_byte_to_complex_short.h + interleaved_byte_to_complex_byte.h + interleaved_short_to_complex_short.h + interleaved_byte_to_complex_short.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} ) list(SORT DATA_TYPE_GR_BLOCKS_HEADERS) list(SORT DATA_TYPE_GR_BLOCKS_SOURCES) -add_library(data_type_gr_blocks ${DATA_TYPE_GR_BLOCKS_SOURCES} ${DATA_TYPE_GR_BLOCKS_HEADERS}) +add_library(data_type_gr_blocks + ${DATA_TYPE_GR_BLOCKS_SOURCES} + ${DATA_TYPE_GR_BLOCKS_HEADERS} +) + source_group(Headers FILES ${DATA_TYPE_GR_BLOCKS_HEADERS}) -target_link_libraries(data_type_gr_blocks ${GNURADIO_RUNTIME_LIBRARIES} ${VOLK_LIBRARIES}) + +target_link_libraries(data_type_gr_blocks + ${GNURADIO_RUNTIME_LIBRARIES} + ${VOLK_LIBRARIES} +) diff --git a/src/algorithms/input_filter/adapters/CMakeLists.txt b/src/algorithms/input_filter/adapters/CMakeLists.txt index 959c1ba88..7f33f4072 100644 --- a/src/algorithms/input_filter/adapters/CMakeLists.txt +++ b/src/algorithms/input_filter/adapters/CMakeLists.txt @@ -17,43 +17,53 @@ # set(INPUT_FILTER_ADAPTER_SOURCES - fir_filter.cc - freq_xlating_fir_filter.cc - beamformer_filter.cc - pulse_blanking_filter.cc - notch_filter.cc - notch_filter_lite.cc + fir_filter.cc + freq_xlating_fir_filter.cc + beamformer_filter.cc + pulse_blanking_filter.cc + notch_filter.cc + notch_filter_lite.cc ) set(INPUT_FILTER_ADAPTER_HEADERS - fir_filter.h - freq_xlating_fir_filter.h - beamformer_filter.h - pulse_blanking_filter.h - notch_filter.h - notch_filter_lite.h + fir_filter.h + freq_xlating_fir_filter.h + beamformer_filter.h + pulse_blanking_filter.h + notch_filter.h + notch_filter_lite.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} ) -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) - add_definitions( -DGR_GREATER_38=1 ) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + add_definitions(-DGR_GREATER_38=1) +endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") list(SORT INPUT_FILTER_ADAPTER_HEADERS) list(SORT INPUT_FILTER_ADAPTER_SOURCES) -add_library(input_filter_adapters ${INPUT_FILTER_ADAPTER_SOURCES} ${INPUT_FILTER_ADAPTER_HEADERS}) +add_library(input_filter_adapters + ${INPUT_FILTER_ADAPTER_SOURCES} + ${INPUT_FILTER_ADAPTER_HEADERS} +) + source_group(Headers FILES ${INPUT_FILTER_ADAPTER_HEADERS}) add_dependencies(input_filter_adapters glog-${glog_RELEASE} gnss_sp_libs) -target_link_libraries(input_filter_adapters input_filter_gr_blocks ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} gnss_sp_libs) +target_link_libraries(input_filter_adapters + input_filter_gr_blocks + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + gnss_sp_libs +) diff --git a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt index 75f903868..ea3de1cb6 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt @@ -18,35 +18,41 @@ set(INPUT_FILTER_GR_BLOCKS_SOURCES - beamformer.cc - pulse_blanking_cc.cc - notch_cc.cc - notch_lite_cc.cc + beamformer.cc + pulse_blanking_cc.cc + notch_cc.cc + notch_lite_cc.cc ) set(INPUT_FILTER_GR_BLOCKS_HEADERS - beamformer.h - pulse_blanking_cc.h - notch_cc.h - notch_lite_cc.h + beamformer.h + pulse_blanking_cc.h + notch_cc.h + notch_lite_cc.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${GNURADIO_BLOCKS_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${GNURADIO_BLOCKS_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} ) list(SORT INPUT_FILTER_GR_BLOCKS_HEADERS) list(SORT INPUT_FILTER_GR_BLOCKS_SOURCES) -add_library(input_filter_gr_blocks ${INPUT_FILTER_GR_BLOCKS_SOURCES} ${INPUT_FILTER_GR_BLOCKS_HEADERS}) +add_library(input_filter_gr_blocks + ${INPUT_FILTER_GR_BLOCKS_SOURCES} + ${INPUT_FILTER_GR_BLOCKS_HEADERS}) + source_group(Headers FILES ${INPUT_FILTER_GR_BLOCKS_HEADERS}) -target_link_libraries(input_filter_gr_blocks ${GNURADIO_FILTER_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${LOG4CPP_LIBRARIES}) +target_link_libraries(input_filter_gr_blocks + ${GNURADIO_FILTER_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${LOG4CPP_LIBRARIES}) if(NOT VOLK_GNSSSDR_FOUND) add_dependencies(input_filter_gr_blocks volk_gnsssdr_module glog-${glog_RELEASE}) diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index de4efc084..29869ea6a 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -19,79 +19,77 @@ add_subdirectory(rtklib) set(GNSS_SPLIBS_SOURCES - gps_l2c_signal.cc - gps_l5_signal.cc - galileo_e1_signal_processing.cc - gnss_sdr_valve.cc - gnss_sdr_sample_counter.cc - gnss_signal_processing.cc - gps_sdr_signal_processing.cc - glonass_l1_signal_processing.cc - glonass_l2_signal_processing.cc - pass_through.cc - galileo_e5_signal_processing.cc - complex_byte_to_float_x2.cc - byte_x2_to_complex_byte.cc - cshort_to_float_x2.cc - short_x2_to_cshort.cc - complex_float_to_complex_byte.cc - conjugate_cc.cc - conjugate_sc.cc - conjugate_ic.cc - gnss_sdr_create_directory.cc - geofunctions.cc + gps_l2c_signal.cc + gps_l5_signal.cc + galileo_e1_signal_processing.cc + gnss_sdr_valve.cc + gnss_sdr_sample_counter.cc + gnss_signal_processing.cc + gps_sdr_signal_processing.cc + glonass_l1_signal_processing.cc + glonass_l2_signal_processing.cc + pass_through.cc + galileo_e5_signal_processing.cc + complex_byte_to_float_x2.cc + byte_x2_to_complex_byte.cc + cshort_to_float_x2.cc + short_x2_to_cshort.cc + complex_float_to_complex_byte.cc + conjugate_cc.cc + conjugate_sc.cc + conjugate_ic.cc + gnss_sdr_create_directory.cc + geofunctions.cc ) set(GNSS_SPLIBS_HEADERS - gps_l2c_signal.h - gps_l5_signal.h - galileo_e1_signal_processing.h - gnss_sdr_valve.h - gnss_sdr_sample_counter.h - gnss_signal_processing.h - gps_sdr_signal_processing.h - glonass_l1_signal_processing.h - glonass_l2_signal_processing.h - pass_through.h - galileo_e5_signal_processing.h - complex_byte_to_float_x2.h - byte_x2_to_complex_byte.h - cshort_to_float_x2.h - short_x2_to_cshort.h - complex_float_to_complex_byte.h - conjugate_cc.h - conjugate_sc.h - conjugate_ic.h - gnss_sdr_create_directory.h - gnss_circular_deque.h - geofunctions.h + gps_l2c_signal.h + gps_l5_signal.h + galileo_e1_signal_processing.h + gnss_sdr_valve.h + gnss_sdr_sample_counter.h + gnss_signal_processing.h + gps_sdr_signal_processing.h + glonass_l1_signal_processing.h + glonass_l2_signal_processing.h + pass_through.h + galileo_e5_signal_processing.h + complex_byte_to_float_x2.h + byte_x2_to_complex_byte.h + cshort_to_float_x2.h + short_x2_to_cshort.h + complex_float_to_complex_byte.h + conjugate_cc.h + conjugate_sc.h + conjugate_ic.h + gnss_sdr_create_directory.h + gnss_circular_deque.h + geofunctions.h ) - if(ENABLE_FPGA) - set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} + set(GNSS_SPLIBS_SOURCES + ${GNSS_SPLIBS_SOURCES} gnss_sdr_time_counter.cc gnss_sdr_fpga_sample_counter.cc - ) - - set(GNSS_SPLIBS_HEADERS ${GNSS_SPLIBS_HEADERS} + ) + set(GNSS_SPLIBS_HEADERS + ${GNSS_SPLIBS_HEADERS} gnss_sdr_time_counter.h gnss_sdr_fpga_sample_counter.h - ) - + ) endif(ENABLE_FPGA) if(OPENCL_FOUND) set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} - opencl/fft_execute.cc # Needs OpenCL - opencl/fft_setup.cc # Needs OpenCL - opencl/fft_kernelstring.cc # Needs OpenCL + opencl/fft_execute.cc # Needs OpenCL + opencl/fft_setup.cc # Needs OpenCL + opencl/fft_kernelstring.cc # Needs OpenCL ) - set(GNSS_SPLIBS_HEADERS ${GNSS_SPLIBS_HEADERS} - opencl/fft_execute.h # Needs OpenCL - opencl/fft_setup.h # Needs OpenCL - opencl/fft_kernelstring.h # Needs OpenCL + opencl/fft_execute.h # Needs OpenCL + opencl/fft_setup.h # Needs OpenCL + opencl/fft_kernelstring.h # Needs OpenCL ) endif(OPENCL_FOUND) @@ -111,7 +109,7 @@ include_directories( ) if(OPENCL_FOUND) - include_directories( ${OPENCL_INCLUDE_DIRS} ) + include_directories(${OPENCL_INCLUDE_DIRS}) if(OS_IS_MACOSX) set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") else(OS_IS_MACOSX) @@ -127,7 +125,8 @@ list(SORT GNSS_SPLIBS_SOURCES) add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS}) source_group(Headers FILES ${GNSS_SPLIBS_HEADERS}) -target_link_libraries(gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES} +target_link_libraries(gnss_sp_libs + ${GNURADIO_RUNTIME_LIBRARIES} ${VOLK_LIBRARIES} ${ORC_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} ${GFlags_LIBS} @@ -140,7 +139,8 @@ target_link_libraries(gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES} ) if(NOT VOLK_GNSSSDR_FOUND) - add_dependencies(gnss_sp_libs volk_gnsssdr_module armadillo-${armadillo_RELEASE}) + add_dependencies(gnss_sp_libs volk_gnsssdr_module + armadillo-${armadillo_RELEASE}) else(NOT VOLK_GNSSSDR_FOUND) add_dependencies(gnss_sp_libs armadillo-${armadillo_RELEASE}) endif(NOT VOLK_GNSSSDR_FOUND) diff --git a/src/algorithms/libs/rtklib/CMakeLists.txt b/src/algorithms/libs/rtklib/CMakeLists.txt index ff81a9fb8..c2f7ff6f8 100644 --- a/src/algorithms/libs/rtklib/CMakeLists.txt +++ b/src/algorithms/libs/rtklib/CMakeLists.txt @@ -16,60 +16,59 @@ # along with GNSS-SDR. If not, see . # -add_definitions( -DGNSS_SDR_VERSION="${VERSION}" ) +add_definitions(-DGNSS_SDR_VERSION="${VERSION}") set(RTKLIB_LIB_SOURCES - rtklib_rtkcmn.cc - rtklib_ephemeris.cc - rtklib_preceph.cc - rtklib_sbas.cc - rtklib_ionex.cc - rtklib_pntpos.cc - rtklib_ppp.cc - rtklib_tides.cc - rtklib_lambda.cc - rtklib_rtkpos.cc - rtklib_conversions.cc - rtklib_stream.cc - rtklib_rtksvr.cc - rtklib_solution.cc - rtklib_rtcm.cc - rtklib_rtcm2.cc - rtklib_rtcm3.cc + rtklib_rtkcmn.cc + rtklib_ephemeris.cc + rtklib_preceph.cc + rtklib_sbas.cc + rtklib_ionex.cc + rtklib_pntpos.cc + rtklib_ppp.cc + rtklib_tides.cc + rtklib_lambda.cc + rtklib_rtkpos.cc + rtklib_conversions.cc + rtklib_stream.cc + rtklib_rtksvr.cc + rtklib_solution.cc + rtklib_rtcm.cc + rtklib_rtcm2.cc + rtklib_rtcm3.cc ) set(RTKLIB_LIB_HEADERS - rtklib_rtkcmn.h - rtklib_ephemeris.h - rtklib_preceph.h - rtklib_sbas.h - rtklib_ionex.h - rtklib_pntpos.h - rtklib_ppp.h - rtklib_tides.h - rtklib_lambda.h - rtklib_rtkpos.h - rtklib_conversions.h - rtklib_stream.h - rtklib_rtksvr.h - rtklib_solution.h - rtklib_rtcm.h - rtklib_rtcm2.h - rtklib_rtcm3.h - rtklib.h + rtklib_rtkcmn.h + rtklib_ephemeris.h + rtklib_preceph.h + rtklib_sbas.h + rtklib_ionex.h + rtklib_pntpos.h + rtklib_ppp.h + rtklib_tides.h + rtklib_lambda.h + rtklib_rtkpos.h + rtklib_conversions.h + rtklib_stream.h + rtklib_rtksvr.h + rtklib_solution.h + rtklib_rtcm.h + rtklib_rtcm2.h + rtklib_rtcm3.h + rtklib.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${Boost_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${Boost_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} ) - list(SORT RTKLIB_LIB_HEADERS) list(SORT RTKLIB_LIB_SOURCES) diff --git a/src/algorithms/observables/adapters/CMakeLists.txt b/src/algorithms/observables/adapters/CMakeLists.txt index d3c5b6933..ef0df1d7d 100644 --- a/src/algorithms/observables/adapters/CMakeLists.txt +++ b/src/algorithms/observables/adapters/CMakeLists.txt @@ -17,24 +17,24 @@ # set(OBS_ADAPTER_SOURCES - hybrid_observables.cc + hybrid_observables.cc ) set(OBS_ADAPTER_HEADERS - hybrid_observables.h + hybrid_observables.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) add_library(obs_adapters ${OBS_ADAPTER_SOURCES} ${OBS_ADAPTER_HEADERS}) diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index 82c5bc243..5a1a55e8d 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -17,32 +17,49 @@ # set(OBS_GR_BLOCKS_SOURCES - hybrid_observables_cc.cc + hybrid_observables_cc.cc ) set(OBS_GR_BLOCKS_HEADERS - hybrid_observables_cc.h + hybrid_observables_cc.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${ARMADILLO_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${MATIO_INCLUDE_DIRS} ) add_library(obs_gr_blocks ${OBS_GR_BLOCKS_SOURCES} ${OBS_GR_BLOCKS_HEADERS}) + source_group(Headers FILES ${OBS_GR_BLOCKS_HEADERS}) + if(MATIO_FOUND) - add_dependencies(obs_gr_blocks gnss_sp_libs glog-${glog_RELEASE} armadillo-${armadillo_RELEASE}) + add_dependencies(obs_gr_blocks + gnss_sp_libs + glog-${glog_RELEASE} + armadillo-${armadillo_RELEASE} + ) else(MATIO_FOUND) - add_dependencies(obs_gr_blocks gnss_sp_libs glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} matio-${GNSSSDR_MATIO_LOCAL_VERSION}) + add_dependencies(obs_gr_blocks + gnss_sp_libs + glog-${glog_RELEASE} + armadillo-${armadillo_RELEASE} + matio-${GNSSSDR_MATIO_LOCAL_VERSION} + ) endif(MATIO_FOUND) -target_link_libraries(obs_gr_blocks gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES} ${ARMADILLO_LIBRARIES} ${MATIO_LIBRARIES}) + +target_link_libraries(obs_gr_blocks + gnss_sp_libs + ${GNURADIO_RUNTIME_LIBRARIES} + ${ARMADILLO_LIBRARIES} + ${MATIO_LIBRARIES} +) diff --git a/src/algorithms/resampler/adapters/CMakeLists.txt b/src/algorithms/resampler/adapters/CMakeLists.txt index 41f5dd8d1..0f6c92684 100644 --- a/src/algorithms/resampler/adapters/CMakeLists.txt +++ b/src/algorithms/resampler/adapters/CMakeLists.txt @@ -16,35 +16,39 @@ # along with GNSS-SDR. If not, see . # + set(RESAMPLER_ADAPTER_SOURCES - direct_resampler_conditioner.cc - mmse_resampler_conditioner.cc + direct_resampler_conditioner.cc + mmse_resampler_conditioner.cc ) - set(RESAMPLER_ADAPTER_HEADERS - direct_resampler_conditioner.h - mmse_resampler_conditioner.h + direct_resampler_conditioner.h + mmse_resampler_conditioner.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/gnuradio_blocks - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/gnuradio_blocks + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} ) - -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) - add_definitions( -DGR_GREATER_38=1 ) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + add_definitions(-DGR_GREATER_38=1) +endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") list(SORT RESAMPLER_ADAPTER_HEADERS) list(SORT RESAMPLER_ADAPTER_SOURCES) -add_library(resampler_adapters ${RESAMPLER_ADAPTER_SOURCES} ${RESAMPLER_ADAPTER_HEADERS}) +add_library(resampler_adapters + ${RESAMPLER_ADAPTER_SOURCES} + ${RESAMPLER_ADAPTER_HEADERS} +) + source_group(Headers FILES ${RESAMPLER_ADAPTER_HEADERS}) + target_link_libraries(resampler_adapters resampler_gr_blocks) diff --git a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt index 26233f3fd..ae570d644 100644 --- a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt @@ -18,28 +18,33 @@ set(RESAMPLER_GR_BLOCKS_SOURCES - direct_resampler_conditioner_cc.cc - direct_resampler_conditioner_cs.cc - direct_resampler_conditioner_cb.cc + direct_resampler_conditioner_cc.cc + direct_resampler_conditioner_cs.cc + direct_resampler_conditioner_cb.cc ) set(RESAMPLER_GR_BLOCKS_HEADERS - direct_resampler_conditioner_cc.h - direct_resampler_conditioner_cs.h - direct_resampler_conditioner_cb.h + direct_resampler_conditioner_cc.h + direct_resampler_conditioner_cs.h + direct_resampler_conditioner_cb.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} ) list(SORT RESAMPLER_GR_BLOCKS_HEADERS) list(SORT RESAMPLER_GR_BLOCKS_SOURCES) -add_library(resampler_gr_blocks ${RESAMPLER_GR_BLOCKS_SOURCES} ${RESAMPLER_GR_BLOCKS_HEADERS}) +add_library(resampler_gr_blocks + ${RESAMPLER_GR_BLOCKS_SOURCES} + ${RESAMPLER_GR_BLOCKS_HEADERS} +) + source_group(Headers FILES ${RESAMPLER_GR_BLOCKS_HEADERS}) + add_dependencies(resampler_gr_blocks glog-${glog_RELEASE}) diff --git a/src/algorithms/signal_generator/adapters/CMakeLists.txt b/src/algorithms/signal_generator/adapters/CMakeLists.txt index c248171d9..fe793203b 100644 --- a/src/algorithms/signal_generator/adapters/CMakeLists.txt +++ b/src/algorithms/signal_generator/adapters/CMakeLists.txt @@ -20,22 +20,28 @@ set(SIGNAL_GENERATOR_ADAPTER_SOURCES signal_generator.cc) set(SIGNAL_GENERATOR_ADAPTER_HEADERS signal_generator.h) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_generator/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_generator/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) -add_library(signal_generator_adapters ${SIGNAL_GENERATOR_ADAPTER_SOURCES} ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) -source_group(Headers FILES ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) -target_link_libraries(signal_generator_adapters gnss_sp_libs - signal_generator_blocks - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} +add_library(signal_generator_adapters + ${SIGNAL_GENERATOR_ADAPTER_SOURCES} + ${SIGNAL_GENERATOR_ADAPTER_HEADERS} +) + +source_group(Headers FILES ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) + +target_link_libraries(signal_generator_adapters + gnss_sp_libs + signal_generator_blocks + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} ) diff --git a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt index b8df4e29f..eade10e00 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt @@ -20,23 +20,31 @@ set(SIGNAL_GENERATOR_BLOCK_SOURCES signal_generator_c.cc) set(SIGNAL_GENERATOR_BLOCK_HEADERS signal_generator_c.h) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} +) + +add_library(signal_generator_blocks + ${SIGNAL_GENERATOR_BLOCK_SOURCES} + ${SIGNAL_GENERATOR_BLOCK_HEADERS} ) -add_library(signal_generator_blocks ${SIGNAL_GENERATOR_BLOCK_SOURCES} ${SIGNAL_GENERATOR_BLOCK_HEADERS}) source_group(Headers FILES ${SIGNAL_GENERATOR_BLOCK_HEADERS}) -target_link_libraries(signal_generator_blocks gnss_system_parameters gnss_sp_libs - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} + +target_link_libraries(signal_generator_blocks + gnss_system_parameters + gnss_sp_libs + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${ORC_LIBRARIES} ) if(VOLK_GNSSSDR_FOUND) diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index d7cde103e..83062ea66 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -81,6 +81,7 @@ if(ENABLE_FMCOMMS2) endif(GRIIO_FOUND) endif(ENABLE_FMCOMMS2) + if(ENABLE_AD9361) ############################################### # AD9361 DIRECT TO FPGA Hardware @@ -92,57 +93,55 @@ if(ENABLE_AD9361) endif(ENABLE_AD9361) - if(ENABLE_GN3S) - ############################################## - # GN3S (USB dongle) - ############################################## - find_package(GRGN3S REQUIRED) - if(NOT GRGN3S_FOUND) - message(" gr-gn3s not found, install it from https://github.com/gnss-sdr/gr-gn3s ") - message(FATAL_ERROR "gr-gn3s required for building gnss-sdr with this option enabled") - endif(NOT GRGN3S_FOUND) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_GN3S_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_GN3S_INCLUDE_DIRS}) - set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gn3s_signal_source.cc) - set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gn3s_signal_source.h) + ############################################## + # GN3S (USB dongle) + ############################################## + find_package(GRGN3S REQUIRED) + if(NOT GRGN3S_FOUND) + message(" gr-gn3s not found, install it from https://github.com/gnss-sdr/gr-gn3s ") + message(FATAL_ERROR "gr-gn3s required for building gnss-sdr with this option enabled") + endif(NOT GRGN3S_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_GN3S_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_GN3S_INCLUDE_DIRS}) + set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gn3s_signal_source.cc) + set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gn3s_signal_source.h) endif(ENABLE_GN3S) if(ENABLE_FLEXIBAND) - ############################################## - # TELEORBIT FLEXIBAND FRONTEND ADAPTER - ############################################## - find_package(TELEORBIT REQUIRED) - if(NOT TELEORBIT_FOUND) - message(FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter") - endif(NOT TELEORBIT_FOUND) - - # Set up variables - set(FLEXIBAND_DRIVER_INCLUDE_DIRS - ${OPT_DRIVER_INCLUDE_DIRS} - ${TELEORBIT_INCLUDE_DIR}/teleorbit - ) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${TELEORBIT_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${FLEXIBAND_DRIVER_INCLUDE_DIRS}) - set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} flexiband_signal_source.cc) - set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} flexiband_signal_source.h) + ############################################## + # TELEORBIT FLEXIBAND FRONTEND ADAPTER + ############################################## + find_package(TELEORBIT REQUIRED) + if(NOT TELEORBIT_FOUND) + message(FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter") + endif(NOT TELEORBIT_FOUND) + # Set up variables + set(FLEXIBAND_DRIVER_INCLUDE_DIRS + ${OPT_DRIVER_INCLUDE_DIRS} + ${TELEORBIT_INCLUDE_DIR}/teleorbit + ) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${TELEORBIT_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${FLEXIBAND_DRIVER_INCLUDE_DIRS}) + set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} flexiband_signal_source.cc) + set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} flexiband_signal_source.h) endif(ENABLE_FLEXIBAND) if(ENABLE_ARRAY) - ############################################## - # DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE - ############################################## - find_package(GRDBFCTTC REQUIRED) - if(NOT GRDBFCTTC_FOUND) - message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc ") - message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled") - endif(NOT GRDBFCTTC_FOUND) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_DBFCTTC_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_DBFCTTC_INCLUDE_DIRS}) - set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc) - set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} raw_array_signal_source.h) + ############################################## + # DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE + ############################################## + find_package(GRDBFCTTC REQUIRED) + if(NOT GRDBFCTTC_FOUND) + message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc ") + message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled") + endif(NOT GRDBFCTTC_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_DBFCTTC_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_DBFCTTC_INCLUDE_DIRS}) + set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc) + set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} raw_array_signal_source.h) endif(ENABLE_ARRAY) @@ -167,6 +166,7 @@ if(ENABLE_OSMOSDR) endif(NOT GROSMOSDR_FOUND) endif(ENABLE_OSMOSDR) + if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} uhd_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} uhd_signal_source.h) @@ -197,27 +197,27 @@ set(SIGNAL_SOURCE_ADAPTER_HEADERS file_signal_source.h if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) - set(SIGNAL_SOURCE_ADAPTER_SOURCES ${SIGNAL_SOURCE_ADAPTER_SOURCES} - two_bit_cpx_file_signal_source.cc - two_bit_packed_file_signal_source.cc ) - set(SIGNAL_SOURCE_ADAPTER_HEADERS ${SIGNAL_SOURCE_ADAPTER_HEADERS} - two_bit_cpx_file_signal_source.h - two_bit_packed_file_signal_source.h ) + set(SIGNAL_SOURCE_ADAPTER_SOURCES ${SIGNAL_SOURCE_ADAPTER_SOURCES} + two_bit_cpx_file_signal_source.cc + two_bit_packed_file_signal_source.cc) + set(SIGNAL_SOURCE_ADAPTER_HEADERS ${SIGNAL_SOURCE_ADAPTER_HEADERS} + two_bit_cpx_file_signal_source.h + two_bit_packed_file_signal_source.h) endif(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${OPT_DRIVER_INCLUDE_DIRS} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${OPT_DRIVER_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} ) if(ARCH_64BITS) @@ -232,9 +232,9 @@ list(SORT SIGNAL_SOURCE_ADAPTER_SOURCES) add_library(signal_source_adapters ${SIGNAL_SOURCE_ADAPTER_SOURCES} ${SIGNAL_SOURCE_ADAPTER_HEADERS}) source_group(Headers FILES ${SIGNAL_SOURCE_ADAPTER_HEADERS}) target_link_libraries(signal_source_adapters signal_source_gr_blocks - ${Boost_LIBRARIES} - ${GNURADIO_PMT_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${OPT_LIBRARIES} - gnss_sp_libs + ${Boost_LIBRARIES} + ${GNURADIO_PMT_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${OPT_LIBRARIES} + gnss_sp_libs ) diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index 9f9c174c7..b673dd897 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -31,38 +31,39 @@ endif(ENABLE_RAW_UDP) set(SIGNAL_SOURCE_GR_BLOCKS_SOURCES - unpack_byte_2bit_samples.cc - unpack_byte_2bit_cpx_samples.cc - unpack_byte_4bit_samples.cc - unpack_intspir_1bit_samples.cc - rtl_tcp_signal_source_c.cc - unpack_2bit_samples.cc - unpack_spir_gss6450_samples.cc - labsat23_source.cc - ${OPT_DRIVER_SOURCES} + unpack_byte_2bit_samples.cc + unpack_byte_2bit_cpx_samples.cc + unpack_byte_4bit_samples.cc + unpack_intspir_1bit_samples.cc + rtl_tcp_signal_source_c.cc + unpack_2bit_samples.cc + unpack_spir_gss6450_samples.cc + labsat23_source.cc + ${OPT_DRIVER_SOURCES} ) + set(SIGNAL_SOURCE_GR_BLOCKS_HEADERS - unpack_byte_2bit_samples.h - unpack_byte_2bit_cpx_samples.h - unpack_byte_4bit_samples.h - unpack_intspir_1bit_samples.h - rtl_tcp_signal_source_c.h - unpack_2bit_samples.h - unpack_spir_gss6450_samples.h - labsat23_source.h - ${OPT_DRIVER_HEADERS} + unpack_byte_2bit_samples.h + unpack_byte_2bit_cpx_samples.h + unpack_byte_4bit_samples.h + unpack_intspir_1bit_samples.h + rtl_tcp_signal_source_c.h + unpack_2bit_samples.h + unpack_spir_gss6450_samples.h + labsat23_source.h + ${OPT_DRIVER_HEADERS} ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${OPT_DRIVER_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${OPT_DRIVER_INCLUDE_DIRS} ) list(SORT SIGNAL_SOURCE_GR_BLOCKS_HEADERS) diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index 759858e08..af65174c0 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -17,64 +17,64 @@ # if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) - find_package(GRIIO REQUIRED) - if(NOT GRIIO_FOUND) - message(STATUS "gnuradio-iio not found, its installation is required.") - message(STATUS "Please build and install the following projects:") - message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") - message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") - message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") - message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled") - endif(NOT GRIIO_FOUND) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) + find_package(GRIIO REQUIRED) + if(NOT GRIIO_FOUND) + message(STATUS "gnuradio-iio not found, its installation is required.") + message(STATUS "Please build and install the following projects:") + message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") + message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") + message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") + message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled") + endif(NOT GRIIO_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) - find_package(LIBIIO REQUIRED) - if(NOT LIBIIO_FOUND) - message(STATUS "libiio not found, its installation is required.") - message(STATUS "Please build and install the following projects:") - message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") - message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") - message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") - message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled") - endif(NOT LIBIIO_FOUND) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) + find_package(LIBIIO REQUIRED) + if(NOT LIBIIO_FOUND) + message(STATUS "libiio not found, its installation is required.") + message(STATUS "Please build and install the following projects:") + message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") + message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") + message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") + message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled") + endif(NOT LIBIIO_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) - ############################################### - # FMCOMMS2 based SDR Hardware - ############################################### - if(LIBIIO_FOUND) - set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) - set(OPT_SIGNAL_SOURCE_LIB_HEADERS ad9361_manager.h) - endif(LIBIIO_FOUND) + ############################################### + # FMCOMMS2 based SDR Hardware + ############################################### + if(LIBIIO_FOUND) + set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) + set(OPT_SIGNAL_SOURCE_LIB_HEADERS ad9361_manager.h) + endif(LIBIIO_FOUND) endif(ENABLE_FMCOMMS2 OR ENABLE_AD9361) if(ENABLE_FPGA OR ENABLE_AD9361) - set(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_switch.cc) - set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_switch.h) + set(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_switch.cc) + set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_switch.h) endif(ENABLE_FPGA OR ENABLE_AD9361) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${OPT_DRIVER_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${OPT_DRIVER_INCLUDE_DIRS} ) set(SIGNAL_SOURCE_LIB_SOURCES - rtl_tcp_commands.cc - rtl_tcp_dongle_info.cc - ${OPT_SIGNAL_SOURCE_LIB_SOURCES} + rtl_tcp_commands.cc + rtl_tcp_dongle_info.cc + ${OPT_SIGNAL_SOURCE_LIB_SOURCES} ) set(SIGNAL_SOURCE_LIB_HEADERS - rtl_tcp_commands.h - rtl_tcp_dongle_info.h - ${OPT_SIGNAL_SOURCE_LIB_HEADERS} + rtl_tcp_commands.h + rtl_tcp_dongle_info.h + ${OPT_SIGNAL_SOURCE_LIB_HEADERS} ) list(SORT SIGNAL_SOURCE_LIB_HEADERS) diff --git a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt index 7c4e4b53a..01836e5ae 100644 --- a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt @@ -40,22 +40,31 @@ set(TELEMETRY_DECODER_ADAPTER_HEADERS ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) list(SORT TELEMETRY_DECODER_ADAPTER_HEADERS) list(SORT TELEMETRY_DECODER_ADAPTER_SOURCES) -add_library(telemetry_decoder_adapters ${TELEMETRY_DECODER_ADAPTER_SOURCES} ${TELEMETRY_DECODER_ADAPTER_HEADERS}) +add_library(telemetry_decoder_adapters + ${TELEMETRY_DECODER_ADAPTER_SOURCES} + ${TELEMETRY_DECODER_ADAPTER_HEADERS} +) + source_group(Headers FILES ${TELEMETRY_DECODER_ADAPTER_HEADERS}) -target_link_libraries(telemetry_decoder_adapters telemetry_decoder_gr_blocks gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES}) + +target_link_libraries(telemetry_decoder_adapters + telemetry_decoder_gr_blocks + gnss_system_parameters + ${GNURADIO_RUNTIME_LIBRARIES} +) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index e0a102148..92d258bfe 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -17,45 +17,56 @@ # set(TELEMETRY_DECODER_GR_BLOCKS_SOURCES - gps_l1_ca_telemetry_decoder_cc.cc - gps_l2c_telemetry_decoder_cc.cc - gps_l5_telemetry_decoder_cc.cc - sbas_l1_telemetry_decoder_cc.cc - glonass_l1_ca_telemetry_decoder_cc.cc - glonass_l2_ca_telemetry_decoder_cc.cc - galileo_telemetry_decoder_cc.cc + gps_l1_ca_telemetry_decoder_cc.cc + gps_l2c_telemetry_decoder_cc.cc + gps_l5_telemetry_decoder_cc.cc + sbas_l1_telemetry_decoder_cc.cc + glonass_l1_ca_telemetry_decoder_cc.cc + glonass_l2_ca_telemetry_decoder_cc.cc + galileo_telemetry_decoder_cc.cc ) set(TELEMETRY_DECODER_GR_BLOCKS_HEADERS - gps_l1_ca_telemetry_decoder_cc.h - gps_l2c_telemetry_decoder_cc.h - gps_l5_telemetry_decoder_cc.h - sbas_l1_telemetry_decoder_cc.h - glonass_l1_ca_telemetry_decoder_cc.h - glonass_l2_ca_telemetry_decoder_cc.h - galileo_telemetry_decoder_cc.h + gps_l1_ca_telemetry_decoder_cc.h + gps_l2c_telemetry_decoder_cc.h + gps_l5_telemetry_decoder_cc.h + sbas_l1_telemetry_decoder_cc.h + glonass_l1_ca_telemetry_decoder_cc.h + glonass_l2_ca_telemetry_decoder_cc.h + galileo_telemetry_decoder_cc.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} ) list(SORT TELEMETRY_DECODER_GR_BLOCKS_HEADERS) list(SORT TELEMETRY_DECODER_GR_BLOCKS_SOURCES) -add_library(telemetry_decoder_gr_blocks ${TELEMETRY_DECODER_GR_BLOCKS_SOURCES} ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS}) +add_library(telemetry_decoder_gr_blocks + ${TELEMETRY_DECODER_GR_BLOCKS_SOURCES} + ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS} +) + source_group(Headers FILES ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS}) -target_link_libraries(telemetry_decoder_gr_blocks telemetry_decoder_libswiftcnav telemetry_decoder_lib gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES}) + +target_link_libraries(telemetry_decoder_gr_blocks + telemetry_decoder_libswiftcnav + telemetry_decoder_lib + gnss_system_parameters + ${GNURADIO_RUNTIME_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} +) if(NOT VOLK_GNSSSDR_FOUND) - add_dependencies(telemetry_decoder_gr_blocks volk_gnsssdr_module) + add_dependencies(telemetry_decoder_gr_blocks volk_gnsssdr_module) endif(NOT VOLK_GNSSSDR_FOUND) diff --git a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt index 5c663c93a..53a997cc8 100644 --- a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt @@ -16,31 +16,36 @@ # along with GNSS-SDR. If not, see . # + add_subdirectory(libswiftcnav) set(TELEMETRY_DECODER_LIB_SOURCES - viterbi_decoder.cc + viterbi_decoder.cc ) set(TELEMETRY_DECODER_LIB_HEADERS - viterbi_decoder.h - convolutional.h + viterbi_decoder.h + convolutional.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} ) list(SORT TELEMETRY_DECODER_LIB_HEADERS) list(SORT TELEMETRY_DECODER_LIB_SOURCES) -add_library(telemetry_decoder_lib ${TELEMETRY_DECODER_LIB_SOURCES} ${TELEMETRY_DECODER_LIB_HEADERS}) +add_library(telemetry_decoder_lib + ${TELEMETRY_DECODER_LIB_SOURCES} + ${TELEMETRY_DECODER_LIB_HEADERS} +) source_group(Headers FILES ${TELEMETRY_DECODER_LIB_HEADERS}) + target_link_libraries(telemetry_decoder_lib gnss_system_parameters) diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt index ad356be81..af753c057 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt @@ -17,27 +17,33 @@ # set(TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES - cnav_msg.c - bits.c - edc.c - viterbi27.c + cnav_msg.c + bits.c + edc.c + viterbi27.c ) set(TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS - cnav_msg.h - bits.h - edc.h - swift_common.h - fec.h + cnav_msg.h + bits.h + edc.h + swift_common.h + fec.h ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} ) list(SORT TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS) list(SORT TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES) -add_library(telemetry_decoder_libswiftcnav STATIC ${TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES} ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS}) +add_library(telemetry_decoder_libswiftcnav STATIC + ${TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES} + ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS} +) + source_group(Headers FILES ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS}) -set_target_properties(telemetry_decoder_libswiftcnav PROPERTIES LINKER_LANGUAGE C) + +set_target_properties(telemetry_decoder_libswiftcnav + PROPERTIES LINKER_LANGUAGE C) diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index 5ac4ec00b..db967b669 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -16,81 +16,104 @@ # along with GNSS-SDR. If not, see . # + if(ENABLE_CUDA) - set(OPT_TRACKING_ADAPTERS_SOURCES ${OPT_TRACKING_ADAPTERS_SOURCES} gps_l1_ca_dll_pll_tracking_gpu.cc) - set(OPT_TRACKING_ADAPTERS_HEADERS ${OPT_TRACKING_ADAPTERS_HEADERS} gps_l1_ca_dll_pll_tracking_gpu.h) - set(OPT_TRACKING_INCLUDE_DIRS ${OPT_TRACKING_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS}) + set(OPT_TRACKING_ADAPTERS_SOURCES + ${OPT_TRACKING_ADAPTERS_SOURCES} + gps_l1_ca_dll_pll_tracking_gpu.cc + ) + set(OPT_TRACKING_ADAPTERS_HEADERS + ${OPT_TRACKING_ADAPTERS_HEADERS} + gps_l1_ca_dll_pll_tracking_gpu.h + ) + set(OPT_TRACKING_INCLUDE_DIRS + ${OPT_TRACKING_INCLUDE_DIRS} + ${CUDA_INCLUDE_DIRS} + ) endif(ENABLE_CUDA) if(ENABLE_FPGA) - set(OPT_TRACKING_ADAPTERS_SOURCES ${OPT_TRACKING_ADAPTERS_SOURCES} - gps_l1_ca_dll_pll_tracking_fpga.cc - gps_l2_m_dll_pll_tracking_fpga.cc - galileo_e1_dll_pll_veml_tracking_fpga.cc - galileo_e5a_dll_pll_tracking_fpga.cc - gps_l5_dll_pll_tracking_fpga.cc) + set(OPT_TRACKING_ADAPTERS_SOURCES + ${OPT_TRACKING_ADAPTERS_SOURCES} + gps_l1_ca_dll_pll_tracking_fpga.cc + gps_l2_m_dll_pll_tracking_fpga.cc + galileo_e1_dll_pll_veml_tracking_fpga.cc + galileo_e5a_dll_pll_tracking_fpga.cc + gps_l5_dll_pll_tracking_fpga.cc + ) - set(OPT_TRACKING_ADAPTERS_HEADERS ${OPT_TRACKING_ADAPTERS_HEADERS} - gps_l1_ca_dll_pll_tracking_fpga.h - gps_l2_m_dll_pll_tracking_fpga.h - galileo_e1_dll_pll_veml_tracking_fpga.h - galileo_e5a_dll_pll_tracking_fpga.h - gps_l5_dll_pll_tracking_fpga.h) + set(OPT_TRACKING_ADAPTERS_HEADERS + ${OPT_TRACKING_ADAPTERS_HEADERS} + gps_l1_ca_dll_pll_tracking_fpga.h + gps_l2_m_dll_pll_tracking_fpga.h + galileo_e1_dll_pll_veml_tracking_fpga.h + galileo_e5a_dll_pll_tracking_fpga.h + gps_l5_dll_pll_tracking_fpga.h + ) endif(ENABLE_FPGA) set(TRACKING_ADAPTER_SOURCES - galileo_e1_dll_pll_veml_tracking.cc - galileo_e1_tcp_connector_tracking.cc - gps_l1_ca_dll_pll_tracking.cc - gps_l1_ca_dll_pll_c_aid_tracking.cc - gps_l1_ca_tcp_connector_tracking.cc - galileo_e5a_dll_pll_tracking.cc - gps_l2_m_dll_pll_tracking.cc - glonass_l1_ca_dll_pll_tracking.cc - glonass_l1_ca_dll_pll_c_aid_tracking.cc - gps_l1_ca_kf_tracking.cc - gps_l5_dll_pll_tracking.cc - glonass_l2_ca_dll_pll_tracking.cc - glonass_l2_ca_dll_pll_c_aid_tracking.cc - ${OPT_TRACKING_ADAPTERS_SOURCES} + galileo_e1_dll_pll_veml_tracking.cc + galileo_e1_tcp_connector_tracking.cc + gps_l1_ca_dll_pll_tracking.cc + gps_l1_ca_dll_pll_c_aid_tracking.cc + gps_l1_ca_tcp_connector_tracking.cc + galileo_e5a_dll_pll_tracking.cc + gps_l2_m_dll_pll_tracking.cc + glonass_l1_ca_dll_pll_tracking.cc + glonass_l1_ca_dll_pll_c_aid_tracking.cc + gps_l1_ca_kf_tracking.cc + gps_l5_dll_pll_tracking.cc + glonass_l2_ca_dll_pll_tracking.cc + glonass_l2_ca_dll_pll_c_aid_tracking.cc + ${OPT_TRACKING_ADAPTERS_SOURCES} ) set(TRACKING_ADAPTER_HEADERS - galileo_e1_dll_pll_veml_tracking.h - galileo_e1_tcp_connector_tracking.h - gps_l1_ca_dll_pll_tracking.h - gps_l1_ca_dll_pll_c_aid_tracking.h - gps_l1_ca_tcp_connector_tracking.h - galileo_e5a_dll_pll_tracking.h - gps_l2_m_dll_pll_tracking.h - glonass_l1_ca_dll_pll_tracking.h - glonass_l1_ca_dll_pll_c_aid_tracking.h - gps_l1_ca_kf_tracking.h - gps_l5_dll_pll_tracking.h - glonass_l2_ca_dll_pll_tracking.h - glonass_l2_ca_dll_pll_c_aid_tracking.h - ${OPT_TRACKING_ADAPTERS_HEADERS} + galileo_e1_dll_pll_veml_tracking.h + galileo_e1_tcp_connector_tracking.h + gps_l1_ca_dll_pll_tracking.h + gps_l1_ca_dll_pll_c_aid_tracking.h + gps_l1_ca_tcp_connector_tracking.h + galileo_e5a_dll_pll_tracking.h + gps_l2_m_dll_pll_tracking.h + glonass_l1_ca_dll_pll_tracking.h + glonass_l1_ca_dll_pll_c_aid_tracking.h + gps_l1_ca_kf_tracking.h + gps_l5_dll_pll_tracking.h + glonass_l2_ca_dll_pll_tracking.h + glonass_l2_ca_dll_pll_c_aid_tracking.h + ${OPT_TRACKING_ADAPTERS_HEADERS} ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${OPT_TRACKING_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${ARMADILLO_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${OPT_TRACKING_INCLUDE_DIRS} ) list(SORT TRACKING_ADAPTER_HEADERS) list(SORT TRACKING_ADAPTER_SOURCES) -add_library(tracking_adapters ${TRACKING_ADAPTER_SOURCES} ${TRACKING_ADAPTER_HEADERS}) +add_library(tracking_adapters + ${TRACKING_ADAPTER_SOURCES} + ${TRACKING_ADAPTER_HEADERS} +) + source_group(Headers FILES ${TRACKING_ADAPTER_HEADERS}) -target_link_libraries(tracking_adapters tracking_gr_blocks gnss_sp_libs gnss_sdr_flags) + +target_link_libraries(tracking_adapters + tracking_gr_blocks + gnss_sp_libs + gnss_sdr_flags +) diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index 9ac1a4e26..fdc72cd34 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -17,77 +17,104 @@ # if(ENABLE_CUDA) - set(OPT_TRACKING_BLOCKS_SOURCES ${OPT_TRACKING_BLOCKS_SOURCES} gps_l1_ca_dll_pll_tracking_gpu_cc.cc) - set(OPT_TRACKING_BLOCKS_HEADERS ${OPT_TRACKING_BLOCKS_HEADERS} gps_l1_ca_dll_pll_tracking_gpu_cc.h) - set(OPT_TRACKING_INCLUDES ${OPT_TRACKING_INCLUDES} ${CUDA_INCLUDE_DIRS}) - set(OPT_TRACKING_LIBRARIES ${OPT_TRACKING_LIBRARIES} ${CUDA_LIBRARIES}) + set(OPT_TRACKING_BLOCKS_SOURCES + ${OPT_TRACKING_BLOCKS_SOURCES} + gps_l1_ca_dll_pll_tracking_gpu_cc.cc + ) + set(OPT_TRACKING_BLOCKS_HEADERS + ${OPT_TRACKING_BLOCKS_HEADERS} + gps_l1_ca_dll_pll_tracking_gpu_cc.h + ) + set(OPT_TRACKING_INCLUDES + ${OPT_TRACKING_INCLUDES} + ${CUDA_INCLUDE_DIRS} + ) + set(OPT_TRACKING_LIBRARIES + ${OPT_TRACKING_LIBRARIES} + ${CUDA_LIBRARIES} + ) endif(ENABLE_CUDA) if(ENABLE_FPGA) - set(OPT_TRACKING_BLOCKS_SOURCES ${OPT_TRACKING_BLOCKS_SOURCES} dll_pll_veml_tracking_fpga.cc) - set(OPT_TRACKING_BLOCKS_HEADERS ${OPT_TRACKING_BLOCKS_HEADERS} dll_pll_veml_tracking_fpga.h) + set(OPT_TRACKING_BLOCKS_SOURCES + ${OPT_TRACKING_BLOCKS_SOURCES} + dll_pll_veml_tracking_fpga.cc + ) + set(OPT_TRACKING_BLOCKS_HEADERS + ${OPT_TRACKING_BLOCKS_HEADERS} + dll_pll_veml_tracking_fpga.h + ) endif(ENABLE_FPGA) set(TRACKING_GR_BLOCKS_SOURCES - galileo_e1_tcp_connector_tracking_cc.cc - gps_l1_ca_tcp_connector_tracking_cc.cc - gps_l1_ca_dll_pll_c_aid_tracking_cc.cc - gps_l1_ca_dll_pll_c_aid_tracking_sc.cc - glonass_l1_ca_dll_pll_tracking_cc.cc - glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc - glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc - gps_l1_ca_kf_tracking_cc.cc - glonass_l2_ca_dll_pll_tracking_cc.cc - glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc - glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc - dll_pll_veml_tracking.cc - ${OPT_TRACKING_BLOCKS_SOURCES} + galileo_e1_tcp_connector_tracking_cc.cc + gps_l1_ca_tcp_connector_tracking_cc.cc + gps_l1_ca_dll_pll_c_aid_tracking_cc.cc + gps_l1_ca_dll_pll_c_aid_tracking_sc.cc + glonass_l1_ca_dll_pll_tracking_cc.cc + glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc + glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc + gps_l1_ca_kf_tracking_cc.cc + glonass_l2_ca_dll_pll_tracking_cc.cc + glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc + glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc + dll_pll_veml_tracking.cc + ${OPT_TRACKING_BLOCKS_SOURCES} ) set(TRACKING_GR_BLOCKS_HEADERS - galileo_e1_tcp_connector_tracking_cc.h - gps_l1_ca_tcp_connector_tracking_cc.h - gps_l1_ca_dll_pll_c_aid_tracking_cc.h - gps_l1_ca_dll_pll_c_aid_tracking_sc.h - glonass_l1_ca_dll_pll_tracking_cc.h - glonass_l1_ca_dll_pll_c_aid_tracking_cc.h - glonass_l1_ca_dll_pll_c_aid_tracking_sc.h - gps_l1_ca_kf_tracking_cc.h - glonass_l2_ca_dll_pll_tracking_cc.h - glonass_l2_ca_dll_pll_c_aid_tracking_cc.h - glonass_l2_ca_dll_pll_c_aid_tracking_sc.h - dll_pll_veml_tracking.h - ${OPT_TRACKING_BLOCKS_HEADERS} + galileo_e1_tcp_connector_tracking_cc.h + gps_l1_ca_tcp_connector_tracking_cc.h + gps_l1_ca_dll_pll_c_aid_tracking_cc.h + gps_l1_ca_dll_pll_c_aid_tracking_sc.h + glonass_l1_ca_dll_pll_tracking_cc.h + glonass_l1_ca_dll_pll_c_aid_tracking_cc.h + glonass_l1_ca_dll_pll_c_aid_tracking_sc.h + gps_l1_ca_kf_tracking_cc.h + glonass_l2_ca_dll_pll_tracking_cc.h + glonass_l2_ca_dll_pll_c_aid_tracking_cc.h + glonass_l2_ca_dll_pll_c_aid_tracking_sc.h + dll_pll_veml_tracking.h + ${OPT_TRACKING_BLOCKS_HEADERS} ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${OPT_TRACKING_INCLUDES} - ${MATIO_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${ARMADILLO_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${OPT_TRACKING_INCLUDES} + ${MATIO_INCLUDE_DIRS} ) if(ENABLE_GENERIC_ARCH) - add_definitions( -DGENERIC_ARCH=1 ) + add_definitions(-DGENERIC_ARCH=1) endif(ENABLE_GENERIC_ARCH) list(SORT TRACKING_GR_BLOCKS_HEADERS) list(SORT TRACKING_GR_BLOCKS_SOURCES) add_library(tracking_gr_blocks ${TRACKING_GR_BLOCKS_SOURCES} ${TRACKING_GR_BLOCKS_HEADERS}) + source_group(Headers FILES ${TRACKING_GR_BLOCKS_HEADERS}) -target_link_libraries(tracking_gr_blocks tracking_lib ${GNURADIO_RUNTIME_LIBRARIES} gnss_sdr_flags gnss_sp_libs ${Boost_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${MATIO_LIBRARIES} ${OPT_TRACKING_LIBRARIES}) +target_link_libraries(tracking_gr_blocks + tracking_lib + ${GNURADIO_RUNTIME_LIBRARIES} + gnss_sdr_flags gnss_sp_libs + ${Boost_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${MATIO_LIBRARIES} + ${OPT_TRACKING_LIBRARIES} +) if(NOT VOLK_GNSSSDR_FOUND) if(MATIO_FOUND) diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index 72d3c66e0..7cce9e680 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -22,44 +22,43 @@ if(ENABLE_CUDA) # set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --gpu-architecture sm_30) list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_30,code=sm_30; -std=c++11;-O3; -use_fast_math -default-stream per-thread") set(CUDA_PROPAGATE_HOST_FLAGS OFF) - CUDA_INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}) + cuda_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) set(LIB_TYPE STATIC) #set the lib type - CUDA_ADD_LIBRARY(CUDA_CORRELATOR_LIB ${LIB_TYPE} cuda_multicorrelator.h cuda_multicorrelator.cu) + cuda_add_library(CUDA_CORRELATOR_LIB ${LIB_TYPE} cuda_multicorrelator.h cuda_multicorrelator.cu) set(OPT_TRACKING_LIBRARIES ${OPT_TRACKING_LIBRARIES} CUDA_CORRELATOR_LIB) - set(OPT_TRACKING_INCLUDES ${OPT_TRACKING_INCLUDES} ${CUDA_INCLUDE_DIRS} ) + set(OPT_TRACKING_INCLUDES ${OPT_TRACKING_INCLUDES} ${CUDA_INCLUDE_DIRS}) endif(ENABLE_CUDA) - set(TRACKING_LIB_SOURCES - cpu_multicorrelator.cc - cpu_multicorrelator_real_codes.cc - cpu_multicorrelator_16sc.cc - lock_detectors.cc - tcp_communication.cc - tcp_packet_data.cc - tracking_2nd_DLL_filter.cc - tracking_2nd_PLL_filter.cc - tracking_discriminators.cc - tracking_FLL_PLL_filter.cc - tracking_loop_filter.cc - dll_pll_conf.cc - bayesian_estimation.cc + cpu_multicorrelator.cc + cpu_multicorrelator_real_codes.cc + cpu_multicorrelator_16sc.cc + lock_detectors.cc + tcp_communication.cc + tcp_packet_data.cc + tracking_2nd_DLL_filter.cc + tracking_2nd_PLL_filter.cc + tracking_discriminators.cc + tracking_FLL_PLL_filter.cc + tracking_loop_filter.cc + dll_pll_conf.cc + bayesian_estimation.cc ) set(TRACKING_LIB_HEADERS - cpu_multicorrelator.h - cpu_multicorrelator_real_codes.h - cpu_multicorrelator_16sc.h - lock_detectors.h - tcp_communication.h - tcp_packet_data.h - tracking_2nd_DLL_filter.h - tracking_2nd_PLL_filter.h - tracking_discriminators.h - tracking_FLL_PLL_filter.h - tracking_loop_filter.h - dll_pll_conf.h - bayesian_estimation.h + cpu_multicorrelator.h + cpu_multicorrelator_real_codes.h + cpu_multicorrelator_16sc.h + lock_detectors.h + tcp_communication.h + tcp_packet_data.h + tracking_2nd_DLL_filter.h + tracking_2nd_PLL_filter.h + tracking_discriminators.h + tracking_FLL_PLL_filter.h + tracking_loop_filter.h + dll_pll_conf.h + bayesian_estimation.h ) if(ENABLE_FPGA) @@ -68,34 +67,41 @@ if(ENABLE_FPGA) endif(ENABLE_FPGA) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${OPT_TRACKING_INCLUDES} - ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${ARMADILLO_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${OPT_TRACKING_INCLUDES} + ${VOLK_GNSSSDR_INCLUDE_DIRS} ) if(ENABLE_GENERIC_ARCH) - add_definitions( -DGENERIC_ARCH=1 ) + add_definitions(-DGENERIC_ARCH=1) endif(ENABLE_GENERIC_ARCH) -if (SSE3_AVAILABLE) - add_definitions( -DHAVE_SSE3=1 ) +if(SSE3_AVAILABLE) + add_definitions(-DHAVE_SSE3=1) endif(SSE3_AVAILABLE) - list(SORT TRACKING_LIB_HEADERS) list(SORT TRACKING_LIB_SOURCES) add_library(tracking_lib ${TRACKING_LIB_SOURCES} ${TRACKING_LIB_HEADERS}) + source_group(Headers FILES ${TRACKING_LIB_HEADERS}) -target_link_libraries(tracking_lib ${OPT_TRACKING_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES}) + +target_link_libraries(tracking_lib + ${OPT_TRACKING_LIBRARIES} + ${VOLK_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${Boost_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} +) if(VOLK_GNSSSDR_FOUND) add_dependencies(tracking_lib glog-${glog_RELEASE}) diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index 0c6bbd4c2..bbecef4d0 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -19,7 +19,7 @@ add_subdirectory(supl) if(OPENSSL_FOUND) - add_definitions( -DUSE_OPENSSL_FALLBACK=1 ) + add_definitions(-DUSE_OPENSSL_FALLBACK=1) endif(OPENSSL_FOUND) set(CORE_LIBS_SOURCES diff --git a/src/core/libs/supl/CMakeLists.txt b/src/core/libs/supl/CMakeLists.txt index 4faecafda..65a639e10 100644 --- a/src/core/libs/supl/CMakeLists.txt +++ b/src/core/libs/supl/CMakeLists.txt @@ -21,12 +21,12 @@ list(SORT ASN_RRLP_SOURCES) file(GLOB ASN_SUPL_SOURCES "${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl/*.c") list(SORT ASN_SUPL_SOURCES) -set (SUPL_SOURCES - supl.c - ) +set(SUPL_SOURCES + supl.c +) if(OPENSSL_FOUND) - add_definitions( -DUSE_OPENSSL_FALLBACK=1 ) + add_definitions(-DUSE_OPENSSL_FALLBACK=1) endif(OPENSSL_FOUND) include_directories( @@ -35,7 +35,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl ${GNUTLS_INCLUDE_DIR} - ) +) if(CMAKE_C_COMPILER_ID MATCHES "Clang") if(CMAKE_BUILD_TYPE MATCHES "Release") @@ -44,6 +44,6 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang") endif(CMAKE_C_COMPILER_ID MATCHES "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS}") -add_library (supl_library STATIC ${ASN_RRLP_SOURCES} ${ASN_SUPL_SOURCES} ${SUPL_SOURCES}) -target_link_libraries (supl_library ${GNUTLS_LIBRARIES} ${GNUTLS_OPENSSL_LIBRARY} gnss_system_parameters) +add_library(supl_library STATIC ${ASN_RRLP_SOURCES} ${ASN_SUPL_SOURCES} ${SUPL_SOURCES}) +target_link_libraries(supl_library ${GNUTLS_LIBRARIES} ${GNUTLS_OPENSSL_LIBRARY} gnss_system_parameters) set_target_properties(supl_library PROPERTIES LINKER_LANGUAGE C) diff --git a/src/core/monitor/CMakeLists.txt b/src/core/monitor/CMakeLists.txt index 8bba7c587..54ee2a589 100644 --- a/src/core/monitor/CMakeLists.txt +++ b/src/core/monitor/CMakeLists.txt @@ -18,16 +18,15 @@ set(CORE_MONITOR_LIBS_SOURCES - gnss_synchro_monitor.cc - gnss_synchro_udp_sink.cc + gnss_synchro_monitor.cc + gnss_synchro_udp_sink.cc ) set(CORE_MONITOR_LIBS_HEADERS - gnss_synchro_monitor.h - gnss_synchro_udp_sink.h + gnss_synchro_monitor.h + gnss_synchro_udp_sink.h ) - include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/core/system_parameters @@ -40,7 +39,13 @@ include_directories( list(SORT CORE_MONITOR_LIBS_HEADERS) list(SORT CORE_MONITOR_LIBS_SOURCES) -add_library(core_monitor_lib ${CORE_MONITOR_LIBS_SOURCES} ${CORE_MONITOR_LIBS_HEADERS}) +add_library(core_monitor_lib + ${CORE_MONITOR_LIBS_SOURCES} + ${CORE_MONITOR_LIBS_HEADERS} +) + source_group(Headers FILES ${CORE_MONITOR_LIBS_HEADERS}) + target_link_libraries(core_monitor_lib ${Boost_LIBRARIES}) + add_dependencies(core_monitor_lib glog-${glog_RELEASE}) diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 461320653..89540b525 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -18,38 +18,38 @@ set(GNSS_RECEIVER_SOURCES - control_thread.cc - control_message_factory.cc - file_configuration.cc - gnss_block_factory.cc - gnss_flowgraph.cc - in_memory_configuration.cc - tcp_cmd_interface.cc + control_thread.cc + control_message_factory.cc + file_configuration.cc + gnss_block_factory.cc + gnss_flowgraph.cc + in_memory_configuration.cc + tcp_cmd_interface.cc ) set(GNSS_RECEIVER_HEADERS - control_thread.h - control_message_factory.h - file_configuration.h - gnss_block_factory.h - gnss_flowgraph.h - in_memory_configuration.h - concurrent_map.h - concurrent_queue.h - control_message.h + control_thread.h + control_message_factory.h + file_configuration.h + gnss_block_factory.h + gnss_flowgraph.h + in_memory_configuration.h + concurrent_map.h + concurrent_queue.h + control_message.h ) if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) - add_definitions(-DMODERN_GNURADIO=1) + add_definitions(-DMODERN_GNURADIO=1) endif(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) if(ENABLE_CUDA) - add_definitions(-DCUDA_GPU_ACCEL=1) - set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS}) + add_definitions(-DCUDA_GPU_ACCEL=1) + set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS}) endif(ENABLE_CUDA) if(ENABLE_FPGA) - add_definitions(-DENABLE_FPGA=1) + add_definitions(-DENABLE_FPGA=1) endif(ENABLE_FPGA) if(ENABLE_RAW_UDP) @@ -57,7 +57,7 @@ if(ENABLE_RAW_UDP) endif(ENABLE_RAW_UDP) if(Boost_VERSION LESS 105000) - add_definitions(-DOLD_BOOST=1) + add_definitions(-DOLD_BOOST=1) endif(Boost_VERSION LESS 105000) if(OPENSSL_FOUND) @@ -88,7 +88,7 @@ endif(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) #Enable OpenCL if found in the system if(OPENCL_FOUND) - message(STATUS "Adding processing blocks implemented using OpenCL" ) + message(STATUS "Adding processing blocks implemented using OpenCL") add_definitions(-DOPENCL_BLOCKS=1) else(OPENCL_FOUND) add_definitions(-DOPENCL_BLOCKS=0) @@ -96,13 +96,13 @@ endif(OPENCL_FOUND) #enable SDR Hardware based on fmcomms2 if(ENABLE_PLUTOSDR) - add_definitions(-DPLUTOSDR_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) + add_definitions(-DPLUTOSDR_DRIVER=1) + set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif(ENABLE_PLUTOSDR) if(ENABLE_FMCOMMS2) - add_definitions(-DFMCOMMS2_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) + add_definitions(-DFMCOMMS2_DRIVER=1) + set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif(ENABLE_FMCOMMS2) if(ENABLE_AD9361) @@ -110,98 +110,105 @@ if(ENABLE_AD9361) set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif(ENABLE_AD9361) -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) - add_definitions( -DGR_GREATER_38=1 ) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + add_definitions( -DGR_GREATER_38=1 ) +endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/libs - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${CMAKE_SOURCE_DIR}/src/core/monitor - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/conditioner/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} - ${OPT_RECEIVER_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/libs + ${CMAKE_SOURCE_DIR}/src/core/libs/supl + ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp + ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl + ${CMAKE_SOURCE_DIR}/src/core/monitor + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/conditioner/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav + ${CMAKE_SOURCE_DIR}/src/algorithms/observables/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/adapters + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/gnuradio_blocks + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib + ${ARMADILLO_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${PUGIXML_INCLUDE_DIR} + ${OPT_RECEIVER_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} ) list(SORT GNSS_RECEIVER_HEADERS) list(SORT GNSS_RECEIVER_SOURCES) -set(GNSS_RECEIVER_INTERFACE_HEADERS ../interfaces/acquisition_interface.h - ../interfaces/channel_interface.h - ../interfaces/configuration_interface.h - ../interfaces/gnss_block_interface.h - ../interfaces/observables_interface.h - ../interfaces/pvt_interface.h - ../interfaces/telemetry_decoder_interface.h - ../interfaces/tracking_interface.h +set(GNSS_RECEIVER_INTERFACE_HEADERS + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/acquisition_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/channel_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/configuration_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/gnss_block_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/observables_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/pvt_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/telemetry_decoder_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/tracking_interface.h ) list(SORT GNSS_RECEIVER_INTERFACE_HEADERS) -add_library(gnss_rx ${GNSS_RECEIVER_SOURCES} ${GNSS_RECEIVER_HEADERS} ${GNSS_RECEIVER_INTERFACE_HEADERS}) +add_library(gnss_rx + ${GNSS_RECEIVER_SOURCES} + ${GNSS_RECEIVER_HEADERS} + ${GNSS_RECEIVER_INTERFACE_HEADERS} +) + source_group(Headers FILES ${GNSS_RECEIVER_HEADERS} ${GNSS_RECEIVER_INTERFACE_HEADERS}) -target_link_libraries(gnss_rx ${Boost_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - gnss_system_parameters - gnss_sp_libs - signal_source_adapters - datatype_adapters - input_filter_adapters - conditioner_adapters - resampler_adapters - acq_adapters - tracking_adapters - channel_adapters - telemetry_decoder_libswiftcnav - telemetry_decoder_lib - telemetry_decoder_adapters - obs_adapters - pvt_adapters - pvt_lib - rx_core_lib - core_monitor_lib +target_link_libraries(gnss_rx + ${Boost_LIBRARIES} + ${ARMADILLO_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + gnss_system_parameters + gnss_sp_libs + signal_source_adapters + datatype_adapters + input_filter_adapters + conditioner_adapters + resampler_adapters + acq_adapters + tracking_adapters + channel_adapters + telemetry_decoder_libswiftcnav + telemetry_decoder_lib + telemetry_decoder_adapters + obs_adapters + pvt_adapters + pvt_lib + rx_core_lib + core_monitor_lib ) diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index 29fc91399..4593d8e1f 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -16,87 +16,87 @@ # along with GNSS-SDR. If not, see . # + set(SYSTEM_PARAMETERS_SOURCES - gnss_satellite.cc - gnss_signal.cc - gps_navigation_message.cc - gps_ephemeris.cc - gps_iono.cc - gps_almanac.cc - gps_utc_model.cc - gps_acq_assist.cc - agnss_ref_time.cc - agnss_ref_location.cc - galileo_utc_model.cc - galileo_ephemeris.cc - galileo_almanac.cc - galileo_almanac_helper.cc - galileo_iono.cc - galileo_navigation_message.cc - sbas_ephemeris.cc - galileo_fnav_message.cc - gps_cnav_ephemeris.cc - gps_cnav_navigation_message.cc - gps_cnav_iono.cc - gps_cnav_utc_model.cc - rtcm.cc - glonass_gnav_ephemeris.cc - glonass_gnav_almanac.cc - glonass_gnav_utc_model.cc - glonass_gnav_navigation_message.cc + gnss_satellite.cc + gnss_signal.cc + gps_navigation_message.cc + gps_ephemeris.cc + gps_iono.cc + gps_almanac.cc + gps_utc_model.cc + gps_acq_assist.cc + agnss_ref_time.cc + agnss_ref_location.cc + galileo_utc_model.cc + galileo_ephemeris.cc + galileo_almanac.cc + galileo_almanac_helper.cc + galileo_iono.cc + galileo_navigation_message.cc + sbas_ephemeris.cc + galileo_fnav_message.cc + gps_cnav_ephemeris.cc + gps_cnav_navigation_message.cc + gps_cnav_iono.cc + gps_cnav_utc_model.cc + rtcm.cc + glonass_gnav_ephemeris.cc + glonass_gnav_almanac.cc + glonass_gnav_utc_model.cc + glonass_gnav_navigation_message.cc ) set(SYSTEM_PARAMETERS_HEADERS - gnss_satellite.h - gnss_signal.h - gps_navigation_message.h - gps_ephemeris.h - gps_iono.h - gps_almanac.h - gps_utc_model.h - gps_acq_assist.h - agnss_ref_time.h - agnss_ref_location.h - galileo_utc_model.h - galileo_ephemeris.h - galileo_almanac.h - galileo_almanac_helper.h - galileo_iono.h - galileo_navigation_message.h - sbas_ephemeris.h - galileo_fnav_message.h - gps_cnav_ephemeris.h - gps_cnav_navigation_message.h - gps_cnav_iono.h - gps_cnav_utc_model.h - rtcm.h - glonass_gnav_ephemeris.h - glonass_gnav_almanac.h - glonass_gnav_utc_model.h - glonass_gnav_navigation_message.h - display.h - Galileo_E1.h - Galileo_E5a.h - GLONASS_L1_L2_CA.h - gnss_frequencies.h - gnss_obs_codes.h - gnss_synchro.h - GPS_CNAV.h - GPS_L1_CA.h - GPS_L2C.h - GPS_L5.h - MATH_CONSTANTS.h + gnss_satellite.h + gnss_signal.h + gps_navigation_message.h + gps_ephemeris.h + gps_iono.h + gps_almanac.h + gps_utc_model.h + gps_acq_assist.h + agnss_ref_time.h + agnss_ref_location.h + galileo_utc_model.h + galileo_ephemeris.h + galileo_almanac.h + galileo_almanac_helper.h + galileo_iono.h + galileo_navigation_message.h + sbas_ephemeris.h + galileo_fnav_message.h + gps_cnav_ephemeris.h + gps_cnav_navigation_message.h + gps_cnav_iono.h + gps_cnav_utc_model.h + rtcm.h + glonass_gnav_ephemeris.h + glonass_gnav_almanac.h + glonass_gnav_utc_model.h + glonass_gnav_navigation_message.h + display.h + Galileo_E1.h + Galileo_E5a.h + GLONASS_L1_L2_CA.h + gnss_frequencies.h + gnss_obs_codes.h + gnss_synchro.h + GPS_CNAV.h + GPS_L1_CA.h + GPS_L2C.h + GPS_L5.h + MATH_CONSTANTS.h ) - include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${GLOG_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib + ${GLOG_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} ) link_directories(${Boost_LIBRARY_DIR}) @@ -104,7 +104,13 @@ link_directories(${Boost_LIBRARY_DIR}) list(SORT SYSTEM_PARAMETERS_HEADERS) list(SORT SYSTEM_PARAMETERS_SOURCES) -add_library(gnss_system_parameters ${SYSTEM_PARAMETERS_SOURCES} ${SYSTEM_PARAMETERS_HEADERS}) +add_library(gnss_system_parameters + ${SYSTEM_PARAMETERS_SOURCES} + ${SYSTEM_PARAMETERS_HEADERS} +) + source_group(Headers FILES ${SYSTEM_PARAMETERS_HEADERS}) + add_dependencies(gnss_system_parameters rtklib_lib glog-${glog_RELEASE}) + target_link_libraries(gnss_system_parameters rtklib_lib ${Boost_LIBRARIES}) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 4dff21617..94a6344e6 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -32,7 +32,7 @@ if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) endif(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) if(OPENSSL_FOUND) - add_definitions( -DUSE_OPENSSL_FALLBACK=1 ) + add_definitions(-DUSE_OPENSSL_FALLBACK=1) endif(OPENSSL_FOUND) if(ENABLE_CUDA) @@ -47,65 +47,68 @@ if(ORC_FOUND) endif(ORC_FOUND) include_directories( - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/core/monitor - ${CMAKE_SOURCE_DIR}/src/core/libs - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} - ${GNSS_SDR_OPTIONAL_HEADERS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${OPT_GNSSSDR_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver + ${CMAKE_SOURCE_DIR}/src/core/monitor + ${CMAKE_SOURCE_DIR}/src/core/libs + ${CMAKE_SOURCE_DIR}/src/core/libs/supl + ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp + ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${ARMADILLO_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${PUGIXML_INCLUDE_DIR} + ${GNSS_SDR_OPTIONAL_HEADERS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} + ${OPT_GNSSSDR_INCLUDE_DIRS} ) -add_definitions( -DGNSS_SDR_VERSION="${VERSION}" ) +add_definitions(-DGNSS_SDR_VERSION="${VERSION}") if(OS_IS_MACOSX) - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(MAC_LIBRARIES "-framework Accelerate -lc++") - endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(MAC_LIBRARIES "-framework Accelerate -lc++") + endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif(OS_IS_MACOSX) add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) -add_custom_command(TARGET gnss-sdr POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ ) +add_custom_command(TARGET gnss-sdr + POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ + ${CMAKE_SOURCE_DIR}/install/$ +) -target_link_libraries(gnss-sdr ${MAC_LIBRARIES} - ${THREAD_LIBRARIES} - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${GNSS_SDR_OPTIONAL_LIBS} - gnss_sp_libs - gnss_sdr_flags - gnss_rx ) +target_link_libraries(gnss-sdr + ${MAC_LIBRARIES} + ${THREAD_LIBRARIES} + ${Boost_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${ARMADILLO_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} + ${GNSS_SDR_OPTIONAL_LIBS} + gnss_sp_libs + gnss_sdr_flags + gnss_rx +) install(TARGETS gnss-sdr - RUNTIME DESTINATION bin - COMPONENT "gnss-sdr" ) + RUNTIME DESTINATION bin + COMPONENT "gnss-sdr") install(DIRECTORY ${CMAKE_SOURCE_DIR}/conf DESTINATION share/gnss-sdr - FILES_MATCHING PATTERN "*.conf" ) + FILES_MATCHING PATTERN "*.conf") install(FILES ${CMAKE_SOURCE_DIR}/conf/gnss-sdr.conf DESTINATION share/gnss-sdr/conf - RENAME default.conf) + RENAME default.conf) if(NOT VOLK_GNSSSDR_FOUND) install(PROGRAMS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/apps/volk_gnsssdr_profile DESTINATION bin COMPONENT "volk_gnsssdr") @@ -123,22 +126,21 @@ find_program(GZIP if(NOT GZIP_NOTFOUND) execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/manpage/gnss-sdr-manpage - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/gnss-sdr.1.gz") + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/gnss-sdr.1.gz") install(FILES ${CMAKE_BINARY_DIR}/gnss-sdr.1.gz DESTINATION share/man/man1) execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/changelog - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/changelog.gz") + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/changelog.gz") install(FILES ${CMAKE_BINARY_DIR}/changelog.gz DESTINATION share/doc/gnss-sdr) if(NOT VOLK_GNSSSDR_FOUND) - execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz") - execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz") - - install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz DESTINATION share/man/man1) - install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz DESTINATION share/man/man1) + execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz") + execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz") + install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz DESTINATION share/man/man1) + install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz DESTINATION share/man/man1) endif(NOT VOLK_GNSSSDR_FOUND) endif(NOT GZIP_NOTFOUND) diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index 252131884..817676b30 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -18,13 +18,12 @@ if(OPENSSL_FOUND) - add_definitions( -DUSE_OPENSSL_FALLBACK=1 ) + add_definitions(-DUSE_OPENSSL_FALLBACK=1) endif(OPENSSL_FOUND) set(FRONT_END_CAL_SOURCES front_end_cal.cc) set(FRONT_END_CAL_HEADERS front_end_cal.h) - include_directories( ${CMAKE_SOURCE_DIR}/src/core/system_parameters ${CMAKE_SOURCE_DIR}/src/core/interfaces @@ -50,69 +49,69 @@ include_directories( add_library(front_end_cal_lib ${FRONT_END_CAL_SOURCES} ${FRONT_END_CAL_HEADERS}) source_group(Headers FILES ${FRONT_END_CAL_HEADERS}) -target_link_libraries(front_end_cal_lib ${MAC_LIBRARIES} - ${THREAD_LIBRARIES} - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} - ${GNSS_SDR_OPTIONAL_LIBS} - rx_core_lib - gnss_sdr_flags - gnss_rx - channel_fsm +target_link_libraries(front_end_cal_lib + ${MAC_LIBRARIES} + ${THREAD_LIBRARIES} + ${Boost_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${ARMADILLO_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} + ${GNSS_SDR_OPTIONAL_LIBS} + rx_core_lib + gnss_sdr_flags + gnss_rx + channel_fsm ) add_dependencies(front_end_cal_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE}) -add_definitions( -DGNSS_SDR_VERSION="${VERSION}" ) -add_definitions( -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" ) +add_definitions(-DGNSS_SDR_VERSION="${VERSION}") +add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") add_executable(front-end-cal ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) add_custom_command(TARGET front-end-cal POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$) + COMMAND ${CMAKE_COMMAND} -E copy $ + ${CMAKE_SOURCE_DIR}/install/$) - -target_link_libraries(front-end-cal ${MAC_LIBRARIES} - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} - ${GNSS_SDR_OPTIONAL_LIBS} - rx_core_lib - gnss_rx - front_end_cal_lib +target_link_libraries(front-end-cal + ${MAC_LIBRARIES} + ${Boost_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FFT_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${ARMADILLO_LIBRARIES} + ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} + ${GNSS_SDR_OPTIONAL_LIBS} + rx_core_lib + gnss_rx + front_end_cal_lib ) - install(TARGETS front-end-cal - RUNTIME DESTINATION bin - COMPONENT "front-end-cal" + RUNTIME DESTINATION bin + COMPONENT "front-end-cal" ) find_program(GZIP gzip - /bin - /usr/bin - /usr/local/bin - /opt/local/bin - /sbin - ) + /bin + /usr/bin + /usr/local/bin + /opt/local/bin + /sbin +) if(NOT GZIP_NOTFOUND) execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/manpage/front-end-cal-manpage - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/front-end-cal.1.gz") + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/front-end-cal.1.gz") install(FILES ${CMAKE_BINARY_DIR}/front-end-cal.1.gz DESTINATION share/man/man1) endif(NOT GZIP_NOTFOUND) diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 01c888381..0461d6185 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -20,8 +20,8 @@ find_package(GPSTK QUIET) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) include(GNUInstallDirs) string(REGEX REPLACE /[^/]*$ "" LIBDIR ${CMAKE_INSTALL_LIBDIR}) - set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} ) - set(GPSTK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include ) + set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(GPSTK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GPSTK_INCLUDE_DIR}/gpstk) @@ -43,17 +43,19 @@ target_link_libraries(rinex2assist ${GPSTK_LIBRARY} ${GFlags_LIBS} gnss_sp_libs - gnss_rx) + gnss_rx +) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) add_custom_command(TARGET rinex2assist POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$) + COMMAND ${CMAKE_COMMAND} -E copy $ + ${CMAKE_SOURCE_DIR}/install/$ +) install(TARGETS rinex2assist - RUNTIME DESTINATION bin - COMPONENT "rinex2assist" + RUNTIME DESTINATION bin + COMPONENT "rinex2assist" ) From a59ffca8a1c656b2480558e4daaf421d65fb07bf Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 22 Nov 2018 11:59:49 +0100 Subject: [PATCH 114/143] Fix Galileo sats position computation from Almanac data --- .../libs/rtklib/rtklib_conversions.cc | 20 ++++++++++--------- src/core/receiver/control_thread.cc | 4 +++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index 3106b6bc1..c913ab459 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -314,32 +314,34 @@ alm_t alm_to_rtklib(const Gps_Almanac& gps_alm) rtklib_alm.f1 = gps_alm.d_A_f1; rtklib_alm.toas = gps_alm.i_Toa; - return rtklib_alm; } + + alm_t alm_to_rtklib(const Galileo_Almanac& gal_alm) { alm_t rtklib_alm; rtklib_alm = {0, 0, 0, 0, {0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - rtklib_alm.sat = gal_alm.i_satellite_PRN; + rtklib_alm.sat = gal_alm.i_satellite_PRN + NSATGPS + NSATGLO; rtklib_alm.svh = gal_alm.E1B_HS; rtklib_alm.svconf = gal_alm.E1B_HS; rtklib_alm.week = gal_alm.i_WNa; - rtklib_alm.toa = gpst2time(gal_alm.i_WNa, gal_alm.i_Toa); + gtime_t toa; + toa.time = gal_alm.i_Toa; + rtklib_alm.toa = toa; rtklib_alm.A = 5440.588203494 + gal_alm.d_Delta_sqrt_A; rtklib_alm.A = rtklib_alm.A * rtklib_alm.A; rtklib_alm.e = gal_alm.d_e_eccentricity; - rtklib_alm.i0 = gal_alm.d_Delta_i + 0.31111; - rtklib_alm.OMG0 = gal_alm.d_OMEGA0; - rtklib_alm.OMGd = gal_alm.d_OMEGA_DOT; - rtklib_alm.omg = gal_alm.d_OMEGA; - rtklib_alm.M0 = gal_alm.d_M_0; + rtklib_alm.i0 = (gal_alm.d_Delta_i + 56.0 / 180.0) * PI; + rtklib_alm.OMG0 = gal_alm.d_OMEGA0 * PI; + rtklib_alm.OMGd = gal_alm.d_OMEGA_DOT * PI; + rtklib_alm.omg = gal_alm.d_OMEGA * PI; + rtklib_alm.M0 = gal_alm.d_M_0 * PI; rtklib_alm.f0 = gal_alm.d_A_f0; rtklib_alm.f1 = gal_alm.d_A_f1; rtklib_alm.toas = gal_alm.i_Toa; - return rtklib_alm; } diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 12148d811..dcd751f58 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -931,7 +931,9 @@ std::vector> ControlThread::get_visible_sats(time alm_t rtklib_alm = alm_to_rtklib(it->second); double r_sat[3]; double clock_bias_s; - alm2pos(gps_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); + gtime_t gal_gtime; + gal_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800); + alm2pos(gal_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); double Az, El, dist_m; arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec dx = r_sat_eb_e - r_eb_e; From 4bdb8c3bc4fb515ed6c6fbbba4b89d3e0bccfc97 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 22 Nov 2018 15:19:36 +0100 Subject: [PATCH 115/143] Fix computation of satellite elevation when using the GPS Almanac --- .../libs/rtklib/rtklib_conversions.cc | 14 ++++---- src/core/receiver/control_thread.cc | 32 ++++++++++++++----- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index c913ab459..4eb8d218f 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -302,14 +302,16 @@ alm_t alm_to_rtklib(const Gps_Almanac& gps_alm) rtklib_alm.svh = gps_alm.i_SV_health; rtklib_alm.svconf = gps_alm.i_AS_status; rtklib_alm.week = gps_alm.i_WNa; - rtklib_alm.toa = gpst2time(gps_alm.i_WNa, gps_alm.i_Toa); + gtime_t toa; + toa.time = gps_alm.i_Toa; + rtklib_alm.toa = toa; rtklib_alm.A = gps_alm.d_sqrt_A * gps_alm.d_sqrt_A; rtklib_alm.e = gps_alm.d_e_eccentricity; - rtklib_alm.i0 = gps_alm.d_Delta_i + 0.3; - rtklib_alm.OMG0 = gps_alm.d_OMEGA0; - rtklib_alm.OMGd = gps_alm.d_OMEGA_DOT; - rtklib_alm.omg = gps_alm.d_OMEGA; - rtklib_alm.M0 = gps_alm.d_M_0; + rtklib_alm.i0 = (gps_alm.d_Delta_i + 0.3) * PI; + rtklib_alm.OMG0 = gps_alm.d_OMEGA0 * PI; + rtklib_alm.OMGd = gps_alm.d_OMEGA_DOT * PI; + rtklib_alm.omg = gps_alm.d_OMEGA * PI; + rtklib_alm.M0 = gps_alm.d_M_0 * PI; rtklib_alm.f0 = gps_alm.d_A_f0; rtklib_alm.f1 = gps_alm.d_A_f1; rtklib_alm.toas = gps_alm.i_Toa; diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index dcd751f58..0aa4f3ac7 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -851,7 +852,8 @@ std::vector> ControlThread::get_visible_sats(time // 3. loop through all the available ephemeris or almanac and compute satellite positions and elevations // store visible satellites in a vector of pairs to associate an elevation to the each satellite std::vector> available_satellites; - + std::vector visible_gps; + std::vector visible_gal; std::shared_ptr pvt_ptr = flowgraph_->get_pvt(); struct tm tstruct; char buf[80]; @@ -880,6 +882,7 @@ std::vector> ControlThread::get_visible_sats(time std::cout << "Using GPS Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); + visible_gps.push_back(it->second.i_satellite_PRN); } } @@ -902,6 +905,7 @@ std::vector> ControlThread::get_visible_sats(time std::cout << "Using Galileo Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); + visible_gal.push_back(it->second.i_satellite_PRN); } } @@ -911,17 +915,23 @@ std::vector> ControlThread::get_visible_sats(time alm_t rtklib_alm = alm_to_rtklib(it->second); double r_sat[3]; double clock_bias_s; + gps_gtime.time = fmod(utc2gpst(gps_gtime).time, 604800); alm2pos(gps_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); double Az, El, dist_m; arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec dx = r_sat_eb_e - r_eb_e; topocent(&Az, &El, &dist_m, r_eb_e, dx); // push sat + std::vector::iterator it2; if (El > 0) { - std::cout << "Using GPS Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; - available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); + it2 = std::find(visible_gps.begin(), visible_gps.end(), it->second.i_satellite_PRN); + if (it2 == visible_gps.end()) + { + std::cout << "Using GPS Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + available_satellites.push_back(std::pair(floor(El), + (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); + } } } @@ -939,11 +949,16 @@ std::vector> ControlThread::get_visible_sats(time arma::vec dx = r_sat_eb_e - r_eb_e; topocent(&Az, &El, &dist_m, r_eb_e, dx); // push sat + std::vector::iterator it2; if (El > 0) { - std::cout << "Using Galileo Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; - available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); + it2 = std::find(visible_gal.begin(), visible_gal.end(), it->second.i_satellite_PRN); + if (it2 == visible_gal.end()) + { + std::cout << "Using Galileo Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + available_satellites.push_back(std::pair(floor(El), + (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); + } } } @@ -951,7 +966,8 @@ std::vector> ControlThread::get_visible_sats(time std::sort(available_satellites.begin(), available_satellites.end(), [](const std::pair &a, const std::pair &b) { // use lambda. Cleaner and easier to read return a.first < b.first; }); - // std::reverse(available_satellites.begin(), available_satellites.end()); + // provide list starting from satellites with higher elevation + std::reverse(available_satellites.begin(), available_satellites.end()); return available_satellites; } From f3e32e30e9503f95dc815dc5b9ea266d0a275597 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 22 Nov 2018 17:07:01 +0100 Subject: [PATCH 116/143] Fix computation of sat positions with GPS Almanac --- src/core/receiver/control_thread.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 0aa4f3ac7..0b1a1aae0 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -734,7 +734,9 @@ void ControlThread::init() else { // fill agnss_ref_time_ - agnss_ref_time_.d_tv_sec = 0; // fill + struct tm tm; + strptime(ref_time_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm); + agnss_ref_time_.d_tv_sec = timegm(&tm); agnss_ref_time_.valid = true; } } @@ -861,7 +863,7 @@ std::vector> ControlThread::get_visible_sats(time strftime(buf, sizeof(buf), "%d/%m/%Y %H:%M:%S ", &tstruct); std::string str_time = std::string(buf); std::cout << "Get visible satellites at " << str_time - << " UTC, assuming RX position " << LLH(0) << " [deg], " << LLH(1) << " [deg], " << LLH(2) << " [m]" << std::endl; + << "UTC, assuming RX position " << LLH(0) << " [deg], " << LLH(1) << " [deg], " << LLH(2) << " [m]" << std::endl; std::map gps_eph_map = pvt_ptr->get_gps_ephemeris(); for (std::map::iterator it = gps_eph_map.begin(); it != gps_eph_map.end(); ++it) @@ -915,8 +917,9 @@ std::vector> ControlThread::get_visible_sats(time alm_t rtklib_alm = alm_to_rtklib(it->second); double r_sat[3]; double clock_bias_s; - gps_gtime.time = fmod(utc2gpst(gps_gtime).time, 604800); - alm2pos(gps_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); + gtime_t aux_gtime; + aux_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800); + alm2pos(aux_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); double Az, El, dist_m; arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec dx = r_sat_eb_e - r_eb_e; From a8fe18f43586b5de56acc6ba7c4c9bbfa61cdd04 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 23 Nov 2018 16:28:28 +0100 Subject: [PATCH 117/143] Fix defects detected by XCode --- src/algorithms/PVT/adapters/rtklib_pvt.h | 2 -- src/algorithms/libs/galileo_e1_signal_processing.cc | 4 ++-- src/algorithms/libs/galileo_e5_signal_processing.cc | 10 ++-------- src/algorithms/libs/gps_sdr_signal_processing.cc | 2 +- src/core/system_parameters/galileo_fnav_message.cc | 2 +- .../system_parameters/galileo_navigation_message.cc | 2 +- .../system_parameters/gps_cnav_navigation_message.cc | 2 +- src/core/system_parameters/gps_navigation_message.cc | 3 ++- .../galileo_fnav_inav_decoder_test.cc | 6 +++--- 9 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.h b/src/algorithms/PVT/adapters/rtklib_pvt.h index bc753a560..ed2bf7da4 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.h +++ b/src/algorithms/PVT/adapters/rtklib_pvt.h @@ -95,8 +95,6 @@ public: private: rtklib_pvt_cc_sptr pvt_; rtk_t rtk; - bool dump_; - std::string dump_filename_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; diff --git a/src/algorithms/libs/galileo_e1_signal_processing.cc b/src/algorithms/libs/galileo_e1_signal_processing.cc index 5078fd479..3aaf2047c 100644 --- a/src/algorithms/libs/galileo_e1_signal_processing.cc +++ b/src/algorithms/libs/galileo_e1_signal_processing.cc @@ -126,8 +126,8 @@ void galileo_e1_gen_float(float* _dest, int* _prn, char _Signal[3]) const float alpha = sqrt(10.0 / 11.0); const float beta = sqrt(1.0 / 11.0); - int32_t sinboc_11[12 * 4092]; // _codeLength not accepted by Clang - int32_t sinboc_61[12 * 4092]; + int32_t sinboc_11[12 * 4092] = {0}; // _codeLength not accepted by Clang + int32_t sinboc_61[12 * 4092] = {0}; galileo_e1_sinboc_11_gen_int(sinboc_11, _prn, _codeLength); //generate sinboc(1,1) 12 samples per chip galileo_e1_sinboc_61_gen_int(sinboc_61, _prn, _codeLength); //generate sinboc(6,1) 12 samples per chip diff --git a/src/algorithms/libs/galileo_e5_signal_processing.cc b/src/algorithms/libs/galileo_e5_signal_processing.cc index 29d7615dd..82ef4ed54 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.cc +++ b/src/algorithms/libs/galileo_e5_signal_processing.cc @@ -131,12 +131,6 @@ void galileo_e5_a_code_gen_complex_sampled(std::complex* _dest, char _Sig { _dest[(i + delay) % _samplesPerCode] = _code[i]; } - if (_fs != _codeFreqBasis) - { - free(_code); - } - else - { - delete[] _code; - } + + delete[] _code; } diff --git a/src/algorithms/libs/gps_sdr_signal_processing.cc b/src/algorithms/libs/gps_sdr_signal_processing.cc index b0a49fbd0..db3c33eff 100644 --- a/src/algorithms/libs/gps_sdr_signal_processing.cc +++ b/src/algorithms/libs/gps_sdr_signal_processing.cc @@ -131,7 +131,7 @@ void gps_l1_ca_code_gen_float(float* _dest, int32_t _prn, uint32_t _chip_shift) void gps_l1_ca_code_gen_complex(std::complex* _dest, int32_t _prn, uint32_t _chip_shift) { const uint32_t _code_length = 1023; - int32_t ca_code_int[_code_length]; + int32_t ca_code_int[_code_length] = {0}; gps_l1_ca_code_gen_int(ca_code_int, _prn, _chip_shift); diff --git a/src/core/system_parameters/galileo_fnav_message.cc b/src/core/system_parameters/galileo_fnav_message.cc index 42a4a7c1b..33cd59056 100644 --- a/src/core/system_parameters/galileo_fnav_message.cc +++ b/src/core/system_parameters/galileo_fnav_message.cc @@ -459,7 +459,7 @@ int64_t Galileo_Fnav_Message::read_navigation_signed(std::bitset start, end; std::chrono::duration elapsed_seconds(0); - + start = std::chrono::system_clock::now(); int repetitions = 10; // FNAV FULLY ENCODED FRAME double FNAV_frame[488] = {-1, 1, -1, -1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -282,7 +282,7 @@ TEST_F(Galileo_FNAV_INAV_test, ValidationOfResults) EXPECT_EQ(decode_INAV_word(&INAV_frame_odd[0], 240), true); } }) << "Exception during INAV frame decoding"; - - + end = std::chrono::system_clock::now(); + elapsed_seconds = end - start; std::cout << "Galileo FNAV/INAV Test completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } From c7486ad723806012ae10a7b766b466266c7d6799 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 23 Nov 2018 16:38:20 +0100 Subject: [PATCH 118/143] Add some control to input parameters --- src/core/receiver/control_thread.cc | 158 ++++++++++++++++------------ 1 file changed, 90 insertions(+), 68 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 0b1a1aae0..63c3cc3fd 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -100,6 +100,94 @@ ControlThread::ControlThread(std::shared_ptr configurati } +void ControlThread::init() +{ + // Instantiates a control queue, a GNSS flowgraph, and a control message factory + control_queue_ = gr::msg_queue::make(0); + cmd_interface_.set_msg_queue(control_queue_); //set also the queue pointer for the telecommand thread + try + { + flowgraph_ = std::make_shared(configuration_, control_queue_); + } + catch (const boost::bad_lexical_cast &e) + { + std::cout << "Caught bad lexical cast with error " << e.what() << std::endl; + } + control_message_factory_ = std::make_shared(); + stop_ = false; + processed_control_messages_ = 0; + applied_actions_ = 0; + supl_mcc = 0; + supl_mns = 0; + supl_lac = 0; + supl_ci = 0; + msqid = -1; + agnss_ref_location_ = Agnss_Ref_Location(); + agnss_ref_time_ = Agnss_Ref_Time(); + + std::string empty_string = ""; + std::string ref_location_str = configuration_->property("GNSS-SDR.AGNSS_ref_location", empty_string); + std::string ref_time_str = configuration_->property("GNSS-SDR.AGNSS_ref_utc_time", empty_string); + if (ref_location_str.compare(empty_string) != 0) + { + std::vector vect; + std::stringstream ss(ref_location_str); + double d; + while (ss >> d) + { + vect.push_back(d); + if ((ss.peek() == ',') or (ss.peek() == ' ')) + ss.ignore(); + } + // fill agnss_ref_location_ + if (vect.size() >= 2) + { + if ((vect[0] < 90.0) and (vect[0] > -90) and (vect[1] < 180.0) and (vect[1] > -180.0)) + { + agnss_ref_location_.lat = vect[0]; + agnss_ref_location_.lon = vect[1]; + agnss_ref_location_.valid = true; + } + else + { + std::cerr << "GNSS-SDR.AGNSS_ref_location=" << ref_location_str << " is not a valid position." << std::endl; + agnss_ref_location_.valid = false; + } + } + } + if (ref_time_str.compare(empty_string) == 0) + { + // Make an educated guess + time_t rawtime; + time(&rawtime); + agnss_ref_time_.d_tv_sec = rawtime; + agnss_ref_time_.valid = true; + } + else + { + // fill agnss_ref_time_ + struct tm tm; + if (strptime(ref_time_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm) != nullptr) + { + agnss_ref_time_.d_tv_sec = timegm(&tm); + if (agnss_ref_time_.d_tv_sec > 0) + { + agnss_ref_time_.valid = true; + } + else + { + std::cerr << "GNSS-SDR.AGNSS_ref_utc_time=" << ref_time_str << " is not well-formed. Please use four digits for the year: DD/MM/YYYY HH:MM:SS" << std::endl; + } + } + else + { + std::cerr << "GNSS-SDR.AGNSS_ref_utc_time=" << ref_time_str << " is not well-formed. Should be DD/MM/YYYY HH:MM:SS in UTC" << std::endl; + agnss_ref_location_.valid = false; + } + } +} + + ControlThread::~ControlThread() { // save navigation data to files @@ -110,7 +198,7 @@ ControlThread::~ControlThread() void ControlThread::telecommand_listener() { - int tcp_cmd_port = configuration_->property("Channel.telecontrol_tcp_port", 3333); + int tcp_cmd_port = configuration_->property("GNSS-SDR.telecontrol_tcp_port", 3333); cmd_interface_.run_cmd_server(tcp_cmd_port); } @@ -653,7 +741,7 @@ void ControlThread::assist_GNSS() } // If we have enough AGNSS data, make use of it - if (agnss_ref_location_.valid == true) // and agnss_ref_time_.valid == true and we have AGNSS data + if ((agnss_ref_location_.valid == true) and ((enable_gps_supl_assistance == true) or (enable_agnss_xml == true))) { // Get the list of visible satellites arma::vec ref_LLH = arma::zeros(3, 1); @@ -676,72 +764,6 @@ void ControlThread::assist_GNSS() } -void ControlThread::init() -{ - // Instantiates a control queue, a GNSS flowgraph, and a control message factory - control_queue_ = gr::msg_queue::make(0); - cmd_interface_.set_msg_queue(control_queue_); //set also the queue pointer for the telecommand thread - try - { - flowgraph_ = std::make_shared(configuration_, control_queue_); - } - catch (const boost::bad_lexical_cast &e) - { - std::cout << "Caught bad lexical cast with error " << e.what() << std::endl; - } - control_message_factory_ = std::make_shared(); - stop_ = false; - processed_control_messages_ = 0; - applied_actions_ = 0; - supl_mcc = 0; - supl_mns = 0; - supl_lac = 0; - supl_ci = 0; - msqid = -1; - agnss_ref_location_ = Agnss_Ref_Location(); - agnss_ref_time_ = Agnss_Ref_Time(); - - std::string empty_string = ""; - std::string ref_location_str = configuration_->property("GNSS-SDR.AGNSS_ref_location", empty_string); - std::string ref_time_str = configuration_->property("GNSS-SDR.AGNSS_ref_utc_time", empty_string); - if (ref_location_str.compare(empty_string) != 0) - { - std::vector vect; - std::stringstream ss(ref_location_str); - double d; - while (ss >> d) - { - vect.push_back(d); - if (ss.peek() == ',') - ss.ignore(); - } - // fill agnss_ref_location_ - if (vect.size() >= 2) - { - agnss_ref_location_.lat = vect[0]; - agnss_ref_location_.lon = vect[1]; - agnss_ref_location_.valid = true; - } - } - if (ref_time_str.compare(empty_string) == 0) - { - // Make an educated guess - time_t rawtime; - time(&rawtime); - agnss_ref_time_.d_tv_sec = rawtime; - agnss_ref_time_.valid = true; - } - else - { - // fill agnss_ref_time_ - struct tm tm; - strptime(ref_time_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm); - agnss_ref_time_.d_tv_sec = timegm(&tm); - agnss_ref_time_.valid = true; - } -} - - void ControlThread::read_control_messages() { DLOG(INFO) << "Reading control messages from queue"; From 144269a268b4f6b99e286787b94925db5e0f9004 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 24 Nov 2018 09:40:15 +0100 Subject: [PATCH 119/143] Minor cleaning --- src/core/receiver/control_thread.cc | 37 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 63c3cc3fd..fa7001e97 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -182,7 +182,7 @@ void ControlThread::init() else { std::cerr << "GNSS-SDR.AGNSS_ref_utc_time=" << ref_time_str << " is not well-formed. Should be DD/MM/YYYY HH:MM:SS in UTC" << std::endl; - agnss_ref_location_.valid = false; + agnss_ref_time_.valid = false; } } } @@ -273,7 +273,7 @@ int ControlThread::run() stop_ = true; flowgraph_->disconnect(); -//Join keyboard thread +// Join keyboard thread #ifdef OLD_BOOST keyboard_thread_.timed_join(boost::posix_time::seconds(1)); sysv_queue_thread_.timed_join(boost::posix_time::seconds(1)); @@ -289,11 +289,11 @@ int ControlThread::run() if (restart_) { - return 42; //signal the gnss-sdr-harness.sh to restart the receiver program + return 42; // signal the gnss-sdr-harness.sh to restart the receiver program } else { - return 0; //normal shutdown + return 0; // normal shutdown } } @@ -590,7 +590,7 @@ void ControlThread::assist_GNSS() bool SUPL_read_gps_assistance_xml = configuration_->property("GNSS-SDR.SUPL_read_gps_assistance_xml", false); if (SUPL_read_gps_assistance_xml == true) { - // read assistance from file + // Read assistance from file if (read_assistance_from_XML()) { std::cout << "GNSS assistance data loaded from local XML file(s)." << std::endl; @@ -740,7 +740,7 @@ void ControlThread::assist_GNSS() } } - // If we have enough AGNSS data, make use of it + // If AGNSS is enabled, make use of it if ((agnss_ref_location_.valid == true) and ((enable_gps_supl_assistance == true) or (enable_agnss_xml == true))) { // Get the list of visible satellites @@ -780,7 +780,6 @@ void ControlThread::read_control_messages() // Apply the corresponding control actions -// TODO: May be it is better to move the apply_action state machine to the control_thread void ControlThread::process_control_messages() { for (unsigned int i = 0; i < control_messages_->size(); i++) @@ -792,7 +791,7 @@ void ControlThread::process_control_messages() } else { - if (control_messages_->at(i)->who == 300) //some TC commands require also actions from controlthread + if (control_messages_->at(i)->who == 300) // some TC commands require also actions from control_thread { apply_action(control_messages_->at(i)->what); } @@ -824,32 +823,32 @@ void ControlThread::apply_action(unsigned int what) break; case 11: LOG(INFO) << "Receiver action COLDSTART"; - //delete all ephemeris and almanac information from maps (also the PVT map queue) + // delete all ephemeris and almanac information from maps (also the PVT map queue) pvt_ptr = flowgraph_->get_pvt(); pvt_ptr->clear_ephemeris(); - //todo: reorder the satellite queues to the receiver default startup order. - //This is required to allow repeatability. Otherwise the satellite search order will depend on the last tracked satellites + // todo: reorder the satellite queues to the receiver default startup order. + // This is required to allow repeatability. Otherwise the satellite search order will depend on the last tracked satellites break; case 12: LOG(INFO) << "Receiver action HOTSTART"; visible_satellites = get_visible_sats(cmd_interface_.get_utc_time(), cmd_interface_.get_LLH()); - //reorder the satellite queue to acquire first those visible satellites + // reorder the satellite queue to acquire first those visible satellites flowgraph_->priorize_satellites(visible_satellites); - //start again the satellite acquisitions (done in chained apply_action to flowgraph) + // start again the satellite acquisitions (done in chained apply_action to flowgraph) break; case 13: LOG(INFO) << "Receiver action WARMSTART"; - //delete all ephemeris and almanac information from maps (also the PVT map queue) + // delete all ephemeris and almanac information from maps (also the PVT map queue) pvt_ptr = flowgraph_->get_pvt(); pvt_ptr->clear_ephemeris(); - //load the ephemeris and the almanac from XML files (receiver assistance) + // load the ephemeris and the almanac from XML files (receiver assistance) read_assistance_from_XML(); - //call here the function that computes the set of visible satellites and its elevation - //for the date and time specified by the warm start command and the assisted position + // call here the function that computes the set of visible satellites and its elevation + // for the date and time specified by the warm start command and the assisted position get_visible_sats(cmd_interface_.get_utc_time(), cmd_interface_.get_LLH()); - //reorder the satellite queue to acquire first those visible satellites + // reorder the satellite queue to acquire first those visible satellites flowgraph_->priorize_satellites(visible_satellites); - //start again the satellite acquisitions (done in chained apply_action to flowgraph) + // start again the satellite acquisitions (done in chained apply_action to flowgraph) break; default: LOG(INFO) << "Unrecognized action."; From 1d659cb1de49982fe7aa3a0ed0f885e1485af858 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 24 Nov 2018 09:41:21 +0100 Subject: [PATCH 120/143] Add protection to malformed time entry --- src/core/receiver/tcp_cmd_interface.cc | 71 ++++++++++++++------------ 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 9d3591488..ecb175e5f 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -35,6 +35,35 @@ #include +TcpCmdInterface::TcpCmdInterface() +{ + register_functions(); + keep_running_ = true; + control_queue_ = nullptr; + rx_latitude_ = 0; + rx_longitude_ = 0; + rx_altitude_ = 0; + receiver_utc_time_ = 0; +} + + +TcpCmdInterface::~TcpCmdInterface() +{ +} + + +void TcpCmdInterface::register_functions() +{ + functions["status"] = std::bind(&TcpCmdInterface::status, this, std::placeholders::_1); + functions["standby"] = std::bind(&TcpCmdInterface::standby, this, std::placeholders::_1); + functions["reset"] = std::bind(&TcpCmdInterface::reset, this, std::placeholders::_1); + functions["hotstart"] = std::bind(&TcpCmdInterface::hotstart, this, std::placeholders::_1); + functions["warmstart"] = std::bind(&TcpCmdInterface::warmstart, this, std::placeholders::_1); + functions["coldstart"] = std::bind(&TcpCmdInterface::coldstart, this, std::placeholders::_1); + functions["set_ch_satellite"] = std::bind(&TcpCmdInterface::set_ch_satellite, this, std::placeholders::_1); +} + + void TcpCmdInterface::set_pvt(std::shared_ptr PVT_sptr) { PVT_sptr_ = PVT_sptr; @@ -145,7 +174,11 @@ std::string TcpCmdInterface::hotstart(const std::vector &commandLin { // Read commandline time parameter struct tm tm; - strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm); + if (strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr) + { + response = "ERROR: time parameter malformed\n"; + return response; + } receiver_utc_time_ = timegm(&tm); // Read latitude, longitude, and height @@ -188,7 +221,11 @@ std::string TcpCmdInterface::warmstart(const std::vector &commandLi // Read commandline time parameter struct tm tm; tmp_str = commandLine.at(1) + commandLine.at(2); - strptime(tmp_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm); + if (strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr) + { + response = "ERROR: time parameter malformed\n"; + return response; + } receiver_utc_time_ = timegm(&tm); // Read latitude, longitude, and height @@ -247,30 +284,6 @@ std::string TcpCmdInterface::set_ch_satellite(const std::vector &co } -void TcpCmdInterface::register_functions() -{ - functions["status"] = std::bind(&TcpCmdInterface::status, this, std::placeholders::_1); - functions["standby"] = std::bind(&TcpCmdInterface::standby, this, std::placeholders::_1); - functions["reset"] = std::bind(&TcpCmdInterface::reset, this, std::placeholders::_1); - functions["hotstart"] = std::bind(&TcpCmdInterface::hotstart, this, std::placeholders::_1); - functions["warmstart"] = std::bind(&TcpCmdInterface::warmstart, this, std::placeholders::_1); - functions["coldstart"] = std::bind(&TcpCmdInterface::coldstart, this, std::placeholders::_1); - functions["set_ch_satellite"] = std::bind(&TcpCmdInterface::set_ch_satellite, this, std::placeholders::_1); -} - - -TcpCmdInterface::TcpCmdInterface() -{ - register_functions(); - keep_running_ = true; - control_queue_ = nullptr; - rx_latitude_ = 0; - rx_longitude_ = 0; - rx_altitude_ = 0; - receiver_utc_time_ = 0; -} - - void TcpCmdInterface::set_msg_queue(gr::msg_queue::sptr control_queue) { control_queue_ = control_queue; @@ -385,9 +398,3 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) std::cout << "TCP Command Interface exception: address already in use" << std::endl; } } - - -TcpCmdInterface::~TcpCmdInterface() -{ - // TODO Auto-generated destructor stub -} From 87d1413447674231f31cbb8f7c09dba2934a51f6 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 24 Nov 2018 18:40:34 +0100 Subject: [PATCH 121/143] Make cmakelint happier --- CMakeLists.txt | 1100 ++++++++--------- src/CMakeLists.txt | 2 +- src/algorithms/PVT/adapters/CMakeLists.txt | 2 +- .../PVT/gnuradio_blocks/CMakeLists.txt | 2 +- src/algorithms/PVT/libs/CMakeLists.txt | 6 +- .../acquisition/adapters/CMakeLists.txt | 4 +- .../gnuradio_blocks/CMakeLists.txt | 18 +- .../acquisition/libs/CMakeLists.txt | 6 +- .../input_filter/adapters/CMakeLists.txt | 2 +- .../gnuradio_blocks/CMakeLists.txt | 6 +- src/algorithms/libs/CMakeLists.txt | 18 +- src/algorithms/libs/rtklib/CMakeLists.txt | 2 +- .../gnuradio_blocks/CMakeLists.txt | 4 +- .../resampler/adapters/CMakeLists.txt | 2 +- .../gnuradio_blocks/CMakeLists.txt | 6 +- .../signal_source/adapters/CMakeLists.txt | 84 +- .../gnuradio_blocks/CMakeLists.txt | 14 +- .../signal_source/libs/CMakeLists.txt | 12 +- .../gnuradio_blocks/CMakeLists.txt | 4 +- .../tracking/adapters/CMakeLists.txt | 5 +- .../tracking/gnuradio_blocks/CMakeLists.txt | 31 +- src/algorithms/tracking/libs/CMakeLists.txt | 12 +- src/core/libs/CMakeLists.txt | 4 +- src/core/libs/supl/CMakeLists.txt | 6 +- src/core/receiver/CMakeLists.txt | 60 +- src/core/system_parameters/CMakeLists.txt | 2 - src/main/CMakeLists.txt | 26 +- src/tests/CMakeLists.txt | 333 ++--- src/tests/system-tests/libs/CMakeLists.txt | 31 +- .../libs/CMakeLists.txt | 33 +- src/utils/CMakeLists.txt | 2 +- src/utils/front-end-cal/CMakeLists.txt | 5 +- src/utils/rinex2assist/CMakeLists.txt | 6 +- 33 files changed, 940 insertions(+), 910 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7366593ad..fceeb244b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ ######################################################################## if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) message(WARNING "In-tree build is bad practice. Try 'cd build && cmake ../' ") -endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) +endif() cmake_minimum_required(VERSION 2.8) project(gnss-sdr CXX C) @@ -31,11 +31,11 @@ file(RELATIVE_PATH RELATIVE_CMAKE_CALL ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRE if(NOT CMAKE_PREFIX_PATH) if(DEFINED ENV{PYBOMBS_PREFIX}) set(CMAKE_PREFIX_PATH $ENV{PYBOMBS_PREFIX}) - endif(DEFINED ENV{PYBOMBS_PREFIX}) + endif() if(DEFINED ENV{SNAP}) set(CMAKE_PREFIX_PATH $ENV{SNAP}) - endif(DEFINED ENV{SNAP}) -endif(NOT CMAKE_PREFIX_PATH) + endif() +endif() @@ -72,7 +72,7 @@ option(ENABLE_OWN_ARMADILLO "Download and build Armadillo locally" OFF) option(ENABLE_LOG "Enable logging" ON) if(ENABLE_PACKAGING) set(ENABLE_GENERIC_ARCH ON) -endif(ENABLE_PACKAGING) +endif() # Testing option(ENABLE_UNIT_TESTING "Build unit tests" ON) @@ -82,12 +82,12 @@ option(ENABLE_SYSTEM_TESTING "Build system tests" OFF) option(ENABLE_SYSTEM_TESTING_EXTRA "Download external tools and build extra system tests" OFF) if(ENABLE_SYSTEM_TESTING_EXTRA) set(ENABLE_SYSTEM_TESTING ON) -endif(ENABLE_SYSTEM_TESTING_EXTRA) +endif() option(ENABLE_OWN_GPSTK "Force to download, build and link GPSTk for system tests, even if it is already installed" OFF) option(ENABLE_INSTALL_TESTS "Install QA code system-wide" OFF) if(ENABLE_FPGA) set(ENABLE_INSTALL_TESTS ON) -endif(ENABLE_FPGA) +endif() @@ -110,15 +110,15 @@ if(NOT ${THIS_IS_A_RELEASE}) OUTPUT_VARIABLE GIT_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE ) -endif(NOT ${THIS_IS_A_RELEASE}) +endif() set(VERSION_INFO_MAJOR_VERSION 0) -set(VERSION_INFO_API_COMPAT 0) +set(VERSION_INFO_API_COMPAT 0) if(${THIS_IS_A_RELEASE}) set(VERSION_INFO_MINOR_VERSION 9) -else(${THIS_IS_A_RELEASE}) +else() set(VERSION_INFO_MINOR_VERSION 9.git-${GIT_BRANCH}-${GIT_COMMIT_HASH}) -endif(${THIS_IS_A_RELEASE}) +endif() set(VERSION ${VERSION_INFO_MAJOR_VERSION}.${VERSION_INFO_API_COMPAT}.${VERSION_INFO_MINOR_VERSION}) @@ -129,9 +129,9 @@ set(VERSION ${VERSION_INFO_MAJOR_VERSION}.${VERSION_INFO_API_COMPAT}.${VERSION_I ######################################################################## include(ExternalProject) # Detect 64-bits machine -if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) +if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(ARCH_64BITS TRUE) -endif( CMAKE_SIZEOF_VOID_P EQUAL 8 ) +endif() set(OS_IS_MACOSX "") set(OS_IS_LINUX "") @@ -142,85 +142,85 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(OS_IS_LINUX TRUE) if(ARCH_64BITS) set(ARCH_ "(64 bits)") - else(ARCH_64BITS) + else() set(ARCH_ "(32 bits)") - endif(ARCH_64BITS) + endif() if(EXISTS "/etc/lsb-release") execute_process(COMMAND cat /etc/lsb-release - COMMAND grep DISTRIB_ID - COMMAND awk -F= "{ print $2 }" - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE LINUX_DISTRIBUTION - RESULT_VARIABLE LINUX_ID_RESULT + COMMAND grep DISTRIB_ID + COMMAND awk -F= "{ print $2 }" + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE LINUX_DISTRIBUTION + RESULT_VARIABLE LINUX_ID_RESULT ) execute_process(COMMAND cat /etc/lsb-release - COMMAND grep DISTRIB_RELEASE - COMMAND awk -F= "{ print $2 }" - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE LINUX_VER - RESULT_VARIABLE LINUX_VER_RESULT + COMMAND grep DISTRIB_RELEASE + COMMAND awk -F= "{ print $2 }" + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE LINUX_VER + RESULT_VARIABLE LINUX_VER_RESULT ) - endif(EXISTS "/etc/lsb-release") + endif() if(NOT LINUX_DISTRIBUTION) if(EXISTS "/etc/linuxmint/info") - set(LINUX_DISTRIBUTION "LinuxMint") - execute_process(COMMAND cat /etc/linuxmint/info - COMMAND grep -m1 RELEASE - COMMAND awk -F= "{ print $2 }" - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE LINUX_VER - RESULT_VARIABLE LINUX_VER_RESULT - ) - endif(EXISTS "/etc/linuxmint/info") - endif(NOT LINUX_DISTRIBUTION) + set(LINUX_DISTRIBUTION "LinuxMint") + execute_process(COMMAND cat /etc/linuxmint/info + COMMAND grep -m1 RELEASE + COMMAND awk -F= "{ print $2 }" + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE LINUX_VER + RESULT_VARIABLE LINUX_VER_RESULT + ) + endif() + endif() if(NOT LINUX_DISTRIBUTION) if(EXISTS "/etc/os-release") - execute_process(COMMAND cat /etc/os-release - COMMAND grep -m1 NAME - COMMAND awk -F= "{ print $2 }" - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE LINUX_DISTRIBUTION - RESULT_VARIABLE LINUX_ID_RESULT - ) - execute_process(COMMAND cat /etc/os-release - COMMAND grep VERSION_ID - COMMAND awk -F= "{ print $2 }" - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE LINUX_VER - RESULT_VARIABLE LINUX_VER_RESULT - ) - if(${LINUX_DISTRIBUTION} MATCHES "Debian") - set(LINUX_DISTRIBUTION "Debian") - file(READ /etc/debian_version LINUX_VER) - endif(${LINUX_DISTRIBUTION} MATCHES "Debian") - endif(EXISTS "/etc/os-release") - endif(NOT LINUX_DISTRIBUTION) + execute_process(COMMAND cat /etc/os-release + COMMAND grep -m1 NAME + COMMAND awk -F= "{ print $2 }" + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE LINUX_DISTRIBUTION + RESULT_VARIABLE LINUX_ID_RESULT + ) + execute_process(COMMAND cat /etc/os-release + COMMAND grep VERSION_ID + COMMAND awk -F= "{ print $2 }" + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE LINUX_VER + RESULT_VARIABLE LINUX_VER_RESULT + ) + if(${LINUX_DISTRIBUTION} MATCHES "Debian") + set(LINUX_DISTRIBUTION "Debian") + file(READ /etc/debian_version LINUX_VER) + endif() + endif() + endif() if(NOT LINUX_DISTRIBUTION) if(EXISTS "/etc/redhat-release") - set(LINUX_DISTRIBUTION "Red Hat") - file(READ /etc/redhat-release LINUX_VER) - endif(EXISTS "/etc/redhat-release") - endif(NOT LINUX_DISTRIBUTION) + set(LINUX_DISTRIBUTION "Red Hat") + file(READ /etc/redhat-release LINUX_VER) + endif() + endif() if(NOT LINUX_DISTRIBUTION) if(EXISTS "/etc/debian_version") - set(LINUX_DISTRIBUTION "Debian") - file(READ /etc/debian_version LINUX_VER) - endif(EXISTS "/etc/debian_version") - endif(NOT LINUX_DISTRIBUTION) + set(LINUX_DISTRIBUTION "Debian") + file(READ /etc/debian_version LINUX_VER) + endif() + endif() if(NOT LINUX_DISTRIBUTION) set(LINUX_DISTRIBUTION "Generic") set(LINUX_VER "Unknown") - endif(NOT LINUX_DISTRIBUTION) + endif() message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on ${LINUX_DISTRIBUTION} GNU/Linux Release ${LINUX_VER} ${ARCH_}") -endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") +endif() if(NOT LINUX_DISTRIBUTION) set(LINUX_DISTRIBUTION "Unknown") -endif(NOT LINUX_DISTRIBUTION) +endif() # Detect macOS / Mac OS X Version if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") @@ -233,48 +233,48 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS Mojave 10.14") - endif(${DARWIN_VERSION} MATCHES "18") + endif() if(${DARWIN_VERSION} MATCHES "17") set(MACOS_HIGH_SIERRA TRUE) set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS High Sierra 10.13") - endif(${DARWIN_VERSION} MATCHES "17") + endif() if(${DARWIN_VERSION} MATCHES "16") set(MACOS_SIERRA TRUE) set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS Sierra 10.12") - endif(${DARWIN_VERSION} MATCHES "16") + endif() if(${DARWIN_VERSION} MATCHES "15") set(MACOSX_EL_CAPITAN TRUE) set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.11 El Capitan") - endif(${DARWIN_VERSION} MATCHES "15") + endif() if(${DARWIN_VERSION} MATCHES "14") set(MACOSX_YOSEMITE TRUE) set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.10 Yosemite") - endif(${DARWIN_VERSION} MATCHES "14") + endif() if(${DARWIN_VERSION} MATCHES "13") set(MACOSX_MAVERICKS TRUE) set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION="com.apple.compilers.llvm.clang.1_0") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.9 Mavericks") - endif(${DARWIN_VERSION} MATCHES "13") + endif() if(${DARWIN_VERSION} MATCHES "12") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.8 Mountain Lion") - endif(${DARWIN_VERSION} MATCHES "12") + endif() if(${DARWIN_VERSION} MATCHES "11") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.7 Lion") - endif(${DARWIN_VERSION} MATCHES "11") + endif() if(${DARWIN_VERSION} MATCHES "10") message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.6 Snow Leopard") - endif(${DARWIN_VERSION} MATCHES "10") -endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + endif() +endif() # Define extra build types and select Release by default to get optimization flags include(GnsssdrBuildTypes) @@ -293,31 +293,31 @@ if(NOT CMAKE_BUILD_TYPE) if(ENABLE_GPERFTOOLS OR ENABLE_GPROF) set(CMAKE_BUILD_TYPE "RelWithDebInfo") message(STATUS "Build type not specified: defaulting to RelWithDebInfo.") - else(ENABLE_GPERFTOOLS OR ENABLE_GPROF) + else() set(CMAKE_BUILD_TYPE "Release") message(STATUS "Build type not specified: defaulting to Release.") - endif(ENABLE_GPERFTOOLS OR ENABLE_GPROF) -else(NOT CMAKE_BUILD_TYPE) + endif() +else() message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.") -endif(NOT CMAKE_BUILD_TYPE) -GNSSSDR_CHECK_BUILD_TYPE(${CMAKE_BUILD_TYPE}) +endif() +gnsssdr_check_build_type(${CMAKE_BUILD_TYPE}) set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") # allow 'large' files in 32 bit builds if(UNIX) add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES) -endif(UNIX) +endif() # Determine if we are using make or ninja if(CMAKE_MAKE_PROGRAM MATCHES "make") set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "make") -endif(CMAKE_MAKE_PROGRAM MATCHES "make") +endif() if(CMAKE_MAKE_PROGRAM MATCHES "ninja") set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "ninja") -endif(CMAKE_MAKE_PROGRAM MATCHES "ninja") +endif() if(NOT CMAKE_MAKE_PROGRAM_PRETTY_NAME) set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "${CMAKE_MAKE_PROGRAM}") -endif(NOT CMAKE_MAKE_PROGRAM_PRETTY_NAME) +endif() @@ -352,7 +352,7 @@ set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.9") if(CMAKE_VERSION VERSION_LESS "3.0.2") # Fix for CentOS 7 set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.1") -endif(CMAKE_VERSION VERSION_LESS "3.0.2") +endif() @@ -362,7 +362,7 @@ endif(CMAKE_VERSION VERSION_LESS "3.0.2") if(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION}) message(STATUS "Your CMake version is too old and does not support some features required by GNSS-SDR. CMake version must be at least ${GNSSSDR_CMAKE_MIN_VERSION}.") message(FATAL_ERROR "Fatal error: CMake >= ${GNSSSDR_CMAKE_MIN_VERSION} required.") -endif(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION}) +endif() @@ -373,8 +373,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION}) message(STATUS "Your GCC version is too old and does not support some C++ features required by GNSS-SDR. GCC version must be at least ${GNSSSDR_GCC_MIN_VERSION}") message(FATAL_ERROR "Fatal error: GCC >= ${GNSSSDR_GCC_MIN_VERSION} required.") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION}) -endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + endif() +endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") execute_process(COMMAND @@ -385,25 +385,25 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # output is in error stream string(REGEX MATCH "^Apple.*" IS_APPLE ${_err}) if("${IS_APPLE}" STREQUAL "") - set(MIN_VERSION ${GNSSSDR_CLANG_MIN_VERSION}) - set(APPLE_STR "") - # retrieve the compiler's version from it - string(REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${_err}) - string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_OTHER_VERSION}) - else("${IS_APPLE}" STREQUAL "") - set(MIN_VERSION ${GNSSSDR_APPLECLANG_MIN_VERSION}) - set(APPLE_STR "Apple ") - # retrieve the compiler's version from it - string(REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${_err}) - string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_APPLE_VERSION}) - endif("${IS_APPLE}" STREQUAL "") + set(MIN_VERSION ${GNSSSDR_CLANG_MIN_VERSION}) + set(APPLE_STR "") + # retrieve the compiler's version from it + string(REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${_err}) + string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_OTHER_VERSION}) + else() + set(MIN_VERSION ${GNSSSDR_APPLECLANG_MIN_VERSION}) + set(APPLE_STR "Apple ") + # retrieve the compiler's version from it + string(REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${_err}) + string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_APPLE_VERSION}) + endif() if(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}") - message(WARNING "\nThe compiler selected to build GNSS-SDR (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") - endif(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}") - else(${_res} STREQUAL "0") + message(WARNING "\nThe compiler selected to build GNSS-SDR (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") + endif() + else() message(WARNING "\nCannot determine the version of the compiler selected to build GNSS-SDR (${APPLE_STR}Clang : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") - endif(${_res} STREQUAL "0") -endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + endif() +endif() @@ -413,10 +413,10 @@ endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(NOT OS_IS_MACOSX) if(CMAKE_CROSSCOMPILING) set(IS_ARM TRUE) - else(CMAKE_CROSSCOMPILING) + else() include(TestForARM) - endif(CMAKE_CROSSCOMPILING) -endif(NOT OS_IS_MACOSX) + endif() +endif() @@ -425,7 +425,7 @@ endif(NOT OS_IS_MACOSX) ################################################################################ if(NOT ENABLE_GENERIC_ARCH) include(TestForSSE) -endif(NOT ENABLE_GENERIC_ARCH) +endif() @@ -435,16 +435,16 @@ endif(NOT ENABLE_GENERIC_ARCH) if(CMAKE_VERSION VERSION_LESS 3.1) find_package(Threads REQUIRED) set(THREAD_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) -else(CMAKE_VERSION VERSION_LESS 3.1) +else() set(CMAKE_THREAD_PREFER_PTHREAD TRUE) if(CMAKE_CROSSCOMPILING) set(THREADS_PREFER_PTHREAD_FLAG FALSE) - else(CMAKE_CROSSCOMPILING) + else() set(THREADS_PREFER_PTHREAD_FLAG TRUE) - endif(CMAKE_CROSSCOMPILING) + endif() find_package(Threads REQUIRED) set(THREAD_LIBRARIES Threads::Threads) -endif(CMAKE_VERSION VERSION_LESS 3.1) +endif() @@ -455,28 +455,28 @@ enable_testing() if(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) if(EXISTS $ENV{GTEST_DIR}) set(GTEST_DIR $ENV{GTEST_DIR}) - endif(EXISTS $ENV{GTEST_DIR}) + endif() if(GTEST_DIR) message(STATUS "Googletest root folder set at ${GTEST_DIR}") find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS ${GTEST_DIR}) - if(LIBGTEST_DEV_DIR) - message(STATUS "Googletest has been found.") - else(LIBGTEST_DEV_DIR) - message(FATAL_ERROR " Googletest source code has not been found at ${GTEST_DIR}.") - endif(LIBGTEST_DEV_DIR) + if(LIBGTEST_DEV_DIR) + message(STATUS "Googletest has been found.") + else() + message(FATAL_ERROR " Googletest source code has not been found at ${GTEST_DIR}.") + endif() find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS ${GTEST_DIR}/include) - else(GTEST_DIR) + else() find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS /usr/src/googletest/googletest /usr/src/gtest /usr/include/gtest /opt/local/src/gtest-1.7.0) find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS /usr/include /opt/local/src/gtest-1.7.0/include) if(LIBGTEST_DEV_DIR) - message(STATUS "Googletest package has been found.") - else(LIBGTEST_DEV_DIR) - message(STATUS " Googletest has not been found.") - message(STATUS " Googletest v${GNSSSDR_GTEST_LOCAL_VERSION} will be downloaded and built automatically ") - message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") - endif(LIBGTEST_DEV_DIR) - endif(GTEST_DIR) -endif(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) + message(STATUS "Googletest package has been found.") + else() + message(STATUS " Googletest has not been found.") + message(STATUS " Googletest v${GNSSSDR_GTEST_LOCAL_VERSION} will be downloaded and built automatically ") + message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") + endif() + endif() +endif() @@ -485,7 +485,7 @@ endif(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) ################################################################################ if(UNIX AND EXISTS "/usr/lib64") list(APPEND BOOST_LIBRARYDIR "/usr/lib64") # Fedora 64-bit fix -endif(UNIX AND EXISTS "/usr/lib64") +endif() set(Boost_ADDITIONAL_VERSIONS "1.45.0" "1.45" "1.46.0" "1.46" "1.48.0" "1.48" "1.49.0" "1.49" "1.50.0" "1.50" "1.51.0" "1.51" "1.53.0" "1.53" "1.54.0" "1.54" @@ -501,7 +501,7 @@ set(Boost_USE_STATIC_LIBS OFF) find_package(Boost COMPONENTS date_time system filesystem thread serialization chrono REQUIRED) if(NOT Boost_FOUND) message(FATAL_ERROR "Fatal error: Boost (version >=${GNSSSDR_BOOST_MIN_VERSION}) required.") -endif(NOT Boost_FOUND) +endif() @@ -514,23 +514,23 @@ if(PC_GNURADIO_RUNTIME_VERSION) if(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION}) set(GNURADIO_RUNTIME_FOUND) message(STATUS "The GNU Radio version installed in your system is too old.") - endif(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION}) -endif(PC_GNURADIO_RUNTIME_VERSION) + endif() +endif() if(NOT GNURADIO_RUNTIME_FOUND) message(STATUS "CMake cannot find GNU Radio >= ${GNSSSDR_GNURADIO_MIN_VERSION}") if(OS_IS_LINUX) - message("Go to https://github.com/gnuradio/pybombs") - message("and follow the instructions to install GNU Radio in your system.") - message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") - endif(OS_IS_LINUX) + message("Go to https://github.com/gnuradio/pybombs") + message("and follow the instructions to install GNU Radio in your system.") + message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") + endif() if(OS_IS_MACOSX) - message("You can install it easily via Macports:") - message(" sudo port install gnuradio ") - message("Alternatively, you can use homebrew:") - message(" brew install gnuradio") - message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") - endif(OS_IS_MACOSX) -endif(NOT GNURADIO_RUNTIME_FOUND) + message("You can install it easily via Macports:") + message(" sudo port install gnuradio ") + message("Alternatively, you can use homebrew:") + message(" brew install gnuradio") + message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") + endif() +endif() if(NOT GNURADIO_ANALOG_FOUND) message(FATAL_ERROR "*** The gnuradio-analog library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") @@ -574,7 +574,6 @@ endif() # volk_gnsssdr module - GNSS-SDR's own VOLK library ################################################################################ find_package(VOLKGNSSSDR) - if(NOT VOLKGNSSSDR_FOUND) message(STATUS " volk_gnsssdr will be built along with gnss-sdr when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'") ############################### @@ -584,13 +583,13 @@ if(NOT VOLKGNSSSDR_FOUND) if(NOT PYTHON_MIN_VER_FOUND) message(FATAL_ERROR "Python ${GNSSSDR_PYTHON_MIN_VERSION} or greater required to build VOLK_GNSSSDR") - endif(NOT PYTHON_MIN_VER_FOUND) + endif() if(${PYTHON3}) set(PYTHON_NAME "python3") - else(${PYTHON3}) + else() set(PYTHON_NAME "python") - endif(${PYTHON3}) + endif() # Mako if(NOT MAKO_FOUND) @@ -600,11 +599,11 @@ if(NOT VOLKGNSSSDR_FOUND) message(STATUS " sudo yum install ${PYTHON_NAME}-mako") elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") message(STATUS " sudo zypper install ${PYTHON_NAME}-Mako") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + else() message(STATUS " sudo apt-get install ${PYTHON_NAME}-mako") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + endif() message(FATAL_ERROR "Mako templates required to build VOLK_GNSSSDR") - endif(NOT MAKO_FOUND) + endif() # Six if(NOT SIX_FOUND) @@ -614,37 +613,37 @@ if(NOT VOLKGNSSSDR_FOUND) message(STATUS " sudo yum install ${PYTHON_NAME}-six") elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") message(STATUS " sudo zypper install ${PYTHON_NAME}-six") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + else() message(STATUS " sudo apt-get install ${PYTHON_NAME}-six") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + endif() message(FATAL_ERROR "six - python 2 and 3 compatibility library required to build VOLK_GNSSSDR") - endif(NOT SIX_FOUND) + endif() set(READ_ENVIRO "") if(ENABLE_PACKAGING) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) - set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON -DCMAKE_VERBOSE_MAKEFILE=ON") - endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) + set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON -DCMAKE_VERBOSE_MAKEFILE=ON") + endif() if(NOT DEFINED ENV{PROTECT_PASSWORDS}) - set(READ_ENVIRO ${CMAKE_COMMAND} -E environment) - endif(NOT DEFINED ENV{PROTECT_PASSWORDS}) - endif(ENABLE_PACKAGING) + set(READ_ENVIRO ${CMAKE_COMMAND} -E environment) + endif() + endif() set(VOLK_GNSSSDR_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}") if(PYTHON_EXECUTABLE) set(USE_THIS_PYTHON "-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}") - endif(PYTHON_EXECUTABLE) + endif() if(OS_IS_MACOSX) if(CMAKE_GENERATOR STREQUAL Xcode) - set(VOLK_GNSSSDR_BUILD_COMMAND "xcodebuild" "-configuration" "Debug" "-target") - endif(CMAKE_GENERATOR STREQUAL Xcode) - endif(OS_IS_MACOSX) + set(VOLK_GNSSSDR_BUILD_COMMAND "xcodebuild" "-configuration" "Debug" "-target") + endif() + endif() if(CMAKE_CROSSCOMPILING) set(VOLK_GNSSSDR_COMPILER "") - else(CMAKE_CROSSCOMPILING) + else() set(VOLK_GNSSSDR_COMPILER -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}) - endif(CMAKE_CROSSCOMPILING) + endif() set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_COMPILER} -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install -DENABLE_STATIC_LIBS=ON @@ -657,39 +656,39 @@ if(NOT VOLKGNSSSDR_FOUND) set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake -DCROSSCOMPILE_MULTILIB=TRUE) - endif(EXISTS $ENV{OECORE_TARGET_SYSROOT}) + endif() if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add(volk_gnsssdr_module - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build - CMAKE_ARGS ${READ_ENVIRO} ${VOLK_GNSSSDR_CMAKE_ARGS} - DOWNLOAD_COMMAND "" - UPDATE_COMMAND "" - PATCH_COMMAND "" - BUILD_COMMAND ${READ_ENVIRO} ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile - INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install + ExternalProject_Add(volk_gnsssdr_module + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build + CMAKE_ARGS ${READ_ENVIRO} ${VOLK_GNSSSDR_CMAKE_ARGS} + DOWNLOAD_COMMAND "" + UPDATE_COMMAND "" + PATCH_COMMAND "" + BUILD_COMMAND ${READ_ENVIRO} ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add(volk_gnsssdr_module - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build - CMAKE_ARGS ${READ_ENVIRO} ${VOLK_GNSSSDR_CMAKE_ARGS} - DOWNLOAD_COMMAND "" - UPDATE_COMMAND "" - PATCH_COMMAND "" - BUILD_COMMAND ${READ_ENVIRO} ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile - INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install + else() + ExternalProject_Add(volk_gnsssdr_module + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build + CMAKE_ARGS ${READ_ENVIRO} ${VOLK_GNSSSDR_CMAKE_ARGS} + DOWNLOAD_COMMAND "" + UPDATE_COMMAND "" + PATCH_COMMAND "" + BUILD_COMMAND ${READ_ENVIRO} ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + endif() find_package(ORC) if(NOT ORC_FOUND) set(ORC_LIBRARIES "") set(ORC_INCLUDE_DIRS "") - endif(NOT ORC_FOUND) + endif() add_library(volk_gnsssdr UNKNOWN IMPORTED) set_property(TARGET volk_gnsssdr PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/libvolk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}) @@ -697,20 +696,20 @@ if(NOT VOLKGNSSSDR_FOUND) set(VOLK_GNSSSDR_LIBRARIES volk_gnsssdr ${ORC_LIBRARIES}) if(CMAKE_VERSION VERSION_LESS 3.2) - add_custom_command(TARGET volk_gnsssdr_module POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile - ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile) - else(CMAKE_VERSION VERSION_LESS 3.2) - add_custom_command(TARGET volk_gnsssdr_module POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile - ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile - BYPRODUCTS ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile) - endif(CMAKE_VERSION VERSION_LESS 3.2) + add_custom_command(TARGET volk_gnsssdr_module POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile + ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile) + else() + add_custom_command(TARGET volk_gnsssdr_module POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile + ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile + BYPRODUCTS ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile) + endif() add_custom_command(TARGET volk_gnsssdr_module POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr-config-info - ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr-config-info) -endif(NOT VOLKGNSSSDR_FOUND) + ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr-config-info) +endif() @@ -725,35 +724,33 @@ if(NOT GFLAGS_FOUND) message(STATUS " when doing 'make'. ") if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - GIT_REPOSITORY git://github.com/gflags/gflags.git - GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} - UPDATE_COMMAND "" - PATCH_COMMAND "" - INSTALL_COMMAND "" - ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - GIT_REPOSITORY git://github.com/gflags/gflags.git - GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} - UPDATE_COMMAND "" - PATCH_COMMAND "" - INSTALL_COMMAND "" - ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + GIT_REPOSITORY git://github.com/gflags/gflags.git + GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" + ) + else() + ExternalProject_Add(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + GIT_REPOSITORY git://github.com/gflags/gflags.git + GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" + ) + endif() set(GFlags_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include CACHE PATH "Local Gflags headers" @@ -770,7 +767,7 @@ if(NOT GFLAGS_FOUND) set(GFlags_lib ${GFlags_LIBS} CACHE FILEPATH "Local Gflags library") set(GFlags_LIBRARY_PATH ${GFlags_LIBS}) set(LOCAL_GFLAGS true CACHE STRING "GFlags downloaded and built automatically" FORCE) -endif(NOT GFLAGS_FOUND) +endif() @@ -781,28 +778,28 @@ if(NOT ${ENABLE_OWN_GLOG}) find_package(GLOG) if(GLOG_INCLUDE_DIRS) set(GLOG_FOUND ON) - endif(GLOG_INCLUDE_DIRS) -endif(NOT ${ENABLE_OWN_GLOG}) + endif() +endif() set(glog_RELEASE ${GNSSSDR_GLOG_LOCAL_VERSION}) if(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) message(STATUS " glog library has not been found") if(NOT GFLAGS_FOUND) message(STATUS " or it is likely not linked to gflags.") - endif(NOT GFLAGS_FOUND) + endif() message(STATUS " glog v${GNSSSDR_GLOG_LOCAL_VERSION} will be downloaded and built automatically ") message(STATUS " when doing 'make'. ") if(NOT ${LOCAL_GFLAGS}) add_library(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} UNKNOWN IMPORTED) set_property(TARGET gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GFlags_LIBS}") - endif(NOT ${LOCAL_GFLAGS}) + endif() set(TARGET_GFLAGS gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) if(${LOCAL_GFLAGS}) set(GFLAGS_LIBRARIES_TO_LINK ${GFlags_SHARED_LIBS}) set(GFLAGS_LIBRARY_DIR_TO_LINK ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib) - else(${LOCAL_GFLAGS}) + else() set(GFLAGS_LIBRARIES_TO_LINK ${GFlags_LIBS}) set(GFLAGS_LIBRARY_DIR_TO_LINK ${GFlags_LIBRARY_DIRS}) - endif(${LOCAL_GFLAGS}) + endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags @@ -820,7 +817,7 @@ autoreconf -vfi cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure") - else(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + else() file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags "#!/bin/sh export CPPFLAGS=-I${GFlags_INCLUDE_DIRS} @@ -832,49 +829,48 @@ automake --add-missing autoreconf -vfi cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure") - endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + endif() file(COPY ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ - GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) set(GLOG_CONFIGURE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure_with_gflags) # Ensure that aclocal and libtool are present if(OS_IS_LINUX) if(EXISTS "/usr/bin/libtoolize") - if(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - # Everything ok, we can move on - else(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - message(" aclocal has not been found.") - message(" You can try to install it by typing:") - if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum groupinstall 'Development Tools'") - elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(" sudo zypper install automake") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install automake") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(FATAL_ERROR "aclocal is required to build glog from source") - endif(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - else(EXISTS "/usr/bin/libtoolize") + if(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") + # Everything ok, we can move on + else() + message(" aclocal has not been found.") + message(" You can try to install it by typing:") + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo yum groupinstall 'Development Tools'") + elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") + message(" sudo zypper install automake") + else() + message(" sudo apt-get install automake") + endif() + message(FATAL_ERROR "aclocal is required to build glog from source") + endif() + else() message(" libtool has not been found.") message(" You can try to install it by typing:") if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum groupinstall 'Development Tools'") + message(" sudo yum groupinstall 'Development Tools'") elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(" sudo zypper install libtoool") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install libtool") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo zypper install libtoool") + else() + message(" sudo apt-get install libtool") + endif() message(FATAL_ERROR "libtool is required to build glog from source") - endif(EXISTS "/usr/bin/libtoolize") - endif(OS_IS_LINUX) + endif() + endif() if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - glog-${GNSSSDR_GLOG_LOCAL_VERSION} + ExternalProject_Add(glog-${GNSSSDR_GLOG_LOCAL_VERSION} DEPENDS ${TARGET_GFLAGS} PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/glog/ @@ -887,9 +883,8 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c PATCH_COMMAND "" INSTALL_COMMAND "" ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - glog-${GNSSSDR_GLOG_LOCAL_VERSION} + else() + ExternalProject_Add(glog-${GNSSSDR_GLOG_LOCAL_VERSION} DEPENDS ${TARGET_GFLAGS} PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/glog/ @@ -903,7 +898,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c PATCH_COMMAND "" INSTALL_COMMAND "" ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + endif() # Set up variables set(GLOG_INCLUDE_DIRS @@ -914,15 +909,15 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} ) set(LOCAL_GLOG true CACHE STRING "Glog downloaded and built automatically" FORCE) -else(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) +else() add_library(glog-${GNSSSDR_GLOG_LOCAL_VERSION} UNKNOWN IMPORTED) set_property(TARGET glog-${GNSSSDR_GLOG_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GLOG_LIBRARIES}") -endif(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) +endif() if(NOT ENABLE_LOG) message(STATUS "Logging is not enabled") add_definitions(-DGOOGLE_STRIP_LOG=1) -endif(NOT ENABLE_LOG) +endif() @@ -936,11 +931,11 @@ if(NOT BLAS) message(" You can try to install it by typing:") if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") message(" sudo yum install blas-devel") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + else() message(" sudo apt-get install libblas-dev") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + endif() message(FATAL_ERROR "BLAS is required to build gnss-sdr") -endif(NOT BLAS) +endif() @@ -956,11 +951,11 @@ if(NOT LAPACK) message(" sudo yum install lapack-devel") elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") message(" sudo zypper install lapack-devel") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + else() message(" sudo apt-get install liblapack-dev") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + endif() message(FATAL_ERROR "LAPACK is required to build gnss-sdr") -endif(NOT LAPACK) +endif() @@ -972,8 +967,8 @@ if(ARMADILLO_FOUND) if(${ARMADILLO_VERSION_STRING} VERSION_LESS ${GNSSSDR_ARMADILLO_MIN_VERSION}) set(ARMADILLO_FOUND false) set(ENABLE_OWN_ARMADILLO true) - endif(${ARMADILLO_VERSION_STRING} VERSION_LESS ${GNSSSDR_ARMADILLO_MIN_VERSION}) -endif(ARMADILLO_FOUND) + endif() +endif() if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) message(STATUS " Armadillo has not been found.") @@ -991,22 +986,21 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) message(STATUS "The gfortran library has not been found.") message(STATUS " You can try to install it by typing:") if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(STATUS " sudo yum install gcc-fortran") + message(STATUS " sudo yum install gcc-fortran") elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(STATUS " sudo zypper install gcc-fortran") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(STATUS " sudo apt-get install gfortran") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(STATUS " sudo zypper install gcc-fortran") + else() + message(STATUS " sudo apt-get install gfortran") + endif() message(FATAL_ERROR "gfortran is required to build gnss-sdr") - endif(NOT GFORTRAN) - endif(NOT OS_IS_MACOSX) + endif() + endif() ############################################# # Download and build Armadillo ############################################# if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - armadillo-${armadillo_RELEASE} + ExternalProject_Add(armadillo-${armadillo_RELEASE} PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} GIT_REPOSITORY https://gitlab.com/conradsnicta/armadillo-code.git GIT_TAG ${armadillo_BRANCH} @@ -1017,9 +1011,8 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) UPDATE_COMMAND "" INSTALL_COMMAND "" ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - armadillo-${armadillo_RELEASE} + else() + ExternalProject_Add(armadillo-${armadillo_RELEASE} PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} GIT_REPOSITORY https://gitlab.com/conradsnicta/armadillo-code.git GIT_TAG ${armadillo_BRANCH} @@ -1031,22 +1024,22 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) UPDATE_COMMAND "" INSTALL_COMMAND "" ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + endif() # Set up variables ExternalProject_Get_Property(armadillo-${armadillo_RELEASE} binary_dir) set(ARMADILLO_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include) if(NOT GFORTRAN) set(GFORTRAN "") - endif(NOT GFORTRAN) + endif() set(ARMADILLO_LIBRARIES ${BLAS} ${LAPACK} ${GFORTRAN} ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}) set(LOCAL_ARMADILLO true CACHE STRING "Armadillo downloaded and built automatically" FORCE) set(ARMADILLO_VERSION_STRING ${armadillo_RELEASE}) -else(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) +else() set(armadillo_RELEASE ${ARMADILLO_VERSION_STRING}) add_library(armadillo-${armadillo_RELEASE} UNKNOWN IMPORTED) set_property(TARGET armadillo-${armadillo_RELEASE} PROPERTY IMPORTED_LOCATION "${ARMADILLO_LIBRARIES}") -endif(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) +endif() @@ -1055,35 +1048,36 @@ endif(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) ################################################################################ find_package(GnuTLS) find_library(GNUTLS_OPENSSL_LIBRARY NAMES gnutls-openssl libgnutls-openssl.so.27 - HINTS /usr/lib - /usr/lib64 - /usr/local/lib - /usr/local/lib64 - /opt/local/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/aarch64-linux-gnu - /usr/lib/arm-linux-gnueabihf - /usr/lib/arm-linux-gnueabi - /usr/lib/i386-linux-gnu - /usr/lib/alpha-linux-gnu - /usr/lib/hppa-linux-gnu - /usr/lib/i386-gnu - /usr/lib/i686-gnu - /usr/lib/i686-linux-gnu - /usr/lib/x86_64-kfreebsd-gnu - /usr/lib/i686-kfreebsd-gnu - /usr/lib/m68k-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/mipsel-linux-gnu - /usr/lib/powerpc-linux-gnu - /usr/lib/powerpc-linux-gnuspe - /usr/lib/powerpc64-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/lib/sparc64-linux-gnu - /usr/lib/x86_64-linux-gnux32 - /usr/lib/sh4-linux-gnu) + HINTS /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + /opt/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/i386-linux-gnu + /usr/lib/alpha-linux-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/i386-gnu + /usr/lib/i686-gnu + /usr/lib/i686-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i686-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/sh4-linux-gnu +) if(NOT GNUTLS_OPENSSL_LIBRARY) message(STATUS "Looking for OpenSSL instead...") @@ -1092,22 +1086,22 @@ if(NOT GNUTLS_OPENSSL_LIBRARY) set(GNUTLS_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR}) set(GNUTLS_LIBRARIES "") set(GNUTLS_OPENSSL_LIBRARY ${OPENSSL_SSL_LIBRARY}) - else(OPENSSL_FOUND) + else() message(" The GnuTLS library with openssl compatibility enabled has not been found.") message(" You can try to install the required libraries by typing:") if(OS_IS_LINUX) - if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum install openssl-devel") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install libgnutls-openssl-dev") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - endif(OS_IS_LINUX) + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo yum install openssl-devel") + else() + message(" sudo apt-get install libgnutls-openssl-dev") + endif() + endif() if(OS_IS_MACOSX) - message(" sudo port install gnutls") - endif(OS_IS_MACOSX) + message(" sudo port install gnutls") + endif() message(FATAL_ERROR "GnuTLS libraries with openssl compatibility are required to build gnss-sdr") - endif(OPENSSL_FOUND) -endif(NOT GNUTLS_OPENSSL_LIBRARY) + endif() +endif() @@ -1118,97 +1112,95 @@ find_package(MATIO) if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERSION}) if(MATIO_FOUND) message(STATUS " Matio installed version (${MATIO_VERSION_STRING}) is too old (>= ${GNSSSDR_MATIO_MIN_VERSION} is required).") - endif(MATIO_FOUND) + endif() message(STATUS " Matio v${GNSSSDR_MATIO_LOCAL_VERSION} will be downloaded and built automatically") message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ") find_package(ZLIB) if(ZLIB_FOUND) get_filename_component(ZLIB_BASE_DIR ${ZLIB_INCLUDE_DIRS} DIRECTORY) if(OS_IS_LINUX) - if(NOT EXISTS "/usr/bin/libtoolize") - message(" libtool has not been found.") - message(" You can try to install it by typing:") - if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum groupinstall 'Development Tools'") - elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(" sudo zypper install libtoool") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install libtool") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(FATAL_ERROR "libtool is required to build matio from source") - endif(NOT EXISTS "/usr/bin/libtoolize") - if(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - message(STATUS "Automake found.") - else(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - message(" aclocal has not been found.") - message(" You can try to install it by typing:") - if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum groupinstall 'Development Tools'") - elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") - message(" sudo zypper install automake") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install automake") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(FATAL_ERROR "aclocal is required to build matio from source") - endif(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") - endif(OS_IS_LINUX) + if(NOT EXISTS "/usr/bin/libtoolize") + message(" libtool has not been found.") + message(" You can try to install it by typing:") + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo yum groupinstall 'Development Tools'") + elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") + message(" sudo zypper install libtoool") + else() + message(" sudo apt-get install libtool") + endif() + message(FATAL_ERROR "libtool is required to build matio from source") + endif() + if(EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10") + message(STATUS "Automake found.") + else() + message(" aclocal has not been found.") + message(" You can try to install it by typing:") + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo yum groupinstall 'Development Tools'") + elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") + message(" sudo zypper install automake") + else() + message(" sudo apt-get install automake") + endif() + message(FATAL_ERROR "aclocal is required to build matio from source") + endif() + endif() find_package(HDF5) if(HDF5_FOUND) - list(GET HDF5_LIBRARIES 0 HDF5_FIRST_DIR) - get_filename_component(HDF5_BASE_DIR2 ${HDF5_FIRST_DIR} DIRECTORY) - get_filename_component(HDF5_BASE_DIR ${HDF5_BASE_DIR2} DIRECTORY) - if(OS_IS_MACOSX) - if(EXISTS /opt/local/include/hdf5.h) - set(HDF5_BASE_DIR /opt/local) - endif(EXISTS /opt/local/include/hdf5.h) - if(EXISTS /usr/local/include/hdf5.h) - set(HDF5_BASE_DIR /usr/local) - endif(EXISTS /usr/local/include/hdf5.h) - endif(OS_IS_MACOSX) - if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - matio-${GNSSSDR_MATIO_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio - GIT_REPOSITORY https://github.com/tbeu/matio - GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} - UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= - BUILD_COMMAND make - ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - matio-${GNSSSDR_MATIO_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio - GIT_REPOSITORY https://github.com/tbeu/matio - GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} - UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= - BUILD_COMMAND make - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} - ) - endif(CMAKE_VERSION VERSION_LESS 3.2) - set(MATIO_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} ${HDF5_LIBRARIES} ${ZLIB_LIBRARIES}) - set(MATIO_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/matio/include) - set(MATIO_LOCAL true) - else(HDF5_FOUND) - message(STATUS " The hdf5 library has not been found in your system.") - message(STATUS " Please try to install it by doing:") - if(OS_IS_MACOSX) - message(STATUS " $ sudo port install hdf5") - message(STATUS " or") - message(STATUS " $ brew install hdf5") - endif(OS_IS_MACOSX) - if(OS_IS_LINUX) - message(STATUS " $ sudo apt-get install libhdf5-dev") - endif(OS_IS_LINUX) - message(FATAL_ERROR "*** The hdf5 library is required to build gnss-sdr") - endif(HDF5_FOUND) - else(ZLIB_FOUND) + list(GET HDF5_LIBRARIES 0 HDF5_FIRST_DIR) + get_filename_component(HDF5_BASE_DIR2 ${HDF5_FIRST_DIR} DIRECTORY) + get_filename_component(HDF5_BASE_DIR ${HDF5_BASE_DIR2} DIRECTORY) + if(OS_IS_MACOSX) + if(EXISTS /opt/local/include/hdf5.h) + set(HDF5_BASE_DIR /opt/local) + endif() + if(EXISTS /usr/local/include/hdf5.h) + set(HDF5_BASE_DIR /usr/local) + endif() + endif() + if(CMAKE_VERSION VERSION_LESS 3.2) + ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio + GIT_REPOSITORY https://github.com/tbeu/matio + GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} + UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh + CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= + BUILD_COMMAND make + ) + else() + ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio + GIT_REPOSITORY https://github.com/tbeu/matio + GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} + UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh + CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= + BUILD_COMMAND make + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} + ) + endif() + set(MATIO_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} ${HDF5_LIBRARIES} ${ZLIB_LIBRARIES}) + set(MATIO_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/matio/include) + set(MATIO_LOCAL true) + else() + message(STATUS " The hdf5 library has not been found in your system.") + message(STATUS " Please try to install it by doing:") + if(OS_IS_MACOSX) + message(STATUS " $ sudo port install hdf5") + message(STATUS " or") + message(STATUS " $ brew install hdf5") + endif() + if(OS_IS_LINUX) + message(STATUS " $ sudo apt-get install libhdf5-dev") + endif() + message(FATAL_ERROR "*** The hdf5 library is required to build gnss-sdr") + endif() + else() message(FATAL_ERROR "*** The zlib library is required to build gnss-sdr") - endif(ZLIB_FOUND) -endif(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERSION}) + endif() +endif() @@ -1217,47 +1209,45 @@ endif(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_V ################################################################################ find_package(PUGIXML QUIET) if(PUGIXML_FOUND) - message(STATUS "PugiXML has been found. Reading of GSA Galileo almanac XML files enabled.") -else(PUGIXML_FOUND) + message(STATUS "PugiXML has been found.") +else() message(STATUS " PugiXML v${GNSSSDR_PUGIXML_LOCAL_VERSION} will be downloaded and built automatically when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'.") set(PUGIXML_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}) set(TOOLCHAIN_ARG "") if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) set(PUGIXML_COMPILER "") set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake") - endif(EXISTS $ENV{OECORE_TARGET_SYSROOT}) + endif() if(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - GIT_REPOSITORY https://github.com/zeux/pugixml - GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - CMAKE_ARGS ${PUGIXML_COMPILER} ${TOOLCHAIN_ARG} - UPDATE_COMMAND "" - PATCH_COMMAND "" - INSTALL_COMMAND "" + ExternalProject_Add(pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + GIT_REPOSITORY https://github.com/zeux/pugixml + GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + CMAKE_ARGS ${PUGIXML_COMPILER} ${TOOLCHAIN_ARG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" ) - else(CMAKE_VERSION VERSION_LESS 3.2) - ExternalProject_Add( - pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - GIT_REPOSITORY https://github.com/zeux/pugixml - GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - CMAKE_ARGS ${PUGIXML_COMPILER} ${TOOLCHAIN_ARG} - UPDATE_COMMAND "" - PATCH_COMMAND "" - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} - INSTALL_COMMAND "" + else() + ExternalProject_Add(pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + GIT_REPOSITORY https://github.com/zeux/pugixml + GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + CMAKE_ARGS ${PUGIXML_COMPILER} ${TOOLCHAIN_ARG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + INSTALL_COMMAND "" ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + endif() set(PUGIXML_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}) set(PUGIXML_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src) set(PUGIXML_LOCAL true) -endif(PUGIXML_FOUND) +endif() ################################################################################ @@ -1270,11 +1260,11 @@ if(ENABLE_UHD) message(STATUS " The USRP Hardware Driver (UHD) signal source will not be built,") message(STATUS " so all USRP-based front-ends will not be usable.") message(STATUS " Please check https://files.ettus.com/manual/") - else(NOT UHD_FOUND) + else() set(GR_REQUIRED_COMPONENTS UHD) find_package(Gnuradio) - endif(NOT UHD_FOUND) -endif(ENABLE_UHD) + endif() +endif() ################################################################################ @@ -1292,10 +1282,10 @@ if(DOXYGEN_FOUND) if(PDFLATEX_COMPILER) set(GENERATE_PDF_DOCUMENTATION "YES") set(GNSSSDR_USE_MATHJAX "NO") - else(PDFLATEX_COMPILER) + else() set(GENERATE_PDF_DOCUMENTATION "NO") set(GNSSSDR_USE_MATHJAX "YES") - endif(PDFLATEX_COMPILER) + endif() configure_file(${CMAKE_SOURCE_DIR}/docs/doxygen/Doxyfile.in ${CMAKE_BINARY_DIR}/docs/doxygen/Doxyfile @ONLY @@ -1315,7 +1305,7 @@ if(DOXYGEN_FOUND) WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/docs/latex COMMENT "Generating PDF manual with Doxygen." VERBATIM ) - endif(LATEX_COMPILER) + endif() message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.") add_custom_target(doc-clean COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/html @@ -1323,21 +1313,21 @@ if(DOXYGEN_FOUND) COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf COMMENT "Cleaning documentation." VERBATIM ) -else(DOXYGEN_FOUND) +else() message(STATUS " Doxygen has not been found in your system.") message(STATUS " You can get nice code documentation by using it!") message(STATUS " Get it from http://www.stack.nl/~dimitri/doxygen/index.html") if(OS_IS_LINUX) if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") message(STATUS " or simply by doing 'sudo yum install doxygen-latex'.") - else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + else() message(STATUS " or simply by doing 'sudo apt-get install doxygen-latex'.") - endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - endif(OS_IS_LINUX) + endif() + endif() if(OS_IS_MACOSX) message(STATUS " or simply by doing 'sudo port install doxygen +latex'.") - endif(OS_IS_MACOSX) -endif(DOXYGEN_FOUND) + endif() +endif() @@ -1348,25 +1338,25 @@ if(ENABLE_OPENCL) find_package(OPENCL) if($ENV{DISABLE_OPENCL}) set(DISABLE_OPENCL TRUE) - endif($ENV{DISABLE_OPENCL}) + endif() if(DISABLE_OPENCL) set(OPENCL_FOUND FALSE) - else(DISABLE_OPENCL) + else() if(OPENCL_FOUND) - message(STATUS "OpenCL has been found and will be used by some processing blocks") - message(STATUS "You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ../' ") - endif(OPENCL_FOUND) - endif(DISABLE_OPENCL) + message(STATUS "OpenCL has been found and will be used by some processing blocks") + message(STATUS "You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ../' ") + endif() + endif() if(ENABLE_GENERIC_ARCH) set(OPENCL_FOUND FALSE) message(STATUS "ENABLE_GENERIC_ARCH is set to ON so the use of OpenCL has been disabled.") - endif(ENABLE_GENERIC_ARCH) + endif() if(NOT OPENCL_FOUND) message(STATUS "Processing blocks using OpenCL will not be built.") - endif(NOT OPENCL_FOUND) -else(ENABLE_OPENCL) + endif() +else() set(OPENCL_FOUND FALSE) -endif(ENABLE_OPENCL) +endif() @@ -1376,16 +1366,18 @@ endif(ENABLE_OPENCL) if($ENV{CUDA_GPU_ACCEL}) message(STATUS "CUDA_GPU_ACCEL environment variable found.") set(ENABLE_CUDA ON) -endif($ENV{CUDA_GPU_ACCEL}) +endif() if(ENABLE_CUDA) - FIND_PACKAGE(CUDA REQUIRED) + find_package(CUDA REQUIRED) message(STATUS "NVIDIA CUDA GPU Acceleration will be enabled.") message(STATUS "You can disable it with 'cmake -DENABLE_CUDA=OFF ../'") -else(ENABLE_CUDA) +else() message(STATUS "NVIDIA CUDA GPU Acceleration will be not enabled.") message(STATUS "Enable it with 'cmake -DENABLE_CUDA=ON ../' to add support for GPU-based acceleration using CUDA.") -endif(ENABLE_CUDA) +endif() + + ############################################################################### # CUSTOM UDP PACKET SOURCE (OPTIONAL) @@ -1393,10 +1385,10 @@ endif(ENABLE_CUDA) if(ENABLE_RAW_UDP) message(STATUS "High-optimized custom UDP ip packet source will be enabled.") message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'") -else(ENABLE_RAW_UDP) +else() message(STATUS "High-optimized custom UDP ip packet source will be enabled.") message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'") -endif(ENABLE_RAW_UDP) +endif() ############################################################################### @@ -1405,10 +1397,10 @@ endif(ENABLE_RAW_UDP) if(ENABLE_FPGA) message(STATUS "FPGA Acceleration will be enabled.") message(STATUS "You can disable it with 'cmake -DENABLE_FPGA=OFF ../'") -else(ENABLE_FPGA) +else() message(STATUS "Fpga Acceleration will be not enabled.") message(STATUS "Enable it with 'cmake -DENABLE_FPGA=ON ../' to add support for GPU-based acceleration using the FPGA.") -endif(ENABLE_FPGA) +endif() @@ -1418,75 +1410,75 @@ endif(ENABLE_FPGA) if($ENV{GN3S_DRIVER}) message(STATUS "GN3S_DRIVER environment variable found.") set(ENABLE_GN3S ON) -endif($ENV{GN3S_DRIVER}) +endif() if(GN3S_DRIVER) set(ENABLE_GN3S ON) -endif(GN3S_DRIVER) +endif() if(ENABLE_GN3S) message(STATUS "The GN3S driver will be compiled.") message(STATUS "You can disable it with 'cmake -DENABLE_GN3S=OFF ../'") -else(ENABLE_GN3S) +else() message(STATUS "The (optional and experimental) GN3S driver is not enabled.") message(STATUS "Enable it with 'cmake -DENABLE_GN3S=ON ../' to add support for the GN3S dongle.") -endif(ENABLE_GN3S) +endif() if($ENV{RAW_ARRAY_DRIVER}) message(STATUS "RAW_ARRAY_DRIVER environment variable found.") set(ENABLE_ARRAY ON) -endif($ENV{RAW_ARRAY_DRIVER}) +endif() if(RAW_ARRAY_DRIVER) set(ENABLE_ARRAY ON) -endif(RAW_ARRAY_DRIVER) +endif() if(ENABLE_ARRAY) message(STATUS "CTTC's Antenna Array front-end driver will be compiled.") message(STATUS "You can disable it with 'cmake -DENABLE_ARRAY=OFF ../'") # copy firmware to install folder # Build project gr-dbfcttc -else(ENABLE_ARRAY) +else() message(STATUS "The (optional) CTTC's Antenna Array front-end driver is not enabled.") message(STATUS "Enable it with 'cmake -DENABLE_ARRAY=ON ../' to add support for the CTTC experimental array front-end.") -endif(ENABLE_ARRAY) +endif() if($ENV{RTLSDR_DRIVER}) message(STATUS "RTLSDR_DRIVER environment variable found.") set(ENABLE_OSMOSDR ON) -endif($ENV{RTLSDR_DRIVER}) +endif() if(ENABLE_OSMOSDR) find_package(GROSMOSDR) if(GROSMOSDR_FOUND) message(STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled.") message(STATUS "You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ../'") - else(GROSMOSDR_FOUND) + else() if(ENABLE_PACKAGING) - message(WARNING "gr-osmosdr has not been found. Source blocks depending on it will NOT be built.") - else(ENABLE_PACKAGING) - message(FATAL_ERROR "gr-osmosdr required to build gnss-sdr with the optional OSMOSDR driver") - endif(ENABLE_PACKAGING) - endif(GROSMOSDR_FOUND) -else(ENABLE_OSMOSDR) + message(WARNING "gr-osmosdr has not been found. Source blocks depending on it will NOT be built.") + else() + message(FATAL_ERROR "gr-osmosdr required to build gnss-sdr with the optional OSMOSDR driver") + endif() + endif() +else() message(STATUS "The (optional) driver for OsmoSDR and related front-ends is not enabled.") message(STATUS "Enable it with 'cmake -DENABLE_OSMOSDR=ON ../' to add support for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based USB dongles, etc.)") -endif(ENABLE_OSMOSDR) +endif() if($ENV{FLEXIBAND_DRIVER}) message(STATUS "FLEXIBAND_DRIVER environment variable found.") set(ENABLE_FLEXIBAND ON) -endif($ENV{FLEXIBAND_DRIVER}) +endif() if(FLEXIBAND_DRIVER) set(ENABLE_FLEXIBAND ON) -endif(FLEXIBAND_DRIVER) +endif() if(ENABLE_FLEXIBAND) message(STATUS "The Teleorbit Flexiband front-end source will be compiled.") message(STATUS "You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ../'") -else(ENABLE_FLEXIBAND) +else() message(STATUS "The (optional) Teleorbit Flexiband front-end driver adapter is not enabled.") message(STATUS "Enable it with 'cmake -DENABLE_FLEXIBAND=ON ../' to add support for the Teleorbit Flexiband front-end.") -endif(ENABLE_FLEXIBAND) +endif() @@ -1499,23 +1491,23 @@ if(ENABLE_GPERFTOOLS) message(STATUS "Although ENABLE_GPERFTOOLS has been set to ON, GPerftools has not been found.") message(STATUS "Binaries will be compiled without 'tcmalloc' and 'profiler' libraries.") message(STATUS "You can install GPerftools from https://github.com/gperftools/gperftools") - else(NOT GPERFTOOLS_FOUND) + else() message(STATUS "GPerftools libraries found.") message(STATUS "Binaries will be compiled with 'tcmalloc' and 'profiler' libraries.") - endif(NOT GPERFTOOLS_FOUND) -endif(ENABLE_GPERFTOOLS) + endif() +endif() if(ENABLE_GPERFTOOLS) # Set GPerftools related flags if it is available # See https://github.com/gperftools/gperftools/blob/master/README if(GPERFTOOLS_FOUND) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free") - endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free") + endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin") - endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - endif(GPERFTOOLS_FOUND) -endif(ENABLE_GPERFTOOLS) + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin") + endif() + endif() +endif() @@ -1526,7 +1518,7 @@ if(ENABLE_GPROF) set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -pg") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg") -endif(ENABLE_GPROF) +endif() ######################################################################## @@ -1538,15 +1530,15 @@ endif(ENABLE_GPROF) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") - else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") + else() # if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") # else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") # endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") + endif() set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall -Wextra") #Add warning flags: For "-Wall" see https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html -endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) +endif() # Support of C++17 is still not possible due to pm_remez.h (solved in GNU Radio 3.8) # Enable C++14 support in Clang >= 3.5.0 or AppleClang >= 600 @@ -1555,37 +1547,37 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(OS_IS_MACOSX) # See https://trac.macports.org/wiki/XcodeVersionInfo for Apple Clang version equivalences if(CLANG_VERSION VERSION_LESS "600") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") - else(CLANG_VERSION VERSION_LESS "600") - # if(CLANG_VERSION VERSION_LESS "900") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - # else(CLANG_VERSION VERSION_LESS "900") - # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") - # endif(CLANG_VERSION VERSION_LESS "900") - endif(CLANG_VERSION VERSION_LESS "600") - else(OS_IS_MACOSX) + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") + else() + # if(CLANG_VERSION VERSION_LESS "900") + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") + # else(CLANG_VERSION VERSION_LESS "900") + # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") + # endif(CLANG_VERSION VERSION_LESS "900") + endif() + else() if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") - else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - # if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - # else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") - # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") - # endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - endif(OS_IS_MACOSX) + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") + else() + # if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") + set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") + # else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") + # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") + # endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") + endif() + endif() if(OS_IS_MACOSX) set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -stdlib=libc++") - endif(OS_IS_MACOSX) -endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + endif() +endif() if(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) AND NOT WIN32) if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 14) - endif(NOT (CMAKE_VERSION VERSION_LESS "3.1")) -endif(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) AND NOT WIN32) + endif() +endif() # Processor-architecture related flags # See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html @@ -1593,31 +1585,31 @@ if(NOT ARCH_COMPILER_FLAGS) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if(OS_IS_MACOSX) set(ARCH_COMPILER_FLAGS "-march=corei7 -mfpmath=sse") - else(OS_IS_MACOSX) + else() if(NOT ${ENABLE_GENERIC_ARCH}) if(IS_ARM) # ARM-specific options (https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html) if(NOT CMAKE_CROSSCOMPILING) - if(ARM_VERSION STREQUAL "arm") - # Unknown arm version - try our best to detect - set(ARCH_COMPILER_FLAGS "-mcpu=native") - else(ARM_VERSION STREQUAL "arm") - set(ARCH_COMPILER_FLAGS "-march=${ARM_VERSION}") - endif(ARM_VERSION STREQUAL "arm") - endif(NOT CMAKE_CROSSCOMPILING) - else(IS_ARM) + if(ARM_VERSION STREQUAL "arm") + # Unknown arm version - try our best to detect + set(ARCH_COMPILER_FLAGS "-mcpu=native") + else() + set(ARCH_COMPILER_FLAGS "-march=${ARM_VERSION}") + endif() + endif() + else() set(ARCH_COMPILER_FLAGS "-march=native -mfpmath=sse") - endif(IS_ARM) - endif(NOT ${ENABLE_GENERIC_ARCH}) - endif(OS_IS_MACOSX) - endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) -endif(NOT ARCH_COMPILER_FLAGS) + endif() + endif() + endif() + endif() +endif() set(MY_CXX_FLAGS "${MY_CXX_FLAGS} ${ARCH_COMPILER_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS}") if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) # https://gcc.gnu.org/wiki/Visibility add_definitions(-fvisibility=hidden) -endif((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 84e918b73..83c519fd5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,5 +21,5 @@ add_subdirectory(core) add_subdirectory(main) if(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) add_subdirectory(tests) -endif(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) +endif() add_subdirectory(utils) diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt index 74ef5d92a..d8c055506 100644 --- a/src/algorithms/PVT/adapters/CMakeLists.txt +++ b/src/algorithms/PVT/adapters/CMakeLists.txt @@ -19,7 +19,7 @@ if(Boost_VERSION LESS 105800) add_definitions(-DOLD_BOOST=1) -endif(Boost_VERSION LESS 105800) +endif() set(PVT_ADAPTER_SOURCES rtklib_pvt.cc diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt index bbe9ed19d..eb58c0894 100644 --- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt @@ -19,7 +19,7 @@ if(Boost_VERSION LESS 105800) add_definitions(-DOLD_BOOST=1) -endif(Boost_VERSION LESS 105800) +endif() set(PVT_GR_BLOCKS_SOURCES rtklib_pvt_cc.cc diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index ad1944c21..cd306531a 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -16,7 +16,7 @@ # along with GNSS-SDR. If not, see . # -add_definitions( -DGNSS_SDR_VERSION="${VERSION}" ) +add_definitions(-DGNSS_SDR_VERSION="${VERSION}") set(PVT_LIB_SOURCES pvt_solution.cc @@ -72,13 +72,13 @@ if(MATIO_FOUND) glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} ) -else(MATIO_FOUND) +else() add_dependencies(pvt_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} matio-${GNSSSDR_MATIO_LOCAL_VERSION} ) -endif(MATIO_FOUND) +endif() target_link_libraries( pvt_lib diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index f1e21185d..ee0046970 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -70,7 +70,7 @@ if(ENABLE_FPGA) galileo_e5a_pcps_acquisition_fpga.h gps_l5i_pcps_acquisition_fpga.h ) -endif(ENABLE_FPGA) +endif() if(OPENCL_FOUND) set(ACQ_ADAPTER_SOURCES @@ -80,7 +80,7 @@ if(OPENCL_FOUND) set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} gps_l1_ca_pcps_opencl_acquisition.h ) -endif(OPENCL_FOUND) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index a6d5f6a45..60825d6f0 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -42,12 +42,12 @@ set(ACQ_GR_BLOCKS_HEADERS if(ENABLE_FPGA) set(ACQ_GR_BLOCKS_SOURCES ${ACQ_GR_BLOCKS_SOURCES} pcps_acquisition_fpga.cc) set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_acquisition_fpga.h) -endif(ENABLE_FPGA) +endif() if(OPENCL_FOUND) set(ACQ_GR_BLOCKS_SOURCES ${ACQ_GR_BLOCKS_SOURCES} pcps_opencl_acquisition_cc.cc) set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_opencl_acquisition_cc.h) -endif(OPENCL_FOUND) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -69,10 +69,10 @@ if(OPENCL_FOUND) include_directories(${OPENCL_INCLUDE_DIRS}) if(OS_IS_MACOSX) set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") - else(OS_IS_MACOSX) + else() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) - endif(OS_IS_MACOSX) -endif(OPENCL_FOUND) + endif() +endif() list(SORT ACQ_GR_BLOCKS_HEADERS) list(SORT ACQ_GR_BLOCKS_SOURCES) @@ -91,7 +91,7 @@ if(ENABLE_FPGA) ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES} ) -else(ENABLE_FPGA) +else() target_link_libraries(acq_gr_blocks gnss_sp_libs gnss_system_parameters @@ -103,8 +103,8 @@ else(ENABLE_FPGA) ${MATIO_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES} ) -endif(ENABLE_FPGA) +endif() -if(NOT VOLK_GNSSSDR_FOUND) +if(NOT VOLKGNSSSDR_FOUND) add_dependencies(acq_gr_blocks volk_gnsssdr_module) -endif(NOT VOLK_GNSSSDR_FOUND) +endif() diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt index 9ffc0e07a..c3f368be6 100644 --- a/src/algorithms/acquisition/libs/CMakeLists.txt +++ b/src/algorithms/acquisition/libs/CMakeLists.txt @@ -30,7 +30,7 @@ if(ENABLE_FPGA) ${GFlags_INCLUDE_DIRS} ${VOLK_GNSSSDR_INCLUDE_DIRS} ) -endif(ENABLE_FPGA) +endif() set(ACQUISITION_LIB_HEADERS ${ACQUISITION_LIB_HEADERS} acq_conf.h) set(ACQUISITION_LIB_SOURCES ${ACQUISITION_LIB_SOURCES} acq_conf.cc) @@ -51,8 +51,8 @@ target_link_libraries(acquisition_lib ${GNURADIO_RUNTIME_LIBRARIES} ) -if(VOLK_GNSSSDR_FOUND) +if(VOLKGNSSSDR_FOUND) add_dependencies(acquisition_lib glog-${glog_RELEASE}) -else(VOLK_GNSSSDR_FOUND) +else() add_dependencies(acquisition_lib glog-${glog_RELEASE} volk_gnsssdr_module) endif() diff --git a/src/algorithms/input_filter/adapters/CMakeLists.txt b/src/algorithms/input_filter/adapters/CMakeLists.txt index 7f33f4072..8153c6c3c 100644 --- a/src/algorithms/input_filter/adapters/CMakeLists.txt +++ b/src/algorithms/input_filter/adapters/CMakeLists.txt @@ -48,7 +48,7 @@ include_directories( if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") add_definitions(-DGR_GREATER_38=1) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") +endif() list(SORT INPUT_FILTER_ADAPTER_HEADERS) list(SORT INPUT_FILTER_ADAPTER_SOURCES) diff --git a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt index ea3de1cb6..8a4aefc11 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt @@ -54,8 +54,8 @@ target_link_libraries(input_filter_gr_blocks ${VOLK_GNSSSDR_LIBRARIES} ${LOG4CPP_LIBRARIES}) -if(NOT VOLK_GNSSSDR_FOUND) +if(NOT VOLKGNSSSDR_FOUND) add_dependencies(input_filter_gr_blocks volk_gnsssdr_module glog-${glog_RELEASE}) -else(NOT VOLK_GNSSSDR_FOUND) +else() add_dependencies(input_filter_gr_blocks glog-${glog_RELEASE}) -endif(NOT VOLK_GNSSSDR_FOUND) +endif() diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 29869ea6a..9ef2da55c 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -78,7 +78,7 @@ if(ENABLE_FPGA) gnss_sdr_time_counter.h gnss_sdr_fpga_sample_counter.h ) -endif(ENABLE_FPGA) +endif() if(OPENCL_FOUND) set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} @@ -91,7 +91,7 @@ if(OPENCL_FOUND) opencl/fft_setup.h # Needs OpenCL opencl/fft_kernelstring.h # Needs OpenCL ) -endif(OPENCL_FOUND) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -112,10 +112,10 @@ if(OPENCL_FOUND) include_directories(${OPENCL_INCLUDE_DIRS}) if(OS_IS_MACOSX) set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") - else(OS_IS_MACOSX) + else() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) - endif(OS_IS_MACOSX) -endif(OPENCL_FOUND) + endif() +endif() add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") @@ -138,16 +138,16 @@ target_link_libraries(gnss_sp_libs gnss_rx ) -if(NOT VOLK_GNSSSDR_FOUND) +if(NOT VOLKGNSSSDR_FOUND) add_dependencies(gnss_sp_libs volk_gnsssdr_module armadillo-${armadillo_RELEASE}) -else(NOT VOLK_GNSSSDR_FOUND) +else() add_dependencies(gnss_sp_libs armadillo-${armadillo_RELEASE}) -endif(NOT VOLK_GNSSSDR_FOUND) +endif() if(${GFLAGS_GREATER_20}) add_definitions(-DGFLAGS_GREATER_2_0=1) -endif(${GFLAGS_GREATER_20}) +endif() add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h) source_group(Headers FILES gnss_sdr_flags.h) diff --git a/src/algorithms/libs/rtklib/CMakeLists.txt b/src/algorithms/libs/rtklib/CMakeLists.txt index c2f7ff6f8..882cd4a81 100644 --- a/src/algorithms/libs/rtklib/CMakeLists.txt +++ b/src/algorithms/libs/rtklib/CMakeLists.txt @@ -78,7 +78,7 @@ add_dependencies(rtklib_lib glog-${glog_RELEASE}) if(OS_IS_MACOSX) set(MAC_LIBRARIES "-framework Accelerate") -endif(OS_IS_MACOSX) +endif() target_link_libraries( rtklib_lib diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index 5a1a55e8d..e829c474d 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -48,14 +48,14 @@ if(MATIO_FOUND) glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} ) -else(MATIO_FOUND) +else() add_dependencies(obs_gr_blocks gnss_sp_libs glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} matio-${GNSSSDR_MATIO_LOCAL_VERSION} ) -endif(MATIO_FOUND) +endif() target_link_libraries(obs_gr_blocks gnss_sp_libs diff --git a/src/algorithms/resampler/adapters/CMakeLists.txt b/src/algorithms/resampler/adapters/CMakeLists.txt index 0f6c92684..07e8ddc74 100644 --- a/src/algorithms/resampler/adapters/CMakeLists.txt +++ b/src/algorithms/resampler/adapters/CMakeLists.txt @@ -39,7 +39,7 @@ include_directories( if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") add_definitions(-DGR_GREATER_38=1) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") +endif() list(SORT RESAMPLER_ADAPTER_HEADERS) list(SORT RESAMPLER_ADAPTER_SOURCES) diff --git a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt index eade10e00..30ab655e1 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt @@ -47,8 +47,8 @@ target_link_libraries(signal_generator_blocks ${ORC_LIBRARIES} ) -if(VOLK_GNSSSDR_FOUND) +if(VOLKGNSSSDR_FOUND) # add_dependencies(signal_generator_blocks glog-${glog_RELEASE}) -else(VOLK_GNSSSDR_FOUND) +else() add_dependencies(signal_generator_blocks volk_gnsssdr_module) -endif(VOLK_GNSSSDR_FOUND) +endif() diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index 83062ea66..6674cd853 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -23,13 +23,13 @@ if(ENABLE_RAW_UDP) find_package(PCAP) if(NOT PCAP_FOUND) message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)") - endif(NOT PCAP_FOUND) + endif() get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} custom_udp_signal_source.h) -endif(ENABLE_RAW_UDP) +endif() if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) find_package(GRIIO REQUIRED) @@ -40,10 +40,10 @@ if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled.") - endif(NOT GRIIO_FOUND) + endif() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) -endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) +endif() if(ENABLE_AD9361) find_package(LIBIIO REQUIRED) @@ -54,10 +54,10 @@ if(ENABLE_AD9361) message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled.") - endif(NOT LIBIIO_FOUND) + endif() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) -endif(ENABLE_AD9361) +endif() if(ENABLE_PLUTOSDR) @@ -67,8 +67,8 @@ if(ENABLE_PLUTOSDR) if(GRIIO_FOUND) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} plutosdr_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} plutosdr_signal_source.h) - endif(GRIIO_FOUND) -endif(ENABLE_PLUTOSDR) + endif() +endif() if(ENABLE_FMCOMMS2) @@ -78,8 +78,8 @@ if(ENABLE_FMCOMMS2) if(GRIIO_FOUND) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} fmcomms2_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} fmcomms2_signal_source.h) - endif(GRIIO_FOUND) -endif(ENABLE_FMCOMMS2) + endif() +endif() if(ENABLE_AD9361) @@ -89,8 +89,8 @@ if(ENABLE_AD9361) if(LIBIIO_FOUND) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} ad9361_fpga_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} ad9361_fpga_signal_source.h) - endif(LIBIIO_FOUND) -endif(ENABLE_AD9361) + endif() +endif() if(ENABLE_GN3S) @@ -101,12 +101,12 @@ if(ENABLE_GN3S) if(NOT GRGN3S_FOUND) message(" gr-gn3s not found, install it from https://github.com/gnss-sdr/gr-gn3s ") message(FATAL_ERROR "gr-gn3s required for building gnss-sdr with this option enabled") - endif(NOT GRGN3S_FOUND) + endif() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_GN3S_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_GN3S_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gn3s_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gn3s_signal_source.h) -endif(ENABLE_GN3S) +endif() if(ENABLE_FLEXIBAND) @@ -116,7 +116,7 @@ if(ENABLE_FLEXIBAND) find_package(TELEORBIT REQUIRED) if(NOT TELEORBIT_FOUND) message(FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter") - endif(NOT TELEORBIT_FOUND) + endif() # Set up variables set(FLEXIBAND_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} @@ -126,7 +126,7 @@ if(ENABLE_FLEXIBAND) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${FLEXIBAND_DRIVER_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} flexiband_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} flexiband_signal_source.h) -endif(ENABLE_FLEXIBAND) +endif() if(ENABLE_ARRAY) @@ -137,12 +137,12 @@ if(ENABLE_ARRAY) if(NOT GRDBFCTTC_FOUND) message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc ") message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled") - endif(NOT GRDBFCTTC_FOUND) + endif() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_DBFCTTC_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_DBFCTTC_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} raw_array_signal_source.h) -endif(ENABLE_ARRAY) +endif() if(ENABLE_OSMOSDR) @@ -152,8 +152,8 @@ if(ENABLE_OSMOSDR) if(NOT GROSMOSDR_FOUND) if(ENABLE_PACKAGING) list(REMOVE_ITEM SIGNAL_SOURCE_ADAPTER_HEADERS ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters/osmosdr_signal_source.h) - endif(ENABLE_PACKAGING) - else(NOT GROSMOSDR_FOUND) + endif() + else() # set OSMO include dirs set(OSMO_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} @@ -163,8 +163,8 @@ if(ENABLE_OSMOSDR) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} osmosdr_signal_source.h) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GROSMOSDR_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${OSMO_DRIVER_INCLUDE_DIRS}) - endif(NOT GROSMOSDR_FOUND) -endif(ENABLE_OSMOSDR) + endif() +endif() if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) @@ -172,27 +172,29 @@ if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} uhd_signal_source.h) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${UHD_INCLUDE_DIRS}) -endif(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) +endif() -set(SIGNAL_SOURCE_ADAPTER_SOURCES file_signal_source.cc - gen_signal_source.cc - nsr_file_signal_source.cc - spir_file_signal_source.cc - spir_gss6450_file_signal_source.cc - rtl_tcp_signal_source.cc - labsat_signal_source.cc - ${OPT_DRIVER_SOURCES} +set(SIGNAL_SOURCE_ADAPTER_SOURCES + file_signal_source.cc + gen_signal_source.cc + nsr_file_signal_source.cc + spir_file_signal_source.cc + spir_gss6450_file_signal_source.cc + rtl_tcp_signal_source.cc + labsat_signal_source.cc + ${OPT_DRIVER_SOURCES} ) -set(SIGNAL_SOURCE_ADAPTER_HEADERS file_signal_source.h - gen_signal_source.h - nsr_file_signal_source.h - spir_file_signal_source.h - spir_gss6450_file_signal_source.h - rtl_tcp_signal_source.h - labsat_signal_source.h - ${OPT_DRIVER_HEADERS} +set(SIGNAL_SOURCE_ADAPTER_HEADERS + file_signal_source.h + gen_signal_source.h + nsr_file_signal_source.h + spir_file_signal_source.h + spir_gss6450_file_signal_source.h + rtl_tcp_signal_source.h + labsat_signal_source.h + ${OPT_DRIVER_HEADERS} ) @@ -203,7 +205,7 @@ if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) set(SIGNAL_SOURCE_ADAPTER_HEADERS ${SIGNAL_SOURCE_ADAPTER_HEADERS} two_bit_cpx_file_signal_source.h two_bit_packed_file_signal_source.h) -endif(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -222,7 +224,7 @@ include_directories( if(ARCH_64BITS) add_definitions(-DARCH_64BITS=1) -endif(ARCH_64BITS) +endif() add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index b673dd897..fb94ec51c 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -20,14 +20,14 @@ if(ENABLE_RAW_UDP) find_package(PCAP) if(NOT PCAP_FOUND) - message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)") - endif(NOT PCAP_FOUND) + message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source") + endif() get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gr_complex_ip_packet_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gr_complex_ip_packet_source.h) -endif(ENABLE_RAW_UDP) +endif() set(SIGNAL_SOURCE_GR_BLOCKS_SOURCES @@ -69,12 +69,18 @@ include_directories( list(SORT SIGNAL_SOURCE_GR_BLOCKS_HEADERS) list(SORT SIGNAL_SOURCE_GR_BLOCKS_SOURCES) -add_library(signal_source_gr_blocks ${SIGNAL_SOURCE_GR_BLOCKS_SOURCES} ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS}) +add_library(signal_source_gr_blocks + ${SIGNAL_SOURCE_GR_BLOCKS_SOURCES} + ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS} +) + source_group(Headers FILES ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS}) + target_link_libraries(signal_source_gr_blocks signal_source_lib ${GNURADIO_RUNTIME_LIBRARIES} ${Boost_LIBRARIES} ${OPT_LIBRARIES} ) + add_dependencies(signal_source_gr_blocks glog-${glog_RELEASE}) diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index af65174c0..3f2a6bbe5 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -25,10 +25,10 @@ if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled") - endif(NOT GRIIO_FOUND) + endif() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) -endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) +endif() if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) find_package(LIBIIO REQUIRED) @@ -39,7 +39,7 @@ if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled") - endif(NOT LIBIIO_FOUND) + endif() set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) @@ -49,13 +49,13 @@ if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) if(LIBIIO_FOUND) set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) set(OPT_SIGNAL_SOURCE_LIB_HEADERS ad9361_manager.h) - endif(LIBIIO_FOUND) -endif(ENABLE_FMCOMMS2 OR ENABLE_AD9361) + endif() +endif() if(ENABLE_FPGA OR ENABLE_AD9361) set(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_switch.cc) set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_switch.h) -endif(ENABLE_FPGA OR ENABLE_AD9361) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index 92d258bfe..83fe5d36f 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -67,6 +67,6 @@ target_link_libraries(telemetry_decoder_gr_blocks ${VOLK_GNSSSDR_LIBRARIES} ) -if(NOT VOLK_GNSSSDR_FOUND) +if(NOT VOLKGNSSSDR_FOUND) add_dependencies(telemetry_decoder_gr_blocks volk_gnsssdr_module) -endif(NOT VOLK_GNSSSDR_FOUND) +endif() diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index db967b669..5150aa400 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -30,7 +30,7 @@ if(ENABLE_CUDA) ${OPT_TRACKING_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS} ) -endif(ENABLE_CUDA) +endif() if(ENABLE_FPGA) set(OPT_TRACKING_ADAPTERS_SOURCES @@ -41,7 +41,6 @@ if(ENABLE_FPGA) galileo_e5a_dll_pll_tracking_fpga.cc gps_l5_dll_pll_tracking_fpga.cc ) - set(OPT_TRACKING_ADAPTERS_HEADERS ${OPT_TRACKING_ADAPTERS_HEADERS} gps_l1_ca_dll_pll_tracking_fpga.h @@ -50,7 +49,7 @@ if(ENABLE_FPGA) galileo_e5a_dll_pll_tracking_fpga.h gps_l5_dll_pll_tracking_fpga.h ) -endif(ENABLE_FPGA) +endif() set(TRACKING_ADAPTER_SOURCES galileo_e1_dll_pll_veml_tracking.cc diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index fdc72cd34..2dd5b494f 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -33,7 +33,7 @@ if(ENABLE_CUDA) ${OPT_TRACKING_LIBRARIES} ${CUDA_LIBRARIES} ) -endif(ENABLE_CUDA) +endif() if(ENABLE_FPGA) set(OPT_TRACKING_BLOCKS_SOURCES @@ -44,7 +44,7 @@ if(ENABLE_FPGA) ${OPT_TRACKING_BLOCKS_HEADERS} dll_pll_veml_tracking_fpga.h ) -endif(ENABLE_FPGA) +endif() set(TRACKING_GR_BLOCKS_SOURCES galileo_e1_tcp_connector_tracking_cc.cc @@ -97,12 +97,15 @@ include_directories( if(ENABLE_GENERIC_ARCH) add_definitions(-DGENERIC_ARCH=1) -endif(ENABLE_GENERIC_ARCH) +endif() list(SORT TRACKING_GR_BLOCKS_HEADERS) list(SORT TRACKING_GR_BLOCKS_SOURCES) -add_library(tracking_gr_blocks ${TRACKING_GR_BLOCKS_SOURCES} ${TRACKING_GR_BLOCKS_HEADERS}) +add_library(tracking_gr_blocks + ${TRACKING_GR_BLOCKS_SOURCES} + ${TRACKING_GR_BLOCKS_HEADERS} +) source_group(Headers FILES ${TRACKING_GR_BLOCKS_HEADERS}) @@ -116,14 +119,18 @@ target_link_libraries(tracking_gr_blocks ${OPT_TRACKING_LIBRARIES} ) -if(NOT VOLK_GNSSSDR_FOUND) +if(NOT VOLKGNSSSDR_FOUND) if(MATIO_FOUND) add_dependencies(tracking_gr_blocks volk_gnsssdr_module) - else(MATIO_FOUND) - add_dependencies(tracking_gr_blocks volk_gnsssdr_module matio-${GNSSSDR_MATIO_LOCAL_VERSION}) - endif(MATIO_FOUND) -else(NOT VOLK_GNSSSDR_FOUND) + else() + add_dependencies(tracking_gr_blocks volk_gnsssdr_module + matio-${GNSSSDR_MATIO_LOCAL_VERSION} + ) + endif() +else() if(NOT MATIO_FOUND) - add_dependencies(tracking_gr_blocks matio-${GNSSSDR_MATIO_LOCAL_VERSION}) - endif(NOT MATIO_FOUND) -endif(NOT VOLK_GNSSSDR_FOUND) + add_dependencies(tracking_gr_blocks + matio-${GNSSSDR_MATIO_LOCAL_VERSION} + ) + endif() +endif() diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index 7cce9e680..6991fbd55 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -27,7 +27,7 @@ if(ENABLE_CUDA) cuda_add_library(CUDA_CORRELATOR_LIB ${LIB_TYPE} cuda_multicorrelator.h cuda_multicorrelator.cu) set(OPT_TRACKING_LIBRARIES ${OPT_TRACKING_LIBRARIES} CUDA_CORRELATOR_LIB) set(OPT_TRACKING_INCLUDES ${OPT_TRACKING_INCLUDES} ${CUDA_INCLUDE_DIRS}) -endif(ENABLE_CUDA) +endif() set(TRACKING_LIB_SOURCES cpu_multicorrelator.cc @@ -64,7 +64,7 @@ set(TRACKING_LIB_HEADERS if(ENABLE_FPGA) set(TRACKING_LIB_SOURCES ${TRACKING_LIB_SOURCES} fpga_multicorrelator.cc dll_pll_conf_fpga.cc) set(TRACKING_LIB_HEADERS ${TRACKING_LIB_HEADERS} fpga_multicorrelator.h dll_pll_conf_fpga.h) -endif(ENABLE_FPGA) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -82,11 +82,11 @@ include_directories( if(ENABLE_GENERIC_ARCH) add_definitions(-DGENERIC_ARCH=1) -endif(ENABLE_GENERIC_ARCH) +endif() if(SSE3_AVAILABLE) add_definitions(-DHAVE_SSE3=1) -endif(SSE3_AVAILABLE) +endif() list(SORT TRACKING_LIB_HEADERS) list(SORT TRACKING_LIB_SOURCES) @@ -103,8 +103,8 @@ target_link_libraries(tracking_lib ${GNURADIO_RUNTIME_LIBRARIES} ) -if(VOLK_GNSSSDR_FOUND) +if(VOLKGNSSSDR_FOUND) add_dependencies(tracking_lib glog-${glog_RELEASE}) -else(VOLK_GNSSSDR_FOUND) +else() add_dependencies(tracking_lib glog-${glog_RELEASE} volk_gnsssdr_module) endif() diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index bbecef4d0..9557199c4 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -20,7 +20,7 @@ add_subdirectory(supl) if(OPENSSL_FOUND) add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif(OPENSSL_FOUND) +endif() set(CORE_LIBS_SOURCES ini.cc @@ -57,4 +57,4 @@ target_link_libraries(rx_core_lib supl_library ${PUGIXML_LIBRARY}) if(PUGIXML_LOCAL) add_dependencies(rx_core_lib pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}) -endif(PUGIXML_LOCAL) +endif() diff --git a/src/core/libs/supl/CMakeLists.txt b/src/core/libs/supl/CMakeLists.txt index 65a639e10..e8e1e69a6 100644 --- a/src/core/libs/supl/CMakeLists.txt +++ b/src/core/libs/supl/CMakeLists.txt @@ -27,7 +27,7 @@ set(SUPL_SOURCES if(OPENSSL_FOUND) add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif(OPENSSL_FOUND) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -40,8 +40,8 @@ include_directories( if(CMAKE_C_COMPILER_ID MATCHES "Clang") if(CMAKE_BUILD_TYPE MATCHES "Release") set(MY_C_FLAGS "${MY_C_FLAGS} -Wno-parentheses-equality") - endif(CMAKE_BUILD_TYPE MATCHES "Release") -endif(CMAKE_C_COMPILER_ID MATCHES "Clang") + endif() +endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS}") add_library(supl_library STATIC ${ASN_RRLP_SOURCES} ${ASN_SUPL_SOURCES} ${SUPL_SOURCES}) diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 89540b525..239e8cf00 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -34,6 +34,7 @@ set(GNSS_RECEIVER_HEADERS gnss_block_factory.h gnss_flowgraph.h in_memory_configuration.h + tcp_cmd_interface.h concurrent_map.h concurrent_queue.h control_message.h @@ -41,78 +42,86 @@ set(GNSS_RECEIVER_HEADERS if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) add_definitions(-DMODERN_GNURADIO=1) -endif(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) +endif() if(ENABLE_CUDA) add_definitions(-DCUDA_GPU_ACCEL=1) - set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS}) -endif(ENABLE_CUDA) + set(OPT_RECEIVER_INCLUDE_DIRS + ${OPT_RECEIVER_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS} + ) +endif() if(ENABLE_FPGA) add_definitions(-DENABLE_FPGA=1) -endif(ENABLE_FPGA) +endif() if(ENABLE_RAW_UDP) add_definitions(-DRAW_UDP=1) -endif(ENABLE_RAW_UDP) +endif() if(Boost_VERSION LESS 105000) add_definitions(-DOLD_BOOST=1) -endif(Boost_VERSION LESS 105000) +endif() if(OPENSSL_FOUND) - add_definitions( -DUSE_OPENSSL_FALLBACK=1 ) -endif(OPENSSL_FOUND) + add_definitions(-DUSE_OPENSSL_FALLBACK=1) +endif() if(ENABLE_GN3S) add_definitions(-DGN3S_DRIVER=1) -endif(ENABLE_GN3S) +endif() if(ENABLE_ARRAY) add_definitions(-DRAW_ARRAY_DRIVER=1) -endif(ENABLE_ARRAY) +endif() if(ENABLE_FLEXIBAND) add_definitions(-DFLEXIBAND_DRIVER=1) -endif(ENABLE_FLEXIBAND) +endif() if(ENABLE_OSMOSDR) if(GROSMOSDR_FOUND) add_definitions(-DOSMOSDR_DRIVER=1) - endif(GROSMOSDR_FOUND) -endif(ENABLE_OSMOSDR) + endif() +endif() if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) add_definitions(-DUHD_DRIVER=1) -endif(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) +endif() #Enable OpenCL if found in the system if(OPENCL_FOUND) message(STATUS "Adding processing blocks implemented using OpenCL") add_definitions(-DOPENCL_BLOCKS=1) -else(OPENCL_FOUND) +else() add_definitions(-DOPENCL_BLOCKS=0) -endif(OPENCL_FOUND) +endif() #enable SDR Hardware based on fmcomms2 if(ENABLE_PLUTOSDR) add_definitions(-DPLUTOSDR_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) -endif(ENABLE_PLUTOSDR) + set(OPT_RECEIVER_INCLUDE_DIRS + ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS} + ) +endif() if(ENABLE_FMCOMMS2) add_definitions(-DFMCOMMS2_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) -endif(ENABLE_FMCOMMS2) + set(OPT_RECEIVER_INCLUDE_DIRS + ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS} + ) +endif() if(ENABLE_AD9361) add_definitions(-DAD9361_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) -endif(ENABLE_AD9361) + set(OPT_RECEIVER_INCLUDE_DIRS + ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS} + ) +endif() if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") - add_definitions( -DGR_GREATER_38=1 ) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + add_definitions(-DGR_GREATER_38=1) +endif() include_directories( @@ -184,7 +193,8 @@ add_library(gnss_rx ${GNSS_RECEIVER_INTERFACE_HEADERS} ) -source_group(Headers FILES ${GNSS_RECEIVER_HEADERS} ${GNSS_RECEIVER_INTERFACE_HEADERS}) +source_group(Headers FILES ${GNSS_RECEIVER_HEADERS} + ${GNSS_RECEIVER_INTERFACE_HEADERS}) target_link_libraries(gnss_rx ${Boost_LIBRARIES} diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index 4593d8e1f..39f3231fb 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -99,8 +99,6 @@ include_directories( ${GFlags_INCLUDE_DIRS} ) -link_directories(${Boost_LIBRARY_DIR}) - list(SORT SYSTEM_PARAMETERS_HEADERS) list(SORT SYSTEM_PARAMETERS_SOURCES) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 94a6344e6..85b250e91 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -23,28 +23,28 @@ if(ENABLE_GPERFTOOLS) if(GPERFTOOLS_FOUND) set(GNSS_SDR_OPTIONAL_LIBS "${GNSS_SDR_OPTIONAL_LIBS};${GPERFTOOLS_PROFILER};${GPERFTOOLS_TCMALLOC}") set(GNSS_SDR_OPTIONAL_HEADERS "${GNSS_SDR_OPTIONAL_HEADERS};${GPERFTOOLS_INCLUDE_DIR}") - endif(GPERFTOOLS_FOUND) -endif(ENABLE_GPERFTOOLS) + endif() +endif() if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) set(GNSS_SDR_OPTIONAL_LIBS ${GNSS_SDR_OPTIONAL_LIBS} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES}) set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${UHD_INCLUDE_DIRS}) -endif(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) +endif() if(OPENSSL_FOUND) add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif(OPENSSL_FOUND) +endif() if(ENABLE_CUDA) add_definitions(-DCUDA_GPU_ACCEL=1) set(GNSS_SDR_OPTIONAL_LIBS ${GNSS_SDR_OPTIONAL_LIBS} ${CUDA_LIBRARIES}) set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${CUDA_INCLUDE_DIRS}) -endif(ENABLE_CUDA) +endif() if(ORC_FOUND) set(GNSS_SDR_OPTIONAL_LIBS ${GNSS_SDR_OPTIONAL_LIBS} ${ORC_LIBRARIES}) set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${ORC_INCLUDE_DIRS}) -endif(ORC_FOUND) +endif() include_directories( ${CMAKE_SOURCE_DIR}/src/core/system_parameters @@ -72,8 +72,8 @@ add_definitions(-DGNSS_SDR_VERSION="${VERSION}") if(OS_IS_MACOSX) if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(MAC_LIBRARIES "-framework Accelerate -lc++") - endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") -endif(OS_IS_MACOSX) + endif() +endif() add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) @@ -110,10 +110,10 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/conf DESTINATION share/gnss-sdr install(FILES ${CMAKE_SOURCE_DIR}/conf/gnss-sdr.conf DESTINATION share/gnss-sdr/conf RENAME default.conf) -if(NOT VOLK_GNSSSDR_FOUND) +if(NOT VOLKGNSSSDR_FOUND) install(PROGRAMS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/apps/volk_gnsssdr_profile DESTINATION bin COMPONENT "volk_gnsssdr") install(PROGRAMS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/apps/volk_gnsssdr-config-info DESTINATION bin COMPONENT "volk_gnsssdr") -endif(NOT VOLK_GNSSSDR_FOUND) +endif() find_program(GZIP gzip @@ -135,12 +135,12 @@ if(NOT GZIP_NOTFOUND) install(FILES ${CMAKE_BINARY_DIR}/changelog.gz DESTINATION share/doc/gnss-sdr) - if(NOT VOLK_GNSSSDR_FOUND) + if(NOT VOLKGNSSSDR_FOUND) execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz") execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz") install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz DESTINATION share/man/man1) install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz DESTINATION share/man/man1) - endif(NOT VOLK_GNSSSDR_FOUND) -endif(NOT GZIP_NOTFOUND) + endif() +endif() diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 0d8dec6f8..de39387b7 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -25,26 +25,26 @@ add_subdirectory(system-tests/libs) ################################################################################ if(EXISTS $ENV{GTEST_DIR}) set(GTEST_DIR_LOCAL $ENV{GTEST_DIR}) -endif(EXISTS $ENV{GTEST_DIR}) +endif() if(GTEST_DIR) set(GTEST_DIR_LOCAL ${GTEST_DIR}) -endif(GTEST_DIR) +endif() if(NOT GTEST_DIR_LOCAL) set(GTEST_DIR_LOCAL false) else() set(GTEST_DIR_LOCAL true) -endif(NOT GTEST_DIR_LOCAL) +endif() if(GTEST_INCLUDE_DIRS) set(GTEST_DIR_LOCAL true) -endif(GTEST_INCLUDE_DIRS) +endif() set(GTEST_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}) set(TOOLCHAIN_ARG "") if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) set(GTEST_COMPILER "") set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Toolchains/oe-sdk_cross.cmake") -endif(EXISTS $ENV{OECORE_TARGET_SYSROOT}) +endif() if(NOT ${GTEST_DIR_LOCAL}) # if GTEST_DIR is not defined, we download and build it @@ -60,7 +60,7 @@ if(NOT ${GTEST_DIR_LOCAL}) PATCH_COMMAND "" INSTALL_COMMAND "" ) - else(CMAKE_VERSION VERSION_LESS 3.2) + else() ExternalProject_Add( gtest-${GNSSSDR_GTEST_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/googletest @@ -74,7 +74,7 @@ if(NOT ${GTEST_DIR_LOCAL}) ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} INSTALL_COMMAND "" ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + endif() # Set up variables # Set recently downloaded and build Googletest root folder @@ -87,30 +87,31 @@ if(NOT ${GTEST_DIR_LOCAL}) ExternalProject_Get_Property(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} binary_dir) if(OS_IS_MACOSX) if(CMAKE_GENERATOR STREQUAL Xcode) - set(binary_dir "${binary_dir}/Debug") - endif(CMAKE_GENERATOR STREQUAL Xcode) - endif(OS_IS_MACOSX) - set(GTEST_LIBRARY_PATH "${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX};${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(FINAL_D "d") + set(ADD_DEBUG "Debug/") + endif() + endif() + set(GTEST_LIBRARY_PATH "${binary_dir}/googletest/${ADD_DEBUG}${CMAKE_FIND_LIBRARY_PREFIXES}gtest${FINAL_D}${CMAKE_STATIC_LIBRARY_SUFFIX};${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${FINAL_D}${CMAKE_STATIC_LIBRARY_SUFFIX}") set(GTEST_LIBRARY gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) set(GTEST_LIBRARIES - ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} - ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} + ${binary_dir}/googletest/${ADD_DEBUG}${CMAKE_FIND_LIBRARY_PREFIXES}gtest${FINAL_D}${CMAKE_STATIC_LIBRARY_SUFFIX} + ${binary_dir}/googletest/${ADD_DEBUG}${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${FINAL_D}${CMAKE_STATIC_LIBRARY_SUFFIX} ${THREAD_LIBRARIES}) set(GTEST_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest") -else(NOT ${GTEST_DIR_LOCAL}) +else() if(GTEST_INCLUDE_DIRS) set(GTEST_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIRS} ${LIBGTEST_DEV_DIR}) add_library(gtest ${LIBGTEST_DEV_DIR}/src/gtest-all.cc ${LIBGTEST_DEV_DIR}/src/gtest_main.cc) set(GTEST_LIBRARIES gtest) - else(GTEST_INCLUDE_DIRS) + else() # If the variable GTEST_DIR is defined, we use the existing Googletest set(GTEST_DIR $ENV{GTEST_DIR}) set(GTEST_INCLUDE_DIRECTORIES ${GTEST_DIR}/include ${GTEST_DIR} ${GTEST_DIR}/src) add_library(gtest ${GTEST_DIR}/src/gtest-all.cc ${GTEST_DIR}/src/gtest_main.cc) set(GTEST_LIBRARIES gtest) - endif(GTEST_INCLUDE_DIRS) + endif() target_link_libraries(gtest ${THREAD_LIBRARIES}) -endif(NOT ${GTEST_DIR_LOCAL}) +endif() @@ -123,58 +124,57 @@ set(GNSS_SDR_TEST_OPTIONAL_HEADERS "") if(ENABLE_CUDA) set(GNSS_SDR_TEST_OPTIONAL_HEADERS ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ${CUDA_INCLUDE_DIRS}) set(GNSS_SDR_TEST_OPTIONAL_LIBS ${GNSS_SDR_TEST_OPTIONAL_LIBS} ${CUDA_LIBRARIES}) -endif(ENABLE_CUDA) - +endif() if(ENABLE_GPERFTOOLS) if(GPERFTOOLS_FOUND) set(GNSS_SDR_TEST_OPTIONAL_LIBS "${GNSS_SDR_TEST_OPTIONAL_LIBS};${GPERFTOOLS_LIBRARIES}") set(GNSS_SDR_TEST_OPTIONAL_HEADERS "${GNSS_SDR_TEST_OPTIONAL_HEADERS};${GPERFTOOLS_INCLUDE_DIR}") - endif(GPERFTOOLS_FOUND) -endif(ENABLE_GPERFTOOLS) + endif() +endif() if(Boost_VERSION LESS 105000) add_definitions(-DOLD_BOOST=1) -endif(Boost_VERSION LESS 105000) +endif() if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") - add_definitions( -DGR_GREATER_38=1) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + add_definitions(-DGR_GREATER_38=1) +endif() + +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.15") + add_definitions(-DGR_GREATER_38=1) +endif() if(OPENSSL_FOUND) add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif(OPENSSL_FOUND) +endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(OS_IS_MACOSX) set(CLANG_FLAGS "-stdlib=libc++ -lc++") - endif(OS_IS_MACOSX) -endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + endif() +endif() if(OPENCL_FOUND) add_definitions(-DOPENCL_BLOCKS_TEST=1) -endif(OPENCL_FOUND) +endif() if(ENABLE_CUDA) add_definitions(-DCUDA_BLOCKS_TEST=1) -endif(ENABLE_CUDA) +endif() if(ENABLE_FPGA) add_definitions(-DFPGA_BLOCKS_TEST=1) -endif(ENABLE_FPGA) +endif() find_package(Gnuplot) if(GNUPLOT_FOUND) add_definitions(-DGNUPLOT_EXECUTABLE="${GNUPLOT_EXECUTABLE}") -endif(GNUPLOT_FOUND) - -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.15") - add_definitions(-DGR_GREATER_38=1) -endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.15") +endif() if(ENABLE_UNIT_TESTING_MINIMAL) add_definitions(-DUNIT_TESTING_MINIMAL=1) -endif(ENABLE_UNIT_TESTING_MINIMAL) +endif() ################################################################################ @@ -186,42 +186,42 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) set(CROSS_INSTALL_DIR "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) set(CROSS_INSTALL_DIR "${CROSS_INSTALL_DIR} -DBOOST_ROOT=$ENV{OECORE_TARGET_SYSROOT}/usr") - endif(EXISTS $ENV{OECORE_TARGET_SYSROOT}) - else(ENABLE_FPGA) + endif() + else() set(CROSS_INSTALL_DIR "") - endif(ENABLE_FPGA) + endif() find_package(GNSSSIMULATOR QUIET) if(GNSSSIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n") add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv") - else(GNSSSIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) - ExternalProject_Add( - gnss-sim - GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator - GIT_TAG ${GNSSSDR_GNSS_SIM_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gnss-sim - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim - CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} ${CROSS_INSTALL_DIR} - UPDATE_COMMAND "" - PATCH_COMMAND "" - INSTALL_COMMAND "" - ) - if(ENABLE_INSTALL_TESTS) - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/gnss_sim DESTINATION bin) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n DESTINATION share/gnss-sim) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv DESTINATION share/gnss-sim) - set(SW_GENERATOR_BIN ${CMAKE_INSTALL_PREFIX}/bin/gnss_sim) - add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") - add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n") - add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv") - else(ENABLE_INSTALL_TESTS) - set(SW_GENERATOR_BIN ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/gnss_sim) - add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") - add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n") - add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv") - endif(ENABLE_INSTALL_TESTS) - endif(GNSSSIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) + else() + ExternalProject_Add( + gnss-sim + GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator + GIT_TAG ${GNSSSDR_GNSS_SIM_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gnss-sim + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim + CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} ${CROSS_INSTALL_DIR} + UPDATE_COMMAND "" + PATCH_COMMAND "" + INSTALL_COMMAND "" + ) + if(ENABLE_INSTALL_TESTS) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/gnss_sim DESTINATION bin) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n DESTINATION share/gnss-sim) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv DESTINATION share/gnss-sim) + set(SW_GENERATOR_BIN ${CMAKE_INSTALL_PREFIX}/bin/gnss_sim) + add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") + add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n") + add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv") + else() + set(SW_GENERATOR_BIN ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/gnss_sim) + add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") + add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n") + add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv") + endif() + endif() ################################################################################ # Local installation of GPSTk http://www.gpstk.org/ @@ -229,10 +229,10 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) find_package(GPSTK) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) message(STATUS "GPSTk v${GNSSSDR_GPSTK_LOCAL_VERSION} will be automatically downloaded and built when doing 'make'.") - if ("${TOOLCHAIN_ARG}" STREQUAL "") + if("${TOOLCHAIN_ARG}" STREQUAL "") set(TOOLCHAIN_ARG "-DCMAKE_CXX_FLAGS=\"-Wno-deprecated\"") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") - endif("${TOOLCHAIN_ARG}" STREQUAL "") + endif() include(GNUInstallDirs) string(REGEX REPLACE /[^/]*$ "" LIBDIR ${CMAKE_INSTALL_LIBDIR}) if(CMAKE_VERSION VERSION_LESS 3.2) @@ -246,7 +246,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) UPDATE_COMMAND "" PATCH_COMMAND "" ) - else(CMAKE_VERSION VERSION_LESS 3.2) + else() ExternalProject_Add( gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} GIT_REPOSITORY https://github.com/SGL-UT/GPSTk @@ -258,24 +258,24 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) UPDATE_COMMAND "" PATCH_COMMAND "" ) - endif(CMAKE_VERSION VERSION_LESS 3.2) + endif() set(GPSTK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers") set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) set(GPSTK_BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") set(OWN_GPSTK True) - else(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) + else() set(GPSTK_INCLUDE_DIRS ${GPSTK_INCLUDE_DIR}) set(GPSTK_BINDIR ${GPSTK_LIBRARY}/../bin/) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") - endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) -endif(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) + endif() +endif() -if (ENABLE_UNIT_TESTING_EXTRA) +if(ENABLE_UNIT_TESTING_EXTRA) set(GNSS_SDR_TEST_OPTIONAL_LIBS ${GNSS_SDR_TEST_OPTIONAL_LIBS} ${GPSTK_LIBRARY}) set(GNSS_SDR_TEST_OPTIONAL_HEADERS ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ${GPSTK_INCLUDE_DIRS} ${GPSTK_INCLUDE_DIRS}/gpstk) -endif (ENABLE_UNIT_TESTING_EXTRA) +endif() if(ENABLE_UNIT_TESTING_EXTRA) add_definitions(-DEXTRA_TESTS) @@ -284,18 +284,18 @@ if(ENABLE_UNIT_TESTING_EXTRA) file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/gps_l2c_m_prn7_5msps.dat ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat SHOW_PROGRESS EXPECTED_HASH MD5=a6fcbefe155137945d3c33c5ef7bd0f9) - endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat) + endif() if(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat) message(STATUS "Downloading some data files for testing...") file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat SHOW_PROGRESS EXPECTED_HASH MD5=ffb72fc63c116be58d5e5ccb1daaed3a) - endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat) + endif() if(ENABLE_INSTALL_TESTS) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat DESTINATION share/gnss-sdr/signal_samples) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat DESTINATION share/gnss-sdr/signal_samples) - endif(ENABLE_INSTALL_TESTS) -endif(ENABLE_UNIT_TESTING_EXTRA) + endif() +endif() if(ENABLE_INSTALL_TESTS) install(FILES ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat DESTINATION share/gnss-sdr/signal_samples) @@ -305,7 +305,7 @@ if(ENABLE_INSTALL_TESTS) install(FILES ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/obs_test1.xml DESTINATION share/gnss-sdr/data/rtklib_test) install(FILES ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION share/gnss-sdr/data/rtklib_test) add_definitions(-DTEST_PATH="${CMAKE_INSTALL_PREFIX}/share/gnss-sdr/") -else(ENABLE_INSTALL_TESTS) +else() file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) @@ -313,7 +313,7 @@ else(ENABLE_INSTALL_TESTS) file(COPY ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/obs_test1.xml DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/data/rtklib_test) file(COPY ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/data/rtklib_test) add_definitions(-DTEST_PATH="${CMAKE_SOURCE_DIR}/thirdparty/") -endif(ENABLE_INSTALL_TESTS) +endif() set(LIST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRECTORIES} @@ -400,44 +400,46 @@ if(ENABLE_UNIT_TESTING) ) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(run_tests gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - endif(NOT ${GTEST_DIR_LOCAL}) + endif() if(ENABLE_INSTALL_TESTS) if(EXISTS ${CMAKE_SOURCE_DIR}/install/run_tests) file(REMOVE ${CMAKE_SOURCE_DIR}/install/run_tests) - endif(EXISTS ${CMAKE_SOURCE_DIR}/install/run_tests) + endif() install(TARGETS run_tests RUNTIME DESTINATION bin COMPONENT "run_tests") - else(ENABLE_INSTALL_TESTS) + else() add_custom_command(TARGET run_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$) - endif(ENABLE_INSTALL_TESTS) -endif(ENABLE_UNIT_TESTING) + endif() +endif() if(ENABLE_FPGA) add_executable(gps_l1_ca_dll_pll_tracking_test_fpga - ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc) + ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc + ) target_link_libraries(gps_l1_ca_dll_pll_tracking_test_fpga - ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_LIBRARIES} - ${MATIO_LIBRARIES} - channel_fsm - gnss_sp_libs - gnss_rx - gnss_system_parameters - signal_processing_testing_lib - ) + ${Boost_LIBRARIES} + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${GTEST_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${ARMADILLO_LIBRARIES} + ${VOLK_LIBRARIES} + ${MATIO_LIBRARIES} + channel_fsm + gnss_sp_libs + gnss_rx + gnss_system_parameters + signal_processing_testing_lib + ) install(TARGETS gps_l1_ca_dll_pll_tracking_test_fpga - RUNTIME DESTINATION bin - COMPONENT "fpga-test") -endif(ENABLE_FPGA) + RUNTIME DESTINATION bin + COMPONENT "fpga-test" + ) +endif() @@ -451,14 +453,14 @@ function(add_system_test executable) # Ensure that executable is rebuilt if it was previously built and then removed if(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${SYSTEM_TEST_SOURCES}) - endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) + endif() add_executable(${executable} ${SYSTEM_TEST_SOURCES}) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(${executable} gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - else(NOT ${GTEST_DIR_LOCAL}) + else() add_dependencies(${executable} gtest) - endif(NOT ${GTEST_DIR_LOCAL}) + endif() include_directories(${OPT_INCLUDES_}) target_link_libraries(${executable} ${OPT_LIBS_}) @@ -466,14 +468,14 @@ function(add_system_test executable) if(ENABLE_INSTALL_TESTS) if(EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) file(REMOVE ${CMAKE_SOURCE_DIR}/install/${executable}) - endif(EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) + endif() install(TARGETS ${executable} RUNTIME DESTINATION bin COMPONENT "${executable}_test") - else(ENABLE_INSTALL_TESTS) + else() add_custom_command(TARGET ${executable} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$) - endif(ENABLE_INSTALL_TESTS) -endfunction(add_system_test) + endif() +endfunction() if(ENABLE_SYSTEM_TESTING) @@ -482,10 +484,10 @@ if(ENABLE_SYSTEM_TESTING) set(HOST_SYSTEM "GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCH_}") string(REPLACE "\n" "" HOST_SYSTEM "${HOST_SYSTEM}") string(REPLACE "\"" "" HOST_SYSTEM "${HOST_SYSTEM}") - endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(HOST_SYSTEM "MacOS") - endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + endif() add_definitions(-DHOST_SYSTEM="${HOST_SYSTEM}") #### TTFF @@ -505,32 +507,22 @@ if(ENABLE_SYSTEM_TESTING) ${GNURADIO_ANALOG_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} gnss_sp_libs gnss_rx gnss_system_parameters system_testing_lib) - add_system_test(position_test) - - #if(GPSTK_FOUND OR OWN_GPSTK) - ## OBS_SYSTEM_TEST and OBS_GPS_L1_SYSTEM_TEST - # set(OPT_LIBS_ ${GFlags_LIBS} ${GLOG_LIBRARIES} ${GTEST_LIBRARIES} - # gnss_sp_libs gnss_rx ${GPSTK_LIBRARY}) - # set(OPT_INCLUDES_ ${GPSTK_INCLUDE_DIRS} ${GPSTK_INCLUDE_DIRS}/gpstk) - # add_system_test(obs_gps_l1_system_test) - # add_system_test(obs_system_test) - #endif(GPSTK_FOUND OR OWN_GPSTK) - else(ENABLE_SYSTEM_TESTING_EXTRA) + else() # Avoid working with old executables if they were switched ON and then OFF if(EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) file(REMOVE ${CMAKE_SOURCE_DIR}/install/position_test) - endif(EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) - endif(ENABLE_SYSTEM_TESTING_EXTRA) -else(ENABLE_SYSTEM_TESTING) + endif() + endif() +else() # Avoid working with old executables if they were switched ON and then OFF if(EXISTS ${CMAKE_SOURCE_DIR}/install/ttff) file(REMOVE ${CMAKE_SOURCE_DIR}/install/ttff) - endif(EXISTS ${CMAKE_SOURCE_DIR}/install/ttff) + endif() if(EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) file(REMOVE ${CMAKE_SOURCE_DIR}/install/position_test) - endif(EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) -endif(ENABLE_SYSTEM_TESTING) + endif() +endif() ######################################################### @@ -550,13 +542,15 @@ target_link_libraries(flowgraph_test ${Boost_LIBRARIES} gnss_sp_libs gnss_rx gnss_system_parameters - ${VOLK_GNSSSDR_LIBRARIES}) + ${VOLK_GNSSSDR_LIBRARIES} +) + add_test(flowgraph_test flowgraph_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(flowgraph_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else(NOT ${GTEST_DIR_LOCAL}) +else() add_dependencies(flowgraph_test gtest) -endif(NOT ${GTEST_DIR_LOCAL}) +endif() set_property(TEST flowgraph_test PROPERTY TIMEOUT 30) ######################################################### @@ -569,7 +563,8 @@ add_executable(gnss_block_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/adapter_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_block_factory_test.cc) + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_block_factory_test.cc +) target_link_libraries(gnss_block_test ${Boost_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} @@ -581,19 +576,21 @@ target_link_libraries(gnss_block_test ${Boost_LIBRARIES} gnss_sp_libs gnss_rx gnss_system_parameters - ${VOLK_GNSSSDR_LIBRARIES}) + ${VOLK_GNSSSDR_LIBRARIES} +) add_test(gnss_block_test gnss_block_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(gnss_block_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else(NOT ${GTEST_DIR_LOCAL}) +else() add_dependencies(gnss_block_test gtest) -endif(NOT ${GTEST_DIR_LOCAL}) +endif() set_property(TEST gnss_block_test PROPERTY TIMEOUT 60) ######################################################### add_executable(gnuradio_block_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc) + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc +) target_link_libraries(gnuradio_block_test ${Boost_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} @@ -605,40 +602,42 @@ target_link_libraries(gnuradio_block_test ${Boost_LIBRARIES} gnss_sp_libs gnss_rx gnss_system_parameters - ${VOLK_GNSSSDR_LIBRARIES}) + ${VOLK_GNSSSDR_LIBRARIES} +) add_test(gnuradio_block_test gnuradio_block_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(gnuradio_block_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else(NOT ${GTEST_DIR_LOCAL}) +else() add_dependencies(gnuradio_block_test gtest) -endif(NOT ${GTEST_DIR_LOCAL}) +endif() set_property(TEST gnuradio_block_test PROPERTY TIMEOUT 30) ######################################################### add_executable(matio_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/arithmetic/matio_test.cc) - + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/arithmetic/matio_test.cc +) target_link_libraries(matio_test ${Boost_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} ${GTEST_LIBRARIES} ${MATIO_LIBRARIES} - gnss_system_parameters) + gnss_system_parameters +) add_test(matio_test matio_test) if(NOT ${GTEST_DIR_LOCAL}) if(MATIO_FOUND) add_dependencies(matio_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - else(MATIO_FOUND) + else() add_dependencies(matio_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION} matio-${GNSSSDR_MATIO_LOCAL_VERSION}) - endif(MATIO_FOUND) -else(NOT ${GTEST_DIR_LOCAL}) + endif() +else() if(MATIO_FOUND) add_dependencies(matio_test gtest) - else(MATIO_FOUND) + else() add_dependencies(matio_test gtest matio-${GNSSSDR_MATIO_LOCAL_VERSION}) - endif(MATIO_FOUND) -endif(NOT ${GTEST_DIR_LOCAL}) + endif() +endif() set_property(TEST matio_test PROPERTY TIMEOUT 30) ######################################################### @@ -663,9 +662,9 @@ target_link_libraries(acq_test ${Boost_LIBRARIES} add_test(acq_test acq_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(acq_test acq_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else(NOT ${GTEST_DIR_LOCAL}) +else() add_dependencies(acq_test acq_test gtest) -endif(NOT ${GTEST_DIR_LOCAL}) +endif() set_property(TEST acq_test PROPERTY TIMEOUT 30) ######################################################### @@ -674,7 +673,8 @@ add_executable(trk_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/tracking_loop_filter_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc) + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc +) target_link_libraries(trk_test ${Boost_LIBRARIES} ${GFlags_LIBS} @@ -688,13 +688,14 @@ target_link_libraries(trk_test ${Boost_LIBRARIES} gnss_rx gnss_system_parameters signal_generator_blocks - ${VOLK_GNSSSDR_LIBRARIES}) + ${VOLK_GNSSSDR_LIBRARIES} +) add_test(trk_test trk_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(trk_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else(NOT ${GTEST_DIR_LOCAL}) +else() add_dependencies(trk_test gtest) -endif(NOT ${GTEST_DIR_LOCAL}) +endif() set_property(TEST trk_test PROPERTY TIMEOUT 30) @@ -703,29 +704,31 @@ set_property(TEST trk_test PROPERTY TIMEOUT 30) if(NOT ENABLE_PACKAGING) add_executable(control_thread_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_message_factory_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_thread_test.cc) + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_thread_test.cc + ) target_link_libraries(control_thread_test ${Boost_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} ${GTEST_LIBRARIES} - gnss_rx) + gnss_rx + ) add_test(control_thread_test control_thread_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(control_thread_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - else(NOT ${GTEST_DIR_LOCAL}) + else() add_dependencies(control_thread_test gtest) - endif(NOT ${GTEST_DIR_LOCAL}) + endif() set_property(TEST control_thread_test PROPERTY TIMEOUT 30) -endif(NOT ENABLE_PACKAGING) +endif() ######################################################### if(ENABLE_PACKAGING) add_dependencies(check flowgraph_test gnss_block_test gnuradio_block_test acq_test trk_test matio_test) -else(ENABLE_PACKAGING) +else() add_dependencies(check control_thread_test flowgraph_test gnss_block_test gnuradio_block_test acq_test trk_test matio_test) -endif(ENABLE_PACKAGING) +endif() diff --git a/src/tests/system-tests/libs/CMakeLists.txt b/src/tests/system-tests/libs/CMakeLists.txt index 89b6970c3..178f83479 100644 --- a/src/tests/system-tests/libs/CMakeLists.txt +++ b/src/tests/system-tests/libs/CMakeLists.txt @@ -23,22 +23,29 @@ set(SYSTEM_TESTING_LIB_SOURCES ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${MATIO_INCLUDE_DIRS} + ${ARMADILLO_INCLUDE_DIRS} ) - file(GLOB SYSTEM_TESTING_LIB_HEADERS "*.h") list(SORT SYSTEM_TESTING_LIB_HEADERS) -add_library(system_testing_lib ${SYSTEM_TESTING_LIB_SOURCES} ${SYSTEM_TESTING_LIB_HEADERS}) + +add_library(system_testing_lib + ${SYSTEM_TESTING_LIB_SOURCES} + ${SYSTEM_TESTING_LIB_HEADERS} +) + source_group(Headers FILES ${SYSTEM_TESTING_LIB_HEADERS}) if(NOT MATIO_FOUND) - add_dependencies(system_testing_lib armadillo-${armadillo_RELEASE} matio-${GNSSSDR_MATIO_LOCAL_VERSION}) -else(NOT MATIO_FOUND) - add_dependencies(system_testing_lib armadillo-${armadillo_RELEASE}) -endif(NOT MATIO_FOUND) \ No newline at end of file + add_dependencies(system_testing_lib + armadillo-${armadillo_RELEASE} + matio-${GNSSSDR_MATIO_LOCAL_VERSION} + ) +else() + add_dependencies(system_testing_lib armadillo-${armadillo_RELEASE}) +endif() diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt index 7d15075f2..d0bd655d7 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt +++ b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt @@ -21,29 +21,36 @@ set(SIGNAL_PROCESSING_TESTING_LIB_SOURCES acquisition_dump_reader.cc acquisition_msg_rx.cc tracking_dump_reader.cc - tlm_dump_reader.cc - observables_dump_reader.cc + tlm_dump_reader.cc + observables_dump_reader.cc tracking_true_obs_reader.cc true_observables_reader.cc ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${Boost_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${GFlags_INCLUDE_DIRS} + ${MATIO_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ) file(GLOB SIGNAL_PROCESSING_TESTING_LIB_HEADERS "*.h") list(SORT SIGNAL_PROCESSING_TESTING_LIB_HEADERS) -add_library(signal_processing_testing_lib ${SIGNAL_PROCESSING_TESTING_LIB_SOURCES} ${SIGNAL_PROCESSING_TESTING_LIB_HEADERS}) + +add_library(signal_processing_testing_lib + ${SIGNAL_PROCESSING_TESTING_LIB_SOURCES} + ${SIGNAL_PROCESSING_TESTING_LIB_HEADERS} +) + source_group(Headers FILES ${SIGNAL_PROCESSING_TESTING_LIB_HEADERS}) if(NOT MATIO_FOUND) - add_dependencies(signal_processing_testing_lib matio-${GNSSSDR_MATIO_LOCAL_VERSION} glog-${glog_RELEASE}) -else(NOT MATIO_FOUND) - add_dependencies(signal_processing_testing_lib glog-${glog_RELEASE}) -endif(NOT MATIO_FOUND) + add_dependencies(signal_processing_testing_lib + matio-${GNSSSDR_MATIO_LOCAL_VERSION} glog-${glog_RELEASE} + ) +else() + add_dependencies(signal_processing_testing_lib glog-${glog_RELEASE}) +endif() diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index bd1a31852..c68294b45 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -20,4 +20,4 @@ add_subdirectory(front-end-cal) if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) add_subdirectory(rinex2assist) -endif(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) +endif() diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index 817676b30..16dfa40be 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -19,7 +19,7 @@ if(OPENSSL_FOUND) add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif(OPENSSL_FOUND) +endif() set(FRONT_END_CAL_SOURCES front_end_cal.cc) set(FRONT_END_CAL_HEADERS front_end_cal.h) @@ -112,6 +112,5 @@ find_program(GZIP gzip if(NOT GZIP_NOTFOUND) execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/manpage/front-end-cal-manpage WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/front-end-cal.1.gz") - install(FILES ${CMAKE_BINARY_DIR}/front-end-cal.1.gz DESTINATION share/man/man1) -endif(NOT GZIP_NOTFOUND) +endif() diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 0461d6185..f99b52421 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -22,7 +22,7 @@ if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) string(REGEX REPLACE /[^/]*$ "" LIBDIR ${CMAKE_INSTALL_LIBDIR}) set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) set(GPSTK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) -endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) +endif() set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GPSTK_INCLUDE_DIR}/gpstk) @@ -48,11 +48,11 @@ target_link_libraries(rinex2assist if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) -endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) +endif() add_custom_command(TARGET rinex2assist POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ + ${CMAKE_SOURCE_DIR}/install/$ ) install(TARGETS rinex2assist From af8d93af1a9f630538b599274431019e9c597f18 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 24 Nov 2018 18:41:36 +0100 Subject: [PATCH 122/143] Remove unused variable --- .../signal_source/gnuradio_blocks/labsat23_source.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc index 89e535df8..34731a1c1 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc @@ -236,8 +236,8 @@ int labsat23_source::general_work(int noutput_items, //std::cout << "Section ID: " << (int)section_id << std::endl; byte_counter += 2; - uint8_t section_lenght_bytes = 0; - section_lenght_bytes += memblock[byte_counter] | (memblock[byte_counter + 1] << 8) | (memblock[byte_counter + 2] << 16) | (memblock[byte_counter + 3] << 24); + //uint8_t section_lenght_bytes = 0; + //section_lenght_bytes += memblock[byte_counter] | (memblock[byte_counter + 1] << 8) | (memblock[byte_counter + 2] << 16) | (memblock[byte_counter + 3] << 24); //std::cout << "section_lenght_bytes=" << (int)section_lenght_bytes << std::endl; byte_counter += 4; From 3f89ed8e6bfe2cd7f37e2c0a07ff138a438f6b1b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 24 Nov 2018 19:23:13 +0100 Subject: [PATCH 123/143] Add missing Galileo ephemeris parameter --- src/utils/rinex2assist/main.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index 71b4b97fc..58cc48c0b 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -205,6 +205,7 @@ int main(int argc, char** argv) eph.i_0_2 = rne.i0; eph.omega_2 = rne.w; eph.OMEGA_dot_3 = rne.OMEGAdot; + eph.delta_n_3 = rne.dn; eph.iDot_2 = rne.idot; eph.C_uc_3 = rne.Cuc; eph.C_us_3 = rne.Cus; From 8c48b80e8b7f741a40f7395939013a59222c0398 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 24 Nov 2018 23:43:48 +0100 Subject: [PATCH 124/143] Fix value --- .../galileo_navigation_message.cc | 2 +- .../gps_cnav_navigation_message.cc | 2 +- .../gps_navigation_message.cc | 2 +- src/utils/rinex2assist/README.md | 34 +++++++++++++++++++ 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 src/utils/rinex2assist/README.md diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index 25a8fc241..e94179e1b 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -306,7 +306,7 @@ int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset Date: Sun, 25 Nov 2018 10:32:21 +0100 Subject: [PATCH 125/143] Add style improvements to CMake scripts --- .../volk_gnsssdr/CMakeLists.txt | 117 ++++++------ .../volk_gnsssdr/apps/CMakeLists.txt | 59 +++--- .../volk_gnsssdr/cmake/Modules/FindORC.cmake | 86 +++++---- .../cmake/Modules/VolkAddTest.cmake | 14 +- .../cmake/Modules/VolkBoost.cmake | 40 ++-- .../cmake/Modules/VolkBuildTypes.cmake | 66 +++---- .../cmake/Modules/VolkGnsssdrConfig.cmake.in | 30 +-- .../Modules/VolkGnsssdrConfigVersion.cmake.in | 6 +- .../cmake/Modules/VolkPython.cmake | 40 ++-- .../volk_gnsssdr/lib/CMakeLists.txt | 180 +++++++++--------- 10 files changed, 320 insertions(+), 318 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt index 5a75277e6..df9463121 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -44,20 +44,20 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # retrieve the compiler's version from it string(REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${_err}) string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_OTHER_VERSION}) - else("${IS_APPLE}" STREQUAL "") + else() set(MIN_VERSION ${GNSSSDR_APPLECLANG_MIN_VERSION}) set(APPLE_STR "Apple ") # retrieve the compiler's version from it string(REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${_err}) string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_APPLE_VERSION}) - endif("${IS_APPLE}" STREQUAL "") + endif() if(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}") message(WARNING "\nThe compiler selected to build VOLK-GNSSSDR (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") - endif(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}") - else(${_res} STREQUAL "0") + endif() + else() message(WARNING "\nCannot determine the version of the compiler selected to build VOLK-GNSSSDR (${APPLE_STR}Clang : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") - endif(${_res} STREQUAL "0") -endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + endif() +endif() # Enable C++17 support in GCC >= 8.0.0 # Enable C++14 support in 8.0.0 > GCC >= 6.1.1 @@ -66,15 +66,15 @@ endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") - else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") + else() if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") + else() set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") + endif() + endif() set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall -Wextra") #Add warning flags: For "-Wall" see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html -endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) +endif() # Enable C++17 support in Clang >= 6.0.0 # Enable C++14 support in 6.0.0 > Clang >= 3.5.0 or AppleClang >= 600 @@ -84,28 +84,28 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # See https://trac.macports.org/wiki/XcodeVersionInfo for Apple Clang version equivalences if(CLANG_VERSION VERSION_LESS "600") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") - else(CLANG_VERSION VERSION_LESS "600") + else() set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - endif(CLANG_VERSION VERSION_LESS "600") - else(CMAKE_SYSTEM_NAME MATCHES "Darwin") + endif() + else() if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") - else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") + else() if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") + else() set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - endif(CMAKE_SYSTEM_NAME MATCHES "Darwin") -endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + endif() + endif() + endif() +endif() if(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 11) - endif(NOT (CMAKE_VERSION VERSION_LESS "3.1")) -endif(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) + endif() +endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS} -Wall") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") @@ -113,9 +113,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") if(CMAKE_VERSION VERSION_GREATER "3.0") cmake_policy(SET CMP0042 NEW) if(CMAKE_VERSION VERSION_GREATER "3.9") - cmake_policy(SET CMP0068 NEW) - endif(CMAKE_VERSION VERSION_GREATER "3.9") -endif(CMAKE_VERSION VERSION_GREATER "3.0") + cmake_policy(SET CMP0068 NEW) + endif() +endif() option(ENABLE_STRIP "Create a stripped volk_gnsssdr_profile binary (without shared libraries)" OFF) @@ -129,7 +129,7 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") message(STATUS "Build type not specified: defaulting to release.") endif() -VOLK_CHECK_BUILD_TYPE(${CMAKE_BUILD_TYPE}) +volk_check_build_type(${CMAKE_BUILD_TYPE}) set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.") @@ -144,14 +144,14 @@ include(VolkVersion) #setup version info ######################################################################## # Environment setup ######################################################################## -IF(NOT DEFINED BOOST_ROOT AND NOT DEFINED ENV{BOOST_ROOT}) - SET(BOOST_ROOT ${CMAKE_INSTALL_PREFIX}) -ENDIF() +if(NOT DEFINED BOOST_ROOT AND NOT DEFINED ENV{BOOST_ROOT}) + set(BOOST_ROOT ${CMAKE_INSTALL_PREFIX}) +endif() -IF(NOT DEFINED CROSSCOMPILE_MULTILIB) - SET(CROSSCOMPILE_MULTILIB "") -ENDIF() -SET(CROSSCOMPILE_MULTILIB ${CROSSCOMPILE_MULTILIB} CACHE STRING "Define \"true\" if you have and want to use multiple C development libs installed for cross compile") +if(NOT DEFINED CROSSCOMPILE_MULTILIB) + set(CROSSCOMPILE_MULTILIB "") +endif() +set(CROSSCOMPILE_MULTILIB ${CROSSCOMPILE_MULTILIB} CACHE STRING "Define \"true\" if you have and want to use multiple C development libs installed for cross compile") if(MSVC) add_definitions(-D_USE_MATH_DEFINES) #enables math constants on all supported versions of MSVC @@ -160,16 +160,16 @@ if(MSVC) add_compile_options(/wd4752) add_compile_options(/wo4273) add_compile_options(/wo4838) -endif(MSVC) +endif() # allow 'large' files in 32 bit builds if(UNIX) - add_definitions( -D_LARGEFILE_SOURCE - -D_FILE_OFFSET_BITS=64 - -D_LARGE_FILES - -D_FORTIFY_SOURCE=2 - ) -endif(UNIX) + add_definitions(-D_LARGEFILE_SOURCE + -D_FILE_OFFSET_BITS=64 + -D_LARGE_FILES + -D_FORTIFY_SOURCE=2 + ) +endif() ######################################################################## @@ -178,9 +178,9 @@ endif(UNIX) # Python include(VolkPython) #sets PYTHON_EXECUTABLE and PYTHON_DASH_B -VOLK_PYTHON_CHECK_MODULE("python >= 2.7" sys "sys.version.split()[0] >= '2.7'" PYTHON_MIN_VER_FOUND) -VOLK_PYTHON_CHECK_MODULE("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND) -VOLK_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) +volk_python_check_module("python >= 2.7" sys "sys.version.split()[0] >= '2.7'" PYTHON_MIN_VER_FOUND) +volk_python_check_module("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND) +volk_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) if(NOT PYTHON_MIN_VER_FOUND) @@ -199,16 +199,16 @@ endif() # Boost if(MSVC) - if (NOT DEFINED BOOST_ALL_DYN_LINK) + if(NOT DEFINED BOOST_ALL_DYN_LINK) set(BOOST_ALL_DYN_LINK TRUE) endif() set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking") if(BOOST_ALL_DYN_LINK) add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc - else(BOOST_ALL_DYN_LINK) + else() unset(BOOST_REQUIRED_COMPONENTS) #empty components list for static link - endif(BOOST_ALL_DYN_LINK) -endif(MSVC) + endif() +endif() include(VolkBoost) @@ -220,9 +220,9 @@ endif() option(ENABLE_ORC "Enable Orc" True) if(ENABLE_ORC) find_package(ORC) -else(ENABLE_ORC) +else() message(STATUS "Disabling use of ORC") -endif(ENABLE_ORC) +endif() ######################################################################## @@ -240,7 +240,7 @@ if(DOXYGEN_FOUND) WORKING_DIRECTORY ${PROJECT_BINARY_DIR} COMMENT "Generating documentation with Doxygen" VERBATIM ) -endif(DOXYGEN_FOUND) +endif() ######################################################################## @@ -255,7 +255,8 @@ set(includedir "\${prefix}/include") configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr.pc.in ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr.pc -@ONLY) + @ONLY +) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr.pc @@ -304,17 +305,17 @@ if(APPLE) set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/${VOLK_LIBRARY_DIR} CACHE PATH "Library Install Name Destination Directory" FORCE) - endif(NOT CMAKE_INSTALL_NAME_DIR) + endif() if(NOT CMAKE_INSTALL_RPATH) set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${VOLK_LIBRARY_DIR} CACHE PATH "Library Install RPath" FORCE) - endif(NOT CMAKE_INSTALL_RPATH) + endif() if(NOT CMAKE_BUILD_WITH_INSTALL_RPATH) set(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "Do Build Using Library Install RPath" FORCE) - endif(NOT CMAKE_BUILD_WITH_INSTALL_RPATH) -endif(APPLE) + endif() +endif() ######################################################################## @@ -358,7 +359,7 @@ configure_file( if(NOT CMAKE_MODULES_DIR) set(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/cmake) -endif(NOT CMAKE_MODULES_DIR) +endif() install( FILES @@ -371,7 +372,7 @@ install( ######################################################################## # Option to enable QA testing, on by default ######################################################################## -OPTION(ENABLE_TESTING "Enable QA testing" ON) +option(ENABLE_TESTING "Enable QA testing" ON) if(ENABLE_TESTING) message(STATUS "QA Testing is enabled.") else() @@ -383,7 +384,7 @@ message(STATUS " Modify using: -DENABLE_TESTING=ON/OFF") ######################################################################## # Option to enable post-build profiling using volk_profile, off by default ######################################################################## -OPTION(ENABLE_PROFILING "Launch system profiler after build" OFF) +option(ENABLE_PROFILING "Launch system profiler after build" OFF) if(ENABLE_PROFILING) set(ENABLE_STATIC_LIBS ON) if(DEFINED VOLK_CONFIGPATH) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt index 00a198b5d..b1afa4ed0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/CMakeLists.txt @@ -22,7 +22,7 @@ ######################################################################## if(MSVC) include_directories(${PROJECT_SOURCE_DIR}/cmake/msvc) -endif(MSVC) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -37,26 +37,26 @@ include_directories( set(Clang_required_link "") if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(Clang_required_link "c++") - endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") -endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(Clang_required_link "c++") + endif() +endif() if(ORC_FOUND) set(orc_lib ${ORC_LIBRARIES}) -elseif(ORC_FOUND) +else() set(orc_lib "") -endif(ORC_FOUND) +endif() # allow 'large' files in 32 bit builds if(UNIX) - add_definitions( -D_LARGEFILE_SOURCE - -D_FILE_OFFSET_BITS=64 - -D_LARGE_FILES - ) -endif(UNIX) + add_definitions(-D_LARGEFILE_SOURCE + -D_FILE_OFFSET_BITS=64 + -D_LARGE_FILES + ) +endif() # MAKE volk_gnsssdr_profile @@ -68,18 +68,18 @@ add_executable(volk_gnsssdr_profile if(ENABLE_STATIC_LIBS) target_link_libraries(volk_gnsssdr_profile volk_gnsssdr_static ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib}) -else(ENABLE_STATIC_LIBS) +else() target_link_libraries(volk_gnsssdr_profile volk_gnsssdr ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib}) add_dependencies(volk_gnsssdr_profile volk_gnsssdr) -endif(ENABLE_STATIC_LIBS) +endif() if(ENABLE_STRIP) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) set_target_properties(volk_gnsssdr_profile - PROPERTIES LINK_FLAGS "-s") - endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) -endif(ENABLE_STRIP) + PROPERTIES LINK_FLAGS "-s") + endif() +endif() install( @@ -92,18 +92,18 @@ install( # MAKE volk_gnsssdr-config-info add_executable(volk_gnsssdr-config-info volk_gnsssdr-config-info.cc ${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr_option_helpers.cc) if(ENABLE_STATIC_LIBS) - target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr_static ${Clang_required_link} ${orc_lib}) -else(ENABLE_STATIC_LIBS) - target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr ${Clang_required_link} ${orc_lib}) - add_dependencies(volk_gnsssdr-config-info volk_gnsssdr) -endif(ENABLE_STATIC_LIBS) + target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr_static ${Clang_required_link} ${orc_lib}) +else() + target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr ${Clang_required_link} ${orc_lib}) + add_dependencies(volk_gnsssdr-config-info volk_gnsssdr) +endif() if(ENABLE_STRIP) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) set_target_properties(volk_gnsssdr-config-info - PROPERTIES LINK_FLAGS "-s") - endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) -endif(ENABLE_STRIP) + PROPERTIES LINK_FLAGS "-s") + endif() +endif() install( TARGETS volk_gnsssdr-config-info @@ -114,17 +114,14 @@ install( # Launch volk_gnsssdr_profile if requested to do so if(ENABLE_PROFILING) - if(DEFINED VOLK_CONFIGPATH) + if(DEFINED VOLK_CONFIGPATH) set( VOLK_CONFIG_ARG "-p${VOLK_CONFIGPATH}" ) set( VOLK_CONFIG "${VOLK_CONFIGPATH}/volk_gnsssdr_config" ) - endif() - add_custom_command(OUTPUT ${VOLK_CONFIG} + endif() + add_custom_command(OUTPUT ${VOLK_CONFIG} COMMAND volk_gnsssdr_profile "${VOLK_CONFIG_ARG}" DEPENDS volk_gnsssdr_profile COMMENT "Launching profiler, this may take a few minutes..." ) add_custom_target(volk-gnsssdr-profile-run ALL DEPENDS ${VOLK_CONFIG}) endif() - - - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake index 0341d3f7b..1154d2e7a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake @@ -16,52 +16,56 @@ # along with GNSS-SDR. If not, see . -FIND_PACKAGE(PkgConfig) -PKG_CHECK_MODULES(PC_ORC "orc-0.4 > 0.4.22") +find_package(PkgConfig) +pkg_check_modules(PC_ORC "orc-0.4 > 0.4.22") -FIND_PROGRAM(ORCC_EXECUTABLE orcc - HINTS ${PC_ORC_TOOLSDIR} - PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin) +find_program(ORCC_EXECUTABLE orcc + HINTS ${PC_ORC_TOOLSDIR} + PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin +) -FIND_PATH(ORC_INCLUDE_DIR NAMES orc/orc.h - HINTS ${PC_ORC_INCLUDEDIR} - PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4) - - -FIND_PATH(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} - HINTS ${PC_ORC_LIBDIR} - /usr/local/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/i386-linux-gnu - /usr/lib/arm-linux-gnueabihf - /usr/lib/arm-linux-gnueabi - /usr/lib/aarch64-linux-gnu - /usr/lib/mipsel-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/powerpc-linux-gnu - /usr/lib/powerpc64-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/hppa-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/lib64 - /usr/lib - PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) - -FIND_LIBRARY(ORC_LIB orc-0.4 - HINTS ${PC_ORC_LIBRARY_DIRS} - PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) - -LIST(APPEND ORC_LIBRARY - ${ORC_LIB} +find_path(ORC_INCLUDE_DIR NAMES orc/orc.h + HINTS ${PC_ORC_INCLUDEDIR} + PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4 ) -SET(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) -SET(ORC_LIBRARIES ${ORC_LIBRARY}) -SET(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR}) +find_path(ORC_LIBRARY_DIR + NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} + HINTS ${PC_ORC_LIBDIR} + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib64 + /usr/lib + PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} +) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE) +find_library(ORC_LIB orc-0.4 + HINTS ${PC_ORC_LIBRARY_DIRS} + PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) + +list(APPEND ORC_LIBRARY + ${ORC_LIB} +) + + +set(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) +set(ORC_LIBRARIES ${ORC_LIBRARY}) +set(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE) mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake index b01a99594..a2097046e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake @@ -30,7 +30,7 @@ set(__INCLUDED_VOLK_ADD_TEST TRUE) function(VOLK_GEN_TEST executable_name) include(CMakeParseArgumentsCopy) - CMAKE_PARSE_ARGUMENTS(VOLK_TEST "" "" "SOURCES;TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN}) + cmake_parse_arguments(VOLK_TEST "" "" "SOURCES;TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN}) add_executable(${executable_name} ${VOLK_TEST_SOURCES}) target_link_libraries(${executable_name} ${VOLK_TEST_TARGET_DEPS}) endfunction() @@ -53,7 +53,7 @@ function(VOLK_ADD_TEST test_name executable_name) #parse the arguments for component names include(CMakeParseArgumentsCopy) - CMAKE_PARSE_ARGUMENTS(VOLK_TEST "" "" "TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN}) + cmake_parse_arguments(VOLK_TEST "" "" "TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN}) #set the initial environs to use set(environs ${VOLK_TEST_ENVIRONS}) @@ -146,7 +146,7 @@ function(VOLK_ADD_TEST test_name executable_name) #each line sets an environment variable foreach(environ ${environs}) file(APPEND ${sh_file} "export ${environ}\n") - endforeach(environ) + endforeach() set(VOLK_TEST_ARGS "${test_name}") @@ -166,7 +166,7 @@ function(VOLK_ADD_TEST test_name executable_name) COMMAND ${SHELL} ${sh_file} ${TARGET_DIR_LIST} ) - endif(UNIX) + endif() if(WIN32) #In the land of windows, all libraries must be in the PATH. Since @@ -199,7 +199,7 @@ function(VOLK_ADD_TEST test_name executable_name) #each line sets an environment variable foreach(environ ${environs}) file(APPEND ${bat_file} "SET ${environ}\n") - endforeach(environ) + endforeach() set(VOLK_TEST_ARGS "${test_name}") @@ -213,7 +213,7 @@ function(VOLK_ADD_TEST test_name executable_name) add_test(NAME qa_${test_name} COMMAND ${bat_file} ${TARGET_DIR_LIST} ) - endif(WIN32) + endif() -endfunction(VOLK_ADD_TEST) +endfunction() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake index 56eb75d47..2aea96b2a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake @@ -31,21 +31,21 @@ set(BOOST_REQUIRED_COMPONENTS if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64") list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix -endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64") +endif() if(MSVC) set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} chrono) - if (NOT DEFINED BOOST_ALL_DYN_LINK) + if(NOT DEFINED BOOST_ALL_DYN_LINK) set(BOOST_ALL_DYN_LINK TRUE) endif() set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking") if(BOOST_ALL_DYN_LINK) add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc - else(BOOST_ALL_DYN_LINK) + else() unset(BOOST_REQUIRED_COMPONENTS) #empty components list for static link - endif(BOOST_ALL_DYN_LINK) -endif(MSVC) + endif() +endif() find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) @@ -68,10 +68,10 @@ set(Boost_ADDITIONAL_VERSIONS # Boost 1.52 disabled, see https://svn.boost.org/trac/boost/ticket/7669 # Similar problems with Boost 1.46 and 1.47. -OPTION(ENABLE_BAD_BOOST "Enable known bad versions of Boost" OFF) +option(ENABLE_BAD_BOOST "Enable known bad versions of Boost" OFF) if(ENABLE_BAD_BOOST) - MESSAGE(STATUS "Enabling use of known bad versions of Boost.") -endif(ENABLE_BAD_BOOST) + message(STATUS "Enabling use of known bad versions of Boost.") +endif() # For any unsuitable Boost version, add the version number below in # the following format: XXYYZZ @@ -80,17 +80,17 @@ endif(ENABLE_BAD_BOOST) # YY is the minor version number ('46' for 1.46) # ZZ is the patcher version number (typically just '00') set(Boost_NOGO_VERSIONS - 104600 104601 104700 105200 - ) + 104600 104601 104700 105200 +) foreach(ver ${Boost_NOGO_VERSIONS}) - if("${Boost_VERSION}" STREQUAL "${ver}") - if(NOT ENABLE_BAD_BOOST) - MESSAGE(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Disabling.") - set(Boost_FOUND FALSE) - else(NOT ENABLE_BAD_BOOST) - MESSAGE(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Continuing anyway.") - set(Boost_FOUND TRUE) - endif(NOT ENABLE_BAD_BOOST) - endif("${Boost_VERSION}" STREQUAL "${ver}") -endforeach(ver) + if("${Boost_VERSION}" STREQUAL "${ver}") + if(NOT ENABLE_BAD_BOOST) + message(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Disabling.") + set(Boost_FOUND FALSE) + else() + message(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Continuing anyway.") + set(Boost_FOUND TRUE) + endif() + endif() +endforeach() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake index 5b2f092ec..6f45f1683 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake @@ -53,16 +53,16 @@ list(APPEND AVAIL_BUILDTYPES # the avialable build types. ######################################################################## function(VOLK_CHECK_BUILD_TYPE settype) - STRING(TOUPPER ${settype} _settype) + string(TOUPPER ${settype} _settype) foreach(btype ${AVAIL_BUILDTYPES}) - STRING(TOUPPER ${btype} _btype) + string(TOUPPER ${btype} _btype) if(${_settype} STREQUAL ${_btype}) return() # found it; exit cleanly - endif(${_settype} STREQUAL ${_btype}) - endforeach(btype) + endif() + endforeach() # Build type not found; error out message(FATAL_ERROR "Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}") -endfunction(VOLK_CHECK_BUILD_TYPE) +endfunction() ######################################################################## # For GCC and Clang, we can set a build type: @@ -74,23 +74,23 @@ endfunction(VOLK_CHECK_BUILD_TYPE) # NOTE: This is not defined on Windows systems. ######################################################################## if(NOT WIN32) - SET(CMAKE_CXX_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING + set(CMAKE_CXX_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING "Flags used by the C++ compiler during DebugParanoid builds." FORCE) - SET(CMAKE_C_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING + set(CMAKE_C_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING "Flags used by the C compiler during DebugParanoid builds." FORCE) - SET(CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID + set(CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used for linking binaries during NoOptWithASM builds." FORCE) - SET(CMAKE_SHARED_LINKER_FLAGS_DEBUGPARANOID + set(CMAKE_SHARED_LINKER_FLAGS_DEBUGPARANOID "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used by the shared lib linker during NoOptWithASM builds." FORCE) - MARK_AS_ADVANCED( + mark_as_advanced( CMAKE_CXX_FLAGS_DEBUGPARANOID CMAKE_C_FLAGS_DEBUGPARANOID CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID CMAKE_SHARED_LINKER_DEBUGPARANOID) -endif(NOT WIN32) +endif() ######################################################################## @@ -105,23 +105,23 @@ endif(NOT WIN32) # NOTE: This is not defined on Windows systems. ######################################################################## if(NOT WIN32) - SET(CMAKE_CXX_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING + set(CMAKE_CXX_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING "Flags used by the C++ compiler during NoOptWithASM builds." FORCE) - SET(CMAKE_C_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING + set(CMAKE_C_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING "Flags used by the C compiler during NoOptWithASM builds." FORCE) - SET(CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM + set(CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used for linking binaries during NoOptWithASM builds." FORCE) - SET(CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM + set(CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used by the shared lib linker during NoOptWithASM builds." FORCE) - MARK_AS_ADVANCED( + mark_as_advanced( CMAKE_CXX_FLAGS_NOOPTWITHASM CMAKE_C_FLAGS_NOOPTWITHASM CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM) -endif(NOT WIN32) +endif() ######################################################################## @@ -137,23 +137,23 @@ endif(NOT WIN32) ######################################################################## if(NOT WIN32) - SET(CMAKE_CXX_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING + set(CMAKE_CXX_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING "Flags used by the C++ compiler during O2WithASM builds." FORCE) - SET(CMAKE_C_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING + set(CMAKE_C_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING "Flags used by the C compiler during O2WithASM builds." FORCE) - SET(CMAKE_EXE_LINKER_FLAGS_O2WITHASM + set(CMAKE_EXE_LINKER_FLAGS_O2WITHASM "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used for linking binaries during O2WithASM builds." FORCE) - SET(CMAKE_SHARED_LINKER_FLAGS_O2WITHASM + set(CMAKE_SHARED_LINKER_FLAGS_O2WITHASM "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used by the shared lib linker during O2WithASM builds." FORCE) - MARK_AS_ADVANCED( + mark_as_advanced( CMAKE_CXX_FLAGS_O2WITHASM CMAKE_C_FLAGS_O2WITHASM CMAKE_EXE_LINKER_FLAGS_O2WITHASM CMAKE_SHARED_LINKER_FLAGS_O2WITHASM) -endif(NOT WIN32) +endif() ######################################################################## @@ -169,23 +169,23 @@ endif(NOT WIN32) ######################################################################## if(NOT WIN32) - SET(CMAKE_CXX_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING + set(CMAKE_CXX_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING "Flags used by the C++ compiler during O3WithASM builds." FORCE) - SET(CMAKE_C_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING + set(CMAKE_C_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING "Flags used by the C compiler during O3WithASM builds." FORCE) - SET(CMAKE_EXE_LINKER_FLAGS_O3WITHASM + set(CMAKE_EXE_LINKER_FLAGS_O3WITHASM "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used for linking binaries during O3WithASM builds." FORCE) - SET(CMAKE_SHARED_LINKER_FLAGS_O3WITHASM + set(CMAKE_SHARED_LINKER_FLAGS_O3WITHASM "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used by the shared lib linker during O3WithASM builds." FORCE) - MARK_AS_ADVANCED( + mark_as_advanced( CMAKE_CXX_FLAGS_O3WITHASM CMAKE_C_FLAGS_O3WITHASM CMAKE_EXE_LINKER_FLAGS_O3WITHASM CMAKE_SHARED_LINKER_FLAGS_O3WITHASM) -endif(NOT WIN32) +endif() ######################################################################## # For GCC and Clang, we can set a build type: @@ -197,14 +197,14 @@ endif(NOT WIN32) # NOTE: This is not defined on Windows systems. ######################################################################## if(NOT WIN32) - SET(CMAKE_CXX_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING + set(CMAKE_CXX_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING "Flags used by the C++ compiler during Address Sanitized builds." FORCE) - SET(CMAKE_C_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING + set(CMAKE_C_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING "Flags used by the C compiler during Address Sanitized builds." FORCE) - MARK_AS_ADVANCED( + mark_as_advanced( CMAKE_CXX_FLAGS_ASAN CMAKE_C_FLAGS_ASAN CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID CMAKE_SHARED_LINKER_DEBUGPARANOID) -endif(NOT WIN32) +endif() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in index 4838f13c0..af9e75169 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in @@ -15,33 +15,33 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_VOLK_GNSSSDR volk_gnsssdr) +include(FindPkgConfig) +pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr) -FIND_PATH( +find_path( VOLK_GNSSSDR_INCLUDE_DIRS NAMES volk_gnsssdr/volk_gnsssdr.h HINTS $ENV{VOLK_DIR}/include ${PC_VOLK_INCLUDEDIR} PATHS /usr/local/include - /usr/include - /opt/local/include - "@CMAKE_INSTALL_PREFIX@/include" + /usr/include + /opt/local/include + "@CMAKE_INSTALL_PREFIX@/include" ) -FIND_LIBRARY( +find_library( VOLK_GNSSSDR_LIBRARIES NAMES volk_gnsssdr HINTS $ENV{VOLK_DIR}/lib ${PC_VOLK_LIBDIR} PATHS /usr/local/lib - /usr/local/lib64 - /usr/lib - /usr/lib64 - /opt/local/lib - "@CMAKE_INSTALL_PREFIX@/lib" + /usr/local/lib64 + /usr/lib + /usr/lib64 + /opt/local/lib + "@CMAKE_INSTALL_PREFIX@/lib" ) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(VOLK_GNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) -MARK_AS_ADVANCED(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) +mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in index d7694fdb9..7808c7dbe 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in @@ -27,6 +27,6 @@ if(${PACKAGE_FIND_VERSION_MAJOR} EQUAL ${MAJOR_VERSION}) if(NOT ${PACKAGE_FIND_VERSION_PATCH} GREATER ${MAINT_VERSION}) set(PACKAGE_VERSION_EXACT 1) # exact match for API version set(PACKAGE_VERSION_COMPATIBLE 1) # compat for minor/patch version - endif(NOT ${PACKAGE_FIND_VERSION_PATCH} GREATER ${MAINT_VERSION}) - endif(${PACKAGE_FIND_VERSION_MINOR} EQUAL ${MINOR_VERSION}) -endif(${PACKAGE_FIND_VERSION_MAJOR} EQUAL ${MAJOR_VERSION}) + endif() + endif() +endif() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake index 809feb8e1..06c51883c 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake @@ -32,30 +32,30 @@ if(CMAKE_VERSION VERSION_LESS 3.12) if(PYTHON_EXECUTABLE) message(STATUS "User set python executable ${PYTHON_EXECUTABLE}") find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED) - else(PYTHON_EXECUTABLE) + else() message(STATUS "PYTHON_EXECUTABLE not set - using default python2") message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python3 to build for python3.") find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION}) if(NOT PYTHONINTERP_FOUND) message(STATUS "python2 not found - using python3") find_package(PythonInterp ${VOLK_PYTHON3_MIN_VERSION} REQUIRED) - endif(NOT PYTHONINTERP_FOUND) - endif(PYTHON_EXECUTABLE) + endif() + endif() find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT) -else(CMAKE_VERSION VERSION_LESS 3.12) +else() if(PYTHON_EXECUTABLE) message(STATUS "User set python executable ${PYTHON_EXECUTABLE}") find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED) - else(PYTHON_EXECUTABLE) - find_package (Python COMPONENTS Interpreter) + else() + find_package(Python COMPONENTS Interpreter) set(PYTHON_VERSION_MAJOR ${Python_VERSION_MAJOR}) set(PYTHON_EXECUTABLE ${Python_EXECUTABLE}) - endif(PYTHON_EXECUTABLE) -endif(CMAKE_VERSION VERSION_LESS 3.12) + endif() +endif() -if (${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3) +if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3) set(PYTHON3 TRUE) -endif () +endif() @@ -79,7 +79,7 @@ macro(VOLK_PYTHON_CHECK_MODULE_RAW desc python_code have) message(STATUS "Python checking for ${desc} - not found") set(${have} FALSE) endif() -endmacro(VOLK_PYTHON_CHECK_MODULE_RAW) +endmacro() macro(VOLK_PYTHON_CHECK_MODULE desc mod cmd have) VOLK_PYTHON_CHECK_MODULE_RAW( @@ -92,7 +92,7 @@ except (ImportError, AssertionError): exit(-1) except: pass #########################################" "${have}") -endmacro(VOLK_PYTHON_CHECK_MODULE) +endmacro() ######################################################################## # Sets the python installation directory VOLK_PYTHON_DIR @@ -121,14 +121,14 @@ unique = hashlib.md5(b'${reldir}${ARGN}').hexdigest()[:5] print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))" OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE) add_custom_target(${_target} ALL DEPENDS ${ARGN}) -endfunction(VOLK_UNIQUE_TARGET) +endfunction() ######################################################################## # Install python sources (also builds and installs byte-compiled python) ######################################################################## function(VOLK_PYTHON_INSTALL) include(CMakeParseArgumentsCopy) - CMAKE_PARSE_ARGUMENTS(VOLK_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN}) + cmake_parse_arguments(VOLK_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN}) #################################################################### if(VOLK_PYTHON_INSTALL_FILES) @@ -162,7 +162,7 @@ function(VOLK_PYTHON_INSTALL) get_filename_component(pygen_path ${pygenfile} PATH) file(MAKE_DIRECTORY ${pygen_path}) - endforeach(pyfile) + endforeach() #the command to generate the pyc files add_custom_command( @@ -189,8 +189,8 @@ function(VOLK_PYTHON_INSTALL) #################################################################### file(TO_NATIVE_PATH ${PYTHON_EXECUTABLE} pyexe_native) - if (CMAKE_CROSSCOMPILING) - set(pyexe_native "/usr/bin/env python") + if(CMAKE_CROSSCOMPILING) + set(pyexe_native "/usr/bin/env python") endif() foreach(pyfile ${VOLK_PYTHON_INSTALL_PROGRAMS}) @@ -220,13 +220,13 @@ function(VOLK_PYTHON_INSTALL) DESTINATION ${VOLK_PYTHON_INSTALL_DESTINATION} COMPONENT ${VOLK_PYTHON_INSTALL_COMPONENT} ) - endforeach(pyfile) + endforeach() endif() - VOLK_UNIQUE_TARGET("pygen" ${python_install_gen_targets}) + volk_unique_target("pygen" ${python_install_gen_targets}) -endfunction(VOLK_PYTHON_INSTALL) +endfunction() ######################################################################## # Write the python helper script that generates byte code files diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt index c538f7206..48c012c09 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt @@ -22,22 +22,22 @@ # header file detection ######################################################################## include(CheckIncludeFile) -CHECK_INCLUDE_FILE(cpuid.h HAVE_CPUID_H) +check_include_file(cpuid.h HAVE_CPUID_H) if(HAVE_CPUID_H) add_definitions(-DHAVE_CPUID_H) endif() -CHECK_INCLUDE_FILE(intrin.h HAVE_INTRIN_H) +check_include_file(intrin.h HAVE_INTRIN_H) if(HAVE_INTRIN_H) add_definitions(-DHAVE_INTRIN_H) endif() -CHECK_INCLUDE_FILE(fenv.h HAVE_FENV_H) +check_include_file(fenv.h HAVE_FENV_H) if(HAVE_FENV_H) add_definitions(-DHAVE_FENV_H) endif() -CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H) +check_include_file(dlfcn.h HAVE_DLFCN_H) if(HAVE_DLFCN_H) add_definitions(-DHAVE_DLFCN_H) list(APPEND volk_gnsssdr_libraries ${CMAKE_DL_LIBS}) @@ -62,7 +62,7 @@ endif() ######################################################################## if(COMPILER_NAME MATCHES "GNU") include(CheckCXXCompilerFlag) - CHECK_CXX_COMPILER_FLAG("-Werror=unused-command-line-argument" HAVE_WERROR_UNUSED_CMD_LINE_ARG) + check_cxx_compiler_flag("-Werror=unused-command-line-argument" HAVE_WERROR_UNUSED_CMD_LINE_ARG) if(HAVE_WERROR_UNUSED_CMD_LINE_ARG) set(VOLK_FLAG_CHECK_FLAGS "-Werror=unused-command-line-argument") endif() @@ -74,20 +74,20 @@ endif() ######################################################################## include(CheckSymbolExists) -CHECK_SYMBOL_EXISTS(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN) - +check_symbol_exists(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN) + if(HAVE_POSIX_MEMALIGN) add_definitions(-DHAVE_POSIX_MEMALIGN) -endif(HAVE_POSIX_MEMALIGN) +endif() if(NOT DEFINED _XOPEN_SOURCE) add_definitions(-D_XOPEN_SOURCE=700) -endif(NOT DEFINED _XOPEN_SOURCE) +endif() ######################################################################## # detect x86 flavor of CPU ######################################################################## -if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(i.86|x86|x86_64|amd64|AMD64)$") +if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(i.86|x86|x86_64|amd64|AMD64)$") message(STATUS "x86* CPU detected") set(CPU_IS_x86 TRUE) endif() @@ -106,7 +106,7 @@ macro(check_arch arch_name) set(flags ${ARGN}) set(have_${arch_name} TRUE) foreach(flag ${flags}) - if (MSVC AND (${flag} STREQUAL "/arch:SSE2" OR ${flag} STREQUAL "/arch:SSE" )) + if(MSVC AND (${flag} STREQUAL "/arch:SSE2" OR ${flag} STREQUAL "/arch:SSE")) # SSE/SSE2 is supported in MSVC since VS 2005 but flag not available when compiling 64-bit so do not check else() include(CheckCXXCompilerFlag) @@ -119,27 +119,27 @@ macro(check_arch arch_name) if(VOLK_FLAG_CHECK_FLAGS) set(CMAKE_REQUIRED_FLAGS ${VOLK_FLAG_CHECK_FLAGS}) endif() - CHECK_CXX_COMPILER_FLAG(${flag} ${have_flag}) + check_cxx_compiler_flag(${flag} ${have_flag}) unset(CMAKE_REQUIRED_FLAGS) - if (NOT ${have_flag}) + if(NOT ${have_flag}) set(have_${arch_name} FALSE) endif() endif() endforeach() - if (have_${arch_name}) + if(have_${arch_name}) list(APPEND available_archs ${arch_name}) endif() -endmacro(check_arch) +endmacro() foreach(line ${arch_flag_lines}) string(REGEX REPLACE "," ";" arch_flags ${line}) check_arch(${arch_flags}) -endforeach(line) +endforeach() macro(OVERRULE_ARCH arch reason) message(STATUS "${reason}, Overruled arch ${arch}") list(REMOVE_ITEM available_archs ${arch}) -endmacro(OVERRULE_ARCH) +endmacro() ######################################################################## # eliminate AVX on if not on x86, or if the compiler does not accept @@ -150,25 +150,25 @@ set(HAVE_XGETBV 0) set(HAVE_AVX_CVTPI32_PS 0) if(CPU_IS_x86) # check to see if the compiler/linker works with xgetb instruction - if (NOT MSVC) + if(NOT MSVC) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv.c "unsigned long long _xgetbv(unsigned int index) { unsigned int eax, edx; __asm__ __volatile__(\"xgetbv\" : \"=a\"(eax), \"=d\"(edx) : \"c\"(index)); return ((unsigned long long)edx << 32) | eax; } int main (void) { (void) _xgetbv(0); return (0); }") - else (NOT MSVC) + else() #MSVC defines an intrinsic file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv.c "#include \n #include \n int main() { int avxSupported = 0; \n#if (_MSC_FULL_VER >= 160040219) \nint cpuInfo[4]; __cpuid(cpuInfo, 1);\nif ((cpuInfo[2] & (1 << 27) || 0) && (cpuInfo[2] & (1 << 28) || 0)) \n{\nunsigned long long xcrFeatureMask = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);\n avxSupported = (xcrFeatureMask & 0x6) == 6;}\n#endif \n return 1- avxSupported; }") - endif(NOT MSVC) + endif() execute_process(COMMAND ${CMAKE_C_COMPILER} -o ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv.c OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE avx_compile_result) if(NOT ${avx_compile_result} EQUAL 0) - OVERRULE_ARCH(avx "Compiler or linker missing xgetbv instruction") + overrule_arch(avx "Compiler or linker missing xgetbv instruction") elseif(NOT CROSSCOMPILE_MULTILIB) execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE avx_exe_result) if(NOT ${avx_exe_result} EQUAL 0) - OVERRULE_ARCH(avx "CPU missing xgetbv") + overrule_arch(avx "CPU missing xgetbv") else() set(HAVE_XGETBV 1) endif() @@ -184,7 +184,7 @@ if(CPU_IS_x86) ######################################################################### # check to see if the compiler/linker works with cvtpi32_ps instrinsic when using AVX - if (CMAKE_SIZEOF_VOID_P EQUAL 4) + if(CMAKE_SIZEOF_VOID_P EQUAL 4) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps.c "#include \nint main (void) {__m128 __a; __m64 __b; __m128 foo = _mm_cvtpi32_ps(__a, __b); return (0); }") execute_process(COMMAND ${CMAKE_C_COMPILER} -mavx -o ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps @@ -192,13 +192,13 @@ if(CPU_IS_x86) OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE avx_compile_result) if(NOT ${avx_compile_result} EQUAL 0) - OVERRULE_ARCH(avx "Compiler missing cvtpi32_ps instrinsic") + overrule_arch(avx "Compiler missing cvtpi32_ps instrinsic") elseif(NOT CROSSCOMPILE_MULTILIB) execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE avx_exe_result) if(NOT ${avx_exe_result} EQUAL 0) - OVERRULE_ARCH(avx "CPU missing cvtpi32_ps") + overrule_arch(avx "CPU missing cvtpi32_ps") else() set(HAVE_AVX_CVTPI32_PS 1) endif() @@ -207,10 +207,10 @@ if(CPU_IS_x86) endif() file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps.c) - else(CMAKE_SIZEOF_VOID_P EQUAL 4) - # 64-bit compilations won't need this command so don't overrule AVX - set(HAVE_AVX_CVTPI32_PS 0) - endif(CMAKE_SIZEOF_VOID_P EQUAL 4) + else() + # 64-bit compilations won't need this command so don't overrule AVX + set(HAVE_AVX_CVTPI32_PS 0) + endif() # Disable SSE4a if Clang is less than version 3.2 if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") @@ -222,14 +222,14 @@ if(CPU_IS_x86) execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE clang_version) string(REGEX MATCH "[0-9].[0-9]" CMAKE_C_COMPILER_VERSION ${clang_version}) - endif(CMAKE_VERSION VERSION_LESS "2.8.10") + endif() if(CMAKE_C_COMPILER_VERSION VERSION_LESS "3.2") - OVERRULE_ARCH(sse4_a "Clang >= 3.2 required for SSE4a") - endif(CMAKE_C_COMPILER_VERSION VERSION_LESS "3.2") - endif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") + overrule_arch(sse4_a "Clang >= 3.2 required for SSE4a") + endif() + endif() -endif(CPU_IS_x86) +endif() if(${HAVE_XGETBV}) add_definitions(-DHAVE_XGETBV) @@ -244,17 +244,17 @@ endif() ######################################################################## if(NOT CPU_IS_x86) - OVERRULE_ARCH(3dnow "Architecture is not x86 or x86_64") - OVERRULE_ARCH(mmx "Architecture is not x86 or x86_64") - OVERRULE_ARCH(sse "Architecture is not x86 or x86_64") - OVERRULE_ARCH(sse2 "Architecture is not x86 or x86_64") - OVERRULE_ARCH(sse3 "Architecture is not x86 or x86_64") - OVERRULE_ARCH(ssse3 "Architecture is not x86 or x86_64") - OVERRULE_ARCH(sse4_a "Architecture is not x86 or x86_64") - OVERRULE_ARCH(sse4_1 "Architecture is not x86 or x86_64") - OVERRULE_ARCH(sse4_2 "Architecture is not x86 or x86_64") - OVERRULE_ARCH(avx "Architecture is not x86 or x86_64") -endif(NOT CPU_IS_x86) + overrule_arch(3dnow "Architecture is not x86 or x86_64") + overrule_arch(mmx "Architecture is not x86 or x86_64") + overrule_arch(sse "Architecture is not x86 or x86_64") + overrule_arch(sse2 "Architecture is not x86 or x86_64") + overrule_arch(sse3 "Architecture is not x86 or x86_64") + overrule_arch(ssse3 "Architecture is not x86 or x86_64") + overrule_arch(sse4_a "Architecture is not x86 or x86_64") + overrule_arch(sse4_1 "Architecture is not x86 or x86_64") + overrule_arch(sse4_2 "Architecture is not x86 or x86_64") + overrule_arch(avx "Architecture is not x86 or x86_64") +endif() ######################################################################## # Select neon based on ARM ISA version @@ -265,33 +265,33 @@ endif(NOT CPU_IS_x86) include(CheckCSourceCompiles) check_c_source_compiles("#include \nint main(){ uint8_t *dest; uint8x8_t res; vst1_u8(dest, res); }" - neon_compile_result) + neon_compile_result) if(neon_compile_result) check_c_source_compiles("int main(){asm volatile(\"vrev32.8 q0, q0\");}" - have_neonv7_result ) + have_neonv7_result) check_c_source_compiles("int main(){asm volatile(\"sub v1.4s,v1.4s,v1.4s\");}" - have_neonv8_result ) + have_neonv8_result) - if (have_neonv7_result) - OVERRULE_ARCH(neonv8 "CPU is armv7") + if(have_neonv7_result) + overrule_arch(neonv8 "CPU is armv7") endif() - if (have_neonv8_result) - OVERRULE_ARCH(neonv7 "CPU is armv8") + if(have_neonv8_result) + overrule_arch(neonv7 "CPU is armv8") endif() -else(neon_compile_result) - OVERRULE_ARCH(neon "Compiler doesn't support NEON") - OVERRULE_ARCH(neonv7 "Compiler doesn't support NEON") - OVERRULE_ARCH(neonv8 "Compiler doesn't support NEON") -endif(neon_compile_result) +else() + overrule_arch(neon "Compiler doesn't support NEON") + overrule_arch(neonv7 "Compiler doesn't support NEON") + overrule_arch(neonv8 "Compiler doesn't support NEON") +endif() ######################################################################## # implement overruling in the ORC case, # since ORC always passes flag detection ######################################################################## if(NOT ORC_FOUND) - OVERRULE_ARCH(orc "ORC support not found") + overrule_arch(orc "ORC support not found") endif() ######################################################################## @@ -301,16 +301,16 @@ endif() if(NOT CROSSCOMPILE_MULTILIB AND CPU_IS_x86) include(CheckTypeSize) check_type_size("void*[8]" SIZEOF_CPU BUILTIN_TYPES_ONLY) - if (${SIZEOF_CPU} EQUAL 64) - OVERRULE_ARCH(32 "CPU width is 64 bits") + if(${SIZEOF_CPU} EQUAL 64) + overrule_arch(32 "CPU width is 64 bits") endif() - if (${SIZEOF_CPU} EQUAL 32) - OVERRULE_ARCH(64 "CPU width is 32 bits") + if(${SIZEOF_CPU} EQUAL 32) + overrule_arch(64 "CPU width is 32 bits") endif() #MSVC 64 bit does not have MMX, overrule it - if (${SIZEOF_CPU} EQUAL 64 AND MSVC) - OVERRULE_ARCH(mmx "No MMX for Win64") + if(${SIZEOF_CPU} EQUAL 64 AND MSVC) + overrule_arch(mmx "No MMX for Win64") endif() endif() @@ -340,12 +340,12 @@ execute_process( foreach(arch mmx orc 64 32) foreach(machine_name ${available_machines}) string(REPLACE "_${arch}" "" machine_name_no_arch ${machine_name}) - if (${machine_name} STREQUAL ${machine_name_no_arch}) + if(${machine_name} STREQUAL ${machine_name_no_arch}) else() list(REMOVE_ITEM available_machines ${machine_name_no_arch}) endif() - endforeach(machine_name) -endforeach(arch) + endforeach() +endforeach() ######################################################################## # done overrules! print the result @@ -373,7 +373,7 @@ macro(gen_template tmpl output) ${PROJECT_SOURCE_DIR}/gen/volk_gnsssdr_tmpl_utils.py --input ${tmpl} --output ${output} ${ARGN} ) -endmacro(gen_template) +endmacro() file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/volk_gnsssdr) @@ -399,13 +399,13 @@ if(MSVC) elseif(MSVC11) #Visual Studio 11 set(cmake_c_compiler_version "Microsoft Visual Studio 11.0") elseif(MSVC12) #Visual Studio 12 - SET(cmake_c_compiler_version "Microsoft Visual Studio 12.0") + set(cmake_c_compiler_version "Microsoft Visual Studio 12.0") endif() else() execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE cmake_c_compiler_version) -endif(MSVC) -set(COMPILER_INFO "${CMAKE_C_COMPILER}:::${CMAKE_C_FLAGS_${GRCBTU}} ${CMAKE_C_FLAGS}\n${CMAKE_CXX_COMPILER}:::${CMAKE_CXX_FLAGS_${GRCBTU}} ${CMAKE_CXX_FLAGS}\n" ) +endif() +set(COMPILER_INFO "${CMAKE_C_COMPILER}:::${CMAKE_C_FLAGS_${GRCBTU}} ${CMAKE_C_FLAGS}\n${CMAKE_CXX_COMPILER}:::${CMAKE_CXX_FLAGS_${GRCBTU}} ${CMAKE_CXX_FLAGS}\n") foreach(machine_name ${available_machines}) #generate machine source @@ -419,8 +419,8 @@ foreach(machine_name ${available_machines}) --mode "machine_flags" --machine "${machine_name}" --compiler "${COMPILER_NAME}" OUTPUT_VARIABLE ${machine_name}_flags OUTPUT_STRIP_TRAILING_WHITESPACE ) - MESSAGE(STATUS "BUILD INFO ::: ${machine_name} ::: ${COMPILER_NAME} ::: ${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}") - set(COMPILER_INFO "${COMPILER_INFO}${machine_name}:::${COMPILER_NAME}:::${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}\n" ) + message(STATUS "BUILD INFO ::: ${machine_name} ::: ${COMPILER_NAME} ::: ${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}") + set(COMPILER_INFO "${COMPILER_INFO}${machine_name}:::${COMPILER_NAME}:::${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}\n") if(${machine_name}_flags AND NOT MSVC) set_source_files_properties(${machine_source} PROPERTIES COMPILE_FLAGS "${${machine_name}_flags}") endif() @@ -428,12 +428,12 @@ foreach(machine_name ${available_machines}) #add to available machine defs string(TOUPPER LV_MACHINE_${machine_name} machine_def) list(APPEND machine_defs ${machine_def}) -endforeach(machine_name) +endforeach() # Convert to a C string to compile and display properly string(STRIP "${cmake_c_compiler_version}" cmake_c_compiler_version) string(STRIP ${COMPILER_INFO} COMPILER_INFO) -MESSAGE(STATUS "Compiler Version: ${cmake_c_compiler_version}") +message(STATUS "Compiler Version: ${cmake_c_compiler_version}") string(REPLACE "\n" " \\n" cmake_c_compiler_version ${cmake_c_compiler_version}) string(REPLACE "\n" " \\n" COMPILER_INFO ${COMPILER_INFO}) @@ -462,7 +462,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9") # set up the assembler flags and include the source files foreach(ARCH ${ASM_ARCHS_AVAILABLE}) string(REGEX MATCH "${ARCH}" ASM_ARCH "${available_archs}") - if( ASM_ARCH STREQUAL "neonv7" ) + if(ASM_ARCH STREQUAL "neonv7") message(STATUS "---- Adding ASM files") # we always use ATT syntax message(STATUS "-- Detected neon architecture; enabling ASM") # setup architecture specific assembler flags @@ -474,23 +474,23 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9") foreach(asm_file ${asm_files}) list(APPEND volk_gnsssdr_sources ${asm_file}) message(STATUS "Adding source file: ${asm_file}") - endforeach(asm_file) + endforeach() endif() enable_language(ASM) set(CMAKE_ASM_FLAGS ${ARCH_ASM_FLAGS}) message(STATUS "c flags: ${FULL_C_FLAGS}") message(STATUS "asm flags: ${CMAKE_ASM_FLAGS}") - endforeach(ARCH) + endforeach() -else(${CMAKE_VERSION} VERSION_GREATER "2.8.9") +else() message(STATUS "Not enabling ASM support. CMake >= 2.8.10 required.") foreach(machine_name ${available_machines}) string(REGEX MATCH "neon" NEON_MACHINE ${machine_name}) - if( NEON_MACHINE STREQUAL "neon") + if(NEON_MACHINE STREQUAL "neon") message(FATAL_ERROR "CMake >= 2.8.10 is required for ARM NEON support") endif() endforeach() -endif(${CMAKE_VERSION} VERSION_GREATER "2.8.9") +endif() ######################################################################## # Handle orc support @@ -517,7 +517,7 @@ if(ORC_FOUND) ) list(APPEND volk_gnsssdr_sources ${orcc_gen}) - endforeach(orc_file) + endforeach() else() message(STATUS "Did not find liborc and orcc, disabling orc support...") endif() @@ -571,7 +571,7 @@ endif() if(CMAKE_VERSION VERSION_GREATER "2.8.7") #Create a volk_gnsssdr object library (requires cmake >= 2.8.8) add_library(volk_gnsssdr_obj OBJECT ${volk_gnsssdr_sources}) - + #Add dynamic library add_library(volk_gnsssdr SHARED $) target_link_libraries(volk_gnsssdr ${volk_gnsssdr_libraries} ${Boost_LIBRARIES}) @@ -597,7 +597,7 @@ if(CMAKE_VERSION VERSION_GREATER "2.8.7") install(TARGETS volk_gnsssdr_static ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" ) - endif(ENABLE_STATIC_LIBS) + endif() #Older cmake versions (slower to build when building dynamic/static libs) else() @@ -619,14 +619,14 @@ else() if(NOT WIN32) set_target_properties(volk_gnsssdr_static PROPERTIES OUTPUT_NAME volk_gnsssdr) - endif(NOT WIN32) + endif() install(TARGETS volk_gnsssdr_static ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file ) - endif(ENABLE_STATIC_LIBS) + endif() +endif() -endif(CMAKE_VERSION VERSION_GREATER "2.8.7") ######################################################################## # Build the QA test application ######################################################################## @@ -641,7 +641,7 @@ if(ENABLE_TESTING) ) include(VolkAddTest) - VOLK_GEN_TEST("volk_gnsssdr_test_all" + volk_gen_test("volk_gnsssdr_test_all" SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/testqa.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_utils.cc TARGET_DEPS volk_gnsssdr @@ -649,7 +649,7 @@ if(ENABLE_TESTING) foreach(kernel ${h_files}) get_filename_component(kernel ${kernel} NAME) string(REPLACE ".h" "" kernel ${kernel}) - VOLK_ADD_TEST(${kernel} "volk_gnsssdr_test_all") + volk_add_test(${kernel} "volk_gnsssdr_test_all") endforeach() -endif(ENABLE_TESTING) +endif() From b755f4a895b1efa300d89a0b674d7f2b2a23ee6c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Nov 2018 10:32:56 +0100 Subject: [PATCH 126/143] Fix value --- src/core/system_parameters/galileo_navigation_message.cc | 2 +- src/core/system_parameters/gps_cnav_navigation_message.cc | 2 +- src/core/system_parameters/gps_navigation_message.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index e94179e1b..4e72f62d3 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -306,7 +306,7 @@ int64_t Galileo_Navigation_Message::read_navigation_signed(std::bitset Date: Sun, 25 Nov 2018 12:29:56 +0100 Subject: [PATCH 127/143] Add ability to read compressed RINEX navigation files --- src/utils/rinex2assist/CMakeLists.txt | 2 ++ src/utils/rinex2assist/README.md | 28 ++++++++++++++++++----- src/utils/rinex2assist/main.cc | 32 ++++++++++++++++++++++++++- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index f99b52421..c87b1cd69 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -26,6 +26,8 @@ endif() set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GPSTK_INCLUDE_DIR}/gpstk) +find_package(Boost COMPONENTS iostreams serialization REQUIRED) + include_directories( ${CMAKE_SOURCE_DIR}/src/core/system_parameters ${GFlags_INCLUDE_DIRS} diff --git a/src/utils/rinex2assist/README.md b/src/utils/rinex2assist/README.md index bc3246374..147c3a17f 100644 --- a/src/utils/rinex2assist/README.md +++ b/src/utils/rinex2assist/README.md @@ -1,7 +1,7 @@ Rinex2assist ------------ -This program generates ephemeris XML files from RINEX navigation data files. The usage is as follows: +This program reads data from RINEX navigation files and generates XML files that can be read by GNSS-SDR as Assisted GNSS data. The usage is as follows: ``` $ rinex2assist /path/to/RINEX_nav_file @@ -9,16 +9,34 @@ $ rinex2assist /path/to/RINEX_nav_file The argument is mandatory (the name of the RINEX navigation file). The name `gps_ephemeris.xml` is given to the output if GPS NAV data is fould. If the RINEX file contains Galileo data, the corresponding `gal_ephemeris.xml` file will be generated. The program is also able to extract parameters of the UTC and the Ionospheric models from the RINEX header, if available. They will be called `gps_utc_model.xml`, `gps_iono.xml`, `gal_utc_model.xml` and `gal_iono.xml`. - -The program accepts either versions 2.xx or 3.xx for the RINEX navigation data file. - There are some servers available for downloading RINEX navigation files. For instance: * NASA: [ftp://cddis.gsfc.nasa.gov/pub/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) * ESA: [ftp://gssc.esa.int/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) Just make sure to pick up a [station near you](http://gpspp.sakura.ne.jp/gmap/igsnet.htm). -An example of GNSS-SDR configuration using ephemeris and UTC and ionospheric model parameters for GPS L1 and Galileo signals is shown below: +The program accepts either versions 2.xx or 3.xx for the RINEX navigation data file, as well as compressed files (ending in `.gz`). + +Examples: + +``` +$ rinex2assist EBRE00ESP_R_20183290400_01H_GN.rnx.gz +Generated file: gps_ephemeris.xml +Generated file: gps_utc_model.xml +Generated file: gps_iono.xml +``` + +and + +``` +$ rinex2assist EBRE00ESP_R_20183290000_01H_EN.rnx.gz +Generated file: gal_ephemeris.xml +Generated file: gal_utc_model.xml +Generated file: gal_iono.xml +``` + + +An example of GNSS-SDR configuration using ephemeris, UTC and ionospheric model parameters for GPS L1 and Galileo signals is shown below: ``` GNSS-SDR.AGNSS_XML_enabled=true diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index 58cc48c0b..d09a1f933 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -42,6 +42,9 @@ #include #include #include +#include +#include +#include #include @@ -70,6 +73,33 @@ int main(int argc, char** argv) } std::string xml_filename; + // Uncompress if RINEX file is gzipped + std::string rinex_filename(argv[1]); + std::size_t found = rinex_filename.find_last_of("."); + if (found != std::string::npos) + { + if ((rinex_filename.substr(found + 1, found + 3).compare("gz") == 0)) + { + std::cerr << "Hello" << std::endl; + std::ifstream file(rinex_filename, std::ios_base::in | std::ios_base::binary); + boost::iostreams::filtering_streambuf in; + try + { + in.push(boost::iostreams::gzip_decompressor()); + } + catch (const boost::exception& e) + { + std::cerr << "Could not decompress file " << rinex_filename << std::endl; + return 1; + } + in.push(file); + std::string rinex_filename_unzipped = rinex_filename.substr(0, found); + std::ofstream output_file(rinex_filename_unzipped.c_str(), std::ios_base::out | std::ios_base::binary); + boost::iostreams::copy(in, output_file); + rinex_filename = rinex_filename_unzipped; + } + } + std::map eph_map; std::map eph_gal_map; @@ -83,7 +113,7 @@ int main(int argc, char** argv) try { // Read nav file - gpstk::Rinex3NavStream rnffs(argv[1]); // Open navigation data file + gpstk::Rinex3NavStream rnffs(rinex_filename.c_str()); // Open navigation data file gpstk::Rinex3NavData rne; gpstk::Rinex3NavHeader hdr; From d1f21d2cb090c3bef4c2d7523060261b21a3eedf Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Nov 2018 13:00:37 +0100 Subject: [PATCH 128/143] Update link to map with IGS stations --- src/utils/rinex2assist/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/rinex2assist/README.md b/src/utils/rinex2assist/README.md index 147c3a17f..dbd69ba5b 100644 --- a/src/utils/rinex2assist/README.md +++ b/src/utils/rinex2assist/README.md @@ -13,7 +13,7 @@ There are some servers available for downloading RINEX navigation files. For ins * NASA: [ftp://cddis.gsfc.nasa.gov/pub/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) * ESA: [ftp://gssc.esa.int/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) -Just make sure to pick up a [station near you](http://gpspp.sakura.ne.jp/gmap/igsnet.htm). +Just make sure to pick up a [station near you](http://www.igs.org/network). The program accepts either versions 2.xx or 3.xx for the RINEX navigation data file, as well as compressed files (ending in `.gz`). From 89bbc565a8659f17d18caff3f132440a14540705 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Nov 2018 14:20:19 +0100 Subject: [PATCH 129/143] Fix building if boost iostreams is not present --- src/utils/rinex2assist/CMakeLists.txt | 63 +++++++++++++++------------ 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index c87b1cd69..81c8fa4de 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -26,38 +26,43 @@ endif() set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GPSTK_INCLUDE_DIR}/gpstk) -find_package(Boost COMPONENTS iostreams serialization REQUIRED) +find_package(Boost COMPONENTS iostreams serialization QUIET) -include_directories( - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GPSTK_INCLUDE_DIR}/gpstk - ${GPSTK_INCLUDE_DIR} -) +if(Boost_FOUND) + include_directories( + ${CMAKE_SOURCE_DIR}/src/core/system_parameters + ${GFlags_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${GPSTK_INCLUDE_DIR}/gpstk + ${GPSTK_INCLUDE_DIR} + ) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") -add_executable(rinex2assist ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) + add_executable(rinex2assist ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) -target_link_libraries(rinex2assist - ${Boost_LIBRARIES} - ${GPSTK_LIBRARY} - ${GFlags_LIBS} - gnss_sp_libs - gnss_rx -) + target_link_libraries(rinex2assist + ${Boost_LIBRARIES} + ${GPSTK_LIBRARY} + ${GFlags_LIBS} + gnss_sp_libs + gnss_rx + ) -if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) - add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) + if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) + add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) + endif() + + add_custom_command(TARGET rinex2assist POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ + ${CMAKE_SOURCE_DIR}/install/$ + ) + + install(TARGETS rinex2assist + RUNTIME DESTINATION bin + COMPONENT "rinex2assist" + ) +else() + message(STATUS "Boost iostrems library not found.") + message(STATUS "rinex2assist will not be built.") endif() - -add_custom_command(TARGET rinex2assist POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ -) - -install(TARGETS rinex2assist - RUNTIME DESTINATION bin - COMPONENT "rinex2assist" -) From 6d46561c38926748ba3febb33e75d3b0cb5b79d8 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Nov 2018 19:21:20 +0100 Subject: [PATCH 130/143] Remove garbage --- src/utils/rinex2assist/main.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index d09a1f933..c37c50143 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -80,7 +80,6 @@ int main(int argc, char** argv) { if ((rinex_filename.substr(found + 1, found + 3).compare("gz") == 0)) { - std::cerr << "Hello" << std::endl; std::ifstream file(rinex_filename, std::ios_base::in | std::ios_base::binary); boost::iostreams::filtering_streambuf in; try From 88e91e6912428eaac88fbf924de8ec964197ab7f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Nov 2018 20:17:00 +0100 Subject: [PATCH 131/143] Fix typo --- src/utils/rinex2assist/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 81c8fa4de..7532e25d6 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -63,6 +63,6 @@ if(Boost_FOUND) COMPONENT "rinex2assist" ) else() - message(STATUS "Boost iostrems library not found.") + message(STATUS "Boost Iostreams library not found.") message(STATUS "rinex2assist will not be built.") endif() From 1f514f156c7eb925d3a2854a38d69a81bbdbe8e2 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Nov 2018 20:52:52 +0100 Subject: [PATCH 132/143] Add ability to read compressed .Z RINEX navigation files --- src/utils/rinex2assist/main.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index c37c50143..ad6dc2eb5 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -45,6 +45,7 @@ #include #include #include +#include #include @@ -81,6 +82,11 @@ int main(int argc, char** argv) if ((rinex_filename.substr(found + 1, found + 3).compare("gz") == 0)) { std::ifstream file(rinex_filename, std::ios_base::in | std::ios_base::binary); + if (file.fail()) + { + std::cerr << "Could not open file " << rinex_filename << std::endl; + return 1; + } boost::iostreams::filtering_streambuf in; try { @@ -97,6 +103,24 @@ int main(int argc, char** argv) boost::iostreams::copy(in, output_file); rinex_filename = rinex_filename_unzipped; } + if ((rinex_filename.substr(found + 1, found + 2).compare("Z") == 0)) + { + std::ifstream file(rinex_filename, std::ios_base::in | std::ios_base::binary); + if (file.fail()) + { + std::cerr << "Could not open file" << rinex_filename << std::endl; + return 1; + } + file.close(); + // option k is not always available, so we save a copy of the original file + std::string argum = std::string("/bin/cp " + rinex_filename + " " + rinex_filename + ".aux"); + std::system(argum.c_str()); + std::string argum2 = std::string("/usr/bin/uncompress -f " + rinex_filename); + std::system(argum2.c_str()); + std::string argum3 = std::string("/bin/mv " + rinex_filename + +".aux" + " " + rinex_filename); + std::system(argum3.c_str()); + rinex_filename = rinex_filename.substr(0, found); + } } std::map eph_map; From c596ed472630ddf679a0879803894f250f0fc482 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Nov 2018 20:55:49 +0100 Subject: [PATCH 133/143] Document ability to read compressed .Z RINEX navigation files --- src/utils/rinex2assist/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/rinex2assist/README.md b/src/utils/rinex2assist/README.md index dbd69ba5b..e3f3594e2 100644 --- a/src/utils/rinex2assist/README.md +++ b/src/utils/rinex2assist/README.md @@ -15,7 +15,7 @@ There are some servers available for downloading RINEX navigation files. For ins Just make sure to pick up a [station near you](http://www.igs.org/network). -The program accepts either versions 2.xx or 3.xx for the RINEX navigation data file, as well as compressed files (ending in `.gz`). +The program accepts either versions 2.xx or 3.xx for the RINEX navigation data file, as well as compressed files (ending in `.gz` or `.Z`). Examples: From c8c8146a5e49f957ed6ce4e1bed997ad887c269a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 11:50:12 +0100 Subject: [PATCH 134/143] Find uncompress program in more environments --- src/utils/rinex2assist/CMakeLists.txt | 12 +++++++++ src/utils/rinex2assist/main.cc | 37 +++++++++++++++++++-------- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 7532e25d6..344c0694b 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -28,6 +28,18 @@ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GPSTK_INCLUDE_DIR}/gpstk) find_package(Boost COMPONENTS iostreams serialization QUIET) +find_program(UNCOMPRESS_EXECUTABLE uncompress + PATHS /bin + /usr/bin + /usr/sbin +) + +if(NOT UNCOMPRESS_EXECUTABLE-NOTFOUND) + add_definitions(-DUNCOMPRESS_EXECUTABLE="${UNCOMPRESS_EXECUTABLE}") +else() + add_definitions(-DUNCOMPRESS_EXECUTABLE="") +endif() + if(Boost_FOUND) include_directories( ${CMAKE_SOURCE_DIR}/src/core/system_parameters diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index ad6dc2eb5..66ccb2e45 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -76,6 +76,7 @@ int main(int argc, char** argv) // Uncompress if RINEX file is gzipped std::string rinex_filename(argv[1]); + std::string input_filename = rinex_filename; std::size_t found = rinex_filename.find_last_of("."); if (found != std::string::npos) { @@ -99,9 +100,14 @@ int main(int argc, char** argv) } in.push(file); std::string rinex_filename_unzipped = rinex_filename.substr(0, found); - std::ofstream output_file(rinex_filename_unzipped.c_str(), std::ios_base::out | std::ios_base::binary); + std::ofstream output_file(rinex_filename_unzipped.c_str(), std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); + if (file.fail()) + { + std::cerr << "Could not create file " << rinex_filename_unzipped << std::endl; + return 1; + } boost::iostreams::copy(in, output_file); - rinex_filename = rinex_filename_unzipped; + input_filename = rinex_filename_unzipped; } if ((rinex_filename.substr(found + 1, found + 2).compare("Z") == 0)) { @@ -112,14 +118,23 @@ int main(int argc, char** argv) return 1; } file.close(); - // option k is not always available, so we save a copy of the original file - std::string argum = std::string("/bin/cp " + rinex_filename + " " + rinex_filename + ".aux"); - std::system(argum.c_str()); - std::string argum2 = std::string("/usr/bin/uncompress -f " + rinex_filename); - std::system(argum2.c_str()); - std::string argum3 = std::string("/bin/mv " + rinex_filename + +".aux" + " " + rinex_filename); - std::system(argum3.c_str()); - rinex_filename = rinex_filename.substr(0, found); + std::string uncompress_executable(UNCOMPRESS_EXECUTABLE); + if (!uncompress_executable.empty()) + { + // option k is not always available, so we save a copy of the original file + std::string argum = std::string("/bin/cp " + rinex_filename + " " + rinex_filename + ".aux"); + std::system(argum.c_str()); + std::string argum2 = std::string(uncompress_executable + " -f " + rinex_filename); + std::system(argum2.c_str()); + std::string argum3 = std::string("/bin/mv " + rinex_filename + +".aux" + " " + rinex_filename); + std::system(argum3.c_str()); + input_filename = rinex_filename.substr(0, found); + } + else + { + std::cerr << "uncompress program not found." << std::endl; + return 1; + } } } @@ -136,7 +151,7 @@ int main(int argc, char** argv) try { // Read nav file - gpstk::Rinex3NavStream rnffs(rinex_filename.c_str()); // Open navigation data file + gpstk::Rinex3NavStream rnffs(input_filename.c_str()); // Open navigation data file gpstk::Rinex3NavData rne; gpstk::Rinex3NavHeader hdr; From e71cbc9f244b4ef7f52314191235a7788cd53390 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 12:04:34 +0100 Subject: [PATCH 135/143] Fix warning --- src/utils/rinex2assist/main.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index 66ccb2e45..2ec31e1dd 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -123,12 +123,17 @@ int main(int argc, char** argv) { // option k is not always available, so we save a copy of the original file std::string argum = std::string("/bin/cp " + rinex_filename + " " + rinex_filename + ".aux"); - std::system(argum.c_str()); + int s1 = std::system(argum.c_str()); std::string argum2 = std::string(uncompress_executable + " -f " + rinex_filename); - std::system(argum2.c_str()); + int s2 = std::system(argum2.c_str()); std::string argum3 = std::string("/bin/mv " + rinex_filename + +".aux" + " " + rinex_filename); - std::system(argum3.c_str()); + int s3 = std::system(argum3.c_str()); input_filename = rinex_filename.substr(0, found); + if ((s1 != 0) or (s2 != 0) or (s3 != 0)) + { + std::cerr << "Failure uncompressing file." << std::endl; + return 1; + } } else { From 6fc09273859943f82f960e4b9d1d79b66f738924 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 15:03:12 +0100 Subject: [PATCH 136/143] Fix reading of Galileo ephemeris --- src/utils/rinex2assist/main.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index 2ec31e1dd..31fcd3ebb 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -291,6 +291,7 @@ int main(int argc, char** argv) eph.af0_4 = rne.af0; eph.af1_4 = rne.af1; eph.af2_4 = rne.af2; + eph.WN_5 = rne.weeknum; eph_gal_map[j] = eph; j++; } From ed3396905fb007d94c38e2256ec7915755e9f6ae Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 20:01:25 +0100 Subject: [PATCH 137/143] Improve documentation --- src/utils/rinex2assist/README.md | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/utils/rinex2assist/README.md b/src/utils/rinex2assist/README.md index e3f3594e2..6ed346cdb 100644 --- a/src/utils/rinex2assist/README.md +++ b/src/utils/rinex2assist/README.md @@ -1,7 +1,35 @@ Rinex2assist ------------ -This program reads data from RINEX navigation files and generates XML files that can be read by GNSS-SDR as Assisted GNSS data. The usage is as follows: +This program reads data from RINEX navigation files and generates XML files that can be read by GNSS-SDR as Assisted GNSS data. + +### Building + +This program is built along with GNSS-SDR if the options `ENABLE_UNIT_TESTING_EXTRA` or `ENABLE_SYSTEM_TESTING_EXTRA` are set to `ON` when calling CMake: + +``` +$ cmake -DENABLE_SYSTEM_TESTING_EXTRA=ON .. +$ make +$ sudo make intall +``` + +The last step is optional. Without it, you will get the executable at `../install/rinex2assist`. + +The building requires two extra dependencies: the Boost Iostreams library and the program `uncompress`: + + * The Boost Iostreams library can be installed through a package: + - In Debian / Ubuntu: `sudo apt-get install libboost-iostreams-dev` + - In Fedora / CentOS: `sudo yum install boost-iostreams` + - In OpenSUSE: `sudo zypper install libboost_iostreams-devel` + - In Arch Linux: included in `boost-libs` package. + - In MacOS: included in Macports / Homebrew `boost` package. + * The program `uncompress` is available by default in most UNIX and GNU/Linux systems. + - In Fedora / CentOS: `sudo yum install ncompress` + - In OpenSUSE: `sudo zypper install ncompress` + +### Usage + +The usage is as follows: ``` $ rinex2assist /path/to/RINEX_nav_file @@ -9,7 +37,7 @@ $ rinex2assist /path/to/RINEX_nav_file The argument is mandatory (the name of the RINEX navigation file). The name `gps_ephemeris.xml` is given to the output if GPS NAV data is fould. If the RINEX file contains Galileo data, the corresponding `gal_ephemeris.xml` file will be generated. The program is also able to extract parameters of the UTC and the Ionospheric models from the RINEX header, if available. They will be called `gps_utc_model.xml`, `gps_iono.xml`, `gal_utc_model.xml` and `gal_iono.xml`. -There are some servers available for downloading RINEX navigation files. For instance: +There are some servers available for downloading recent RINEX navigation files. For instance: * NASA: [ftp://cddis.gsfc.nasa.gov/pub/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) * ESA: [ftp://gssc.esa.int/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) From 880c6715c113b3e0c990abb82587de3e6045bc76 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 21:00:47 +0100 Subject: [PATCH 138/143] Reorder XML file and remove duplicated parameter --- src/core/system_parameters/galileo_ephemeris.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/core/system_parameters/galileo_ephemeris.h b/src/core/system_parameters/galileo_ephemeris.h index d2555790c..fd844adf2 100644 --- a/src/core/system_parameters/galileo_ephemeris.h +++ b/src/core/system_parameters/galileo_ephemeris.h @@ -123,10 +123,7 @@ public: { }; - archive& BOOST_SERIALIZATION_NVP(flag_all_ephemeris); - archive& BOOST_SERIALIZATION_NVP(IOD_ephemeris); - archive& BOOST_SERIALIZATION_NVP(IOD_nav_1); - archive& BOOST_SERIALIZATION_NVP(SV_ID_PRN_4); + archive& BOOST_SERIALIZATION_NVP(i_satellite_PRN); archive& BOOST_SERIALIZATION_NVP(M0_1); archive& BOOST_SERIALIZATION_NVP(delta_n_3); @@ -155,6 +152,10 @@ public: archive& BOOST_SERIALIZATION_NVP(Galileo_satClkDrift); archive& BOOST_SERIALIZATION_NVP(Galileo_dtr); + archive& BOOST_SERIALIZATION_NVP(flag_all_ephemeris); + archive& BOOST_SERIALIZATION_NVP(IOD_ephemeris); + archive& BOOST_SERIALIZATION_NVP(IOD_nav_1); + archive& BOOST_SERIALIZATION_NVP(SISA_3); archive& BOOST_SERIALIZATION_NVP(E5a_HS); archive& BOOST_SERIALIZATION_NVP(E5b_HS_5); @@ -165,8 +166,6 @@ public: archive& BOOST_SERIALIZATION_NVP(BGD_E1E5a_5); archive& BOOST_SERIALIZATION_NVP(BGD_E1E5b_5); - - archive& BOOST_SERIALIZATION_NVP(i_satellite_PRN); } }; From f416a06304452258857fa15a09fed2b8c6397958 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 21:18:45 +0100 Subject: [PATCH 139/143] Update Galileo ephemeris schema --- docs/xml-schemas/gal_ephemeris_map.xsd | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/xml-schemas/gal_ephemeris_map.xsd b/docs/xml-schemas/gal_ephemeris_map.xsd index 06c541af5..bf6c5ea20 100644 --- a/docs/xml-schemas/gal_ephemeris_map.xsd +++ b/docs/xml-schemas/gal_ephemeris_map.xsd @@ -1,4 +1,4 @@ - +< @@ -16,6 +16,7 @@ + @@ -34,6 +35,22 @@ + + + + + + + + + + + + + + + + From 2c6e3e621dfc48fb4437c341b4755d261ba6af99 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 22:13:33 +0100 Subject: [PATCH 140/143] Update changelog --- docs/changelog | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/changelog b/docs/changelog index dece16401..96dcc4b6a 100644 --- a/docs/changelog +++ b/docs/changelog @@ -16,6 +16,7 @@ Next release will have several improvements in different dimensions, addition of - Redesign of the time counter for enhanced continuity. - Improved flow graph in multisystem configurations: the receiver does not get stalled anymore if no signal is found from the first system. - Improved acquisition and tracking sensitivity. +- Added mechanisms for Assisted GNSS, thus shortening the Time-To-First-Fix. Provision of data via XML files or via SUPL v1.0. Documented at https://gnss-sdr.org/docs/sp-blocks/global-parameters/ - Other minor bug fixes. @@ -27,6 +28,7 @@ Next release will have several improvements in different dimensions, addition of - New volk_gnsssdr kernels: volk_gnsssdr_16i_xn_resampler_16i_xn.h, volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h, volk_gnsssdr_32f_xn_resampler_32f_xn.h, volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h - Some AVX2 implementations added to the volk_gnsssdr library. - Improvement in C++ usage: Use of const container calls when result is immediately converted to a const iterator. Using these members removes an implicit conversion from iterator to const_iterator. +- Output printers can be shut down, with some savings in memory and storage requirements. - A number of code optimizations here and there. @@ -34,7 +36,8 @@ Next release will have several improvements in different dimensions, addition of - A number of new parameters have been exposed to the configuration system. - Possibility to choose Pilot or Data component for tracking of GPS L5 and Galileo E5a signals. -- Enabled extended coherent integration times. +- Enabled extended coherent integration times for signal tracking. +- Configurable coherent and/or non-coherent signal acquisition. - Some configuration parameters can now be overridden by commandline flags for easier use in scripts. @@ -48,11 +51,14 @@ Next release will have several improvements in different dimensions, addition of - Added five more signal sources: "Fmcomms2_Signal_Source" (requires gr-iio), "Plutosdr_Signal Source" (requires gr-iio), "Spir_GSS6450_File_Signal_Source", "Labsat_Signal_Source" and "Custom_UDP_Signal_Source" (requires libpcap). Documented in https://gnss-sdr.org/docs/sp-blocks/signal-source/ - Improved support for BladeRF, HackRF and RTL-SDR front-ends. - Added tools for the interaction with front-ends based on the AD9361 chipset. -- Intermediate results are now saved in .mat binary format, readable from Matlab/Octave and from Python via h5py. +- Intermediate results are now saved in MAT-file format (.mat), readable from Matlab/Octave and from Python via h5py. - Added the GPX output format. -- Fixed a bug in the format of NMEA sentences when latitude or longitude minutes were >10. +- Improvements in the generation of KML files. +- Improvements in the NMEA output. The receiver can produce GPGGA, GPRMC, GPGSA, GPGSV, GAGSA and GAGSV sentences. - Improvements in the RTCM server stability. - Improvements in the correctness of generated RINEX files. +- The receiver can read and make use of Galileo almanac XML files published by the European GNSS Service Centre at https://www.gsc-europa.eu/system-status/almanac-data +- Added program rinex2assist to convert RINEX navigation files into XML files usable for AGNSS. Only available building from source. See https://github.com/gnss-sdr/gnss-sdr/tree/next/src/utils/rinex2assist ### Improvements in Maintainability: @@ -64,6 +70,8 @@ Next release will have several improvements in different dimensions, addition of - Improvement in C++ usage: The override special identifier is now used when overriding a virtual function. This helps the compiler to check for type changes in the base class, making the detection of errors easier. - Improvement in C++ usage: A number of unused includes have been removed. Order of includes set to: local (in-source) headers, then library headers, then system headers. This helps to detect missing includes. - Improvement in C++ usage: Enhanced const correctness. Misuses of those variables are detected by the compiler. +- Applied some style rules to CMake scripts. +- Minimal versions of dependencies identified and detected. ### Improvements in Portability: @@ -76,15 +84,16 @@ Next release will have several improvements in different dimensions, addition of - The Ninja build system can be used in replacement of make. - The volk_gnsssdr library can be built using Python 2.7 or Python 3.6. - The volk_gnsssdr library is now ready for AArch64 NEON instructions. -- Ready for GNU Radio 3.8 C++ API (as per current next branch of GNU Radio upstream repository). +- Ready for GNU Radio 3.8 C++ API (as per current master branch of GNU Radio upstream repository). - Improved detection of required and optional dependencies in many GNU/Linux distributions and processor architectures. -- Improvement in C++ usage: The library has been replaced by the more modern and portable . +- Improvement in C++ usage: The library has been replaced by the more modern and portable (except for the interaction with RTKLIB). - Improvement in C++ usage: The library has been replaced by the more modern and portable for file handling. - Improvement in C++ usage: C++ libraries preferred over C libraries (e.g., instead of , instead of ). - Fixes required by Debian packaging. - Fixes required by Macports packaging. - A downside in portability: BLAS and LAPACK libraries are now required even in ARM devices. - A downside in portability: the matio library >= 1.5.3 is a new required dependency. If not found, it is downloaded and built automatically at building time, but this requires libtool, automake and hdf5 already installed in the system. +- A downside in portability: the PugiXML library is a new required dependency. If not found, it is downloaded and built automatically at building time. ### Improvements in Reliability: @@ -93,6 +102,7 @@ Next release will have several improvements in different dimensions, addition of - Improved flow graph stabiliy. - Introduction of high-integrity C++ practices into the source code and included in the coding style guide. See https://gnss-sdr.org/coding-style/ - Fixed a number of defects detected by Coverity Scan. +- Improvement of QA code and addition of a number of new tests. Documented at https://gnss-sdr.org/docs/tutorials/testing-software-receiver-2/ - Improvement in C++ usage: rand() function replaced by library. - Improvement in C++ usage: strlen and strncpy have been replaced by safer C++ counterparts. - Improvement in C++ usage: Some destructors have been fixed, avoiding segmentation faults when exiting the program. @@ -122,9 +132,10 @@ Next release will have several improvements in different dimensions, addition of - All Observables block implementations have been merged into a single implementation for all kinds of GNSS signals, making it easier to configure. - All PVT block implementations have been merged into a single implementation for all kinds of GNSS signals, making it easier to configure. -- Misleading parameter name GNSS-SDR.internal_fs_hz has been replaced by GNSS-SDR.internal_fs_sps. The old parameter name is still read. If found, a warning is provided to the user. -- Updated and improved documentation of processing blocks at https://gnss-sdr.org/docs/sp-blocks/ +- Misleading parameter name GNSS-SDR.internal_fs_hz has been replaced by GNSS-SDR.internal_fs_sps. The old parameter name is still read. If found, a warning is provided to the user. The old name will be removed in future releases. +- Updated and improved online documentation of processing blocks at https://gnss-sdr.org/docs/sp-blocks/ - Improved documentation of required dependency packages in several GNU/Linux distributions. +- Dump and output files can now be stored anywhere. - Parameter names with the same role have been harmonized within different block implementations. - Added a changelog, a code of conduct, a contributing guide and a pull-request template in the source tree. - Added colors to the commandline user interface. From d518b19ef10c1588d06560f830a9b5511357d92e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 22:18:27 +0100 Subject: [PATCH 141/143] Update changelog --- docs/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index 96dcc4b6a..2382a4779 100644 --- a/docs/changelog +++ b/docs/changelog @@ -58,7 +58,8 @@ Next release will have several improvements in different dimensions, addition of - Improvements in the RTCM server stability. - Improvements in the correctness of generated RINEX files. - The receiver can read and make use of Galileo almanac XML files published by the European GNSS Service Centre at https://www.gsc-europa.eu/system-status/almanac-data -- Added program rinex2assist to convert RINEX navigation files into XML files usable for AGNSS. Only available building from source. See https://github.com/gnss-sdr/gnss-sdr/tree/next/src/utils/rinex2assist +- Own-defined XML schemas for navigation data published at https://github.com/gnss-sdr/gnss-sdr/tree/next/docs/xml-schemas +- Added program rinex2assist to convert RINEX navigation files into XML files usable for Assisted GNSS. Only available building from source. See https://github.com/gnss-sdr/gnss-sdr/tree/next/src/utils/rinex2assist ### Improvements in Maintainability: From 6c4de4b14419dc9c62d73d019c93ea0078195e0b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 22:39:27 +0100 Subject: [PATCH 142/143] Add link to rinex2assist --- docs/xml-schemas/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/xml-schemas/README.md b/docs/xml-schemas/README.md index e85c643fe..007d520c0 100644 --- a/docs/xml-schemas/README.md +++ b/docs/xml-schemas/README.md @@ -12,14 +12,14 @@ GPS L1 C/A - [iono_model.xsd](./iono_model.xsd) - GPS NAV message ionospheric model parameters. - [utc_model.xsd](./utc_model.xsd) - GPS NAV message UTC model parameters. - [gps_almanac_map.xsd](./gps_almanac_map.xsd) - GPS NAV message almanac. - - + + GPS L2C and L5 -------------- - + - [cnav_ephemeris_map.xsd](./cnav_ephemeris_map.xsd) - GPS CNAV message ephemeris parameters. - - + + Galileo ------- @@ -31,4 +31,5 @@ Galileo ------- Please check https://gnss-sdr.org/docs/sp-blocks/global-parameters/ for more information about the usage of XML files in GNSS-SDR. - + +You could find useful the utility program [rinex2assist](https://github.com/gnss-sdr/gnss-sdr/tree/next/src/utils/rinex2assist) for the generation of compatible XML files from recent, publicly available RINEX navigation data files. From c74b9527cd67ee217cb7ccc73832776fa4ed261c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 26 Nov 2018 23:08:05 +0100 Subject: [PATCH 143/143] Add UNAVCO FTP link for RINEX navigation data files --- src/utils/rinex2assist/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/rinex2assist/README.md b/src/utils/rinex2assist/README.md index 6ed346cdb..9d378d797 100644 --- a/src/utils/rinex2assist/README.md +++ b/src/utils/rinex2assist/README.md @@ -32,7 +32,7 @@ The building requires two extra dependencies: the Boost Iostreams library and th The usage is as follows: ``` -$ rinex2assist /path/to/RINEX_nav_file +$ rinex2assist /path/to/RINEX_nav_file ``` The argument is mandatory (the name of the RINEX navigation file). The name `gps_ephemeris.xml` is given to the output if GPS NAV data is fould. If the RINEX file contains Galileo data, the corresponding `gal_ephemeris.xml` file will be generated. The program is also able to extract parameters of the UTC and the Ionospheric models from the RINEX header, if available. They will be called `gps_utc_model.xml`, `gps_iono.xml`, `gal_utc_model.xml` and `gal_iono.xml`. @@ -40,8 +40,9 @@ The argument is mandatory (the name of the RINEX navigation file). The name `gps There are some servers available for downloading recent RINEX navigation files. For instance: * NASA: [ftp://cddis.gsfc.nasa.gov/pub/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) * ESA: [ftp://gssc.esa.int/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/) + * UNAVCO: [ftp://data-out.unavco.org/pub/hourly/rinex/](ftp://data-out.unavco.org/pub/hourly/rinex/) -Just make sure to pick up a [station near you](http://www.igs.org/network). +Just make sure to pick up a recent file from a [station near you](http://www.igs.org/network). The program accepts either versions 2.xx or 3.xx for the RINEX navigation data file, as well as compressed files (ending in `.gz` or `.Z`).