From 994f192636431fb6a0e0d9d9371a437d04e19519 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 19 Mar 2019 21:11:21 +0100 Subject: [PATCH 01/12] Fix warning if put_time is not present --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index 7b58f31ae..54ca099a5 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -366,10 +366,10 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, // Display time in local time zone d_show_local_time_zone = conf_.show_local_time_zone; - time_t when = std::time(nullptr); - auto const tm = *std::localtime(&when); std::ostringstream os; #ifdef HAS_PUT_TIME + time_t when = std::time(nullptr); + auto const tm = *std::localtime(&when); os << std::put_time(&tm, "%z"); #endif std::string utc_diff_str = os.str(); // in ISO 8601 format: "+HHMM" or "-HHMM" From 8a52c20e28822d2c9544b4a8dc60bd4055e0a8d2 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 20 Mar 2019 15:44:59 +0100 Subject: [PATCH 02/12] Add missing override keyword --- .../acquisition/adapters/beidou_b1i_pcps_acquisition.h | 4 ++-- .../acquisition/adapters/beidou_b3i_pcps_acquisition.h | 4 ++-- .../adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h | 4 ++-- .../adapters/galileo_e1_pcps_ambiguous_acquisition.h | 4 ++-- .../adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h | 4 ++-- .../adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h | 4 ++-- .../galileo_e1_pcps_quicksync_ambiguous_acquisition.h | 4 ++-- .../adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h | 4 ++-- .../adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h | 4 ++-- .../acquisition/adapters/galileo_e5a_pcps_acquisition.h | 4 ++-- .../acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h | 4 ++-- .../acquisition/adapters/glonass_l1_ca_pcps_acquisition.h | 4 ++-- .../acquisition/adapters/glonass_l2_ca_pcps_acquisition.h | 4 ++-- .../acquisition/adapters/gps_l1_ca_pcps_acquisition.h | 4 ++-- .../adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h | 4 ++-- .../acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h | 4 ++-- .../adapters/gps_l1_ca_pcps_assisted_acquisition.h | 4 ++-- .../acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h | 4 ++-- .../adapters/gps_l1_ca_pcps_quicksync_acquisition.h | 4 ++-- .../acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h | 4 ++-- .../acquisition/adapters/gps_l2_m_pcps_acquisition.h | 4 ++-- .../acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h | 4 ++-- .../acquisition/adapters/gps_l5i_pcps_acquisition.h | 4 ++-- .../acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h | 4 ++-- 24 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h index 6822659cf..05965a97f 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h @@ -93,7 +93,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_->set_channel(channel_); @@ -102,7 +102,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_->set_channel_fsm(channel_fsm); diff --git a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h index 2562d2790..93f65a89d 100644 --- a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h @@ -92,7 +92,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_->set_channel(channel_); @@ -101,7 +101,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_->set_channel_fsm(channel_fsm); 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 35044840b..265bf9701 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 @@ -87,7 +87,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_cc_->set_channel(channel_); @@ -96,7 +96,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_cc_->set_channel_fsm(channel_fsm); 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 897336965..ea2d18b27 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h @@ -91,7 +91,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_->set_channel(channel_); @@ -100,7 +100,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_->set_channel_fsm(channel_fsm); 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 543c55248..3e070ca83 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 @@ -93,7 +93,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_fpga_->set_channel(channel_); @@ -102,7 +102,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_fpga_->set_channel_fsm(channel_fsm); 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 561b6055e..46957d533 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 @@ -87,7 +87,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_cc_->set_channel(channel_); @@ -96,7 +96,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_cc_->set_channel_fsm(channel_fsm); 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 017ebf295..b29b808a8 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 @@ -88,7 +88,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_cc_->set_channel(channel_); @@ -97,7 +97,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_cc_->set_channel_fsm(channel_fsm); 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 8618c606f..0893f731c 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 @@ -87,7 +87,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_cc_->set_channel(channel_); @@ -96,7 +96,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_cc_->set_channel_fsm(channel_fsm); 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 cdd1504c4..6d709894f 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 @@ -88,7 +88,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_cc_->set_channel(channel_); @@ -97,7 +97,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_cc_->set_channel_fsm(channel_fsm); diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h index 4ea234cf5..b3c43d542 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h @@ -79,7 +79,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_->set_channel(channel_); @@ -88,7 +88,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_->set_channel_fsm(channel_fsm); 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 ff9e9a126..37282fb25 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h @@ -92,7 +92,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_fpga_->set_channel(channel_); @@ -101,7 +101,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_fpga_->set_channel_fsm(channel_fsm); 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 9f3e4497f..91229faa8 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h @@ -89,7 +89,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_->set_channel(channel_); @@ -98,7 +98,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_->set_channel_fsm(channel_fsm); 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 95bfde06c..a063d0532 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h @@ -89,7 +89,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_->set_channel(channel_); @@ -98,7 +98,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_->set_channel_fsm(channel_fsm); 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 727c0a81c..ab2ed82d7 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h @@ -95,7 +95,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_->set_channel(channel_); @@ -104,7 +104,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_->set_channel_fsm(channel_fsm); 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 33bd36c0f..2b7daf80e 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 @@ -88,7 +88,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_cc_->set_channel(channel_); @@ -97,7 +97,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_cc_->set_channel_fsm(channel_fsm); 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 e92e3a41c..228c56ca9 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 @@ -93,7 +93,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_fpga_->set_channel(channel_); @@ -102,7 +102,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_fpga_->set_channel_fsm(channel_fsm); 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 24d22f4a5..13560238e 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 @@ -88,7 +88,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_cc_->set_channel(channel_); @@ -97,7 +97,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_cc_->set_channel_fsm(channel_fsm); 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 e5c8b11b9..29da366a6 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 @@ -87,7 +87,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_cc_->set_channel(channel_); @@ -96,7 +96,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_cc_->set_channel_fsm(channel_fsm); 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 b5de94a96..fadd57f73 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 @@ -89,7 +89,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_cc_->set_channel(channel_); @@ -98,7 +98,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_cc_->set_channel_fsm(channel_fsm); 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 c158b0c9a..5fac3c436 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 @@ -88,7 +88,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_cc_->set_channel(channel_); @@ -97,7 +97,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_cc_->set_channel_fsm(channel_fsm); 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 a3398ae63..1c7c591bb 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h @@ -92,7 +92,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_->set_channel(channel_); @@ -101,7 +101,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_->set_channel_fsm(channel_fsm); 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 08bf8a9fb..ddcf10cd8 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 @@ -94,7 +94,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_fpga_->set_channel(channel_); @@ -103,7 +103,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_fpga_->set_channel_fsm(channel_fsm); diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h index 756d122d4..fa157024e 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h @@ -92,7 +92,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_->set_channel(channel_); @@ -101,7 +101,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_->set_channel_fsm(channel_fsm); 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 d009eca49..9238b06c9 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h @@ -95,7 +95,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - inline void set_channel(unsigned int channel) + inline void set_channel(unsigned int channel) override { channel_ = channel; acquisition_fpga_->set_channel(channel_); @@ -104,7 +104,7 @@ public: /*! * \brief Set channel fsm associated to this acquisition instance */ - inline void set_channel_fsm(std::shared_ptr channel_fsm) + inline void set_channel_fsm(std::shared_ptr channel_fsm) override { channel_fsm_ = channel_fsm; acquisition_fpga_->set_channel_fsm(channel_fsm); From 55b1f316edefd6a958f5f81521afdb3c68f123f8 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Wed, 20 Mar 2019 16:57:50 +0100 Subject: [PATCH 03/12] Removing gnuradio block inheritance in FPGA acquisition --- ...ileo_e1_pcps_ambiguous_acquisition_fpga.cc | 6 ++-- .../galileo_e5a_pcps_acquisition_fpga.cc | 7 ++-- .../gps_l1_ca_pcps_acquisition_fpga.cc | 6 ++-- .../gps_l2_m_pcps_acquisition_fpga.cc | 7 ++-- .../adapters/gps_l5i_pcps_acquisition_fpga.cc | 6 ++-- .../gnuradio_blocks/pcps_acquisition_fpga.cc | 36 ++++++------------- .../gnuradio_blocks/pcps_acquisition_fpga.h | 10 ++---- src/algorithms/channel/adapters/channel.cc | 28 +++++++++++---- 8 files changed, 56 insertions(+), 50 deletions(-) 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 191279974..898ba8d62 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 @@ -64,6 +64,9 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + acq_parameters.repeat_satellite = configuration_->property(role + ".repeat_satellite", false); + DLOG(INFO) << role << " satellite repeat = " << acq_parameters.repeat_satellite; + float downsampling_factor = configuration_->property(role + ".downsampling_factor", 4.0); acq_parameters.downsampling_factor = downsampling_factor; @@ -163,7 +166,6 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( acq_parameters.total_block_exp = configuration_->property(role + ".total_block_exp", 14); acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); - DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; channel_ = 0; doppler_step_ = 0; @@ -274,5 +276,5 @@ gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisitionFpga::get_left_block() gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisitionFpga::get_right_block() { - return acquisition_fpga_; + return nullptr; } 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 5c79068ed..3da2486c2 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -61,6 +61,10 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + + acq_parameters.repeat_satellite = configuration_->property(role + ".repeat_satellite", false); + DLOG(INFO) << role << " satellite repeat = " << acq_parameters.repeat_satellite; + float downsampling_factor = configuration_->property(role + ".downsampling_factor", 1.0); acq_parameters.downsampling_factor = downsampling_factor; fs_in = fs_in / downsampling_factor; @@ -164,7 +168,6 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf acq_parameters.total_block_exp = configuration_->property(role + ".total_block_exp", 14); acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); - DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; channel_ = 0; doppler_step_ = 0; @@ -274,5 +277,5 @@ gr::basic_block_sptr GalileoE5aPcpsAcquisitionFpga::get_left_block() gr::basic_block_sptr GalileoE5aPcpsAcquisitionFpga::get_right_block() { - return acquisition_fpga_; + return nullptr; } 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 2505180f0..ff300ea57 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 @@ -68,6 +68,9 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + acq_parameters.repeat_satellite = configuration_->property(role + ".repeat_satellite", false); + DLOG(INFO) << role << " satellite repeat = " << acq_parameters.repeat_satellite; + float downsampling_factor = configuration_->property(role + ".downsampling_factor", 4.0); acq_parameters.downsampling_factor = downsampling_factor; @@ -146,7 +149,6 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( acq_parameters.total_block_exp = configuration_->property(role + ".total_block_exp", 14); acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); - DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; channel_ = 0; doppler_step_ = 0; @@ -257,5 +259,5 @@ gr::basic_block_sptr GpsL1CaPcpsAcquisitionFpga::get_left_block() gr::basic_block_sptr GpsL1CaPcpsAcquisitionFpga::get_right_block() { - return acquisition_fpga_; + return nullptr; } 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 cc08b8bb2..6dcb7e224 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 @@ -70,6 +70,9 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters.fs_in = fs_in_; + acq_parameters.repeat_satellite = configuration_->property(role + ".repeat_satellite", false); + DLOG(INFO) << role << " satellite repeat = " << acq_parameters.repeat_satellite; + doppler_max_ = configuration->property(role + ".doppler_max", 5000); if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; acq_parameters.doppler_max = doppler_max_; @@ -139,13 +142,11 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( delete[] fft_codes_padded; acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); - DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; channel_ = 0; doppler_step_ = 0; gnss_synchro_ = nullptr; channel_fsm_ = nullptr; - DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; threshold_ = 0.0; } @@ -253,5 +254,5 @@ gr::basic_block_sptr GpsL2MPcpsAcquisitionFpga::get_left_block() gr::basic_block_sptr GpsL2MPcpsAcquisitionFpga::get_right_block() { - return acquisition_fpga_; + return nullptr; } 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 92b43c988..413f68783 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc @@ -67,6 +67,9 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + acq_parameters.repeat_satellite = configuration_->property(role + ".repeat_satellite", false); + DLOG(INFO) << role << " satellite repeat = " << acq_parameters.repeat_satellite; + float downsampling_factor = configuration_->property(role + ".downsampling_factor", 1.0); acq_parameters.downsampling_factor = downsampling_factor; @@ -146,7 +149,6 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( acq_parameters.total_block_exp = configuration_->property(role + ".total_block_exp", 14); acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); - DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; channel_ = 0; doppler_step_ = 0; @@ -258,5 +260,5 @@ gr::basic_block_sptr GpsL5iPcpsAcquisitionFpga::get_left_block() gr::basic_block_sptr GpsL5iPcpsAcquisitionFpga::get_right_block() { - return acquisition_fpga_; + return nullptr; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc index f89d0fc16..9ffbcaabd 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc @@ -52,12 +52,8 @@ pcps_acquisition_fpga_sptr pcps_make_acquisition_fpga(pcpsconf_fpga_t conf_) } -pcps_acquisition_fpga::pcps_acquisition_fpga(pcpsconf_fpga_t conf_) : gr::block("pcps_acquisition_fpga", - gr::io_signature::make(0, 0, 0), - gr::io_signature::make(0, 0, 0)) +pcps_acquisition_fpga::pcps_acquisition_fpga(pcpsconf_fpga_t conf_) { - this->message_port_register_out(pmt::mp("events")); - acq_parameters = std::move(conf_); d_sample_counter = 0ULL; // SAMPLE COUNTER d_active = false; @@ -150,15 +146,8 @@ void pcps_acquisition_fpga::send_positive_acquisition() << ", magnitude " << d_mag << ", input signal power " << d_input_power; - if (d_channel_fsm) - { - //the channel FSM is set, so, notify it directly the positive acquisition to minimize delays - d_channel_fsm->Event_valid_acquisition(); - } - else - { - this->message_port_pub(pmt::mp("events"), pmt::from_long(1)); - } + //the channel FSM is set, so, notify it directly the positive acquisition to minimize delays + d_channel_fsm->Event_valid_acquisition(); } @@ -175,7 +164,14 @@ void pcps_acquisition_fpga::send_negative_acquisition() << ", magnitude " << d_mag << ", input signal power " << d_input_power; - this->message_port_pub(pmt::mp("events"), pmt::from_long(2)); + if (acq_parameters.repeat_satellite == true) + { + d_channel_fsm->Event_failed_acquisition_repeat(); + } + else + { + d_channel_fsm->Event_failed_acquisition_no_repeat(); + } } @@ -266,16 +262,6 @@ void pcps_acquisition_fpga::set_active(bool active) } -int pcps_acquisition_fpga::general_work(int noutput_items __attribute__((unused)), - gr_vector_int& ninput_items __attribute__((unused)), - gr_vector_const_void_star& input_items __attribute__((unused)), - gr_vector_void_star& output_items __attribute__((unused))) -{ - // the general work is not used with the acquisition that uses the FPGA - return noutput_items; -} - - void pcps_acquisition_fpga::reset_acquisition(void) { // this function triggers a HW reset of the FPGA PL. diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h index 4ee9acb81..f7d13b50f 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h @@ -68,6 +68,7 @@ typedef struct float downsampling_factor; uint32_t total_block_exp; uint32_t excludelimit; + bool repeat_satellite; } pcpsconf_fpga_t; class pcps_acquisition_fpga; @@ -83,7 +84,7 @@ pcps_make_acquisition_fpga(pcpsconf_fpga_t conf_); * Check \ref Navitec2012 "An Open Source Galileo E1 Software Receiver", * Algorithm 1, for a pseudocode description of this implementation. */ -class pcps_acquisition_fpga : public gr::block +class pcps_acquisition_fpga { private: friend pcps_acquisition_fpga_sptr pcps_make_acquisition_fpga(pcpsconf_fpga_t conf_); @@ -221,13 +222,6 @@ public: * \brief This funciton is only used for the unit tests */ void read_fpga_total_scale_factor(uint32_t* total_scale_factor, uint32_t* fw_scale_factor); - - /*! - * \brief Parallel Code Phase Search Acquisition signal processing. - */ - int general_work(int noutput_items, gr_vector_int& ninput_items, - gr_vector_const_void_star& input_items, - gr_vector_void_star& output_items); }; #endif /* GNSS_SDR_PCPS_ACQUISITION_FPGA_H_*/ diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index c68c35628..9620e5d67 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -55,7 +55,7 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::s queue_ = std::move(queue); channel_fsm_ = std::make_shared(); - flag_enable_fpga = configuration->property("Channel.enable_FPGA", false); + flag_enable_fpga = configuration->property("GNSS-SDR.enable_FPGA", false); acq_->set_channel(channel_); acq_->set_channel_fsm(channel_fsm_); trk_->set_channel(channel_); @@ -125,7 +125,10 @@ Channel::~Channel() = default; void Channel::connect(gr::top_block_sptr top_block) { - acq_->connect(top_block); + if (!flag_enable_fpga) + { + acq_->connect(top_block); + } trk_->connect(top_block); nav_->connect(top_block); @@ -136,7 +139,10 @@ void Channel::connect(gr::top_block_sptr top_block) DLOG(INFO) << "tracking -> telemetry_decoder"; // Message ports - top_block->msg_connect(acq_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events")); + if (!flag_enable_fpga) + { + top_block->msg_connect(acq_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events")); + } top_block->msg_connect(trk_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events")); connected_ = true; @@ -152,12 +158,18 @@ void Channel::disconnect(gr::top_block_sptr top_block) } top_block->disconnect(trk_->get_right_block(), 0, nav_->get_left_block(), 0); - - acq_->disconnect(top_block); + if (!flag_enable_fpga) + { + acq_->disconnect(top_block); + } trk_->disconnect(top_block); nav_->disconnect(top_block); + top_block->msg_disconnect(nav_->get_left_block(), pmt::mp("telemetry_to_trk"), trk_->get_right_block(), pmt::mp("telemetry_to_trk")); - top_block->msg_disconnect(acq_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events")); + if (!flag_enable_fpga) + { + top_block->msg_disconnect(acq_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events")); + } top_block->msg_disconnect(trk_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events")); connected_ = false; } @@ -178,6 +190,10 @@ gr::basic_block_sptr Channel::get_left_block_trk() gr::basic_block_sptr Channel::get_left_block_acq() { + if (flag_enable_fpga) + { + LOG(ERROR) << "Enabled FPGA and called get_left_block() in channel interface"; + } return acq_->get_left_block(); } From f3d91bbd38e589789506d8ef51aa0b96d4772480 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 20 Mar 2019 18:00:37 +0100 Subject: [PATCH 04/12] Remove unused includes --- .../adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h | 7 +------ .../adapters/galileo_e5a_pcps_acquisition_fpga.cc | 1 - .../adapters/galileo_e5a_pcps_acquisition_fpga.h | 4 ++-- .../acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h | 1 + .../acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h | 7 +------ .../acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h | 6 ------ 6 files changed, 5 insertions(+), 21 deletions(-) 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 3e070ca83..8683d5556 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 @@ -33,10 +33,7 @@ #define GNSS_SDR_GALILEO_E1_PCPS_AMBIGUOUS_ACQUISITION_FPGA_H_ #include "channel_fsm.h" -#include "complex_byte_to_float_x2.h" #include "pcps_acquisition_fpga.h" -#include -#include #include // for basic_block_sptr, top_block_sptr #include // for lv_16sc_t #include // for size_t @@ -107,6 +104,7 @@ public: channel_fsm_ = channel_fsm; acquisition_fpga_->set_channel_fsm(channel_fsm); } + /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -157,9 +155,6 @@ public: private: ConfigurationInterface* configuration_; pcps_acquisition_fpga_sptr acquisition_fpga_; - gr::blocks::stream_to_vector::sptr stream_to_vector_; - gr::blocks::float_to_complex::sptr float_to_complex_; - complex_byte_to_float_x2_sptr cbyte_to_float_x2_; bool acquire_pilot_; uint32_t channel_; std::shared_ptr channel_fsm_; 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 3da2486c2..0b8e0c815 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -61,7 +61,6 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); int64_t fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - acq_parameters.repeat_satellite = configuration_->property(role + ".repeat_satellite", false); DLOG(INFO) << role << " satellite repeat = " << acq_parameters.repeat_satellite; 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 37282fb25..62c186503 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h @@ -35,7 +35,6 @@ #include "channel_fsm.h" #include "pcps_acquisition_fpga.h" -#include #include // for basic_block_sptr, top_block_sptr #include // for lv_16sc_t #include // for size_t @@ -89,6 +88,7 @@ public: * tracking blocks */ void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; + /*! * \brief Set acquisition channel unique ID */ @@ -106,6 +106,7 @@ public: channel_fsm_ = channel_fsm; acquisition_fpga_->set_channel_fsm(channel_fsm); } + /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -166,7 +167,6 @@ public: private: ConfigurationInterface* configuration_; pcps_acquisition_fpga_sptr acquisition_fpga_; - gr::blocks::stream_to_vector::sptr stream_to_vector_; std::string item_type_; std::string dump_filename_; 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 228c56ca9..6204354b2 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 @@ -107,6 +107,7 @@ public: channel_fsm_ = channel_fsm; acquisition_fpga_->set_channel_fsm(channel_fsm); } + /*! * \brief Set statistics threshold of PCPS algorithm */ 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 ddcf10cd8..495a613e5 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 @@ -35,10 +35,7 @@ #define GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_FPGA_H_ #include "channel_fsm.h" -#include "complex_byte_to_float_x2.h" #include "pcps_acquisition_fpga.h" -#include -#include #include // for basic_block_sptr, top_block_sptr #include // for lv_16sc_t #include // for size_t @@ -108,6 +105,7 @@ public: channel_fsm_ = channel_fsm; acquisition_fpga_->set_channel_fsm(channel_fsm); } + /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -158,9 +156,6 @@ public: private: ConfigurationInterface* configuration_; pcps_acquisition_fpga_sptr acquisition_fpga_; - gr::blocks::stream_to_vector::sptr stream_to_vector_; - gr::blocks::float_to_complex::sptr float_to_complex_; - complex_byte_to_float_x2_sptr cbyte_to_float_x2_; std::string item_type_; unsigned int channel_; std::shared_ptr channel_fsm_; 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 9238b06c9..caecc68a8 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h @@ -36,10 +36,7 @@ #define GNSS_SDR_GPS_L5I_PCPS_ACQUISITION_FPGA_H_ #include "channel_fsm.h" -#include "complex_byte_to_float_x2.h" #include "pcps_acquisition_fpga.h" -#include -#include #include // for basic_block_sptr, top_block_sptr #include // for lv_16sc_t #include // for size_t @@ -159,9 +156,6 @@ public: private: ConfigurationInterface* configuration_; pcps_acquisition_fpga_sptr acquisition_fpga_; - gr::blocks::stream_to_vector::sptr stream_to_vector_; - gr::blocks::float_to_complex::sptr float_to_complex_; - complex_byte_to_float_x2_sptr cbyte_to_float_x2_; std::string item_type_; uint32_t channel_; std::shared_ptr channel_fsm_; From 88b60aa6b1f66981fa333b631f646626a8f3e2f1 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 20 Mar 2019 18:08:39 +0100 Subject: [PATCH 05/12] Remove unused includes --- .../acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc | 9 +++------ .../acquisition/gnuradio_blocks/pcps_acquisition_fpga.h | 2 -- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc index 9ffbcaabd..e3e5fdd60 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc @@ -35,12 +35,9 @@ #include "pcps_acquisition_fpga.h" #include "gnss_synchro.h" #include -#include -#include // for from_long -#include // for mp -#include // for ceil -#include // for operator<< -#include // for move +#include // for ceil +#include // for operator<< +#include // for move #define AQ_DOWNSAMPLING_DELAY 40 // delay due to the downsampling filter in the acquisition diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h index f7d13b50f..174ee7af5 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h @@ -44,8 +44,6 @@ #include "channel_fsm.h" #include "fpga_acquisition.h" #include -#include // for block -#include // for gr_vector_const_void_star #include // for lv_16sc_t #include // for uint32_t #include // for shared_ptr From 6a17a33d6fa3e34bb73e2298b79a247f43f44d14 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 21 Mar 2019 19:21:39 +0100 Subject: [PATCH 06/12] Expose more tracking parameters to the configuration: filters order, FLL usage, pull-in time --- .../adapters/beidou_b1i_dll_pll_tracking.cc | 43 +++++++++++++++++ .../adapters/beidou_b3i_dll_pll_tracking.cc | 46 ++++++++++++++++++- .../galileo_e1_dll_pll_veml_tracking.cc | 43 +++++++++++++++++ .../adapters/galileo_e5a_dll_pll_tracking.cc | 43 +++++++++++++++++ .../adapters/gps_l1_ca_dll_pll_tracking.cc | 43 +++++++++++++++++ .../adapters/gps_l2_m_dll_pll_tracking.cc | 43 +++++++++++++++++ .../adapters/gps_l5_dll_pll_tracking.cc | 43 +++++++++++++++++ 7 files changed, 302 insertions(+), 2 deletions(-) diff --git a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc index 6dba51ede..8bfcbe82f 100644 --- a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc @@ -73,6 +73,49 @@ BeidouB1iDllPllTracking::BeidouB1iDllPllTracking( dll_bw_hz = static_cast(FLAGS_dll_bw_hz); } trk_param.dll_bw_hz = dll_bw_hz; + + int dll_filter_order = configuration->property(role + ".dll_filter_order", 2); + if (dll_filter_order < 1) + { + LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 1."; + dll_filter_order = 1; + } + if (dll_filter_order > 3) + { + LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 3."; + dll_filter_order = 3; + } + trk_param.dll_filter_order = dll_filter_order; + + int pll_filter_order = configuration->property(role + ".pll_filter_order", 3); + if (pll_filter_order < 2) + { + LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 2."; + pll_filter_order = 2; + } + if (pll_filter_order > 3) + { + LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 3."; + pll_filter_order = 3; + } + trk_param.pll_filter_order = pll_filter_order; + + if (pll_filter_order == 2) + { + trk_param.fll_filter_order = 1; + } + if (pll_filter_order == 3) + { + trk_param.fll_filter_order = 2; + } + + bool enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", false); + trk_param.enable_fll_pull_in = enable_fll_pull_in; + float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0); + trk_param.fll_bw_hz = fll_bw_hz; + float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0); + trk_param.pull_in_time_s = pull_in_time_s; + float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); 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); diff --git a/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc index 6253788e8..49d76417c 100644 --- a/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc @@ -68,6 +68,49 @@ BeidouB3iDllPllTracking::BeidouB3iDllPllTracking( float dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); trk_param.dll_bw_hz = dll_bw_hz; + + int dll_filter_order = configuration->property(role + ".dll_filter_order", 2); + if (dll_filter_order < 1) + { + LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 1."; + dll_filter_order = 1; + } + if (dll_filter_order > 3) + { + LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 3."; + dll_filter_order = 3; + } + trk_param.dll_filter_order = dll_filter_order; + + int pll_filter_order = configuration->property(role + ".pll_filter_order", 3); + if (pll_filter_order < 2) + { + LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 2."; + pll_filter_order = 2; + } + if (pll_filter_order > 3) + { + LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 3."; + pll_filter_order = 3; + } + trk_param.pll_filter_order = pll_filter_order; + + if (pll_filter_order == 2) + { + trk_param.fll_filter_order = 1; + } + if (pll_filter_order == 3) + { + trk_param.fll_filter_order = 2; + } + + bool enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", false); + trk_param.enable_fll_pull_in = enable_fll_pull_in; + float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0); + trk_param.fll_bw_hz = fll_bw_hz; + float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0); + trk_param.pull_in_time_s = pull_in_time_s; + float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); 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); @@ -141,8 +184,7 @@ BeidouB3iDllPllTracking::BeidouB3iDllPllTracking( } -BeidouB3iDllPllTracking::~BeidouB3iDllPllTracking() -= default; +BeidouB3iDllPllTracking::~BeidouB3iDllPllTracking() = default; void BeidouB3iDllPllTracking::start_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 ec8e95979..1beba6c51 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 @@ -88,6 +88,49 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( trk_param.pll_bw_narrow_hz = pll_bw_narrow_hz; float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 0.25); trk_param.dll_bw_narrow_hz = dll_bw_narrow_hz; + + int dll_filter_order = configuration->property(role + ".dll_filter_order", 2); + if (dll_filter_order < 1) + { + LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 1."; + dll_filter_order = 1; + } + if (dll_filter_order > 3) + { + LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 3."; + dll_filter_order = 3; + } + trk_param.dll_filter_order = dll_filter_order; + + int pll_filter_order = configuration->property(role + ".pll_filter_order", 3); + if (pll_filter_order < 2) + { + LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 2."; + pll_filter_order = 2; + } + if (pll_filter_order > 3) + { + LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 3."; + pll_filter_order = 3; + } + trk_param.pll_filter_order = pll_filter_order; + + if (pll_filter_order == 2) + { + trk_param.fll_filter_order = 1; + } + if (pll_filter_order == 3) + { + trk_param.fll_filter_order = 2; + } + + bool enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", false); + trk_param.enable_fll_pull_in = enable_fll_pull_in; + float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0); + trk_param.fll_bw_hz = fll_bw_hz; + float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0); + trk_param.pull_in_time_s = pull_in_time_s; + int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15); trk_param.early_late_space_chips = early_late_space_chips; 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 aa8b0f998..cdf4d7cad 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc @@ -83,6 +83,49 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( dll_bw_hz = static_cast(FLAGS_dll_bw_hz); } trk_param.dll_bw_hz = dll_bw_hz; + + int dll_filter_order = configuration->property(role + ".dll_filter_order", 2); + if (dll_filter_order < 1) + { + LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 1."; + dll_filter_order = 1; + } + if (dll_filter_order > 3) + { + LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 3."; + dll_filter_order = 3; + } + trk_param.dll_filter_order = dll_filter_order; + + int pll_filter_order = configuration->property(role + ".pll_filter_order", 3); + if (pll_filter_order < 2) + { + LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 2."; + pll_filter_order = 2; + } + if (pll_filter_order > 3) + { + LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 3."; + pll_filter_order = 3; + } + trk_param.pll_filter_order = pll_filter_order; + + if (pll_filter_order == 2) + { + trk_param.fll_filter_order = 1; + } + if (pll_filter_order == 3) + { + trk_param.fll_filter_order = 2; + } + + bool enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", false); + trk_param.enable_fll_pull_in = enable_fll_pull_in; + float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0); + trk_param.fll_bw_hz = fll_bw_hz; + float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0); + trk_param.pull_in_time_s = pull_in_time_s; + float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 5.0); trk_param.pll_bw_narrow_hz = pll_bw_narrow_hz; float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0); 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 b8f4815e2..a511503fb 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 @@ -89,6 +89,49 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( dll_bw_hz = static_cast(FLAGS_dll_bw_hz); } trk_param.dll_bw_hz = dll_bw_hz; + + int dll_filter_order = configuration->property(role + ".dll_filter_order", 2); + if (dll_filter_order < 1) + { + LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 1."; + dll_filter_order = 1; + } + if (dll_filter_order > 3) + { + LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 3."; + dll_filter_order = 3; + } + trk_param.dll_filter_order = dll_filter_order; + + int pll_filter_order = configuration->property(role + ".pll_filter_order", 3); + if (pll_filter_order < 2) + { + LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 2."; + pll_filter_order = 2; + } + if (pll_filter_order > 3) + { + LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 3."; + pll_filter_order = 3; + } + trk_param.pll_filter_order = pll_filter_order; + + if (pll_filter_order == 2) + { + trk_param.fll_filter_order = 1; + } + if (pll_filter_order == 3) + { + trk_param.fll_filter_order = 2; + } + + bool enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", false); + trk_param.enable_fll_pull_in = enable_fll_pull_in; + float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0); + trk_param.fll_bw_hz = fll_bw_hz; + float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0); + trk_param.pull_in_time_s = pull_in_time_s; + float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); 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); 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 a1e2c722c..65912ccbf 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 @@ -77,6 +77,49 @@ 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; + + int dll_filter_order = configuration->property(role + ".dll_filter_order", 2); + if (dll_filter_order < 1) + { + LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 1."; + dll_filter_order = 1; + } + if (dll_filter_order > 3) + { + LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 3."; + dll_filter_order = 3; + } + trk_param.dll_filter_order = dll_filter_order; + + int pll_filter_order = configuration->property(role + ".pll_filter_order", 3); + if (pll_filter_order < 2) + { + LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 2."; + pll_filter_order = 2; + } + if (pll_filter_order > 3) + { + LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 3."; + pll_filter_order = 3; + } + trk_param.pll_filter_order = pll_filter_order; + + if (pll_filter_order == 2) + { + trk_param.fll_filter_order = 1; + } + if (pll_filter_order == 3) + { + trk_param.fll_filter_order = 2; + } + + bool enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", false); + trk_param.enable_fll_pull_in = enable_fll_pull_in; + float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0); + trk_param.fll_bw_hz = fll_bw_hz; + float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0); + trk_param.pull_in_time_s = pull_in_time_s; + 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_l5_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc index 2066f99be..988f8dccb 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc @@ -90,6 +90,49 @@ 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; + + int dll_filter_order = configuration->property(role + ".dll_filter_order", 2); + if (dll_filter_order < 1) + { + LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 1."; + dll_filter_order = 1; + } + if (dll_filter_order > 3) + { + LOG(WARNING) << "dll_filter_order parameter must be 1, 2 or 3. Set to 3."; + dll_filter_order = 3; + } + trk_param.dll_filter_order = dll_filter_order; + + int pll_filter_order = configuration->property(role + ".pll_filter_order", 3); + if (pll_filter_order < 2) + { + LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 2."; + pll_filter_order = 2; + } + if (pll_filter_order > 3) + { + LOG(WARNING) << "pll_filter_order parameter must be 2 or 3. Set to 3."; + pll_filter_order = 3; + } + trk_param.pll_filter_order = pll_filter_order; + + if (pll_filter_order == 2) + { + trk_param.fll_filter_order = 1; + } + if (pll_filter_order == 3) + { + trk_param.fll_filter_order = 2; + } + + bool enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", false); + trk_param.enable_fll_pull_in = enable_fll_pull_in; + float fll_bw_hz = configuration->property(role + ".fll_bw_hz", 35.0); + trk_param.fll_bw_hz = fll_bw_hz; + float pull_in_time_s = configuration->property(role + ".pull_in_time_s", 2.0); + trk_param.pull_in_time_s = pull_in_time_s; + 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); From 33403dedea9b58706fdee1c1d85f73f9be74af1e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 21 Mar 2019 21:10:56 +0100 Subject: [PATCH 07/12] Fix high_dynamics correlator --- ...2f_high_dynamic_rotator_dot_prod_32fc_xn.h | 65 +++++++--- ...igh_dynamic_rotator_dotprodxnpuppet_32fc.h | 122 +++++------------- 2 files changed, 80 insertions(+), 107 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h index 822742daf..131509411 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h @@ -1,9 +1,10 @@ /*! * \file volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h * \brief VOLK_GNSSSDR kernel: multiplies N complex (32-bit float per component) vectors - * by a common vector, phase rotated and accumulates the results in N float complex outputs. + * by a common vector, phase rotated with Doppler rate and accumulates the results in N float complex outputs. * \authors
    - *
  • Antonio Ramos 2018. antonio.ramosdet(at)gmail.com + *
  • Carles Fernandez, 2019 cfernandez@cttc.es + *
  • Javier Arribas, 2019 javiarribas@cttc.es *
* * VOLK_GNSSSDR kernel that multiplies N 32 bits complex vectors by a common vector, which is @@ -43,8 +44,8 @@ * * Rotates and multiplies the reference complex vector with an arbitrary number of other real vectors, * accumulates the results and stores them in the output vector. - * The rotation is done at a fixed rate per sample, from an initial \p phase offset. - * This function can be used for Doppler wipe-off and multiple correlator. + * The rotation is done at a variable rate per sample, from an initial \p phase offset. + * This function can be used for Doppler wipe-off and multiple correlator in the presence of Doppler rate. * * Dispatcher Prototype * \code @@ -70,24 +71,19 @@ #define INCLUDED_volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_H -#include #include #include #include #include + #ifdef LV_HAVE_GENERIC static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_generic(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, const lv_32fc_t phase_inc_rate, lv_32fc_t* phase, const float** in_a, int num_a_vectors, unsigned int num_points) { lv_32fc_t tmp32_1; -#ifdef __cplusplus - lv_32fc_t half_phase_inc_rate = std::sqrt(phase_inc_rate); -#else - lv_32fc_t half_phase_inc_rate = csqrtf(phase_inc_rate); -#endif - lv_32fc_t constant_rotation = phase_inc * half_phase_inc_rate; - lv_32fc_t delta_phase_rate = lv_cmake(1.0f, 0.0f); + lv_32fc_t phase_doppler_rate = lv_cmake(1.0f, 0.0f); + lv_32fc_t phase_doppler = (*phase); int n_vec; unsigned int n; for (n_vec = 0; n_vec < num_a_vectors; n_vec++) @@ -96,27 +92,60 @@ static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_g } for (n = 0; n < num_points; n++) { - tmp32_1 = *in_common++ * (*phase); // Regenerate phase if (n % 256 == 0) { #ifdef __cplusplus (*phase) /= std::abs((*phase)); - delta_phase_rate /= std::abs(delta_phase_rate); #else (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase)); - delta_phase_rate /= hypotf(lv_creal(delta_phase_rate), lv_cimag(delta_phase_rate)); #endif } - (*phase) *= (constant_rotation * delta_phase_rate); - delta_phase_rate *= phase_inc_rate; + tmp32_1 = *in_common++ * (*phase); + + phase_doppler *= phase_inc; + phase_doppler_rate = cpowf(phase_inc_rate, lv_cmake(n * n, 0.0f)); + (*phase) = phase_doppler * phase_doppler_rate; + for (n_vec = 0; n_vec < num_a_vectors; n_vec++) { result[n_vec] += (tmp32_1 * in_a[n_vec][n]); } } } +#endif -#endif /*LV_HAVE_GENERIC*/ + +#ifdef LV_HAVE_GENERIC +static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_generic_acc(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, const lv_32fc_t phase_inc_rate, lv_32fc_t* phase, const float** in_a, int num_a_vectors, unsigned int num_points) +{ + lv_32fc_t tmp32_1 = lv_cmake(0.0f, 0.0f); + lv_32fc_t phase_rate_acc = lv_cmake(1.0f, 0.0f); + int n_vec; + unsigned int n; + for (n_vec = 0; n_vec < num_a_vectors; n_vec++) + { + result[n_vec] = lv_cmake(0.0f, 0.0f); + } + for (n = 0; n < num_points; n++) + { + // Regenerate phase + if (n % 256 == 0) + { +#ifdef __cplusplus + (*phase) /= std::abs((*phase)); +#else + (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase)); +#endif + } + phase_rate_acc += phase_inc_rate; + (*phase) *= lv_cmake(cosf(phase_rate_acc), sinf(phase_rate_acc)); + for (n_vec = 0; n_vec < num_a_vectors; n_vec++) + { + result[n_vec] += (tmp32_1 * in_a[n_vec][n]); + } + } +} +#endif #endif /* INCLUDED_volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc.h index ac71ab47a..bb3c8d9f8 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc.h @@ -1,6 +1,7 @@ /*! * \file volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc.h - * \brief Volk puppet for the multiple 16-bit complex dot product kernel. + * \brief VOLK_GNSSSDR kernel: multiplies N complex (32-bit float per component) vectors + * by a common vector, phase rotated with Doppler rate and accumulates the results in N float complex outputs. * \authors
    *
  • Carles Fernandez Prades 2016 cfernandez at cttc dot cat *
@@ -61,6 +62,7 @@ static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32 in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points); } + volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_generic(result, local_code, phase_inc[0], phase_inc_rate[0], phase, (const float**)in_a, num_a_vectors, num_points); for (n = 0; n < num_a_vectors; n++) @@ -71,93 +73,35 @@ static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32 } #endif // Generic -// -//#ifdef LV_HAVE_GENERIC -//static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_generic_reload(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points) -//{ -// // phases must be normalized. Phase rotator expects a complex exponential input! -// float rem_carrier_phase_in_rad = 0.25; -// float phase_step_rad = 0.1; -// lv_32fc_t phase[1]; -// phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad)); -// lv_32fc_t phase_inc[1]; -// phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); -// int n; -// int num_a_vectors = 3; -// float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment()); -// for (n = 0; n < num_a_vectors; n++) -// { -// in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); -// memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points); -// } -// volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_generic_reload(result, local_code, phase_inc[0], phase, (const float**)in_a, num_a_vectors, num_points); -// -// for (n = 0; n < num_a_vectors; n++) -// { -// volk_gnsssdr_free(in_a[n]); -// } -// volk_gnsssdr_free(in_a); -//} -// -//#endif // Generic -// -//#ifdef LV_HAVE_AVX -//static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_u_avx(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points) -//{ -// // phases must be normalized. Phase rotator expects a complex exponential input! -// float rem_carrier_phase_in_rad = 0.25; -// float phase_step_rad = 0.1; -// lv_32fc_t phase[1]; -// phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad)); -// lv_32fc_t phase_inc[1]; -// phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); -// int n; -// int num_a_vectors = 3; -// float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment()); -// for (n = 0; n < num_a_vectors; n++) -// { -// in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); -// memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points); -// } -// volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_u_avx(result, local_code, phase_inc[0], phase, (const float**)in_a, num_a_vectors, num_points); -// -// for (n = 0; n < num_a_vectors; n++) -// { -// volk_gnsssdr_free(in_a[n]); -// } -// volk_gnsssdr_free(in_a); -//} -// -//#endif // AVX -// -// -//#ifdef LV_HAVE_AVX -//static inline void volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_a_avx(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points) -//{ -// // phases must be normalized. Phase rotator expects a complex exponential input! -// float rem_carrier_phase_in_rad = 0.25; -// float phase_step_rad = 0.1; -// lv_32fc_t phase[1]; -// phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad)); -// lv_32fc_t phase_inc[1]; -// phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); -// int n; -// int num_a_vectors = 3; -// float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment()); -// for (n = 0; n < num_a_vectors; n++) -// { -// in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); -// memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points); -// } -// volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_a_avx(result, local_code, phase_inc[0], phase, (const float**)in_a, num_a_vectors, num_points); -// -// for (n = 0; n < num_a_vectors; n++) -// { -// volk_gnsssdr_free(in_a[n]); -// } -// volk_gnsssdr_free(in_a); -//} -// -//#endif // AVX +#ifdef LV_HAVE_GENERIC +static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc_generic_acc(lv_32fc_t* result, const lv_32fc_t* local_code, const float* in, unsigned int num_points) +{ + // phases must be normalized. Phase rotator expects a complex exponential input! + float rem_carrier_phase_in_rad = 0.25; + float phase_step_rad = 0.1; + lv_32fc_t phase[1]; + phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), sin(rem_carrier_phase_in_rad)); + lv_32fc_t phase_inc[1]; + phase_inc[0] = lv_cmake(cos(phase_step_rad), sin(phase_step_rad)); + lv_32fc_t phase_inc_rate[1]; + phase_inc_rate[0] = lv_cmake(cos(phase_step_rad * 0.001), sin(phase_step_rad * 0.001)); + int n; + int num_a_vectors = 3; + float** in_a = (float**)volk_gnsssdr_malloc(sizeof(float*) * num_a_vectors, volk_gnsssdr_get_alignment()); + for (n = 0; n < num_a_vectors; n++) + { + in_a[n] = (float*)volk_gnsssdr_malloc(sizeof(float) * num_points, volk_gnsssdr_get_alignment()); + memcpy((float*)in_a[n], (float*)in, sizeof(float) * num_points); + } + + volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_generic_acc(result, local_code, phase_inc[0], phase_inc_rate[0], phase, (const float**)in_a, num_a_vectors, num_points); + + for (n = 0; n < num_a_vectors; n++) + { + volk_gnsssdr_free(in_a[n]); + } + volk_gnsssdr_free(in_a); +} +#endif // Generic #endif // INCLUDED_volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc_H From c2917939bad742811b365eeb8784cad4ce623460 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 22 Mar 2019 09:33:29 +0100 Subject: [PATCH 08/12] Update glog vesion to 0.4.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9a035feb..547772040 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -408,7 +408,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.2") -set(GNSSSDR_GLOG_LOCAL_VERSION "0.3.5") +set(GNSSSDR_GLOG_LOCAL_VERSION "0.4.0") set(GNSSSDR_ARMADILLO_LOCAL_VERSION "9.200.x") set(GNSSSDR_GTEST_LOCAL_VERSION "1.8.1") set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master") From cb59c1cc83b089ec5092cbfd5eb46fb88214c226 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 22 Mar 2019 11:00:13 +0100 Subject: [PATCH 09/12] Fix bug in MacOS when BeiDou was enabled in rtklib.h The BLAS and LAPACK implementations that come with the Accelerate Framework (soft-linked in /usr/bin) caused a random crash when exiting the program, only if the variable ENABDS was set. This bug disappears when linking to the libraries that Homebrew or Macports install, or when manually downloaded, built and installed by the user --- CMakeLists.txt | 40 ++++++++++++---- README.md | 5 +- cmake/Modules/AvoidAccelerate.cmake | 58 +++++++++++++++++++++++ src/algorithms/libs/rtklib/CMakeLists.txt | 8 +--- src/algorithms/libs/rtklib/rtklib.h | 2 - 5 files changed, 96 insertions(+), 17 deletions(-) create mode 100644 cmake/Modules/AvoidAccelerate.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 547772040..005286a12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1331,14 +1331,30 @@ endif() # Check that BLAS (Basic Linear Algebra Subprograms) is found in the system # See http://www.netlib.org/blas/ ################################################################################ -find_library(BLAS blas) -if(NOT BLAS) +if(OS_IS_MACOSX) + # Avoid using the implementation that comes with the Accelerate framework + include(AvoidAccelerate) +else() + find_package(BLAS) + set_package_properties(BLAS PROPERTIES + URL "http://www.netlib.org/blas/" + DESCRIPTION "Basic Linear Algebra Subprograms" + PURPOSE "Used for matrix algebra computations." + TYPE REQUIRED + ) +endif() +if(NOT BLAS_FOUND) message(" The BLAS library 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 install blas-devel") + if(OS_IS_MACOSX) + message(" 'sudo port install lapack' if you are using Macports, or") + message(" 'brew install lapack' if you are using Homebrew.") else() - message(" sudo apt-get install libblas-dev") + if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") + message(" sudo yum install blas-devel") + else() + message(" sudo apt-get install libblas-dev") + endif() endif() message(FATAL_ERROR "BLAS is required to build gnss-sdr") endif() @@ -1349,8 +1365,16 @@ endif() # Check that LAPACK (Linear Algebra PACKage) is found in the system # See http://www.netlib.org/lapack/ ################################################################################ -find_library(LAPACK lapack) -if(NOT LAPACK) +if(NOT OS_IS_MACOSX) + find_package(LAPACK) + set_package_properties(LAPACK PROPERTIES + URL "http://www.netlib.org/lapack/" + DESCRIPTION "Linear Algebra PACKage" + PURPOSE "Used for matrix algebra computations." + TYPE REQUIRED + ) +endif() +if(NOT LAPACK_FOUND) message(" The LAPACK library has not been found.") message(" You can try to install it by typing:") if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") @@ -1457,7 +1481,7 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) if(NOT GFORTRAN) set(GFORTRAN "") endif() - set(ARMADILLO_LIBRARIES ${BLAS} ${LAPACK} ${GFORTRAN} ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(ARMADILLO_LIBRARIES ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${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}) file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include) diff --git a/README.md b/README.md index 4e6e0b11c..0cec356ac 100644 --- a/README.md +++ b/README.md @@ -545,6 +545,7 @@ $ sudo port selfupdate $ sudo port upgrade outdated $ sudo port install doxygen +docs $ sudo port install gnuradio +$ sudo port install lapack $ sudo port install armadillo $ sudo port install gnutls $ sudo port install google-glog +gflags @@ -586,7 +587,9 @@ Install the required dependencies: ~~~~~~ $ brew install cmake -$ brew install hdf5 arpack superlu armadillo +$ brew install hdf5 +$ brew install lapack +$ brew install arpack superlu armadillo $ brew install glog gflags $ brew install gnuradio $ brew install libmatio diff --git a/cmake/Modules/AvoidAccelerate.cmake b/cmake/Modules/AvoidAccelerate.cmake new file mode 100644 index 000000000..ab6e54cde --- /dev/null +++ b/cmake/Modules/AvoidAccelerate.cmake @@ -0,0 +1,58 @@ +# Copyright (C) 2011-2019 (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 . + +# Avoid using the BLAS and LAPACK implementations that comes with the Accelerate +# framework, which causes a bug when the BeiDou constellation is enabled + +find_library(BLAS_LIBRARIES + libblas.dylib + PATHS + /opt/local/lib/lapack + /usr/local/opt/lapack/lib + /usr/local/lib + ${BLAS_ROOT}/lib + $ENV{BLAS_ROOT}/lib + NO_DEFAULT_PATH + NO_SYSTEM_ENVIRONMENT_PATH + NO_CMAKE_ENVIRONMENT_PATH + NO_SYSTEM_ENVIRONMENT_PATH + NO_CMAKE_SYSTEM_PATH +) + +if(BLAS_LIBRARIES) + set(BLAS_FOUND TRUE) +endif() + + +find_library(LAPACK_LIBRARIES + liblapack.dylib + PATHS + /opt/local/lib/lapack + /usr/local/opt/lapack/lib + /usr/local/lib + ${BLAS_ROOT}/lib + $ENV{BLAS_ROOT}/lib + NO_DEFAULT_PATH + NO_SYSTEM_ENVIRONMENT_PATH + NO_CMAKE_ENVIRONMENT_PATH + NO_SYSTEM_ENVIRONMENT_PATH + NO_CMAKE_SYSTEM_PATH +) + +if(LAPACK_LIBRARIES) + set(LAPACK_FOUND TRUE) +endif() diff --git a/src/algorithms/libs/rtklib/CMakeLists.txt b/src/algorithms/libs/rtklib/CMakeLists.txt index f15c1c074..814ad6eaf 100644 --- a/src/algorithms/libs/rtklib/CMakeLists.txt +++ b/src/algorithms/libs/rtklib/CMakeLists.txt @@ -70,14 +70,10 @@ target_link_libraries(algorithms_libs_rtklib core_system_parameters Gflags::gflags Glog::glog + ${LAPACK_LIBRARIES} + ${BLAS_LIBRARIES} ) -if(OS_IS_MACOSX) - target_link_libraries(algorithms_libs_rtklib PRIVATE "-framework Accelerate") -else() - target_link_libraries(algorithms_libs_rtklib PRIVATE ${LAPACK} ${BLAS}) -endif() - set_property(TARGET algorithms_libs_rtklib APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/libs/rtklib/rtklib.h b/src/algorithms/libs/rtklib/rtklib.h index 1b8cd9cbe..0f8cf61b7 100644 --- a/src/algorithms/libs/rtklib/rtklib.h +++ b/src/algorithms/libs/rtklib/rtklib.h @@ -215,9 +215,7 @@ const int NSATQZS = 0; const int NSYSQZS = 0; #endif -#ifndef __APPLE__ #define ENABDS -#endif #ifdef ENABDS const int MINPRNBDS = 1; //!< min satellite sat number of BeiDou const int MAXPRNBDS = 37; //!< max satellite sat number of BeiDou From 52aa4290d8f4a0ed82c8d0c801923641e5f49b40 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 22 Mar 2019 13:45:52 +0100 Subject: [PATCH 10/12] Update suggested glog and armadillo versions if built manually --- CMakeLists.txt | 2 +- README.md | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 005286a12..356eec9db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -409,7 +409,7 @@ set(GNSSSDR_MATIO_MIN_VERSION "1.5.3") ################################################################################ set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.2") set(GNSSSDR_GLOG_LOCAL_VERSION "0.4.0") -set(GNSSSDR_ARMADILLO_LOCAL_VERSION "9.200.x") +set(GNSSSDR_ARMADILLO_LOCAL_VERSION "9.300.x") set(GNSSSDR_GTEST_LOCAL_VERSION "1.8.1") set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master") set(GNSSSDR_GPSTK_LOCAL_VERSION "2.10.6") diff --git a/README.md b/README.md index 0cec356ac..3cc77bcdc 100644 --- a/README.md +++ b/README.md @@ -190,9 +190,9 @@ $ sudo apt-get install libblas-dev liblapack-dev # For Debian/Ubuntu/Linux $ sudo yum install lapack-devel blas-devel # For Fedora/CentOS/RHEL $ sudo zypper install lapack-devel blas-devel # For OpenSUSE $ sudo pacman -S blas lapack # For Arch Linux -$ wget https://sourceforge.net/projects/arma/files/armadillo-9.200.7.tar.xz -$ tar xvfz armadillo-9.200.7.tar.xz -$ cd armadillo-9.200.7 +$ wget https://sourceforge.net/projects/arma/files/armadillo-9.300.2.tar.xz +$ tar xvfz armadillo-9.300.2.tar.xz +$ cd armadillo-9.300.2 $ cmake . $ make $ sudo make install @@ -219,9 +219,10 @@ $ sudo ldconfig #### Install [Glog](https://github.com/google/glog "Glog's Homepage"), a library that implements application-level logging: ~~~~~~ -$ wget https://github.com/google/glog/archive/v0.3.5.tar.gz -$ tar xvfz v0.3.5.tar.gz -$ cd glog-0.3.5 +$ wget https://github.com/google/glog/archive/v0.4.0.tar.gz +$ tar xvfz v0.4.0.tar.gz +$ cd glog-0.4.0 +$ ./autogen.sh $ ./configure $ make $ sudo make install From f9b450bc80e2520f622a3d8fb3ba42c1d879ef2e Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Fri, 22 Mar 2019 16:03:09 +0100 Subject: [PATCH 11/12] Adding channel modifications for FPGA acceleration --- src/algorithms/channel/adapters/channel.cc | 11 ++++++++++- src/algorithms/channel/libs/channel_fsm.cc | 15 ++++++++++++++- src/algorithms/channel/libs/channel_fsm.h | 7 ++++--- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index 9620e5d67..a344b9580 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -56,6 +56,7 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::s channel_fsm_ = std::make_shared(); flag_enable_fpga = configuration->property("GNSS-SDR.enable_FPGA", false); + acq_->set_channel(channel_); acq_->set_channel_fsm(channel_fsm_); trk_->set_channel(channel_); @@ -236,7 +237,15 @@ void Channel::start_acquisition() { std::lock_guard lk(mx); bool result = false; - result = channel_fsm_->Event_start_acquisition(); + if (!flag_enable_fpga) + { + result = channel_fsm_->Event_start_acquisition(); + } + else + { + result = channel_fsm_->Event_start_acquisition_fpga(); + channel_fsm_->start_acquisition(); + } if (!result) { LOG(WARNING) << "Invalid channel event"; diff --git a/src/algorithms/channel/libs/channel_fsm.cc b/src/algorithms/channel/libs/channel_fsm.cc index 533bbd2d4..f5e75ed7c 100644 --- a/src/algorithms/channel/libs/channel_fsm.cc +++ b/src/algorithms/channel/libs/channel_fsm.cc @@ -1,7 +1,8 @@ /*! * \file channel_fsm.cc * \brief Implementation of a State Machine for channel - * \authors Antonio Ramos, 2017. antonio.ramos(at)cttc.es + * \authors Javier Arribas, 2019. javiarribas@gmail.com + * Antonio Ramos, 2017. antonio.ramos(at)cttc.es * Luis Esteve, 2011. luis(at)epsilon-formacion.com * * ------------------------------------------------------------------------- @@ -74,6 +75,18 @@ bool ChannelFsm::Event_stop_channel() } +bool ChannelFsm::Event_start_acquisition_fpga() +{ + std::lock_guard lk(mx); + if ((d_state == 1) || (d_state == 2)) + { + return false; + } + d_state = 1; + DLOG(INFO) << "CH = " << channel_ << ". Ev start acquisition FPGA"; + return true; +} + bool ChannelFsm::Event_start_acquisition() { std::lock_guard lk(mx); diff --git a/src/algorithms/channel/libs/channel_fsm.h b/src/algorithms/channel/libs/channel_fsm.h index bb26b3c08..8a3342511 100644 --- a/src/algorithms/channel/libs/channel_fsm.h +++ b/src/algorithms/channel/libs/channel_fsm.h @@ -1,7 +1,8 @@ /*! * \file channel_fsm.h * \brief Interface of the State Machine for channel - * \authors Antonio Ramos, 2017. antonio.ramos(at)cttc.es + * \authors Javier Arribas, 2019. javiarribas@gmail.com + * Antonio Ramos, 2017. antonio.ramos(at)cttc.es * Luis Esteve, 2011. luis(at)epsilon-formacion.com * * ------------------------------------------------------------------------- @@ -55,9 +56,10 @@ public: void set_telemetry(std::shared_ptr telemetry); void set_queue(gr::msg_queue::sptr queue); void set_channel(uint32_t channel); - + void start_acquisition(); // FSM EVENTS bool Event_start_acquisition(); + bool Event_start_acquisition_fpga(); bool Event_valid_acquisition(); bool Event_stop_channel(); bool Event_failed_acquisition_repeat(); @@ -65,7 +67,6 @@ public: bool Event_failed_tracking_standby(); private: - void start_acquisition(); void start_tracking(); void stop_acquisition(); void stop_tracking(); From c877e745652d43e2d35d136130f2f626a75d56b7 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Fri, 22 Mar 2019 18:11:45 +0100 Subject: [PATCH 12/12] -Adding more FPGA helpers to channel operations --- src/algorithms/channel/adapters/channel.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index a344b9580..419df642c 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -216,6 +216,11 @@ void Channel::set_signal(const Gnss_Signal& gnss_signal) gnss_synchro_.PRN = gnss_signal_.get_satellite().get_PRN(); gnss_synchro_.System = gnss_signal_.get_satellite().get_system_short().c_str()[0]; acq_->set_local_code(); + if (flag_enable_fpga) + { + //set again the gnss_synchro pointer to trigger the preloading of the current PRN code to the FPGA fabric + trk_->set_gnss_synchro(&gnss_synchro_); + } nav_->set_satellite(gnss_signal_.get_satellite()); }