1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-12 19:20:32 +00:00

Merge pull request #11 from carlesfernandez/osnma-cesare-fix11

Add basic infrastructure for the GNSS-SDR.osnma_mode=strict mode
This commit is contained in:
cesaaargm 2024-07-26 15:23:25 +02:00 committed by GitHub
commit ffb456d058
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 44 additions and 7 deletions

View File

@ -919,6 +919,17 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration,
// Use unhealthy satellites // Use unhealthy satellites
pvt_output_parameters.use_unhealthy_sats = configuration->property(role + ".use_unhealthy_sats", pvt_output_parameters.use_unhealthy_sats); pvt_output_parameters.use_unhealthy_sats = configuration->property(role + ".use_unhealthy_sats", pvt_output_parameters.use_unhealthy_sats);
// OSNMA
if (gal_1B_count > 0)
{
std::string osnma_mode = configuration->property("GNSS-SDR.osnma_mode", std::string(""));
bool enable_osnma = configuration->property("GNSS-SDR.osnma_enable", true);
if (enable_osnma && osnma_mode == "strict")
{
pvt_output_parameters.osnma_strict = true;
}
}
// make PVT object // make PVT object
pvt_ = rtklib_make_pvt_gs(in_streams_, pvt_output_parameters, rtk); pvt_ = rtklib_make_pvt_gs(in_streams_, pvt_output_parameters, rtk);
DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")"; DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")";

View File

@ -185,7 +185,8 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
d_an_printer_enabled(conf_.an_output_enabled), d_an_printer_enabled(conf_.an_output_enabled),
d_log_timetag(conf_.log_source_timetag), d_log_timetag(conf_.log_source_timetag),
d_use_has_corrections(conf_.use_has_corrections), d_use_has_corrections(conf_.use_has_corrections),
d_use_unhealthy_sats(conf_.use_unhealthy_sats) d_use_unhealthy_sats(conf_.use_unhealthy_sats),
d_osnma_strict(conf_.osnma_strict)
{ {
// Send feedback message to observables block with the receiver clock offset // Send feedback message to observables block with the receiver clock offset
this->message_port_register_out(pmt::mp("pvt_to_observables")); this->message_port_register_out(pmt::mp("pvt_to_observables"));
@ -1652,10 +1653,18 @@ void rtklib_pvt_gs::msg_handler_osnma(const pmt::pmt_t& msg)
{ {
try try
{ {
// Still not sure about what we should receive here.
// It should be a structure with the list of PRNs authenticated (NavData and utcData,
// so with ADKD0 and ADKD12 validated), their corresponding TOW at the beginning
// of the authenticated subframe, and maybe the COP.
const size_t msg_type_hash_code = pmt::any_ref(msg).type().hash_code(); const size_t msg_type_hash_code = pmt::any_ref(msg).type().hash_code();
if (msg_type_hash_code == typeid(std::shared_ptr<OSNMA_data>).hash_code()) if (msg_type_hash_code == typeid(std::shared_ptr<OSNMA_data>).hash_code())
{ {
// Act according to NMA data // Act according to NMA data
if (d_osnma_strict)
{
// TODO
}
} }
} }
catch (const wht::bad_any_cast& e) catch (const wht::bad_any_cast& e)
@ -2023,7 +2032,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
bool store_valid_observable = false; bool store_valid_observable = false;
if (tmp_eph_iter_gps != d_internal_pvt_solver->gps_ephemeris_map.cend()) if (!d_osnma_strict && tmp_eph_iter_gps != d_internal_pvt_solver->gps_ephemeris_map.cend())
{ {
const uint32_t prn_aux = tmp_eph_iter_gps->second.PRN; const uint32_t prn_aux = tmp_eph_iter_gps->second.PRN;
if ((prn_aux == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal, 2) == std::string("1C")) && (d_use_unhealthy_sats || (tmp_eph_iter_gps->second.SV_health == 0))) if ((prn_aux == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal, 2) == std::string("1C")) && (d_use_unhealthy_sats || (tmp_eph_iter_gps->second.SV_health == 0)))
@ -2039,10 +2048,18 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
((std::string(in[i][epoch].Signal, 2) == std::string("5X")) && (d_use_unhealthy_sats || ((tmp_eph_iter_gal->second.E5a_DVS == false) && (tmp_eph_iter_gal->second.E5a_HS == 0)))) || ((std::string(in[i][epoch].Signal, 2) == std::string("5X")) && (d_use_unhealthy_sats || ((tmp_eph_iter_gal->second.E5a_DVS == false) && (tmp_eph_iter_gal->second.E5a_HS == 0)))) ||
((std::string(in[i][epoch].Signal, 2) == std::string("7X")) && (d_use_unhealthy_sats || ((tmp_eph_iter_gal->second.E5b_DVS == false) && (tmp_eph_iter_gal->second.E5b_HS == 0)))))) ((std::string(in[i][epoch].Signal, 2) == std::string("7X")) && (d_use_unhealthy_sats || ((tmp_eph_iter_gal->second.E5b_DVS == false) && (tmp_eph_iter_gal->second.E5b_HS == 0))))))
{ {
store_valid_observable = true; if (d_osnma_strict && ((std::string(in[i][epoch].Signal, 2) == std::string("1B")) || ((std::string(in[i][epoch].Signal, 2) == std::string("7X")))))
{
// Pick up only authenticated satellites
// TODO
}
else
{
store_valid_observable = true;
}
} }
} }
if (tmp_eph_iter_cnav != d_internal_pvt_solver->gps_cnav_ephemeris_map.cend()) if (!d_osnma_strict && tmp_eph_iter_cnav != d_internal_pvt_solver->gps_cnav_ephemeris_map.cend())
{ {
const uint32_t prn_aux = tmp_eph_iter_cnav->second.PRN; const uint32_t prn_aux = tmp_eph_iter_cnav->second.PRN;
if ((prn_aux == in[i][epoch].PRN) && (((std::string(in[i][epoch].Signal, 2) == std::string("2S")) || (std::string(in[i][epoch].Signal, 2) == std::string("L5"))))) if ((prn_aux == in[i][epoch].PRN) && (((std::string(in[i][epoch].Signal, 2) == std::string("2S")) || (std::string(in[i][epoch].Signal, 2) == std::string("L5")))))
@ -2050,7 +2067,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
store_valid_observable = true; store_valid_observable = true;
} }
} }
if (tmp_eph_iter_glo_gnav != d_internal_pvt_solver->glonass_gnav_ephemeris_map.cend()) if (!d_osnma_strict && tmp_eph_iter_glo_gnav != d_internal_pvt_solver->glonass_gnav_ephemeris_map.cend())
{ {
const uint32_t prn_aux = tmp_eph_iter_glo_gnav->second.PRN; const uint32_t prn_aux = tmp_eph_iter_glo_gnav->second.PRN;
if ((prn_aux == in[i][epoch].PRN) && ((std::string(in[i][epoch].Signal, 2) == std::string("1G")) || (std::string(in[i][epoch].Signal, 2) == std::string("2G")))) if ((prn_aux == in[i][epoch].PRN) && ((std::string(in[i][epoch].Signal, 2) == std::string("1G")) || (std::string(in[i][epoch].Signal, 2) == std::string("2G"))))
@ -2058,7 +2075,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
store_valid_observable = true; store_valid_observable = true;
} }
} }
if (tmp_eph_iter_bds_dnav != d_internal_pvt_solver->beidou_dnav_ephemeris_map.cend()) if (!d_osnma_strict && tmp_eph_iter_bds_dnav != d_internal_pvt_solver->beidou_dnav_ephemeris_map.cend())
{ {
const uint32_t prn_aux = tmp_eph_iter_bds_dnav->second.PRN; const uint32_t prn_aux = tmp_eph_iter_bds_dnav->second.PRN;
if ((prn_aux == in[i][epoch].PRN) && (((std::string(in[i][epoch].Signal, 2) == std::string("B1")) || (std::string(in[i][epoch].Signal, 2) == std::string("B3"))) && (d_use_unhealthy_sats || (tmp_eph_iter_bds_dnav->second.SV_health == 0)))) if ((prn_aux == in[i][epoch].PRN) && (((std::string(in[i][epoch].Signal, 2) == std::string("B1")) || (std::string(in[i][epoch].Signal, 2) == std::string("B3"))) && (d_use_unhealthy_sats || (tmp_eph_iter_bds_dnav->second.SV_health == 0))))
@ -2068,7 +2085,14 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
} }
if (std::string(in[i][epoch].Signal, 2) == std::string("E6")) if (std::string(in[i][epoch].Signal, 2) == std::string("E6"))
{ {
store_valid_observable = true; if (d_osnma_strict)
{
// TODO
}
else
{
store_valid_observable = true;
}
} }
if (store_valid_observable) if (store_valid_observable)

View File

@ -280,6 +280,7 @@ private:
bool d_log_timetag; bool d_log_timetag;
bool d_use_has_corrections; bool d_use_has_corrections;
bool d_use_unhealthy_sats; bool d_use_unhealthy_sats;
bool d_osnma_strict;
}; };

View File

@ -95,6 +95,7 @@ public:
bool use_e6_for_pvt = true; bool use_e6_for_pvt = true;
bool use_has_corrections = true; bool use_has_corrections = true;
bool use_unhealthy_sats = false; bool use_unhealthy_sats = false;
bool osnma_strict = false;
// PVT KF parameters // PVT KF parameters
bool enable_pvt_kf = false; bool enable_pvt_kf = false;