1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 04:00:34 +00:00

Improvements to gnss_flowgraph

1) Fixed a bug in gnss_signal::compare

The signal string comparison was not correct.

2) Fix for gnss_flowgraph when satellites are specified

3) Better handling of acquisition in flow graph

Now PRNs are alternated amongst channels, so we don't get 'stuck' on a
particular PRN, and we don't miss out on PRNs that are assigned to
channels that come after a channel that is always in the acquisition state.

4) Added SYS.prns to config file.

Now we can specify which PRNs are available in the configuration, rather
than re-compiling. Particularly useful for debugging, or experimenting
with files where you already know which signals are present
This commit is contained in:
Cillian O'Driscoll 2015-10-24 09:39:10 +01:00
parent af3d706fd3
commit 086118c4aa
2 changed files with 70 additions and 5 deletions

View File

@ -43,6 +43,8 @@
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "channel_interface.h" #include "channel_interface.h"
#include "gnss_block_factory.h" #include "gnss_block_factory.h"
#include <boost/tokenizer.hpp>
#include <algorithm>
#define GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS 8 #define GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS 8
@ -313,12 +315,12 @@ void GNSSFlowgraph::connect()
} }
channels_.at(i)->set_signal(available_GNSS_signals_.front()); channels_.at(i)->set_signal(available_GNSS_signals_.front());
LOG(INFO) << "Channel " << i << " assigned to " << available_GNSS_signals_.front(); LOG(INFO) << "Channel " << i << " assigned to " << available_GNSS_signals_.front();
available_GNSS_signals_.pop_front();
channels_.at(i)->start(); channels_.at(i)->start();
if (channels_state_[i] == 1) if (channels_state_[i] == 1)
{ {
channels_.at(i)->start_acquisition(); channels_.at(i)->start_acquisition();
available_GNSS_signals_.pop_front();
LOG(INFO) << "Channel " << i << " connected to observables and ready for acquisition"; LOG(INFO) << "Channel " << i << " connected to observables and ready for acquisition";
} }
else else
@ -413,13 +415,20 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
LOG(INFO) << "Channel " << who << " ACQ SUCCESS satellite " << channels_.at(who)->get_signal().get_satellite(); LOG(INFO) << "Channel " << who << " ACQ SUCCESS satellite " << channels_.at(who)->get_signal().get_satellite();
channels_state_[who] = 2; channels_state_[who] = 2;
acq_channels_count_--; acq_channels_count_--;
if (acq_channels_count_ < max_acq_channels_) if (!available_GNSS_signals_.empty() && acq_channels_count_ < max_acq_channels_)
{ {
for (unsigned int i = 0; i < channels_count_; i++) for (unsigned int i = 0; i < channels_count_; i++)
{ {
if (channels_state_[i] == 0) if (channels_state_[i] == 0)
{ {
channels_state_[i] = 1; channels_state_[i] = 1;
while (channels_.at(i)->get_signal().get_signal_str().compare(available_GNSS_signals_.front().get_signal_str()) != 0 )
{
available_GNSS_signals_.push_back(available_GNSS_signals_.front());
available_GNSS_signals_.pop_front();
}
channels_.at(i)->set_signal(available_GNSS_signals_.front());
available_GNSS_signals_.pop_front();
acq_channels_count_++; acq_channels_count_++;
channels_.at(i)->start_acquisition(); channels_.at(i)->start_acquisition();
break; break;
@ -442,6 +451,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
{ {
channels_state_[who] = 0; channels_state_[who] = 0;
channels_.at(who)->standby(); channels_.at(who)->standby();
available_GNSS_signals_.push_back( channels_.at(who)->get_signal() );
} }
// for (unsigned int i = 0; i < channels_count_; i++) // for (unsigned int i = 0; i < channels_count_; i++)
@ -593,8 +603,55 @@ void GNSSFlowgraph::set_signals_list()
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36}; 29, 30, 31, 32, 33, 34, 35, 36};
std::string sv_list = configuration_->property("Galileo.prns", std::string("") );
if( sv_list.length() > 0 )
{
// Reset the available prns:
std::set< unsigned int > tmp_set;
boost::tokenizer<> tok( sv_list );
std::transform( tok.begin(), tok.end(), std::inserter( tmp_set, tmp_set.begin() ),
boost::lexical_cast<unsigned int, std::string> );
if( tmp_set.size() > 0 )
{
available_galileo_prn = tmp_set;
}
}
sv_list = configuration_->property("GPS.prns", std::string("") );
if( sv_list.length() > 0 )
{
// Reset the available prns:
std::set< unsigned int > tmp_set;
boost::tokenizer<> tok( sv_list );
std::transform( tok.begin(), tok.end(), std::inserter( tmp_set, tmp_set.begin() ),
boost::lexical_cast<unsigned int, std::string> );
if( tmp_set.size() > 0 )
{
available_gps_prn = tmp_set;
}
}
sv_list = configuration_->property("SBAS.prns", std::string("") );
if( sv_list.length() > 0 )
{
// Reset the available prns:
std::set< unsigned int > tmp_set;
boost::tokenizer<> tok( sv_list );
std::transform( tok.begin(), tok.end(), std::inserter( tmp_set, tmp_set.begin() ),
boost::lexical_cast<unsigned int, std::string> );
if( tmp_set.size() > 0 )
{
available_sbas_prn = tmp_set;
}
}
if ((configuration_->property("Channels_1C.count", 0) > 0) or (default_system.find(std::string("GPS")) != std::string::npos) or (default_signal.compare("1C") == 0) or (configuration_->property("Channels_GPS.count", 0) > 0) ) if ((configuration_->property("Channels_1C.count", 0) > 0) or (default_system.find(std::string("GPS")) != std::string::npos) or (default_signal.compare("1C") == 0) or (configuration_->property("Channels_GPS.count", 0) > 0) )
{ {
/* /*
@ -691,8 +748,16 @@ void GNSSFlowgraph::set_signals_list()
} }
else else
{ {
Gnss_Signal signal_value = Gnss_Signal(Gnss_Satellite(gnss_system, gnss_it->get_satellite().get_PRN()), gnss_signal); Gnss_Signal signal_value = Gnss_Signal(Gnss_Satellite(gnss_system, ( sat != 0 ? sat : gnss_it->get_satellite().get_PRN())), gnss_signal);
if( gnss_it == available_GNSS_signals_.begin() )
{
available_GNSS_signals_.remove(signal_value); available_GNSS_signals_.remove(signal_value);
gnss_it = available_GNSS_signals_.begin();
}
else
{
available_GNSS_signals_.remove(signal_value);
}
available_GNSS_signals_.insert(gnss_it, signal_value); available_GNSS_signals_.insert(gnss_it, signal_value);
} }
} }

View File

@ -73,7 +73,7 @@ bool operator==(const Gnss_Signal &sig1, const Gnss_Signal &sig2)
if (sig1.get_satellite() == sig2.get_satellite()) if (sig1.get_satellite() == sig2.get_satellite())
{ {
if (sig1.get_signal_str().compare(sig1.get_signal_str())) if (sig1.get_signal_str().compare(sig1.get_signal_str())==0)
{ {
equal = true; equal = true;
} }