mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-08-30 17:38:00 +00:00
Merge branch 'pedromiguelcp-fix/acquisition-prn-reassignment' into next
This commit is contained in:
@@ -571,7 +571,7 @@ int GNSSFlowgraph::connect_desktop_flowgraph()
|
|||||||
for (int i = 0; i < channels_count_; i++)
|
for (int i = 0; i < channels_count_; i++)
|
||||||
{
|
{
|
||||||
LOG(INFO) << "Channel " << i << " assigned to " << channels_.at(i)->get_signal();
|
LOG(INFO) << "Channel " << i << " assigned to " << channels_.at(i)->get_signal();
|
||||||
if (channels_state_[i] == 1)
|
if (channels_state_[i] == 2)
|
||||||
{
|
{
|
||||||
#if ENABLE_FPGA
|
#if ENABLE_FPGA
|
||||||
if (enable_fpga_offloading_)
|
if (enable_fpga_offloading_)
|
||||||
@@ -1696,7 +1696,7 @@ void GNSSFlowgraph::acquisition_manager(unsigned int who)
|
|||||||
{
|
{
|
||||||
LOG(WARNING) << e.what();
|
LOG(WARNING) << e.what();
|
||||||
}
|
}
|
||||||
if ((acq_channels_count_ < max_acq_channels_) && (channels_state_[current_channel] == 0))
|
if ((acq_channels_count_ < max_acq_channels_) && (channels_state_[current_channel] <= 1))
|
||||||
{
|
{
|
||||||
bool is_primary_freq = true;
|
bool is_primary_freq = true;
|
||||||
bool assistance_available = false;
|
bool assistance_available = false;
|
||||||
@@ -1705,7 +1705,7 @@ void GNSSFlowgraph::acquisition_manager(unsigned int who)
|
|||||||
float estimated_doppler;
|
float estimated_doppler;
|
||||||
double RX_time;
|
double RX_time;
|
||||||
|
|
||||||
if (sat_ == 0)
|
if ((sat_ == 0) && (channels_state_[current_channel] == 0))
|
||||||
{
|
{
|
||||||
gnss_signal = search_next_signal(channels_[current_channel]->get_signal().get_signal_str(),
|
gnss_signal = search_next_signal(channels_[current_channel]->get_signal().get_signal_str(),
|
||||||
is_primary_freq,
|
is_primary_freq,
|
||||||
@@ -1723,7 +1723,7 @@ void GNSSFlowgraph::acquisition_manager(unsigned int who)
|
|||||||
|
|
||||||
if (start_acquisition == true)
|
if (start_acquisition == true)
|
||||||
{
|
{
|
||||||
channels_state_[current_channel] = 1;
|
channels_state_[current_channel] = 2;
|
||||||
acq_channels_count_++;
|
acq_channels_count_++;
|
||||||
DLOG(INFO) << "Channel " << current_channel
|
DLOG(INFO) << "Channel " << current_channel
|
||||||
<< " Starting acquisition " << channels_[current_channel]->get_signal().get_satellite()
|
<< " Starting acquisition " << channels_[current_channel]->get_signal().get_satellite()
|
||||||
@@ -1830,7 +1830,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
|
|||||||
// If the satellite is in the list of available ones, remove it.
|
// If the satellite is in the list of available ones, remove it.
|
||||||
remove_signal(gs);
|
remove_signal(gs);
|
||||||
|
|
||||||
channels_state_[who] = 2;
|
channels_state_[who] = 3;
|
||||||
if (acq_channels_count_ > 0)
|
if (acq_channels_count_ > 0)
|
||||||
{
|
{
|
||||||
acq_channels_count_--;
|
acq_channels_count_--;
|
||||||
@@ -1845,7 +1845,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
|
|||||||
if (acq_channels_count_ < max_acq_channels_)
|
if (acq_channels_count_ < max_acq_channels_)
|
||||||
{
|
{
|
||||||
// try to acquire the same satellite
|
// try to acquire the same satellite
|
||||||
channels_state_[who] = 1;
|
channels_state_[who] = 2;
|
||||||
acq_channels_count_++;
|
acq_channels_count_++;
|
||||||
DLOG(INFO) << "Channel " << who << " Starting acquisition " << gs.get_satellite() << ", Signal " << gs.get_signal_str();
|
DLOG(INFO) << "Channel " << who << " Starting acquisition " << gs.get_satellite() << ", Signal " << gs.get_signal_str();
|
||||||
channels_[who]->set_signal(channels_[who]->get_signal());
|
channels_[who]->set_signal(channels_[who]->get_signal());
|
||||||
@@ -1878,7 +1878,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
|
|||||||
case 10: // request standby mode
|
case 10: // request standby mode
|
||||||
for (size_t n = 0; n < channels_.size(); n++)
|
for (size_t n = 0; n < channels_.size(); n++)
|
||||||
{
|
{
|
||||||
if (channels_state_[n] == 1 or channels_state_[n] == 2) // channel in acquisition or in tracking
|
if (channels_state_[n] == 2 or channels_state_[n] == 3) // channel in acquisition or in tracking
|
||||||
{
|
{
|
||||||
// recover the satellite assigned
|
// recover the satellite assigned
|
||||||
Gnss_Signal gs_assigned = channels_[n]->get_signal();
|
Gnss_Signal gs_assigned = channels_[n]->get_signal();
|
||||||
@@ -1949,7 +1949,7 @@ void GNSSFlowgraph::start_acquisition_helper()
|
|||||||
std::lock_guard<std::mutex> lock(signal_list_mutex_);
|
std::lock_guard<std::mutex> lock(signal_list_mutex_);
|
||||||
for (int i = 0; i < channels_count_; i++)
|
for (int i = 0; i < channels_count_; i++)
|
||||||
{
|
{
|
||||||
if (channels_state_[i] == 1)
|
if (channels_state_[i] == 2)
|
||||||
{
|
{
|
||||||
#if ENABLE_FPGA
|
#if ENABLE_FPGA
|
||||||
if (enable_fpga_offloading_)
|
if (enable_fpga_offloading_)
|
||||||
@@ -2119,11 +2119,11 @@ void GNSSFlowgraph::set_channels_state()
|
|||||||
{
|
{
|
||||||
if (i < max_acq_channels_)
|
if (i < max_acq_channels_)
|
||||||
{
|
{
|
||||||
channels_state_.push_back(1);
|
channels_state_.push_back(2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
channels_state_.push_back(0);
|
channels_state_.push_back(1);
|
||||||
}
|
}
|
||||||
DLOG(INFO) << "Channel " << i << " in state " << channels_state_[i];
|
DLOG(INFO) << "Channel " << i << " in state " << channels_state_[i];
|
||||||
}
|
}
|
||||||
@@ -2258,11 +2258,6 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal
|
|||||||
{
|
{
|
||||||
result = available_signals.front();
|
result = available_signals.front();
|
||||||
available_signals.pop_front();
|
available_signals.pop_front();
|
||||||
const std::string sys = result.get_satellite().get_system();
|
|
||||||
if ((sys == "Glonass") || (sys == "Beidou"))
|
|
||||||
{
|
|
||||||
available_signals.push_back(result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@@ -244,7 +244,7 @@ private:
|
|||||||
gnss_sdr_fpga_sample_counter_sptr ch_out_fpga_sample_counter_;
|
gnss_sdr_fpga_sample_counter_sptr ch_out_fpga_sample_counter_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::vector<unsigned int> channels_state_;
|
std::vector<unsigned int> channels_state_; // 0 - Idle, 1 - Assigned, 2 - Acquisition, 3 - Tracking
|
||||||
|
|
||||||
std::unordered_map<std::string, std::list<Gnss_Signal>> available_signals_map_;
|
std::unordered_map<std::string, std::list<Gnss_Signal>> available_signals_map_;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user