1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-05 09:43:04 +00:00

Implement GNSS-SDR.GPS_banned_prns, GNSS-SDR.Galileo_banned_prns, GNSS-SDR.Glonass_banned_prns, and GNSS-SDR.Beidou_banned_prns configuration parameters. The user can specify lists of satellites that will not be processed (e.g. GNSS-SDR.Galileo_banned_prns=14,18 since Galileo E14 and E18 satellites are not usable for PVT). Documented at https://gnss-sdr.org/docs/sp-blocks/global-parameters/\#banned-satellites Inspired by #397

This commit is contained in:
Carles Fernandez
2020-07-07 00:05:31 +02:00
parent 999ee6c623
commit 58853ace7d
4 changed files with 129 additions and 0 deletions

View File

@@ -53,6 +53,7 @@
#include <iterator> // for insert_iterator, inserter
#include <memory> // for std::shared_ptr
#include <set> // for set
#include <sstream> // for std::stringstream
#include <stdexcept> // for invalid_argument
#include <thread> // for std::thread
#include <utility> // for std::move
@@ -1668,6 +1669,30 @@ void GNSSFlowgraph::set_signals_list()
}
}
std::string sv_banned = configuration_->property("GNSS-SDR.Galileo_banned_prns", std::string(""));
if (!sv_banned.empty())
{
std::stringstream ss(sv_banned);
while (ss.good())
{
std::string substr;
std::getline(ss, substr, ',');
try
{
auto banned = static_cast<unsigned int>(std::stoi(substr));
available_galileo_prn.erase(banned);
}
catch (const std::invalid_argument& ia)
{
std::cerr << "Invalid argument at GNSS-SDR.Galileo_banned_prns configuration parameter: " << ia.what() << '\n';
}
catch (const std::out_of_range& oor)
{
std::cerr << "Out of range at GNSS-SDR.Galileo_banned_prns configuration parameter: " << oor.what() << '\n';
}
}
}
sv_list = configuration_->property("GPS.prns", std::string(""));
if (sv_list.length() > 0)
@@ -1684,6 +1709,30 @@ void GNSSFlowgraph::set_signals_list()
}
}
sv_banned = configuration_->property("GNSS-SDR.GPS_banned_prns", std::string(""));
if (!sv_banned.empty())
{
std::stringstream ss(sv_banned);
while (ss.good())
{
std::string substr;
std::getline(ss, substr, ',');
try
{
auto banned = static_cast<unsigned int>(std::stoi(substr));
available_gps_prn.erase(banned);
}
catch (const std::invalid_argument& ia)
{
std::cerr << "Invalid argument at GNSS-SDR.GPS_banned_prns configuration parameter: " << ia.what() << '\n';
}
catch (const std::out_of_range& oor)
{
std::cerr << "Out of range at GNSS-SDR.GPS_banned_prns configuration parameter: " << oor.what() << '\n';
}
}
}
sv_list = configuration_->property("SBAS.prns", std::string(""));
if (sv_list.length() > 0)
@@ -1700,6 +1749,30 @@ void GNSSFlowgraph::set_signals_list()
}
}
sv_banned = configuration_->property("GNSS-SDR.SBAS_banned_prns", std::string(""));
if (!sv_banned.empty())
{
std::stringstream ss(sv_banned);
while (ss.good())
{
std::string substr;
std::getline(ss, substr, ',');
try
{
auto banned = static_cast<unsigned int>(std::stoi(substr));
available_sbas_prn.erase(banned);
}
catch (const std::invalid_argument& ia)
{
std::cerr << "Invalid argument at GNSS-SDR.SBAS_banned_prns configuration parameter: " << ia.what() << '\n';
}
catch (const std::out_of_range& oor)
{
std::cerr << "Out of range at GNSS-SDR.SBAS_banned_prns configuration parameter: " << oor.what() << '\n';
}
}
}
sv_list = configuration_->property("Glonass.prns", std::string(""));
if (sv_list.length() > 0)
@@ -1716,6 +1789,30 @@ void GNSSFlowgraph::set_signals_list()
}
}
sv_banned = configuration_->property("GNSS-SDR.Glonass_banned_prns", std::string(""));
if (!sv_banned.empty())
{
std::stringstream ss(sv_banned);
while (ss.good())
{
std::string substr;
std::getline(ss, substr, ',');
try
{
auto banned = static_cast<unsigned int>(std::stoi(substr));
available_glonass_prn.erase(banned);
}
catch (const std::invalid_argument& ia)
{
std::cerr << "Invalid argument at GNSS-SDR.Glonass_banned_prns configuration parameter: " << ia.what() << '\n';
}
catch (const std::out_of_range& oor)
{
std::cerr << "Out of range at GNSS-SDR.Glonass_banned_prns configuration parameter: " << oor.what() << '\n';
}
}
}
sv_list = configuration_->property("Beidou.prns", std::string(""));
if (sv_list.length() > 0)
@@ -1732,6 +1829,30 @@ void GNSSFlowgraph::set_signals_list()
}
}
sv_banned = configuration_->property("GNSS-SDR.Beidou_banned_prns", std::string(""));
if (!sv_banned.empty())
{
std::stringstream ss(sv_banned);
while (ss.good())
{
std::string substr;
std::getline(ss, substr, ',');
try
{
auto banned = static_cast<unsigned int>(std::stoi(substr));
available_beidou_prn.erase(banned);
}
catch (const std::invalid_argument& ia)
{
std::cerr << "Invalid argument at GNSS-SDR.Beidou_banned_prns configuration parameter: " << ia.what() << '\n';
}
catch (const std::out_of_range& oor)
{
std::cerr << "Out of range at GNSS-SDR.Beidou_banned_prns configuration parameter: " << oor.what() << '\n';
}
}
}
if (configuration_->property("Channels_1C.count", 0) > 0)
{
// Loop to create GPS L1 C/A signals