1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-15 09:39:57 +00:00

Merge branch 'next' of git+ssh://github.com/gnss-sdr/gnss-sdr into next

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
This commit is contained in:
Carles Fernandez 2016-04-18 18:07:59 +02:00
commit 1f8f63a462
122 changed files with 298 additions and 980 deletions

View File

@ -52,7 +52,7 @@ $ python setup.py build
$ sudo python setup.py install
$ pybombs recipes add gr-recipes https://github.com/gnuradio/gr-recipes.git
$ pybombs recipes add gr-etcetera https://github.com/gnuradio/gr-etcetera.git
$ pybombs prefix init /usr/local -a myprefix
$ sudo pybombs prefix init /usr/local -a myprefix
$ pybombs config default_prefix myprefix
$ pybombs install gnuradio gr-osmosdr armadillo glog
~~~~~~

View File

@ -172,9 +172,9 @@ Resampler.sample_freq_out=4000000
;######### CHANNELS GLOBAL CONFIG ############
;#count: Number of available GPS satellite channels.
Channels_1C.count=2
Channels_1C.count=5
;#count: Number of available Galileo satellite channels.
Channels_1B.count=4
Channels_1B.count=0
;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver
Channels.in_acquisition=1
@ -185,9 +185,9 @@ Channels.in_acquisition=1
;# "5X" GALILEO E5a I+Q
Channel0.signal=1C
Channel1.signal=1C
Channel2.signal=1B
Channel3.signal=1B
Channel4.signal=1B
Channel2.signal=1C
Channel3.signal=1C
Channel4.signal=1C
Channel5.signal=1B
Channel6.signal=1B
Channel7.signal=1B

View File

@ -107,7 +107,6 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
}
@ -178,18 +177,6 @@ GalileoE1Pcps8msAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step
}
void
GalileoE1Pcps8msAmbiguousAcquisition::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_channel_queue(channel_internal_queue_);
}
}
void
GalileoE1Pcps8msAmbiguousAcquisition::set_gnss_synchro(
Gnss_Synchro* gnss_synchro)

View File

@ -104,11 +104,6 @@ public:
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*!
* \brief Initializes acquisition algorithm.
*/
@ -154,7 +149,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
float calculate_threshold(float pfa);
};

View File

@ -111,7 +111,6 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
}
@ -176,16 +175,6 @@ void GalileoE1PcpsAmbiguousAcquisition::set_doppler_step(unsigned int doppler_st
}
void GalileoE1PcpsAmbiguousAcquisition::set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_channel_queue(channel_internal_queue_);
}
}
void GalileoE1PcpsAmbiguousAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{
gnss_synchro_ = gnss_synchro;

View File

@ -103,11 +103,6 @@ public:
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*!
* \brief Initializes acquisition algorithm.
*/
@ -159,7 +154,6 @@ private:
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
concurrent_queue<int> *channel_internal_queue_;
float calculate_threshold(float pfa);
};

View File

@ -108,7 +108,6 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
}
@ -181,19 +180,6 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::set_doppler_step(unsigned int doppler_s
}
}
void
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_channel_queue(channel_internal_queue_);
}
}
void
GalileoE1PcpsCccwsrAmbiguousAcquisition::set_gnss_synchro(
Gnss_Synchro* gnss_synchro)

View File

@ -104,11 +104,6 @@ public:
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*!
* \brief Initializes acquisition algorithm.
*/
@ -158,7 +153,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
float calculate_threshold(float pfa);
};

View File

@ -142,7 +142,6 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
}
@ -212,19 +211,6 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_doppler_step(unsigned int dopple
}
}
void
GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_channel_queue(channel_internal_queue_);
}
}
void
GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_gnss_synchro(
Gnss_Synchro* gnss_synchro)

View File

@ -104,11 +104,6 @@ public:
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*!
* \brief Initializes acquisition algorithm.
*/
@ -161,7 +156,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
float calculate_threshold(float pfa);
};

View File

@ -110,7 +110,6 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
bit_transition_flag_ = false;
}
@ -183,18 +182,6 @@ GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_step(unsigned int doppler_ste
}
void
GalileoE1PcpsTongAmbiguousAcquisition::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_channel_queue(channel_internal_queue_);
}
}
void
GalileoE1PcpsTongAmbiguousAcquisition::set_gnss_synchro(
Gnss_Synchro* gnss_synchro)

View File

@ -104,11 +104,6 @@ public:
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*!
* \brief Initializes acquisition algorithm.
*/
@ -161,7 +156,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
float calculate_threshold(float pfa);
};

View File

@ -113,7 +113,6 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
bit_transition_flag_ = false;
}
@ -182,17 +181,6 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_doppler_step(unsigned int dopple
}
void GalileoE5aNoncoherentIQAcquisitionCaf::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_channel_queue(channel_internal_queue_);
}
}
void GalileoE5aNoncoherentIQAcquisitionCaf::set_gnss_synchro(
Gnss_Synchro* gnss_synchro)
{

View File

@ -106,11 +106,6 @@ public:
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*!
* \brief Initializes acquisition algorithm.
*/
@ -168,7 +163,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
float calculate_threshold(float pfa);
};
#endif /* GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_H_ */

View File

@ -119,7 +119,6 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
doppler_max_ = 0;
doppler_step_ = 0;
gnss_synchro_ = 0;
channel_internal_queue_ = 0;
}
@ -202,23 +201,6 @@ void GpsL1CaPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
}
void GpsL1CaPcpsAcquisition::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
if (item_type_.compare("cshort") == 0)
{
acquisition_sc_->set_channel_queue(channel_internal_queue_);
}
else
{
acquisition_cc_->set_channel_queue(channel_internal_queue_);
}
}
void GpsL1CaPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{
gnss_synchro_ = gnss_synchro;

View File

@ -114,11 +114,6 @@ public:
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*!
* \brief Initializes acquisition algorithm.
*/
@ -175,7 +170,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
float calculate_threshold(float pfa);
};

View File

@ -83,7 +83,6 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
threshold_ = 0.0;
doppler_step_ = 0;
gnss_synchro_ = 0;
channel_internal_queue_ = 0;
}
@ -121,14 +120,6 @@ void GpsL1CaPcpsAcquisitionFineDoppler::set_doppler_step(unsigned int doppler_st
}
void GpsL1CaPcpsAcquisitionFineDoppler::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
acquisition_cc_->set_channel_queue(channel_internal_queue_);
}
void GpsL1CaPcpsAcquisitionFineDoppler::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{
gnss_synchro_ = gnss_synchro;

View File

@ -106,11 +106,6 @@ public:
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*!
* \brief Initializes acquisition algorithm.
*/
@ -150,7 +145,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
};
#endif /* GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FINE_DOPPLER_H_ */

View File

@ -86,7 +86,6 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
}
@ -125,14 +124,6 @@ void GpsL1CaPcpsAssistedAcquisition::set_doppler_step(unsigned int doppler_step)
}
void GpsL1CaPcpsAssistedAcquisition::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
acquisition_cc_->set_channel_queue(channel_internal_queue_);
}
void GpsL1CaPcpsAssistedAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{
gnss_synchro_ = gnss_synchro;

View File

@ -106,11 +106,6 @@ public:
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*!
* \brief Initializes acquisition algorithm.
*/
@ -151,7 +146,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
};
#endif /* GNSS_SDR_GPS_L1_CA_PCPS_ASSISTED_ACQUISITION_H_ */

View File

@ -105,7 +105,6 @@ GpsL1CaPcpsMultithreadAcquisition::GpsL1CaPcpsMultithreadAcquisition(
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
}
@ -173,17 +172,6 @@ void GpsL1CaPcpsMultithreadAcquisition::set_doppler_step(unsigned int doppler_st
}
void GpsL1CaPcpsMultithreadAcquisition::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_channel_queue(channel_internal_queue_);
}
}
void GpsL1CaPcpsMultithreadAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{
gnss_synchro_ = gnss_synchro;

View File

@ -105,11 +105,6 @@ public:
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*!
* \brief Initializes acquisition algorithm.
*/
@ -156,7 +151,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
float calculate_threshold(float pfa);
};

View File

@ -102,7 +102,6 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition(
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
}
@ -170,17 +169,6 @@ void GpsL1CaPcpsOpenClAcquisition::set_doppler_step(unsigned int doppler_step)
}
void GpsL1CaPcpsOpenClAcquisition::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_channel_queue(channel_internal_queue_);
}
}
void GpsL1CaPcpsOpenClAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{
gnss_synchro_ = gnss_synchro;

View File

@ -105,11 +105,6 @@ public:
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*!
* \brief Initializes acquisition algorithm.
*/
@ -156,7 +151,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
float calculate_threshold(float pfa);
};

View File

@ -136,7 +136,6 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
}
@ -204,17 +203,6 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_doppler_step(unsigned int doppler_step
}
void GpsL1CaPcpsQuickSyncAcquisition::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_channel_queue(channel_internal_queue_);
}
}
void GpsL1CaPcpsQuickSyncAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{
gnss_synchro_ = gnss_synchro;

View File

@ -107,11 +107,6 @@ public:
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*!
* \brief Initializes acquisition algorithm.
*/
@ -163,7 +158,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
float calculate_threshold(float pfa);

View File

@ -94,7 +94,6 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
bit_transition_flag_ = false;
}
@ -163,17 +162,6 @@ void GpsL1CaPcpsTongAcquisition::set_doppler_step(unsigned int doppler_step)
}
void GpsL1CaPcpsTongAcquisition::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
if (item_type_.compare("gr_complex") == 0)
{
acquisition_cc_->set_channel_queue(channel_internal_queue_);
}
}
void GpsL1CaPcpsTongAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{
gnss_synchro_ = gnss_synchro;

View File

@ -105,11 +105,6 @@ public:
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*!
* \brief Initializes acquisition algorithm.
*/
@ -162,7 +157,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
float calculate_threshold(float pfa);
};

View File

@ -117,7 +117,6 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
}
@ -187,17 +186,6 @@ void GpsL2MPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
}
void GpsL2MPcpsAcquisition::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
// if (item_type_.compare("gr_complex") == 0)
// {
acquisition_cc_->set_channel_queue(channel_internal_queue_);
// }
}
void GpsL2MPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
{
gnss_synchro_ = gnss_synchro;

View File

@ -109,11 +109,6 @@ public:
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*!
* \brief Initializes acquisition algorithm.
*/
@ -167,7 +162,6 @@ private:
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
concurrent_queue<int> *channel_internal_queue_;
float calculate_threshold(float pfa);
};

View File

@ -162,7 +162,6 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit
d_code_phase = 0;
d_doppler_freq = 0;
d_test_statistics = 0;
d_channel_internal_queue = 0;
d_CAF_vector = 0;
d_CAF_vector_I = 0;
d_CAF_vector_Q = 0;
@ -783,7 +782,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
d_state = 0;
acquisition_message = 1;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
d_sample_counter += ninput_items[0]; // sample counter
consume_each(ninput_items[0]);
break;
@ -807,7 +806,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
d_sample_counter += ninput_items[0]; // sample counter
consume_each(ninput_items[0]);
acquisition_message = 2;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
break;
}
}

View File

@ -136,7 +136,6 @@ private:
float d_test_statistics;
bool d_bit_transition_flag;
gr::msg_queue::sptr d_queue;
concurrent_queue<int> *d_channel_internal_queue;
std::ofstream d_dump_file;
bool d_active;
int d_state;
@ -245,15 +244,6 @@ public:
}
/*!
* \brief Set tracking channel internal queue.
* \param channel_internal_queue - Channel's internal blocks information queue.
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
/*!
* \brief Parallel Code Phase Search Acquisition signal processing.
*/

View File

@ -101,7 +101,6 @@ galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc(
d_code_phase = 0;
d_doppler_freq = 0;
d_test_statistics = 0;
d_channel_internal_queue = 0;
d_channel = 0;
}
@ -391,7 +390,7 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
consume_each(ninput_items[0]);
acquisition_message = 1;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
break;
}
@ -416,7 +415,7 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
consume_each(ninput_items[0]);
acquisition_message = 2;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
break;
}

View File

@ -105,7 +105,6 @@ private:
float d_input_power;
float d_test_statistics;
gr::msg_queue::sptr d_queue;
concurrent_queue<int> *d_channel_internal_queue;
std::ofstream d_dump_file;
bool d_active;
int d_state;
@ -202,16 +201,6 @@ public:
d_doppler_step = doppler_step;
}
/*!
* \brief Set tracking channel internal queue.
* \param channel_internal_queue - Channel's internal blocks information queue.
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
/*!
* \brief Parallel Code Phase Search Acquisition signal processing.
*/

View File

@ -70,6 +70,9 @@ pcps_acquisition_cc::pcps_acquisition_cc(
gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms * ( bit_transition_flag ? 2 : 1 )),
gr::io_signature::make(0, 0, sizeof(gr_complex) * sampled_ms * samples_per_ms * ( bit_transition_flag ? 2 : 1 )) )
{
this->message_port_register_out(pmt::mp("events"));
d_sample_counter = 0; // SAMPLE COUNTER
d_active = false;
d_state = 0;
@ -127,7 +130,6 @@ pcps_acquisition_cc::pcps_acquisition_cc(
d_dump_filename = dump_filename;
d_gnss_synchro = 0;
d_channel_internal_queue = 0;
d_grid_doppler_wipeoffs = 0;
}
@ -450,7 +452,9 @@ int pcps_acquisition_cc::general_work(int noutput_items,
consume_each(ninput_items[0]);
acquisition_message = 1;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
break;
}
@ -474,7 +478,8 @@ int pcps_acquisition_cc::general_work(int noutput_items,
d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
consume_each(ninput_items[0]);
acquisition_message = 2;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
break;
}

View File

@ -55,7 +55,6 @@
#include <gnuradio/block.h>
#include <gnuradio/gr_complex.h>
#include <gnuradio/fft/fft.h>
#include "concurrent_queue.h"
#include "gnss_synchro.h"
class pcps_acquisition_cc;
@ -124,7 +123,6 @@ private:
float d_test_statistics;
bool d_bit_transition_flag;
bool d_use_CFAR_algorithm_flag;
concurrent_queue<int> *d_channel_internal_queue;
std::ofstream d_dump_file;
bool d_active;
int d_state;
@ -221,15 +219,6 @@ public:
d_doppler_step = doppler_step;
}
/*!
* \brief Set tracking channel internal queue.
* \param channel_internal_queue - Channel's internal blocks information queue.
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
/*!
* \brief Parallel Code Phase Search Acquisition signal processing.
*/

View File

@ -104,7 +104,6 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(
d_code_phase = 0;
d_doppler_freq = 0;
d_test_statistics = 0;
d_channel_internal_queue = 0;
d_well_count = 0;
d_channel = 0;
}
@ -503,7 +502,7 @@ int pcps_acquisition_fine_doppler_cc::general_work(int noutput_items,
d_active = false;
// Send message to channel queue //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
d_channel_internal_queue->push(1); // 1-> positive acquisition
this->message_port_pub(pmt::mp("events"), pmt::from_long(1));
d_state = 0;
break;
case 5: // Negative_Acq
@ -519,7 +518,7 @@ int pcps_acquisition_fine_doppler_cc::general_work(int noutput_items,
d_active = false;
// Send message to channel queue //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
d_channel_internal_queue->push(2); // 2-> negative acquisition
this->message_port_pub(pmt::mp("events"), pmt::from_long(2));
d_state = 0;
break;
default:

View File

@ -130,7 +130,6 @@ private:
float d_input_power;
float d_test_statistics;
boost::shared_ptr<gr::msg_queue> d_queue;
concurrent_queue<int> *d_channel_internal_queue;
std::ofstream d_dump_file;
int d_state;
bool d_active;
@ -220,15 +219,6 @@ public:
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue.
* \param channel_internal_queue - Channel's internal blocks information queue.
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
/*!
* \brief Parallel Code Phase Search Acquisition signal processing.
*/

View File

@ -127,7 +127,6 @@ pcps_acquisition_sc::pcps_acquisition_sc(
d_dump_filename = dump_filename;
d_gnss_synchro = 0;
d_channel_internal_queue = 0;
d_grid_doppler_wipeoffs = 0;
}
@ -454,7 +453,7 @@ int pcps_acquisition_sc::general_work(int noutput_items,
consume_each(ninput_items[0]);
acquisition_message = 1;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
break;
}
@ -478,7 +477,7 @@ int pcps_acquisition_sc::general_work(int noutput_items,
d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
consume_each(ninput_items[0]);
acquisition_message = 2;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
break;
}

View File

@ -128,7 +128,6 @@ private:
float d_test_statistics;
bool d_bit_transition_flag;
bool d_use_CFAR_algorithm_flag;
concurrent_queue<int> *d_channel_internal_queue;
std::ofstream d_dump_file;
bool d_active;
int d_state;
@ -225,14 +224,6 @@ public:
d_doppler_step = doppler_step;
}
/*!
* \brief Set tracking channel internal queue.
* \param channel_internal_queue - Channel's internal blocks information queue.
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
/*!
* \brief Parallel Code Phase Search Acquisition signal processing.

View File

@ -107,7 +107,6 @@ pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc(
d_code_phase = 0;
d_doppler_freq = 0;
d_test_statistics = 0;
d_channel_internal_queue = 0;
d_well_count = 0;
d_channel = 0;
}
@ -463,7 +462,7 @@ int pcps_assisted_acquisition_cc::general_work(int noutput_items,
DLOG(INFO) << "input signal power " << d_input_power;
d_active = false;
// Send message to channel queue //0=STOP_CHANNEL 1=ACQ_SUCCESS 2=ACQ_FAIL
d_channel_internal_queue->push(1); // 1-> positive acquisition
this->message_port_pub(pmt::mp("events"), pmt::from_long(1));
free_grid_memory();
// consume samples to not block the GNU Radio flowgraph
d_sample_counter += ninput_items[0]; // sample counter
@ -481,7 +480,7 @@ int pcps_assisted_acquisition_cc::general_work(int noutput_items,
DLOG(INFO) << "input signal power " << d_input_power;
d_active = false;
// Send message to channel queue //0=STOP_CHANNEL 1=ACQ_SUCCESS 2=ACQ_FAIL
d_channel_internal_queue->push(2); // 2-> negative acquisition
this->message_port_pub(pmt::mp("events"), pmt::from_long(2));
free_grid_memory();
// consume samples to not block the GNU Radio flowgraph
d_sample_counter += ninput_items[0]; // sample counter

View File

@ -130,7 +130,6 @@ private:
float d_input_power;
float d_test_statistics;
boost::shared_ptr<gr::msg_queue> d_queue;
concurrent_queue<int> *d_channel_internal_queue;
std::ofstream d_dump_file;
int d_state;
bool d_active;
@ -220,14 +219,6 @@ public:
*/
void set_doppler_step(unsigned int doppler_step);
/*!
* \brief Set tracking channel internal queue.
* \param channel_internal_queue - Channel's internal blocks information queue.
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
/*!
* \brief Parallel Code Phase Search Acquisition signal processing.

View File

@ -113,7 +113,6 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc(
d_code_phase = 0;
d_doppler_freq = 0;
d_test_statistics = 0;
d_channel_internal_queue = 0;
d_channel = 0;
}
@ -416,7 +415,7 @@ int pcps_cccwsr_acquisition_cc::general_work(int noutput_items,
consume_each(ninput_items[0]);
acquisition_message = 1;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
break;
}
@ -441,7 +440,7 @@ int pcps_cccwsr_acquisition_cc::general_work(int noutput_items,
consume_each(ninput_items[0]);
acquisition_message = 2;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
break;
}

View File

@ -114,7 +114,6 @@ private:
float d_input_power;
float d_test_statistics;
gr::msg_queue::sptr d_queue;
concurrent_queue<int> *d_channel_internal_queue;
std::ofstream d_dump_file;
bool d_active;
int d_state;
@ -212,15 +211,6 @@ public:
d_doppler_step = doppler_step;
}
/*!
* \brief Set tracking channel internal queue.
* \param channel_internal_queue - Channel's internal blocks information queue.
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
/*!
* \brief Coherent Channel Combining With Sign Recovery Acquisition signal processing.
*/

View File

@ -118,7 +118,6 @@ pcps_multithread_acquisition_cc::pcps_multithread_acquisition_cc(
d_code_phase = 0;
d_doppler_freq = 0;
d_test_statistics = 0;
d_channel_internal_queue = 0;
d_channel = 0;
}
@ -444,7 +443,7 @@ int pcps_multithread_acquisition_cc::general_work(int noutput_items,
d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
acquisition_message = 1;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
break;
}
@ -468,7 +467,7 @@ int pcps_multithread_acquisition_cc::general_work(int noutput_items,
d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
acquisition_message = 2;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
break;
}

View File

@ -130,7 +130,6 @@ private:
float d_test_statistics;
bool d_bit_transition_flag;
gr::msg_queue::sptr d_queue;
concurrent_queue<int> *d_channel_internal_queue;
std::ofstream d_dump_file;
bool d_active;
int d_state;
@ -232,15 +231,6 @@ public:
}
/*!
* \brief Set tracking channel internal queue.
* \param channel_internal_queue - Channel's internal blocks information queue.
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
/*!
* \brief Parallel Code Phase Search Acquisition signal processing.
*/

View File

@ -796,7 +796,7 @@ int pcps_opencl_acquisition_cc::general_work(int noutput_items,
d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
acquisition_message = 1;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
break;
}
@ -820,7 +820,7 @@ int pcps_opencl_acquisition_cc::general_work(int noutput_items,
d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
acquisition_message = 2;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
break;
}

View File

@ -139,7 +139,6 @@ private:
float d_test_statistics;
bool d_bit_transition_flag;
gr::msg_queue::sptr d_queue;
concurrent_queue<int> *d_channel_internal_queue;
std::ofstream d_dump_file;
bool d_active;
int d_state;
@ -257,16 +256,6 @@ public:
d_doppler_step = doppler_step;
}
/*!
* \brief Set tracking channel internal queue.
* \param channel_internal_queue - Channel's internal blocks information queue.
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
/*!
* \brief Parallel Code Phase Search Acquisition signal processing.
*/

View File

@ -129,7 +129,6 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc(
d_code_phase = 0;
d_doppler_freq = 0;
d_test_statistics = 0;
d_channel_internal_queue = 0;
d_channel = 0;
//d_code_folded = 0;
@ -549,7 +548,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
consume_each(ninput_items[0]);
acquisition_message = 1;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
//DLOG(INFO) << "END CASE 2";
break;
}
@ -578,7 +577,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
consume_each(ninput_items[0]);
acquisition_message = 2;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
//DLOG(INFO) << "END CASE 3";
break;
}

View File

@ -146,7 +146,6 @@ private:
float d_test_statistics;
bool d_bit_transition_flag;
gr::msg_queue::sptr d_queue;
concurrent_queue<int> *d_channel_internal_queue;
std::ofstream d_dump_file;
bool d_active;
int d_state;
@ -244,15 +243,6 @@ public:
}
/*!
* \brief Set tracking channel internal queue.
* \param channel_internal_queue - Channel's internal blocks information queue.
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
/*!
* \brief Parallel Code Phase Search Acquisition signal processing.
*/

View File

@ -122,7 +122,6 @@ pcps_tong_acquisition_cc::pcps_tong_acquisition_cc(
d_code_phase = 0;
d_doppler_freq = 0;
d_test_statistics = 0;
d_channel_internal_queue = 0;
d_channel = 0;
}
@ -409,7 +408,7 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items,
consume_each(ninput_items[0]);
acquisition_message = 1;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
break;
}
@ -434,7 +433,7 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items,
consume_each(ninput_items[0]);
acquisition_message = 2;
d_channel_internal_queue->push(acquisition_message);
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
break;
}

View File

@ -124,7 +124,6 @@ private:
float d_input_power;
float d_test_statistics;
gr::msg_queue::sptr d_queue;
concurrent_queue<int> *d_channel_internal_queue;
std::ofstream d_dump_file;
bool d_active;
int d_state;
@ -222,15 +221,6 @@ public:
}
/*!
* \brief Set tracking channel internal queue.
* \param channel_internal_queue - Channel's internal blocks information queue.
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
/*!
* \brief Parallel Code Phase Search Acquisition signal processing.
*/

View File

@ -28,16 +28,16 @@
*
* -------------------------------------------------------------------------
*/
#include "channel.h"
#include <memory>
#include <boost/lexical_cast.hpp>
#include <glog/logging.h>
#include "channel_interface.h"
#include "acquisition_interface.h"
#include "tracking_interface.h"
#include "telemetry_decoder_interface.h"
#include "configuration_interface.h"
#include "channel_msg_receiver_cc.h"
using google::LogMessage;
@ -45,12 +45,18 @@ using google::LogMessage;
Channel::Channel(ConfigurationInterface *configuration, unsigned int channel,
GNSSBlockInterface *pass_through, AcquisitionInterface *acq,
TrackingInterface *trk, TelemetryDecoderInterface *nav,
std::string role, std::string implementation, boost::shared_ptr<gr::msg_queue> queue) :
pass_through_(pass_through), acq_(acq), trk_(trk), nav_(nav),
role_(role), implementation_(implementation), channel_(channel),
queue_(queue)
std::string role, std::string implementation, boost::shared_ptr<gr::msg_queue> queue)
{
stop_ = false;
pass_through_=pass_through;
acq_=acq;
trk_=trk;
nav_=nav;
role_=role;
implementation_=implementation;
channel_=channel;
queue_=queue;
acq_->set_channel(channel_);
trk_->set_channel(channel_);
nav_->set_channel(channel_);
@ -82,31 +88,24 @@ Channel::Channel(ConfigurationInterface *configuration, unsigned int channel,
repeat_ = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast<std::string>(channel_) + ".repeat_satellite", false);
DLOG(INFO) << "Channel " << channel_ << " satellite repeat = " << repeat_;
acq_->set_channel_queue(&channel_internal_queue_);
trk_->set_channel_queue(&channel_internal_queue_);
channel_fsm_.set_acquisition(acq_);
channel_fsm_.set_tracking(trk_);
channel_fsm_.set_channel(channel_);
channel_fsm_.set_queue(queue_);
connected_ = false;
message_ = 0;
gnss_signal_ = Gnss_Signal();
}
chennel_msg_rx= channel_msg_receiver_make_cc(&channel_fsm_, repeat_);
}
// Destructor
Channel::~Channel()
{
delete acq_;
delete trk_;
delete nav_;
delete pass_through_;
channel_fsm_.terminate();
}
void Channel::connect(gr::top_block_sptr top_block)
{
if (connected_)
@ -130,11 +129,15 @@ void Channel::connect(gr::top_block_sptr top_block)
// Message ports
top_block->msg_connect(nav_->get_left_block(),pmt::mp("preamble_timestamp_s"),trk_->get_right_block(),pmt::mp("preamble_timestamp_s"));
DLOG(INFO) << "MSG FEEDBACK CHANNEL telemetry_decoder -> tracking";
//std::cout<<"has port: "<<trk_->get_right_block()->has_msg_port(pmt::mp("events"))<<std::endl;
top_block->msg_connect(acq_->get_right_block(),pmt::mp("events"), chennel_msg_rx,pmt::mp("events"));
top_block->msg_connect(trk_->get_right_block(),pmt::mp("events"), chennel_msg_rx,pmt::mp("events"));
connected_ = true;
}
void Channel::disconnect(gr::top_block_sptr top_block)
{
if (!connected_)
@ -152,22 +155,17 @@ void Channel::disconnect(gr::top_block_sptr top_block)
connected_ = false;
}
gr::basic_block_sptr Channel::get_left_block()
{
return pass_through_->get_left_block();
}
gr::basic_block_sptr Channel::get_right_block()
{
return nav_->get_right_block();
}
void Channel::set_signal(const Gnss_Signal& gnss_signal)
{
gnss_signal_ = gnss_signal;
@ -181,90 +179,7 @@ void Channel::set_signal(const Gnss_Signal& gnss_signal)
nav_->set_satellite(gnss_signal_.get_satellite());
}
void Channel::start_acquisition()
{
channel_fsm_.Event_start_acquisition();
}
void Channel::start()
{
ch_thread_ = std::thread(&Channel::run, this);
}
void Channel::run()
{
while (!stop_)
{
channel_internal_queue_.wait_and_pop(message_);
process_channel_messages();
}
}
void Channel::standby()
{
channel_fsm_.Event_failed_tracking_standby();
}
/*
* Set stop_ to true and blocks the calling thread until
* the thread of the constructor has completed
*/
void Channel::stop()
{
stop_ = true;
channel_internal_queue_.push(0); //message to stop channel
/* When the std::thread object that represents a thread of execution
* is destroyed the thread becomes detached. Once a thread is detached,
* it will continue executing until the invocation of the function or
* callable object supplied on construction has completed,
* or the program is terminated. In order to wait for a thread of
* execution to finish, the join() member function of
* the std::thread object must be used. join() will block the calling
* thread until the thread represented by the std::thread object
* has completed.
*/
ch_thread_.join();
}
void Channel::process_channel_messages()
{
switch (message_)
{
case 0:
DLOG(INFO) << "Stop channel " << channel_;
break;
case 1:
DLOG(INFO) << "Channel " << channel_ << " ACQ SUCCESS satellite " <<
gnss_synchro_.System << " " << gnss_synchro_.PRN;
channel_fsm_.Event_valid_acquisition();
break;
case 2:
DLOG(INFO) << "Channel " << channel_
<< " ACQ FAILED satellite " << gnss_synchro_.System << " " << gnss_synchro_.PRN;
if (repeat_ == true)
{
channel_fsm_.Event_failed_acquisition_repeat();
}
else
{
channel_fsm_.Event_failed_acquisition_no_repeat();
}
break;
default:
LOG(WARNING) << "Default case, invalid message.";
break;
}
}

View File

@ -35,14 +35,14 @@
#ifndef GNSS_SDR_CHANNEL_H_
#define GNSS_SDR_CHANNEL_H_
#include <memory>
#include <string>
#include <thread>
#include <gnuradio/msg_queue.h>
#include <gnuradio/block.h>
#include "channel_interface.h"
#include "channel_fsm.h"
#include "concurrent_queue.h"
#include "gnss_synchro.h"
#include "channel_msg_receiver_cc.h"
class ConfigurationInterface;
class AcquisitionInterface;
@ -57,6 +57,7 @@ class TelemetryDecoderInterface;
*/
class Channel: public ChannelInterface
{
public:
//! Constructor
Channel(ConfigurationInterface *configuration, unsigned int channel,
@ -81,15 +82,12 @@ public:
TelemetryDecoderInterface* telemetry(){ return nav_; }
void start_acquisition(); //!< Start the State Machine
void set_signal(const Gnss_Signal& gnss_signal_); //!< Sets the channel GNSS signal
void start(); //!< Start the thread
void standby();
/*!
* \brief Set stop_ to true and blocks the calling thread until
* the thread of the constructor has completed
*/
void stop();
void msg_handler_events(pmt::pmt_t msg);
private:
channel_msg_receiver_cc_sptr chennel_msg_rx;
GNSSBlockInterface *pass_through_;
AcquisitionInterface *acq_;
TrackingInterface *trk_;
@ -100,15 +98,9 @@ private:
Gnss_Synchro gnss_synchro_;
Gnss_Signal gnss_signal_;
bool connected_;
bool stop_;
int message_;
bool repeat_;
ChannelFsm channel_fsm_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> channel_internal_queue_;
std::thread ch_thread_;
void run();
void process_channel_messages();
};
#endif /*GNSS_SDR_CHANNEL_H_*/

View File

@ -16,7 +16,10 @@
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
#
set(CHANNEL_FSM_SOURCES channel_fsm.cc )
set(CHANNEL_FSM_SOURCES
channel_fsm.cc
channel_msg_receiver_cc.cc
)
include_directories(
$(CMAKE_CURRENT_SOURCE_DIR)

View File

@ -92,10 +92,16 @@ public:
channel_tracking_fsm_S2(my_context ctx) : my_base(ctx)
{
//std::cout << "Enter Channel_tracking_S2 " << std::endl;
//std::cout << "Enter Channel_tracking_S2 " << std::endl;
context<ChannelFsm> ().start_tracking();
}
~channel_tracking_fsm_S2()
{
//std::cout << "Exit Channel_tracking_S2 " << std::endl;
context<ChannelFsm> ().notify_stop_tracking();
}
};
@ -223,3 +229,11 @@ void ChannelFsm::request_satellite()
}
}
void ChannelFsm::notify_stop_tracking()
{
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (queue_ != gr::msg_queue::make())
{
queue_->handle(cmf->GetQueueMessage(channel_, 2));
}
}

View File

@ -64,6 +64,7 @@ public:
void start_acquisition();
void start_tracking();
void request_satellite();
void notify_stop_tracking();
//FSM EVENTS
void Event_start_acquisition();

View File

@ -0,0 +1,94 @@
/*!
* \file channel_msg_receiver_cc.cc
* \brief GNURadio block that receives asynchronous channel messages from acquisition and tracking blocks
* \author Javier Arribas, 2016. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2016 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#include "channel_msg_receiver_cc.h"
#include <gnuradio/gr_complex.h>
#include <gnuradio/io_signature.h>
#include <glog/logging.h>
using google::LogMessage;
channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(ChannelFsm* channel_fsm, bool repeat)
{
return channel_msg_receiver_cc_sptr(new channel_msg_receiver_cc(channel_fsm, repeat));
}
void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg)
{
try {
long int message=pmt::to_long(msg);
switch (message)
{
case 1: //positive acquisition
//DLOG(INFO) << "Channel " << channel_ << " ACQ SUCCESS satellite " <<
// gnss_synchro_.System << " " << gnss_synchro_.PRN;
d_channel_fsm->Event_valid_acquisition();
break;
case 2: //negative acquisition
//DLOG(INFO) << "Channel " << channel_
// << " ACQ FAILED satellite " << gnss_synchro_.System << " " << gnss_synchro_.PRN;
if (d_repeat == true)
{
d_channel_fsm->Event_failed_acquisition_repeat();
}
else
{
d_channel_fsm->Event_failed_acquisition_no_repeat();
}
break;
case 3: // tracking loss of lock event
d_channel_fsm->Event_failed_tracking_standby();
break;
default:
LOG(WARNING) << "Default case, invalid message.";
break;
}
}catch(boost::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_telemetry Bad any cast!\n";
}
}
channel_msg_receiver_cc::channel_msg_receiver_cc(ChannelFsm* channel_fsm, bool repeat) :
gr::block("channel_msg_receiver_cc", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
{
this->message_port_register_in(pmt::mp("events"));
this->set_msg_handler(pmt::mp("events"), boost::bind(&channel_msg_receiver_cc::msg_handler_events, this, _1));
d_channel_fsm=channel_fsm;
d_repeat=repeat;
}
channel_msg_receiver_cc::~channel_msg_receiver_cc()
{}

View File

@ -0,0 +1,60 @@
/*!
* \file channel_msg_receiver_cc.h
* \brief GNURadio block that receives asynchronous channel messages from acquisition and tracking blocks
* \author Javier Arribas, 2016. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2016 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_CHANNEL_MSG_RECEIVER_CC_H
#define GNSS_SDR_CHANNEL_MSG_RECEIVER_CC_H
#include <gnuradio/block.h>
#include "channel_fsm.h"
class channel_msg_receiver_cc;
typedef boost::shared_ptr<channel_msg_receiver_cc> channel_msg_receiver_cc_sptr;
channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(ChannelFsm* channel_fsm, bool repeat);
/*!
* \brief This class implements a block that computes the PVT solution with Galileo E1 signals
*/
class channel_msg_receiver_cc : public gr::block
{
private:
ChannelFsm* d_channel_fsm;
bool d_repeat; // todo: change FSM to include repeat value
friend channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(ChannelFsm* channel_fsm, bool repeat);
void msg_handler_events(pmt::pmt_t msg);
channel_msg_receiver_cc(ChannelFsm* channel_fsm, bool repeat);
public:
~channel_msg_receiver_cc (); //!< Default destructor
};
#endif

View File

@ -238,7 +238,6 @@ GpsL1CaSubframeFsm::GpsL1CaSubframeFsm()
d_nav.reset();
i_channel_ID = 0;
i_satellite_PRN = 0;
d_almanac_queue = 0;
d_preamble_time_ms = 0;
d_subframe_ID=0;
d_flag_new_subframe=false;

View File

@ -71,8 +71,6 @@ public:
int i_channel_ID; //!< Channel id
unsigned int i_satellite_PRN; //!< Satellite PRN number
concurrent_queue<Gps_Almanac> *d_almanac_queue; //!< Almanac queue
Gps_Navigation_Message d_nav; //!< GPS L1 C/A navigation message object
// GPS SV and System parameters

View File

@ -100,7 +100,6 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
}
channel_ = 0;
channel_internal_queue_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
}
@ -122,17 +121,6 @@ void GalileoE1DllPllVemlTracking::set_channel(unsigned int channel)
tracking_->set_channel(channel);
}
/*
* Set tracking channel internal queue
*/
void GalileoE1DllPllVemlTracking::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
tracking_->set_channel_queue(channel_internal_queue_);
}
void GalileoE1DllPllVemlTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{

View File

@ -93,10 +93,6 @@ public:
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
void start_tracking();
@ -108,7 +104,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
};
#endif // GNSS_SDR_GALILEO_E1_DLL_PLL_VEML_TRACKING_H_

View File

@ -100,7 +100,6 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking(
LOG(WARNING) << item_type << " unknown tracking item type.";
}
channel_ = 0;
channel_internal_queue_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
}
@ -123,17 +122,6 @@ void GalileoE1TcpConnectorTracking::set_channel(unsigned int channel)
tracking_->set_channel(channel);
}
/*
* Set tracking channel internal queue
*/
void GalileoE1TcpConnectorTracking::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
tracking_->set_channel_queue(channel_internal_queue_);
}
void GalileoE1TcpConnectorTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{

View File

@ -94,10 +94,6 @@ public:
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
void start_tracking();
@ -109,7 +105,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
};
#endif // GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_H_

View File

@ -107,7 +107,6 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
LOG(WARNING) << item_type << " unknown tracking item type.";
}
channel_ = 0;
channel_internal_queue_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
}
@ -130,15 +129,6 @@ void GalileoE5aDllPllTracking::set_channel(unsigned int channel)
tracking_->set_channel(channel);
}
/*
* Set tracking channel internal queue
*/
void GalileoE5aDllPllTracking::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
tracking_->set_channel_queue(channel_internal_queue_);
}
void GalileoE5aDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{

View File

@ -92,10 +92,6 @@ public:
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
void start_tracking();
@ -107,7 +103,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
};
#endif /* GNSS_SDR_GALILEO_E5A_DLL_PLL_TRACKING_H_ */

View File

@ -122,7 +122,6 @@ GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking(
LOG(WARNING) << item_type_ << " unknown tracking item type.";
}
channel_ = 0;
channel_internal_queue_ = 0;
}
@ -168,28 +167,6 @@ void GpsL1CaDllPllCAidTracking::set_channel(unsigned int channel)
}
}
/*
* Set tracking channel internal queue
*/
void GpsL1CaDllPllCAidTracking::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
if (item_type_.compare("gr_complex") == 0)
{
tracking_cc->set_channel_queue(channel_internal_queue_);
}
else if (item_type_.compare("cshort") == 0)
{
tracking_sc->set_channel_queue(channel_internal_queue_);
}
else
{
LOG(WARNING) << item_type_ << " unknown tracking item type";
}
}
void GpsL1CaDllPllCAidTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
if (item_type_.compare("gr_complex") == 0)

View File

@ -94,10 +94,6 @@ public:
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
void start_tracking();
@ -111,7 +107,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
};
#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_H_

View File

@ -95,7 +95,6 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
LOG(WARNING) << item_type << " unknown tracking item type.";
}
channel_ = 0;
channel_internal_queue_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
}
@ -120,17 +119,6 @@ void GpsL1CaDllPllTracking::set_channel(unsigned int channel)
}
/*
* Set tracking channel internal queue
*/
void GpsL1CaDllPllTracking::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
tracking_->set_channel_queue(channel_internal_queue_);
}
void GpsL1CaDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);

View File

@ -93,10 +93,6 @@ public:
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
void start_tracking();
@ -108,7 +104,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
};
#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_H_

View File

@ -96,7 +96,6 @@ GpsL1CaDllPllTrackingGPU::GpsL1CaDllPllTrackingGPU(
LOG(WARNING) << item_type << " unknown tracking item type.";
}
channel_ = 0;
channel_internal_queue_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
}
@ -119,16 +118,6 @@ void GpsL1CaDllPllTrackingGPU::set_channel(unsigned int channel)
tracking_->set_channel(channel);
}
/*
* Set tracking channel internal queue
*/
void GpsL1CaDllPllTrackingGPU::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
tracking_->set_channel_queue(channel_internal_queue_);
}
void GpsL1CaDllPllTrackingGPU::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
tracking_->set_gnss_synchro(p_gnss_synchro);

View File

@ -91,10 +91,6 @@ public:
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
void start_tracking();
@ -106,7 +102,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
};
#endif // GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_GPU_H_

View File

@ -93,7 +93,6 @@ GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking(
}
channel_ = 0;
channel_internal_queue_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
}
@ -116,15 +115,6 @@ void GpsL1CaTcpConnectorTracking::set_channel(unsigned int channel)
tracking_->set_channel(channel);
}
/*
* Set tracking channel internal queue
*/
void GpsL1CaTcpConnectorTracking::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
tracking_->set_channel_queue(channel_internal_queue_);
}
void GpsL1CaTcpConnectorTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{

View File

@ -94,10 +94,6 @@ public:
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
void start_tracking();
@ -112,7 +108,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
};
#endif // GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_H_

View File

@ -95,7 +95,6 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking(
LOG(WARNING) << item_type << " unknown tracking item type.";
}
channel_ = 0;
channel_internal_queue_ = 0;
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
}
@ -118,15 +117,6 @@ void GpsL2MDllPllTracking::set_channel(unsigned int channel)
tracking_->set_channel(channel);
}
/*
* Set tracking channel internal queue
*/
void GpsL2MDllPllTracking::set_channel_queue(
concurrent_queue<int> *channel_internal_queue)
{
channel_internal_queue_ = channel_internal_queue;
tracking_->set_channel_queue(channel_internal_queue_);
}
void GpsL2MDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{

View File

@ -93,11 +93,6 @@ public:
*/
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
/*!
* \brief Set tracking channel internal queue
*/
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
void start_tracking();
private:
@ -108,7 +103,6 @@ private:
unsigned int in_streams_;
unsigned int out_streams_;
boost::shared_ptr<gr::msg_queue> queue_;
concurrent_queue<int> *channel_internal_queue_;
};
#endif // GNSS_SDR_gps_l2_m_dll_pll_tracking_H_

View File

@ -107,6 +107,9 @@ galileo_e1_dll_pll_veml_tracking_cc::galileo_e1_dll_pll_veml_tracking_cc(
// Telemetry bit synchronization message port input
this->message_port_register_in(pmt::mp("preamble_timestamp_s"));
this->set_relative_rate(1.0 / vector_length);
this->message_port_register_out(pmt::mp("events"));
// initialize internal vars
d_queue = queue;
d_dump = dump;
@ -190,7 +193,6 @@ galileo_e1_dll_pll_veml_tracking_cc::galileo_e1_dll_pll_veml_tracking_cc(
*d_Late = gr_complex(0,0);
*d_Very_Late = gr_complex(0,0);
d_channel_internal_queue = 0;
d_acquisition_gnss_synchro = 0;
d_channel = 0;
d_acq_code_phase_samples = 0.0;
@ -383,11 +385,14 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri
{
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (d_queue != gr::msg_queue::sptr())
{
d_queue->handle(cmf->GetQueueMessage(d_channel, 2));
}
pmt::pmt_t value = pmt::from_long(3);//3 -> loss of lock
this->message_port_pub(pmt::mp("events"), value);
// std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
// if (d_queue != gr::msg_queue::sptr())
// {
// d_queue->handle(cmf->GetQueueMessage(d_channel, 2));
// }
d_carrier_lock_fail_counter = 0;
d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine
}
@ -523,12 +528,6 @@ void galileo_e1_dll_pll_veml_tracking_cc::set_channel(unsigned int channel)
void galileo_e1_dll_pll_veml_tracking_cc::set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
void galileo_e1_dll_pll_veml_tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{

View File

@ -71,7 +71,6 @@ public:
void set_channel(unsigned int channel);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void start_tracking();
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*!
* \brief Code DLL + carrier PLL according to the algorithms described in:
@ -113,7 +112,6 @@ private:
// tracking configuration vars
boost::shared_ptr<gr::msg_queue> d_queue;
concurrent_queue<int> *d_channel_internal_queue;
unsigned int d_vector_length;
bool d_dump;

View File

@ -187,7 +187,6 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc(
d_carrier_lock_threshold = CARRIER_LOCK_THRESHOLD;
systemName["E"] = std::string("Galileo");
d_channel_internal_queue = 0;
d_acquisition_gnss_synchro = 0;
d_channel = 0;
d_next_rem_code_phase_samples = 0;
@ -541,12 +540,6 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::set_channel(unsigned int channel)
void Galileo_E1_Tcp_Connector_Tracking_cc::set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
void Galileo_E1_Tcp_Connector_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
d_acquisition_gnss_synchro = p_gnss_synchro;

View File

@ -80,7 +80,6 @@ public:
void set_channel(unsigned int channel);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void start_tracking();
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
int general_work (int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
@ -118,7 +117,6 @@ private:
// tracking configuration vars
boost::shared_ptr<gr::msg_queue> d_queue;
concurrent_queue<int> *d_channel_internal_queue;
unsigned int d_vector_length;
bool d_dump;

View File

@ -193,7 +193,6 @@ Galileo_E5a_Dll_Pll_Tracking_cc::Galileo_E5a_Dll_Pll_Tracking_cc(
d_carrier_lock_fail_counter = 0;
d_carrier_lock_threshold = CARRIER_LOCK_THRESHOLD;
d_channel_internal_queue = 0;
d_acquisition_gnss_synchro = 0;
d_channel = 0;
tmp_E = 0;
@ -754,13 +753,6 @@ void Galileo_E5a_Dll_Pll_Tracking_cc::set_channel(unsigned int channel)
}
void Galileo_E5a_Dll_Pll_Tracking_cc::set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
void Galileo_E5a_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
d_acquisition_gnss_synchro = p_gnss_synchro;

View File

@ -80,7 +80,6 @@ public:
void set_channel(unsigned int channel);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void start_tracking();
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
int general_work (int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
@ -117,7 +116,6 @@ private:
void acquire_secondary();
// tracking configuration vars
boost::shared_ptr<gr::msg_queue> d_queue;
concurrent_queue<int> *d_channel_internal_queue;
unsigned int d_vector_length;
int d_current_ti_ms;
int d_ti_ms;

View File

@ -122,7 +122,7 @@ gps_l1_ca_dll_pll_c_aid_tracking_cc::gps_l1_ca_dll_pll_c_aid_tracking_cc(
this->set_msg_handler(pmt::mp("preamble_timestamp_s"),
boost::bind(&gps_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index, this, _1));
this->message_port_register_out(pmt::mp("events"));
// initialize internal vars
d_queue = queue;
d_dump = dump;
@ -193,7 +193,6 @@ gps_l1_ca_dll_pll_c_aid_tracking_cc::gps_l1_ca_dll_pll_c_aid_tracking_cc(
set_relative_rate(1.0 / static_cast<double>(d_vector_length));
d_channel_internal_queue = 0;
d_acquisition_gnss_synchro = 0;
d_channel = 0;
d_acq_code_phase_samples = 0.0;
@ -549,11 +548,14 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri
{
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (d_queue != gr::msg_queue::sptr())
{
d_queue->handle(cmf->GetQueueMessage(d_channel, 2));
}
pmt::pmt_t value = pmt::from_long(3);//3 -> loss of lock
this->message_port_pub(pmt::mp("events"), value);
//std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
//if (d_queue != gr::msg_queue::sptr())
// {
// d_queue->handle(cmf->GetQueueMessage(d_channel, 2));
// }
d_carrier_lock_fail_counter = 0;
d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine
}
@ -691,11 +693,6 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::set_channel(unsigned int channel)
}
void gps_l1_ca_dll_pll_c_aid_tracking_cc::set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
void gps_l1_ca_dll_pll_c_aid_tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{

View File

@ -83,7 +83,6 @@ public:
void set_channel(unsigned int channel);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void start_tracking();
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
int general_work (int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
@ -120,7 +119,6 @@ private:
// tracking configuration vars
boost::shared_ptr<gr::msg_queue> d_queue;
concurrent_queue<int> *d_channel_internal_queue;
unsigned int d_vector_length;
bool d_dump;

View File

@ -175,7 +175,6 @@ gps_l1_ca_dll_pll_c_aid_tracking_sc::gps_l1_ca_dll_pll_c_aid_tracking_sc(
set_relative_rate(1.0 / (static_cast<double>(d_vector_length) * 2.0));
d_channel_internal_queue = 0;
d_acquisition_gnss_synchro = 0;
d_channel = 0;
d_acq_code_phase_samples = 0.0;
@ -552,12 +551,6 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::set_channel(unsigned int channel)
}
void gps_l1_ca_dll_pll_c_aid_tracking_sc::set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
void gps_l1_ca_dll_pll_c_aid_tracking_sc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
d_acquisition_gnss_synchro = p_gnss_synchro;

View File

@ -84,7 +84,6 @@ public:
void set_channel(unsigned int channel);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void start_tracking();
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
int general_work (int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
@ -119,7 +118,6 @@ private:
// tracking configuration vars
boost::shared_ptr<gr::msg_queue> d_queue;
concurrent_queue<int> *d_channel_internal_queue;
unsigned int d_vector_length;
bool d_dump;

View File

@ -105,6 +105,9 @@ Gps_L1_Ca_Dll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Pll_Tracking_cc(
{
// Telemetry bit synchronization message port input
this->message_port_register_in(pmt::mp("preamble_timestamp_s"));
this->message_port_register_out(pmt::mp("events"));
// initialize internal vars
d_queue = queue;
d_dump = dump;
@ -168,7 +171,6 @@ Gps_L1_Ca_Dll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Pll_Tracking_cc(
systemName["G"] = std::string("GPS");
systemName["S"] = std::string("SBAS");
d_channel_internal_queue = 0;
d_acquisition_gnss_synchro = 0;
d_channel = 0;
d_acq_code_phase_samples = 0.0;
@ -406,11 +408,13 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__
{
std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl;
LOG(INFO) << "Loss of lock in channel " << d_channel << "!";
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (d_queue != gr::msg_queue::sptr())
{
d_queue->handle(cmf->GetQueueMessage(d_channel, 2));
}
pmt::pmt_t value = pmt::from_long(3);//3 -> loss of lock
this->message_port_pub(pmt::mp("events"), value);
// std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
// if (d_queue != gr::msg_queue::sptr())
// {
// d_queue->handle(cmf->GetQueueMessage(d_channel, 2));
// }
d_carrier_lock_fail_counter = 0;
d_enable_tracking = false; // TODO: check if disabling tracking is consistent with the channel state machine
}
@ -535,12 +539,6 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::set_channel(unsigned int channel)
}
void Gps_L1_Ca_Dll_Pll_Tracking_cc::set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
void Gps_L1_Ca_Dll_Pll_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
d_acquisition_gnss_synchro = p_gnss_synchro;

View File

@ -77,7 +77,6 @@ public:
void set_channel(unsigned int channel);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void start_tracking();
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
int general_work (int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
@ -108,7 +107,6 @@ private:
// tracking configuration vars
boost::shared_ptr<gr::msg_queue> d_queue;
concurrent_queue<int> *d_channel_internal_queue;
unsigned int d_vector_length;
bool d_dump;

View File

@ -170,7 +170,6 @@ Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc(
set_relative_rate(1.0 / (static_cast<double>(d_vector_length) * 2.0));
d_channel_internal_queue = 0;
d_acquisition_gnss_synchro = 0;
d_channel = 0;
d_acq_code_phase_samples = 0.0;
@ -557,10 +556,6 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::set_channel(unsigned int channel)
}
}
void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{

View File

@ -76,7 +76,6 @@ public:
void set_channel(unsigned int channel);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void start_tracking();
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
int general_work (int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
@ -109,7 +108,6 @@ private:
// tracking configuration vars
boost::shared_ptr<gr::msg_queue> d_queue;
concurrent_queue<int> *d_channel_internal_queue;
unsigned int d_vector_length;
bool d_dump;

View File

@ -179,7 +179,6 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc(
systemName["E"] = std::string("Galileo");
systemName["C"] = std::string("Compass");
d_channel_internal_queue = 0;
d_acquisition_gnss_synchro = 0;
d_channel = 0;
d_next_rem_code_phase_samples = 0;
@ -588,12 +587,6 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_channel(unsigned int channel)
}
void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
d_acquisition_gnss_synchro = p_gnss_synchro;

View File

@ -75,7 +75,6 @@ public:
void set_channel(unsigned int channel);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void start_tracking();
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
/*
* \brief just like gr_block::general_work, only this arranges to call consume_each for you
@ -108,7 +107,6 @@ private:
// tracking configuration vars
boost::shared_ptr<gr::msg_queue> d_queue;
concurrent_queue<int> *d_channel_internal_queue;
unsigned int d_vector_length;
bool d_dump;

View File

@ -174,7 +174,6 @@ gps_l2_m_dll_pll_tracking_cc::gps_l2_m_dll_pll_tracking_cc(
set_relative_rate(1.0/((double)d_vector_length*2));
//set_min_output_buffer((long int)300);
d_channel_internal_queue = 0;
d_acquisition_gnss_synchro = 0;
d_channel = 0;
d_acq_code_phase_samples = 0.0;
@ -540,12 +539,6 @@ void gps_l2_m_dll_pll_tracking_cc::set_channel(unsigned int channel)
void gps_l2_m_dll_pll_tracking_cc::set_channel_queue(concurrent_queue<int> *channel_internal_queue)
{
d_channel_internal_queue = channel_internal_queue;
}
void gps_l2_m_dll_pll_tracking_cc::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
{
d_acquisition_gnss_synchro = p_gnss_synchro;

View File

@ -77,7 +77,6 @@ public:
void set_channel(unsigned int channel);
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
void start_tracking();
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
int general_work (int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
@ -108,7 +107,6 @@ private:
// tracking configuration vars
boost::shared_ptr<gr::msg_queue> d_queue;
concurrent_queue<int> *d_channel_internal_queue;
unsigned int d_vector_length;
bool d_dump;

View File

@ -59,7 +59,6 @@ public:
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;
virtual void set_channel_queue(concurrent_queue<int> *channel_internal_queue) = 0;
virtual void init() = 0;
virtual void set_local_code() = 0;
virtual signed int mag() = 0;

View File

@ -54,9 +54,6 @@ public:
virtual Gnss_Signal get_signal() const = 0;
virtual void start_acquisition() = 0;
virtual void set_signal(const Gnss_Signal&) = 0;
virtual void start() = 0;
virtual void standby() = 0;
virtual void stop() = 0;
};
#endif /* GNSS_SDR_CHANNEL_INTERFACE_H_ */

View File

@ -57,7 +57,6 @@ public:
virtual void start_tracking() = 0;
virtual void set_gnss_synchro(Gnss_Synchro* gnss_synchro) = 0;
virtual void set_channel(unsigned int channel) = 0;
virtual void set_channel_queue(concurrent_queue<int> *channel_internal_queue) = 0;
};
#endif /* GNSS_SDR_TRACKING_INTERFACE_H_ */

View File

@ -140,7 +140,7 @@ void ControlThread::run()
keyboard_thread_.timed_join(boost::posix_time::seconds(1));
#endif
#ifndef OLD_BOOST
keyboard_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50));
keyboard_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000));
#endif
LOG(INFO) << "Flowgraph stopped";
@ -597,5 +597,6 @@ void ControlThread::keyboard_listener()
}
read_keys = false;
}
usleep(500000);
}
}

View File

@ -35,6 +35,7 @@
#include "gnss_flowgraph.h"
#include "unistd.h"
#include <memory>
#include <algorithm>
#include <exception>
#include <iostream>
@ -90,12 +91,12 @@ void GNSSFlowgraph::start()
void GNSSFlowgraph::stop()
{
for (unsigned int i = 0; i < channels_count_; i++)
{
channels_.at(i)->stop();
LOG(INFO) << "Channel " << i << " in state " << channels_state_[i];
}
LOG(INFO) << "Threads finished. Return to main program.";
// for (unsigned int i = 0; i < channels_count_; i++)
// {
// channels_.at(i)->stop_channel();
// LOG(INFO) << "Channel " << i << " in state " << channels_state_[i];
// }
// LOG(INFO) << "Threads finished. Return to main program.";
top_block_->stop();
running_ = false;
}
@ -303,7 +304,7 @@ void GNSSFlowgraph::connect()
}
channels_.at(i)->set_signal(available_GNSS_signals_.front());
LOG(INFO) << "Channel " << i << " assigned to " << available_GNSS_signals_.front();
channels_.at(i)->start();
//channels_.at(i)->start_channel();
if (channels_state_[i] == 1)
{
@ -342,8 +343,6 @@ void GNSSFlowgraph::connect()
}
void GNSSFlowgraph::wait()
{
if (!running_)
@ -389,16 +388,8 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
}
channels_.at(who)->set_signal(available_GNSS_signals_.front());
available_GNSS_signals_.pop_front();
//todo: This is a provisional bug fix to avoid random channel state machine deadlock caused by an incorrect sequence of events
// Correct sequence: start_acquisition() is triggered after the negative acquisition driven by the process_channel_messages() thread inside channel class
// Incorrect sequence: due to thread concurrency, some times start_acquisition is triggered BEFORE the last negative_acquisition notification, thus producing a deadlock
// a short delay here (5ms) apparently reduces the chances to enter in this deadlock
usleep(5000);
channels_.at(who)->start_acquisition();
break;
// TODO: Tracking messages
case 1:
LOG(INFO) << "Channel " << who << " ACQ SUCCESS satellite " << channels_.at(who)->get_signal().get_satellite();
channels_state_[who] = 2;
@ -438,7 +429,6 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
else
{
channels_state_[who] = 0;
channels_.at(who)->standby();
available_GNSS_signals_.push_back( channels_.at(who)->get_signal() );
}
@ -478,7 +468,7 @@ void GNSSFlowgraph::init()
/*
* Instantiates the receiver blocks
*/
std::shared_ptr<GNSSBlockFactory> block_factory_ = std::make_shared<GNSSBlockFactory>();
std::unique_ptr<GNSSBlockFactory> block_factory_(new GNSSBlockFactory());
// 1. read the number of RF front-ends available (one file_source per RF front-end)
sources_count_ = configuration_->property("Receiver.sources_count", 1);
@ -532,6 +522,7 @@ void GNSSFlowgraph::init()
std::shared_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> channels = block_factory_->GetChannels(configuration_, queue_);
//todo:check smart pointer coherence...
channels_count_ = channels->size();
for (unsigned int i = 0; i < channels_count_; i++)
{

Some files were not shown because too many files have changed in this diff Show More