From 0be8c657de21d01feb864dfa5078e9659b7dc947 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Wed, 20 Mar 2019 15:13:17 +0100 Subject: [PATCH] Reducing the latency in the acquisition to tracking transition --- .../acquisition/adapters/CMakeLists.txt | 1 + .../adapters/beidou_b1i_pcps_acquisition.cc | 7 +----- .../adapters/beidou_b1i_pcps_acquisition.h | 19 +++++++++++++-- .../adapters/beidou_b3i_pcps_acquisition.cc | 8 +------ .../adapters/beidou_b3i_pcps_acquisition.h | 19 +++++++++++++-- ...lileo_e1_pcps_8ms_ambiguous_acquisition.cc | 11 +-------- ...alileo_e1_pcps_8ms_ambiguous_acquisition.h | 16 ++++++++++++- .../galileo_e1_pcps_ambiguous_acquisition.cc | 9 +------ .../galileo_e1_pcps_ambiguous_acquisition.h | 17 +++++++++++-- ...ileo_e1_pcps_ambiguous_acquisition_fpga.cc | 9 +------ ...lileo_e1_pcps_ambiguous_acquisition_fpga.h | 17 +++++++++++-- ...eo_e1_pcps_cccwsr_ambiguous_acquisition.cc | 24 +------------------ ...leo_e1_pcps_cccwsr_ambiguous_acquisition.h | 17 +++++++++++-- ...e1_pcps_quicksync_ambiguous_acquisition.cc | 11 +-------- ..._e1_pcps_quicksync_ambiguous_acquisition.h | 17 +++++++++++-- ...ileo_e1_pcps_tong_ambiguous_acquisition.cc | 11 +-------- ...lileo_e1_pcps_tong_ambiguous_acquisition.h | 17 +++++++++++-- ...ileo_e5a_noncoherent_iq_acquisition_caf.cc | 11 +-------- ...lileo_e5a_noncoherent_iq_acquisition_caf.h | 17 +++++++++++-- .../adapters/galileo_e5a_pcps_acquisition.cc | 8 +------ .../adapters/galileo_e5a_pcps_acquisition.h | 17 +++++++++++-- .../galileo_e5a_pcps_acquisition_fpga.cc | 9 +------ .../galileo_e5a_pcps_acquisition_fpga.h | 18 +++++++++++--- .../glonass_l1_ca_pcps_acquisition.cc | 9 +------ .../adapters/glonass_l1_ca_pcps_acquisition.h | 18 +++++++++++--- .../glonass_l2_ca_pcps_acquisition.cc | 8 +------ .../adapters/glonass_l2_ca_pcps_acquisition.h | 17 +++++++++++-- .../adapters/gps_l1_ca_pcps_acquisition.cc | 9 +------ .../adapters/gps_l1_ca_pcps_acquisition.h | 17 +++++++++++-- ...gps_l1_ca_pcps_acquisition_fine_doppler.cc | 8 +------ .../gps_l1_ca_pcps_acquisition_fine_doppler.h | 17 +++++++++++-- .../gps_l1_ca_pcps_acquisition_fpga.cc | 9 +------ .../gps_l1_ca_pcps_acquisition_fpga.h | 17 +++++++++++-- .../gps_l1_ca_pcps_assisted_acquisition.cc | 8 +------ .../gps_l1_ca_pcps_assisted_acquisition.h | 17 +++++++++++-- .../gps_l1_ca_pcps_opencl_acquisition.cc | 12 +--------- .../gps_l1_ca_pcps_opencl_acquisition.h | 17 +++++++++++-- .../gps_l1_ca_pcps_quicksync_acquisition.cc | 12 +--------- .../gps_l1_ca_pcps_quicksync_acquisition.h | 17 +++++++++++-- .../gps_l1_ca_pcps_tong_acquisition.cc | 12 +--------- .../gps_l1_ca_pcps_tong_acquisition.h | 17 +++++++++++-- .../adapters/gps_l2_m_pcps_acquisition.cc | 8 +------ .../adapters/gps_l2_m_pcps_acquisition.h | 17 +++++++++++-- .../gps_l2_m_pcps_acquisition_fpga.cc | 9 +------ .../adapters/gps_l2_m_pcps_acquisition_fpga.h | 17 +++++++++++-- .../adapters/gps_l5i_pcps_acquisition.cc | 8 +------ .../adapters/gps_l5i_pcps_acquisition.h | 17 +++++++++++-- .../adapters/gps_l5i_pcps_acquisition_fpga.cc | 9 +------ .../adapters/gps_l5i_pcps_acquisition_fpga.h | 17 +++++++++++-- .../gnuradio_blocks/CMakeLists.txt | 1 + ...eo_e5a_noncoherent_iq_acquisition_caf_cc.h | 9 +++++++ .../galileo_pcps_8ms_acquisition_cc.h | 10 ++++++++ .../gnuradio_blocks/pcps_acquisition.cc | 10 +++++++- .../gnuradio_blocks/pcps_acquisition.h | 12 +++++++++- .../pcps_acquisition_fine_doppler_cc.h | 12 +++++++++- .../gnuradio_blocks/pcps_acquisition_fpga.cc | 10 +++++++- .../gnuradio_blocks/pcps_acquisition_fpga.h | 11 +++++++++ .../pcps_assisted_acquisition_cc.h | 12 +++++++++- .../pcps_cccwsr_acquisition_cc.h | 10 ++++++++ .../pcps_opencl_acquisition_cc.h | 11 ++++++++- .../pcps_quicksync_acquisition_cc.h | 10 ++++++++ .../pcps_tong_acquisition_cc.h | 10 ++++++++ src/algorithms/channel/adapters/channel.cc | 1 + src/algorithms/channel/adapters/channel.h | 4 ++-- src/algorithms/channel/libs/CMakeLists.txt | 2 +- .../channel/libs/channel_msg_receiver_cc.cc | 2 ++ src/core/interfaces/acquisition_interface.h | 5 +++- src/core/receiver/CMakeLists.txt | 1 + src/core/receiver/gnss_flowgraph.cc | 3 ++- 69 files changed, 524 insertions(+), 275 deletions(-) diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index 726a1d86a..d8c2b3173 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -98,6 +98,7 @@ target_link_libraries(acquisition_adapters algorithms_libs gnss_sdr_flags acquisition_gr_blocks + channel_libs core_system_parameters Gnuradio::blocks Volk::volk diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc index c8ecc37b3..168209193 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc @@ -124,6 +124,7 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -145,12 +146,6 @@ void BeidouB1iPcpsAcquisition::stop_acquisition() { } -void BeidouB1iPcpsAcquisition::set_channel(uint32_t channel) -{ - channel_ = channel; - acquisition_->set_channel(channel_); -} - void BeidouB1iPcpsAcquisition::set_threshold(float threshold) { diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h index f01b6abdf..6822659cf 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h @@ -34,7 +34,7 @@ #ifndef GNSS_SDR_BEIDOU_B1I_PCPS_ACQUISITION_H_ #define GNSS_SDR_BEIDOU_B1I_PCPS_ACQUISITION_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" @@ -93,7 +93,21 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(uint32_t channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_->set_channel(channel_); + } + + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_->set_channel_fsm(channel_fsm); + } + /*! * \brief Set statistics threshold of PCPS algorithm @@ -159,6 +173,7 @@ private: bool bit_transition_flag_; bool use_CFAR_algorithm_flag_; uint32_t channel_; + std::shared_ptr channel_fsm_; float threshold_; uint32_t doppler_max_; uint32_t doppler_step_; diff --git a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc index cb42488af..7d458c855 100644 --- a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc @@ -121,6 +121,7 @@ BeidouB3iPcpsAcquisition::BeidouB3iPcpsAcquisition( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -142,13 +143,6 @@ void BeidouB3iPcpsAcquisition::stop_acquisition() { } -void BeidouB3iPcpsAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - acquisition_->set_channel(channel_); -} - - void BeidouB3iPcpsAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + ".pfa", 0.0); diff --git a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h index 79059b7c8..2562d2790 100644 --- a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.h @@ -33,7 +33,7 @@ #define GNSS_SDR_BEIDOU_B3I_PCPS_ACQUISITION_H_ #include "acq_conf.h" -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" @@ -92,7 +92,21 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_->set_channel(channel_); + } + + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_->set_channel_fsm(channel_fsm); + } + /*! * \brief Set statistics threshold of PCPS algorithm @@ -158,6 +172,7 @@ private: bool bit_transition_flag_; bool use_CFAR_algorithm_flag_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; 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 2a8fcebb5..25ff95866 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 @@ -110,6 +110,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -132,16 +133,6 @@ void GalileoE1Pcps8msAmbiguousAcquisition::stop_acquisition() } -void GalileoE1Pcps8msAmbiguousAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - if (item_type_ == "gr_complex") - { - acquisition_cc_->set_channel(channel_); - } -} - - void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); 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 ce9cd440b..35044840b 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,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_cc_->set_channel(channel_); + } + + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_cc_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm @@ -143,6 +156,7 @@ private: unsigned int vector_length_; unsigned int code_length_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; 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 76206cb0e..4d9df2c64 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -154,6 +154,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -175,14 +176,6 @@ void GalileoE1PcpsAmbiguousAcquisition::stop_acquisition() { } - -void GalileoE1PcpsAmbiguousAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - acquisition_->set_channel(channel_); -} - - void GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); 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 ee4538022..897336965 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h @@ -33,7 +33,7 @@ #define GNSS_SDR_GALILEO_E1_PCPS_AMBIGUOUS_ACQUISITION_H_ #include "acq_conf.h" -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" @@ -91,8 +91,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -159,6 +171,7 @@ private: bool use_CFAR_algorithm_flag_; bool acquire_pilot_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; 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 4fb6fb644..191279974 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 @@ -168,7 +168,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( channel_ = 0; doppler_step_ = 0; gnss_synchro_ = nullptr; - + channel_fsm_ = nullptr; // temporary buffers that we can delete delete[] code; delete fft_if; @@ -189,13 +189,6 @@ void GalileoE1PcpsAmbiguousAcquisitionFpga::stop_acquisition() } -void GalileoE1PcpsAmbiguousAcquisitionFpga::set_channel(unsigned int channel) -{ - channel_ = channel; - acquisition_fpga_->set_channel(channel_); -} - - void GalileoE1PcpsAmbiguousAcquisitionFpga::set_threshold(float threshold) { DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold; 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 41a405794..543c55248 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 @@ -32,7 +32,7 @@ #ifndef GNSS_SDR_GALILEO_E1_PCPS_AMBIGUOUS_ACQUISITION_FPGA_H_ #define GNSS_SDR_GALILEO_E1_PCPS_AMBIGUOUS_ACQUISITION_FPGA_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "complex_byte_to_float_x2.h" #include "pcps_acquisition_fpga.h" #include @@ -93,8 +93,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_fpga_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_fpga_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -150,6 +162,7 @@ private: complex_byte_to_float_x2_sptr cbyte_to_float_x2_; bool acquire_pilot_; uint32_t channel_; + std::shared_ptr channel_fsm_; uint32_t doppler_max_; uint32_t doppler_step_; std::string dump_filename_; 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 2241174ec..212d739cc 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 @@ -111,6 +111,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -134,31 +135,8 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::stop_acquisition() } -void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - if (item_type_ == "gr_complex") - { - acquisition_cc_->set_channel(channel_); - } -} - - void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_threshold(float threshold) { - // float pfa = configuration_->property(role_+ std::to_string(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); - // } - threshold_ = threshold; DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; 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 4e472c112..561b6055e 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 @@ -32,7 +32,7 @@ #ifndef GNSS_SDR_GALILEO_E1_PCPS_CCCWSR_AMBIGUOUS_ACQUISITION_H_ #define GNSS_SDR_GALILEO_E1_PCPS_CCCWSR_AMBIGUOUS_ACQUISITION_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "gnss_synchro.h" #include "pcps_cccwsr_acquisition_cc.h" #include @@ -87,8 +87,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_cc_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_cc_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of CCCWSR algorithm */ @@ -143,6 +155,7 @@ private: unsigned int code_length_; //unsigned int satellite_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; 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 527391553..f3a1cc016 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 @@ -144,6 +144,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -166,16 +167,6 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::stop_acquisition() } -void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - if (item_type_ == "gr_complex") - { - acquisition_cc_->set_channel(channel_); - } -} - - void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); 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 981cf46a6..017ebf295 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 @@ -32,7 +32,7 @@ #ifndef GNSS_SDR_GALILEO_E1_PCPS_QUICKSYNC_AMBIGUOUS_ACQUISITION_H_ #define GNSS_SDR_GALILEO_E1_PCPS_QUICKSYNC_AMBIGUOUS_ACQUISITION_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "gnss_synchro.h" #include "pcps_quicksync_acquisition_cc.h" #include @@ -88,8 +88,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_cc_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_cc_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -147,6 +159,7 @@ private: unsigned int code_length_; bool bit_transition_flag_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; 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 24d17fa1b..cc087c4a7 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 @@ -114,6 +114,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -136,16 +137,6 @@ void GalileoE1PcpsTongAmbiguousAcquisition::stop_acquisition() } -void GalileoE1PcpsTongAmbiguousAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - if (item_type_ == "gr_complex") - { - acquisition_cc_->set_channel(channel_); - } -} - - void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); 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 95fbaee0b..8618c606f 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 @@ -32,7 +32,7 @@ #ifndef GNSS_SDR_GALILEO_E1_PCPS_TONG_AMBIGUOUS_ACQUISITION_H_ #define GNSS_SDR_GALILEO_E1_PCPS_TONG_AMBIGUOUS_ACQUISITION_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "gnss_synchro.h" #include "pcps_tong_acquisition_cc.h" #include @@ -87,8 +87,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_cc_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_cc_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of TONG algorithm */ @@ -145,6 +157,7 @@ private: unsigned int vector_length_; unsigned int code_length_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; 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 c2b09ba8a..6f971d094 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 @@ -119,6 +119,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -142,16 +143,6 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::stop_acquisition() } -void GalileoE5aNoncoherentIQAcquisitionCaf::set_channel(unsigned int channel) -{ - channel_ = channel; - if (item_type_ == "gr_complex") - { - acquisition_cc_->set_channel(channel_); - } -} - - void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); 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 3e4d936aa..cdd1504c4 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 @@ -38,7 +38,7 @@ #ifndef GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_H_ #define GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h" #include "gnss_synchro.h" #include @@ -88,8 +88,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_cc_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_cc_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -148,6 +160,7 @@ private: unsigned int code_length_; bool bit_transition_flag_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc index 18ff351c2..102854469 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc @@ -152,6 +152,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -174,13 +175,6 @@ void GalileoE5aPcpsAcquisition::stop_acquisition() } -void GalileoE5aPcpsAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - acquisition_->set_channel(channel_); -} - - void GalileoE5aPcpsAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h index 5a4d71fc1..4ea234cf5 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h @@ -32,7 +32,7 @@ #define GALILEO_E5A_PCPS_ACQUISITION_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" #include @@ -79,8 +79,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -157,6 +169,7 @@ private: unsigned int vector_length_; unsigned int code_length_; unsigned int channel_; + std::shared_ptr channel_fsm_; unsigned int doppler_max_; unsigned int doppler_step_; unsigned int sampled_ms_; 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 9c1535261..5c79068ed 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -169,7 +169,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf channel_ = 0; doppler_step_ = 0; gnss_synchro_ = nullptr; - + channel_fsm_ = nullptr; // temporary buffers that we can delete delete[] code; delete fft_if; @@ -190,13 +190,6 @@ void GalileoE5aPcpsAcquisitionFpga::stop_acquisition() } -void GalileoE5aPcpsAcquisitionFpga::set_channel(unsigned int channel) -{ - channel_ = channel; - acquisition_fpga_->set_channel(channel_); -} - - void GalileoE5aPcpsAcquisitionFpga::set_threshold(float threshold) { DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold; 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 bd17742a1..ff9e9a126 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h @@ -33,7 +33,7 @@ #define GNSS_SDR_GALILEO_E5A_PCPS_ACQUISITION_FPGA_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "pcps_acquisition_fpga.h" #include #include // for basic_block_sptr, top_block_sptr @@ -89,12 +89,23 @@ public: * tracking blocks */ void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; - /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_fpga_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_fpga_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -165,6 +176,7 @@ private: bool acq_iq_; uint32_t channel_; + std::shared_ptr channel_fsm_; uint32_t doppler_max_; uint32_t doppler_step_; unsigned int in_streams_; 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 67874f772..0f3b63feb 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc @@ -125,6 +125,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -146,14 +147,6 @@ void GlonassL1CaPcpsAcquisition::stop_acquisition() { } - -void GlonassL1CaPcpsAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - acquisition_->set_channel(channel_); -} - - void GlonassL1CaPcpsAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + ".pfa", 0.0); 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 17affc67c..9f3e4497f 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h @@ -34,7 +34,7 @@ #ifndef GNSS_SDR_GLONASS_L1_CA_PCPS_ACQUISITION_H_ #define GNSS_SDR_GLONASS_L1_CA_PCPS_ACQUISITION_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" @@ -86,12 +86,23 @@ public: * tracking blocks */ void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; - /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -151,6 +162,7 @@ private: bool bit_transition_flag_; bool use_CFAR_algorithm_flag_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; 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 47d9b51d6..bb82680b6 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc @@ -124,6 +124,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -146,13 +147,6 @@ void GlonassL2CaPcpsAcquisition::stop_acquisition() } -void GlonassL2CaPcpsAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - acquisition_->set_channel(channel_); -} - - void GlonassL2CaPcpsAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + ".pfa", 0.0); 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 ad99d9d5a..95bfde06c 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h @@ -33,7 +33,7 @@ #ifndef GNSS_SDR_GLONASS_L2_CA_PCPS_ACQUISITION_H_ #define GNSS_SDR_GLONASS_L2_CA_PCPS_ACQUISITION_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" @@ -89,8 +89,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -150,6 +162,7 @@ private: bool bit_transition_flag_; bool use_CFAR_algorithm_flag_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; 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 7c5b28e8e..32dce833f 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -147,6 +147,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -168,14 +169,6 @@ void GpsL1CaPcpsAcquisition::stop_acquisition() { } - -void GpsL1CaPcpsAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - acquisition_->set_channel(channel_); -} - - void GpsL1CaPcpsAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + ".pfa", 0.0); 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 efca26bdd..727c0a81c 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h @@ -37,7 +37,7 @@ #define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_ #include "acq_conf.h" -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" @@ -95,8 +95,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -162,6 +174,7 @@ private: bool bit_transition_flag_; bool use_CFAR_algorithm_flag_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; 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 75f5d5944..da2b73132 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 @@ -97,6 +97,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -119,13 +120,6 @@ void GpsL1CaPcpsAcquisitionFineDoppler::stop_acquisition() } -void GpsL1CaPcpsAcquisitionFineDoppler::set_channel(unsigned int channel) -{ - channel_ = channel; - acquisition_cc_->set_channel(channel_); -} - - void GpsL1CaPcpsAcquisitionFineDoppler::set_threshold(float threshold) { threshold_ = threshold; 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 b1b64d6eb..33bd36c0f 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 @@ -34,7 +34,7 @@ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FINE_DOPPLER_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FINE_DOPPLER_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "gnss_synchro.h" #include "pcps_acquisition_fine_doppler_cc.h" #include @@ -88,8 +88,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_cc_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_cc_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -140,6 +152,7 @@ private: std::string item_type_; unsigned int vector_length_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; int doppler_max_; unsigned int doppler_step_; 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 42f0fef79..2505180f0 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 @@ -151,7 +151,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( channel_ = 0; doppler_step_ = 0; gnss_synchro_ = nullptr; - + channel_fsm_ = nullptr; // temporary buffers that we can delete delete[] code; delete fft_if; @@ -172,13 +172,6 @@ void GpsL1CaPcpsAcquisitionFpga::stop_acquisition() } -void GpsL1CaPcpsAcquisitionFpga::set_channel(unsigned int channel) -{ - channel_ = channel; - acquisition_fpga_->set_channel(channel_); -} - - void GpsL1CaPcpsAcquisitionFpga::set_threshold(float threshold) { DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold; 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 8a9160c4b..e92e3a41c 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 @@ -35,7 +35,7 @@ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "pcps_acquisition_fpga.h" #include // for basic_block_sptr, top_block_sptr #include // for lv_16sc_t @@ -93,8 +93,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_fpga_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_fpga_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -146,6 +158,7 @@ private: ConfigurationInterface* configuration_; pcps_acquisition_fpga_sptr acquisition_fpga_; uint32_t channel_; + std::shared_ptr channel_fsm_; uint32_t doppler_max_; uint32_t doppler_step_; Gnss_Synchro* gnss_synchro_; 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 9f361309b..2880d3c74 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 @@ -89,6 +89,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -111,13 +112,6 @@ void GpsL1CaPcpsAssistedAcquisition::stop_acquisition() } -void GpsL1CaPcpsAssistedAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - acquisition_cc_->set_channel(channel_); -} - - void GpsL1CaPcpsAssistedAcquisition::set_threshold(float threshold) { threshold_ = threshold; 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 04b653440..24d22f4a5 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 @@ -34,7 +34,7 @@ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_ASSISTED_ACQUISITION_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_ASSISTED_ACQUISITION_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "gnss_synchro.h" #include "pcps_assisted_acquisition_cc.h" #include @@ -88,8 +88,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_cc_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_cc_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -137,6 +149,7 @@ private: unsigned int vector_length_; //unsigned int satellite_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; int doppler_max_; unsigned int doppler_step_; 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 45c52b10c..277db1fac 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 @@ -105,6 +105,7 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -126,17 +127,6 @@ void GpsL1CaPcpsOpenClAcquisition::stop_acquisition() { } - -void GpsL1CaPcpsOpenClAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - if (item_type_ == "gr_complex") - { - acquisition_cc_->set_channel(channel_); - } -} - - void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); 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 a7dbe1bc9..e5c8b11b9 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 @@ -32,7 +32,7 @@ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_OPENCL_ACQUISITION_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_OPENCL_ACQUISITION_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "gnss_synchro.h" #include "pcps_opencl_acquisition_cc.h" #include @@ -87,8 +87,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_cc_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_cc_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -142,6 +154,7 @@ private: unsigned int code_length_; bool bit_transition_flag_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; 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 b38e466e2..578a01d4f 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 @@ -137,6 +137,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -158,17 +159,6 @@ void GpsL1CaPcpsQuickSyncAcquisition::stop_acquisition() { } - -void GpsL1CaPcpsQuickSyncAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - if (item_type_ == "gr_complex") - { - acquisition_cc_->set_channel(channel_); - } -} - - void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); 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 482db0f44..b5de94a96 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 @@ -33,7 +33,7 @@ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_QUICKSYNC_ACQUISITION_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_QUICKSYNC_ACQUISITION_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "configuration_interface.h" #include "gnss_synchro.h" #include "pcps_quicksync_acquisition_cc.h" @@ -89,8 +89,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_cc_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_cc_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -148,6 +160,7 @@ private: unsigned int code_length_; bool bit_transition_flag_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; 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 cf50926ae..d1fdeb95d 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 @@ -99,6 +99,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -120,17 +121,6 @@ void GpsL1CaPcpsTongAcquisition::stop_acquisition() { } - -void GpsL1CaPcpsTongAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - if (item_type_ == "gr_complex") - { - acquisition_cc_->set_channel(channel_); - } -} - - void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); 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 63e89b8a5..c158b0c9a 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 @@ -32,7 +32,7 @@ #ifndef GNSS_SDR_GPS_L1_CA_TONG_ACQUISITION_H_ #define GNSS_SDR_GPS_L1_CA_TONG_ACQUISITION_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "configuration_interface.h" #include "gnss_synchro.h" #include "pcps_tong_acquisition_cc.h" @@ -88,8 +88,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_cc_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_cc_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of TONG algorithm */ @@ -146,6 +158,7 @@ private: unsigned int vector_length_; unsigned int code_length_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; 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 4a1377e1b..bb796e769 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -151,6 +151,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; num_codes_ = acq_parameters_.sampled_ms / acq_parameters_.ms_per_code; if (in_streams_ > 1) { @@ -174,13 +175,6 @@ void GpsL2MPcpsAcquisition::stop_acquisition() } -void GpsL2MPcpsAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - acquisition_->set_channel(channel_); -} - - void GpsL2MPcpsAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); 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 da1c7ef6e..a3398ae63 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h @@ -34,7 +34,7 @@ #ifndef GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_H_ #define GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" @@ -92,8 +92,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -159,6 +171,7 @@ private: bool bit_transition_flag_; bool use_CFAR_algorithm_flag_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; 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 8dddca5c2..cc08b8bb2 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 @@ -144,7 +144,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( channel_ = 0; doppler_step_ = 0; gnss_synchro_ = nullptr; - + channel_fsm_ = nullptr; DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; threshold_ = 0.0; @@ -162,13 +162,6 @@ void GpsL2MPcpsAcquisitionFpga::stop_acquisition() } -void GpsL2MPcpsAcquisitionFpga::set_channel(unsigned int channel) -{ - channel_ = channel; - acquisition_fpga_->set_channel(channel_); -} - - void GpsL2MPcpsAcquisitionFpga::set_threshold(float threshold) { threshold_ = threshold; 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 70593ea67..08bf8a9fb 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 @@ -34,7 +34,7 @@ #ifndef GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_FPGA_H_ #define GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_FPGA_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "complex_byte_to_float_x2.h" #include "pcps_acquisition_fpga.h" #include @@ -94,8 +94,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_fpga_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_fpga_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -151,6 +163,7 @@ private: complex_byte_to_float_x2_sptr cbyte_to_float_x2_; std::string item_type_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc index 7b595d38a..376e3b00c 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc @@ -147,6 +147,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; + channel_fsm_ = nullptr; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -169,13 +170,6 @@ void GpsL5iPcpsAcquisition::stop_acquisition() } -void GpsL5iPcpsAcquisition::set_channel(unsigned int channel) -{ - channel_ = channel; - acquisition_->set_channel(channel_); -} - - void GpsL5iPcpsAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h index af8cabb81..756d122d4 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h @@ -34,7 +34,7 @@ #ifndef GNSS_SDR_GPS_L5i_PCPS_ACQUISITION_H_ #define GNSS_SDR_GPS_L5i_PCPS_ACQUISITION_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" @@ -92,8 +92,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -158,6 +170,7 @@ private: bool bit_transition_flag_; bool use_CFAR_algorithm_flag_; unsigned int channel_; + std::shared_ptr channel_fsm_; float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; 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 b1c0fe060..92b43c988 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc @@ -151,7 +151,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( channel_ = 0; doppler_step_ = 0; gnss_synchro_ = nullptr; - + channel_fsm_ = nullptr; // temporary buffers that we can delete delete[] code; delete fft_if; @@ -173,13 +173,6 @@ void GpsL5iPcpsAcquisitionFpga::stop_acquisition() } -void GpsL5iPcpsAcquisitionFpga::set_channel(unsigned int channel) -{ - channel_ = channel; - acquisition_fpga_->set_channel(channel_); -} - - void GpsL5iPcpsAcquisitionFpga::set_threshold(float threshold) { DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold; 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 79fe12967..d009eca49 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h @@ -35,7 +35,7 @@ #ifndef GNSS_SDR_GPS_L5I_PCPS_ACQUISITION_FPGA_H_ #define GNSS_SDR_GPS_L5I_PCPS_ACQUISITION_FPGA_H_ -#include "acquisition_interface.h" +#include "channel_fsm.h" #include "complex_byte_to_float_x2.h" #include "pcps_acquisition_fpga.h" #include @@ -95,8 +95,20 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + inline void set_channel(unsigned int channel) + { + channel_ = channel; + acquisition_fpga_->set_channel(channel_); + } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + channel_fsm_ = channel_fsm; + acquisition_fpga_->set_channel_fsm(channel_fsm); + } /*! * \brief Set statistics threshold of PCPS algorithm */ @@ -152,6 +164,7 @@ private: complex_byte_to_float_x2_sptr cbyte_to_float_x2_; std::string item_type_; uint32_t channel_; + std::shared_ptr channel_fsm_; uint32_t doppler_max_; uint32_t doppler_step_; std::string dump_filename_; diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index 5a135364b..a23bfba82 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -71,6 +71,7 @@ target_link_libraries(acquisition_gr_blocks Gnuradio::runtime Gnuradio::fft Volk::volk + channel_libs acquisition_libs core_system_parameters ${OPT_LIBRARIES} diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h index c95a74b82..8604478b3 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h @@ -38,6 +38,7 @@ #ifndef GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_CC_H_ #define GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_CC_H_ +#include "channel_fsm.h" #include "gnss_synchro.h" #include #include @@ -99,6 +100,7 @@ private: int doppler_offset); float estimate_input_power(gr_complex* in); + std::shared_ptr d_channel_fsm; int64_t d_fs_in; int d_samples_per_ms; int d_sampled_ms; @@ -211,6 +213,13 @@ public: d_channel = channel; } + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + d_channel_fsm = channel_fsm; + } /*! * \brief Set statistics threshold of PCPS algorithm. * \param threshold - Threshold for signal detection (check \ref Navitec2012, diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h index 0c1b81e20..9e8ad5e0f 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h @@ -32,6 +32,7 @@ #ifndef GNSS_SDR_PCPS_8MS_ACQUISITION_CC_H_ #define GNSS_SDR_PCPS_8MS_ACQUISITION_CC_H_ +#include "channel_fsm.h" #include "gnss_synchro.h" #include #include @@ -117,6 +118,7 @@ private: int32_t d_state; bool d_dump; uint32_t d_channel; + std::shared_ptr d_channel_fsm; std::string d_dump_filename; public: @@ -180,6 +182,14 @@ public: d_channel = channel; } + + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + d_channel_fsm = channel_fsm; + } /*! * \brief Set statistics threshold of PCPS algorithm. * \param threshold - Threshold for signal detection (check \ref Navitec2012, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index e4b5f2a7c..92b72f774 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -429,7 +429,15 @@ void pcps_acquisition::send_positive_acquisition() << ", magnitude " << d_mag << ", input signal power " << d_input_power; d_positive_acq = 1; - this->message_port_pub(pmt::mp("events"), pmt::from_long(1)); + 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)); + } } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h index a86bebf99..eeb56b66c 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h @@ -53,6 +53,7 @@ #define GNSS_SDR_PCPS_ACQUISITION_H_ #include "acq_conf.h" +#include "channel_fsm.h" #include #include #include @@ -123,6 +124,7 @@ private: int64_t d_old_freq; int32_t d_state; uint32_t d_channel; + std::shared_ptr d_channel_fsm; uint32_t d_doppler_step; float d_doppler_center_step_two; uint32_t d_num_noncoherent_integrations_counter; @@ -204,10 +206,18 @@ public: */ inline void set_channel(uint32_t channel) { - gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler d_channel = channel; } + + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + d_channel_fsm = channel_fsm; + } + /*! * \brief Set statistics threshold of PCPS algorithm. * \param threshold - Threshold for signal detection (check \ref Navitec2012, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h index 211f3ca13..e1d8d1412 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h @@ -50,6 +50,7 @@ #define GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_ #include "acq_conf.h" +#include "channel_fsm.h" #include "gnss_synchro.h" #include #include @@ -121,10 +122,11 @@ private: int d_n_samples_in_buffer; bool d_dump; unsigned int d_channel; + std::shared_ptr d_channel_fsm; std::string d_dump_filename; - arma ::fmat grid_; + arma::fmat grid_; int64_t d_dump_number; unsigned int d_dump_channel; @@ -183,6 +185,14 @@ public: d_dump_channel = d_channel; } + + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + d_channel_fsm = channel_fsm; + } /*! * \brief Set statistics threshold of PCPS algorithm. * \param threshold - Threshold for signal detection (check \ref Navitec2012, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc index d54b572b9..f89d0fc16 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc @@ -150,7 +150,15 @@ void pcps_acquisition_fpga::send_positive_acquisition() << ", magnitude " << d_mag << ", input signal power " << d_input_power; - this->message_port_pub(pmt::mp("events"), pmt::from_long(1)); + 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)); + } } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h index ce78f6a47..4ee9acb81 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h @@ -41,6 +41,7 @@ #define GNSS_SDR_PCPS_ACQUISITION_FPGA_H_ +#include "channel_fsm.h" #include "fpga_acquisition.h" #include #include // for block @@ -104,6 +105,7 @@ private: float d_test_statistics; int32_t d_state; uint32_t d_channel; + std::shared_ptr d_channel_fsm; uint32_t d_doppler_step; uint32_t d_fft_size; uint32_t d_num_doppler_bins; @@ -171,6 +173,15 @@ public: d_channel = channel; } + + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + d_channel_fsm = channel_fsm; + } + /*! * \brief Set statistics threshold of PCPS algorithm. * \param threshold - Threshold for signal detection (check \ref Navitec2012, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h index b27f920df..1fcda44ea 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h @@ -48,6 +48,7 @@ #ifndef GNSS_SDR_PCPS_ASSISTED_ACQUISITION_CC_H_ #define GNSS_SDR_PCPS_ASSISTED_ACQUISITION_CC_H_ +#include "channel_fsm.h" #include "gnss_synchro.h" #include #include @@ -137,7 +138,7 @@ private: int32_t d_well_count; bool d_dump; uint32_t d_channel; - + std::shared_ptr d_channel_fsm; std::string d_dump_filename; public: @@ -194,6 +195,15 @@ public: d_channel = channel; } + + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + d_channel_fsm = channel_fsm; + } + /*! * \brief Set statistics threshold of PCPS algorithm. * \param threshold - Threshold for signal detection (check \ref Navitec2012, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h index b1edf0106..341207dbf 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h @@ -37,6 +37,7 @@ #ifndef GNSS_SDR_PCPS_CCCWSR_ACQUISITION_CC_H_ #define GNSS_SDR_PCPS_CCCWSR_ACQUISITION_CC_H_ +#include "channel_fsm.h" #include "gnss_synchro.h" #include #include @@ -116,6 +117,7 @@ private: int32_t d_state; bool d_dump; uint32_t d_channel; + std::shared_ptr d_channel_fsm; std::string d_dump_filename; public: @@ -180,6 +182,14 @@ public: d_channel = channel; } + + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + d_channel_fsm = channel_fsm; + } /*! * \brief Set statistics threshold of CCCWSR algorithm. * \param threshold - Threshold for signal detection (check \ref Navitec2012, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h index 20b53d082..230338d09 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h @@ -51,6 +51,7 @@ #ifndef GNSS_SDR_PCPS_OPENCL_ACQUISITION_CC_H_ #define GNSS_SDR_PCPS_OPENCL_ACQUISITION_CC_H_ +#include "channel_fsm.h" #include "gnss_synchro.h" #include "opencl/fft_internal.h" #include @@ -161,7 +162,7 @@ private: cl::CommandQueue* d_cl_queue; clFFT_Plan d_cl_fft_plan; cl_int d_cl_fft_batch_size; - + std::shared_ptr d_channel_fsm; int d_opencl; public: @@ -225,6 +226,14 @@ public: d_channel = channel; } + + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + d_channel_fsm = channel_fsm; + } /*! * \brief Set statistics threshold of PCPS algorithm. * \param threshold - Threshold for signal detection (check \ref Navitec2012, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h index cf24625a5..d4626aa5e 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h @@ -51,6 +51,7 @@ #ifndef GNSS_SDR_PCPS_QUICKSYNC_ACQUISITION_CC_H_ #define GNSS_SDR_PCPS_QUICKSYNC_ACQUISITION_CC_H_ +#include "channel_fsm.h" #include "gnss_synchro.h" #include #include @@ -150,6 +151,7 @@ private: int32_t d_state; bool d_dump; uint32_t d_channel; + std::shared_ptr d_channel_fsm; std::string d_dump_filename; public: @@ -213,6 +215,14 @@ public: d_channel = channel; } + + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + d_channel_fsm = channel_fsm; + } /*! * \brief Set statistics threshold of PCPS algorithm. * \param threshold - Threshold for signal detection (check \ref Navitec2012, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h index e2443fa33..8b38da0b7 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h @@ -51,6 +51,7 @@ #ifndef GNSS_SDR_PCPS_TONG_ACQUISITION_CC_H_ #define GNSS_SDR_PCPS_TONG_ACQUISITION_CC_H_ +#include "channel_fsm.h" #include "gnss_synchro.h" #include #include @@ -133,6 +134,7 @@ private: int32_t d_state; bool d_dump; uint32_t d_channel; + std::shared_ptr d_channel_fsm; std::string d_dump_filename; public: @@ -196,6 +198,14 @@ public: d_channel = channel; } + + /*! + * \brief Set channel fsm associated to this acquisition instance + */ + inline void set_channel_fsm(std::shared_ptr channel_fsm) + { + d_channel_fsm = channel_fsm; + } /*! * \brief Set statistics threshold of TONG algorithm. * \param threshold - Threshold for signal detection (check \ref Navitec2012, diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index 375c04c79..c68c35628 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -57,6 +57,7 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::s flag_enable_fpga = configuration->property("Channel.enable_FPGA", false); acq_->set_channel(channel_); + acq_->set_channel_fsm(channel_fsm_); trk_->set_channel(channel_); nav_->set_channel(channel_); diff --git a/src/algorithms/channel/adapters/channel.h b/src/algorithms/channel/adapters/channel.h index 81030fd51..975122852 100644 --- a/src/algorithms/channel/adapters/channel.h +++ b/src/algorithms/channel/adapters/channel.h @@ -34,7 +34,7 @@ #ifndef GNSS_SDR_CHANNEL_H_ #define GNSS_SDR_CHANNEL_H_ - +#include "channel_fsm.h" #include "channel_interface.h" #include "channel_msg_receiver_cc.h" #include "gnss_signal.h" @@ -51,7 +51,7 @@ class ConfigurationInterface; class AcquisitionInterface; class TrackingInterface; class TelemetryDecoderInterface; -class ChannelFsm; +//class ChannelFsm; /*! * \brief This class represents a GNSS channel. It wraps an AcquisitionInterface, diff --git a/src/algorithms/channel/libs/CMakeLists.txt b/src/algorithms/channel/libs/CMakeLists.txt index 415b118ec..ba6e2a274 100644 --- a/src/algorithms/channel/libs/CMakeLists.txt +++ b/src/algorithms/channel/libs/CMakeLists.txt @@ -24,7 +24,7 @@ set(CHANNEL_FSM_SOURCES set(CHANNEL_FSM_HEADERS channel_fsm.h channel_msg_receiver_cc.h -) +) list(SORT CHANNEL_FSM_HEADERS) list(SORT CHANNEL_FSM_SOURCES) diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc index 8fb4aa47e..c7cc8846f 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc @@ -67,6 +67,8 @@ void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg) switch (message) { case 1: // positive acquisition + // Now the acquisition block can optionally trigger the event valid acquisition internally, + // in order to reduce acquisition to tracking delay. result = d_channel_fsm->Event_valid_acquisition(); break; case 2: // negative acquisition diff --git a/src/core/interfaces/acquisition_interface.h b/src/core/interfaces/acquisition_interface.h index 7067d403a..8e8fdbb43 100644 --- a/src/core/interfaces/acquisition_interface.h +++ b/src/core/interfaces/acquisition_interface.h @@ -44,6 +44,8 @@ template class Concurrent_Queue; +class ChannelFsm; + /*! \brief This abstract class represents an interface to an acquisition GNSS block. * * Abstract class for acquisition algorithms. Since all its methods are virtual, @@ -55,7 +57,8 @@ class AcquisitionInterface : public GNSSBlockInterface { public: virtual void set_gnss_synchro(Gnss_Synchro* gnss_synchro) = 0; - virtual void set_channel(unsigned int channel) = 0; + virtual void set_channel(unsigned int channel_id) = 0; + virtual void set_channel_fsm(std::shared_ptr channel_fsm) = 0; virtual void set_threshold(float threshold) = 0; virtual void set_doppler_max(unsigned int doppler_max) = 0; virtual void set_doppler_step(unsigned int doppler_step) = 0; diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 469960d47..d18eaa976 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -140,6 +140,7 @@ target_link_libraries(core_receiver Boost::boost Boost::thread Gnuradio::runtime + channel_libs core_libs core_monitor PRIVATE diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 6e6f03c92..95ea7df45 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -39,6 +39,7 @@ #include "Galileo_E1.h" #include "Galileo_E5a.h" #include "channel.h" +#include "channel_fsm.h" #include "channel_interface.h" #include "configuration_interface.h" #include "gnss_block_factory.h" @@ -214,7 +215,7 @@ void GNSSFlowgraph::connect() } DLOG(INFO) << "blocks connected internally"; - // Signal Source (i) > Signal conditioner (i) > +// Signal Source (i) > Signal conditioner (i) > #ifndef ENABLE_FPGA int RF_Channels = 0; int signal_conditioner_ID = 0;