mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-31 11:19:18 +00:00
Fixes ugly exit when the ephemeris map from SUPL is empty
This commit is contained in:
parent
825a4fc440
commit
872ed26527
@ -234,8 +234,7 @@ bool ControlThread::read_assistance_from_XML()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "ERROR: SUPL client error reading XML" << std::endl;
|
std::cout << "ERROR: SUPL client error reading XML" << std::endl;
|
||||||
std::cout << "Disabling SUPL assistance.." << std::endl;
|
std::cout << "Disabling SUPL assistance..." << std::endl;
|
||||||
ret = false;
|
|
||||||
}
|
}
|
||||||
// Only look for {utc, iono, ref time, ref location} if SUPL is enabled
|
// Only look for {utc, iono, ref time, ref location} if SUPL is enabled
|
||||||
bool enable_gps_supl_assistance = configuration_->property("GNSS-SDR.SUPL_gps_enabled", false);
|
bool enable_gps_supl_assistance = configuration_->property("GNSS-SDR.SUPL_gps_enabled", false);
|
||||||
@ -246,48 +245,43 @@ bool ControlThread::read_assistance_from_XML()
|
|||||||
{
|
{
|
||||||
LOG(INFO) << "SUPL: Read XML UTC model";
|
LOG(INFO) << "SUPL: Read XML UTC model";
|
||||||
global_gps_utc_model_queue.push(supl_client_acquisition_.gps_utc);
|
global_gps_utc_model_queue.push(supl_client_acquisition_.gps_utc);
|
||||||
//ret = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG(ERROR) << "SUPL: couldn't read UTC model XML";
|
LOG(INFO) << "SUPL: couldn't read UTC model XML";
|
||||||
//ret = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to read Iono model from XML
|
// Try to read Iono model from XML
|
||||||
if (supl_client_acquisition_.load_iono_xml(iono_xml_filename) == true)
|
if (supl_client_acquisition_.load_iono_xml(iono_xml_filename) == true)
|
||||||
{
|
{
|
||||||
LOG(INFO) << "SUPL: Read XML IONO model";
|
LOG(INFO) << "SUPL: Read XML IONO model";
|
||||||
global_gps_iono_queue.push(supl_client_acquisition_.gps_iono);
|
global_gps_iono_queue.push(supl_client_acquisition_.gps_iono);
|
||||||
//ret = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG(ERROR) << "SUPL: couldn't read IONO model XML";
|
LOG(INFO) << "SUPL: couldn't read IONO model XML";
|
||||||
//ret = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to read Ref Time from XML
|
// Try to read Ref Time from XML
|
||||||
if (supl_client_acquisition_.load_ref_time_xml(ref_time_xml_filename) == true)
|
if (supl_client_acquisition_.load_ref_time_xml(ref_time_xml_filename) == true)
|
||||||
{
|
{
|
||||||
LOG(INFO) << "SUPL: Read XML Ref Time";
|
LOG(INFO) << "SUPL: Read XML Ref Time";
|
||||||
global_gps_ref_time_queue.push(supl_client_acquisition_.gps_time);
|
global_gps_ref_time_queue.push(supl_client_acquisition_.gps_time);
|
||||||
//ret = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG(ERROR) << "SUPL: couldn't read Ref Time XML";
|
LOG(INFO) << "SUPL: couldn't read Ref Time XML";
|
||||||
//ret = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to read Ref Location from XML
|
// Try to read Ref Location from XML
|
||||||
if (supl_client_acquisition_.load_ref_location_xml(ref_location_xml_filename) == true)
|
if (supl_client_acquisition_.load_ref_location_xml(ref_location_xml_filename) == true)
|
||||||
{
|
{
|
||||||
LOG(INFO) << "SUPL: Read XML Ref Location";
|
LOG(INFO) << "SUPL: Read XML Ref Location";
|
||||||
global_gps_ref_location_queue.push(supl_client_acquisition_.gps_ref_loc);
|
global_gps_ref_location_queue.push(supl_client_acquisition_.gps_ref_loc);
|
||||||
//ret = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG(ERROR) << "SUPL: couldn't read Ref Location XML";
|
LOG(INFO) << "SUPL: couldn't read Ref Location XML";
|
||||||
//ret = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,16 +301,16 @@ bool ControlThread::save_assistance_to_XML()
|
|||||||
std::string ref_time_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ref_time_xml", ref_time_default_xml_filename);
|
std::string ref_time_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ref_time_xml", ref_time_default_xml_filename);
|
||||||
std::string ref_location_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ref_location_xml", ref_location_default_xml_filename);
|
std::string ref_location_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ref_location_xml", ref_location_default_xml_filename);
|
||||||
|
|
||||||
std::cout << "SUPL: Try to save GPS ephemeris to XML file " << eph_xml_filename << std::endl;
|
LOG(INFO) << "SUPL: Try to save GPS ephemeris to XML file " << eph_xml_filename;
|
||||||
std::map<int, Gps_Ephemeris> eph_copy = global_gps_ephemeris_map.get_map_copy();
|
std::map<int, Gps_Ephemeris> eph_copy = global_gps_ephemeris_map.get_map_copy();
|
||||||
if (supl_client_ephemeris_.save_ephemeris_map_xml(eph_xml_filename, eph_copy) == true)
|
if (supl_client_ephemeris_.save_ephemeris_map_xml(eph_xml_filename, eph_copy) == true)
|
||||||
{
|
{
|
||||||
std::cout << "SUPL: Successfully saved ephemeris XML file" << std::endl;
|
LOG(INFO) << "SUPL: Successfully saved ephemeris XML file";
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "SUPL: Error while trying to save ephemeris XML file" << std::endl;
|
LOG(INFO) << "SUPL: Error while trying to save ephemeris XML file. Maybe an empty map?";
|
||||||
ret = false;
|
ret = false;
|
||||||
}
|
}
|
||||||
// Only try to save {utc, iono, ref time, ref location} if SUPL is enabled
|
// Only try to save {utc, iono, ref time, ref location} if SUPL is enabled
|
||||||
@ -332,7 +326,7 @@ bool ControlThread::save_assistance_to_XML()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG(ERROR) << "SUPL: Error while trying to save utc XML file";
|
LOG(INFO) << "SUPL: Error while trying to save utc XML file";
|
||||||
//ret = false;
|
//ret = false;
|
||||||
}
|
}
|
||||||
// try to save iono model xml file
|
// try to save iono model xml file
|
||||||
@ -344,7 +338,7 @@ bool ControlThread::save_assistance_to_XML()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG(ERROR) << "SUPL: Error while trying to save iono XML file";
|
LOG(INFO) << "SUPL: Error while trying to save iono XML file";
|
||||||
//ret = false;
|
//ret = false;
|
||||||
}
|
}
|
||||||
// try to save ref time xml file
|
// try to save ref time xml file
|
||||||
@ -356,7 +350,7 @@ bool ControlThread::save_assistance_to_XML()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG(ERROR) << "SUPL: Error while trying to save ref time XML file";
|
LOG(INFO) << "SUPL: Error while trying to save ref time XML file";
|
||||||
//ref = false;
|
//ref = false;
|
||||||
}
|
}
|
||||||
// try to save ref location xml file
|
// try to save ref location xml file
|
||||||
@ -368,7 +362,7 @@ bool ControlThread::save_assistance_to_XML()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG(ERROR) << "SUPL: Error while trying to save ref location XML file";
|
LOG(INFO) << "SUPL: Error while trying to save ref location XML file";
|
||||||
//ret = false;
|
//ret = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user