1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 04:30:33 +00:00

Add generation of IGM01 messages

This commit is contained in:
Carles Fernandez 2021-10-18 17:24:02 +02:00
parent 0138738231
commit fc32c076df
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
4 changed files with 57 additions and 10 deletions

View File

@ -3250,12 +3250,40 @@ std::string Rtcm::get_MSM_7_content_signal_data(const Gps_Ephemeris& ephNAV,
} }
std::string Rtcm::get_IGM01_header(const Galileo_HAS_data& has_data, uint8_t nsys) std::vector<std::string> Rtcm::print_IGM01(const Galileo_HAS_data& has_data)
{
std::vector<std::string> msgs;
const uint8_t nsys = has_data.Nsys;
bool ssr_multiple_msg_indicator = true;
for (uint8_t sys = 0; sys < nsys; sys++)
{
if (sys == nsys - 1)
{
ssr_multiple_msg_indicator = false; // last message of a sequence
}
const std::string header = Rtcm::get_IGM01_header(has_data, sys, ssr_multiple_msg_indicator);
const std::string sat_data = Rtcm::get_IGM01_content_sat(has_data, sys);
std::string message = build_message(header + sat_data);
if (server_is_running)
{
rtcm_message_queue->push(message);
}
msgs.push_back(message);
}
return msgs;
}
std::string Rtcm::get_IGM01_header(const Galileo_HAS_data& has_data, uint8_t nsys, bool ssr_multiple_msg_indicator)
{ {
std::string header; std::string header;
uint32_t tow = 0;
uint16_t ssr_provider_id = 0; // ? uint32_t tow = 0; // TODO
uint8_t igm_version = 0; uint16_t ssr_provider_id = 0; // ?
uint8_t igm_version = 0; // ?
uint8_t ssr_solution_id = 0; // ?
auto iod_ssr = has_data.header.iod_id % 15; // ?? HAS IOD is 0-31
bool regional_indicator = false; // ?
uint8_t subtype_msg_number = 0; uint8_t subtype_msg_number = 0;
if (has_data.gnss_id_mask[nsys] == 0) // GPS if (has_data.gnss_id_mask[nsys] == 0) // GPS
@ -3267,10 +3295,6 @@ std::string Rtcm::get_IGM01_header(const Galileo_HAS_data& has_data, uint8_t nsy
subtype_msg_number = 61; subtype_msg_number = 61;
} }
uint8_t ssr_solution_id = 0; // ?
bool ssr_multiple_msg_indicator = false;
bool regional_indicator = false;
uint8_t validity_index = has_data.validity_interval_index_orbit_corrections; uint8_t validity_index = has_data.validity_interval_index_orbit_corrections;
uint16_t validity_seconds = has_data.get_validity_interval_s(validity_index); uint16_t validity_seconds = has_data.get_validity_interval_s(validity_index);
uint8_t ssr_update_interval = 0; uint8_t ssr_update_interval = 0;
@ -3342,7 +3366,6 @@ std::string Rtcm::get_IGM01_header(const Galileo_HAS_data& has_data, uint8_t nsy
} }
} }
auto iod_ssr = has_data.header.iod_id % 15; // ?? HAS IOD is 0-31
uint8_t Nsat = has_data.get_num_satellites()[nsys]; uint8_t Nsat = has_data.get_num_satellites()[nsys];
Rtcm::set_DF002(4076); // Always “4076” for IGS Proprietary Messages Rtcm::set_DF002(4076); // Always “4076” for IGS Proprietary Messages

View File

@ -337,6 +337,11 @@ public:
bool divergence_free, bool divergence_free,
bool more_messages); bool more_messages);
/*!
* \brief Prints messages of type IGM01 (SSR Orbit Correction)
*/
std::vector<std::string> print_IGM01(const Galileo_HAS_data& has_data);
uint32_t lock_time(const Gps_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); //!< Returns the time period in which GPS L1 signals have been continually tracked. uint32_t lock_time(const Gps_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); //!< Returns the time period in which GPS L1 signals have been continually tracked.
uint32_t lock_time(const Gps_CNAV_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); //!< Returns the time period in which GPS L2 signals have been continually tracked. uint32_t lock_time(const Gps_CNAV_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); //!< Returns the time period in which GPS L2 signals have been continually tracked.
uint32_t lock_time(const Galileo_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); //!< Returns the time period in which Galileo signals have been continually tracked. uint32_t lock_time(const Galileo_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); //!< Returns the time period in which Galileo signals have been continually tracked.
@ -477,7 +482,7 @@ private:
std::string get_MSM_6_content_signal_data(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& ephCNAV, const Galileo_Ephemeris& ephFNAV, const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables); std::string get_MSM_6_content_signal_data(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& ephCNAV, const Galileo_Ephemeris& ephFNAV, const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
std::string get_MSM_7_content_signal_data(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& ephCNAV, const Galileo_Ephemeris& ephFNAV, const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables); std::string get_MSM_7_content_signal_data(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& ephCNAV, const Galileo_Ephemeris& ephFNAV, const Glonass_Gnav_Ephemeris& ephGNAV, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables);
std::string get_IGM01_header(const Galileo_HAS_data& has_data, uint8_t nsys); std::string get_IGM01_header(const Galileo_HAS_data& has_data, uint8_t nsys, bool ssr_multiple_msg_indicator);
std::string get_IGM01_content_sat(const Galileo_HAS_data& has_data, uint8_t nsys_index); std::string get_IGM01_content_sat(const Galileo_HAS_data& has_data, uint8_t nsys_index);

View File

@ -19,6 +19,7 @@
#include "rtcm_printer.h" #include "rtcm_printer.h"
#include "galileo_ephemeris.h" #include "galileo_ephemeris.h"
#include "galileo_has_data.h"
#include "glonass_gnav_ephemeris.h" #include "glonass_gnav_ephemeris.h"
#include "glonass_gnav_utc_model.h" #include "glonass_gnav_utc_model.h"
#include "gnss_sdr_filesystem.h" #include "gnss_sdr_filesystem.h"
@ -1599,6 +1600,21 @@ bool Rtcm_Printer::Print_Rtcm_MSM(uint32_t msm_number, const Gps_Ephemeris& gps_
} }
bool Rtcm_Printer::Print_Rtcm_IGM01(const Galileo_HAS_data& has_data)
{
const std::vector<std::string> msgs = rtcm->print_IGM01(has_data);
if (msgs.empty())
{
return false;
}
for (const auto& s : msgs)
{
Rtcm_Printer::Print_Message(s);
}
return true;
}
int Rtcm_Printer::init_serial(const std::string& serial_device) int Rtcm_Printer::init_serial(const std::string& serial_device)
{ {
/* /*

View File

@ -40,6 +40,7 @@ class Gps_CNAV_Ephemeris;
class Gps_Ephemeris; class Gps_Ephemeris;
class Rtcm; class Rtcm;
class Rtklib_Solver; class Rtklib_Solver;
class Galileo_HAS_data;
/*! /*!
* \brief This class provides a implementation of a subset of the RTCM Standard 10403.2 messages * \brief This class provides a implementation of a subset of the RTCM Standard 10403.2 messages
@ -178,6 +179,8 @@ private:
bool divergence_free, bool divergence_free,
bool more_messages); bool more_messages);
bool Print_Rtcm_IGM01(const Galileo_HAS_data& has_data); // SSR Orbit Corrections
int32_t init_serial(const std::string& serial_device); // serial port control int32_t init_serial(const std::string& serial_device); // serial port control
void close_serial() const; void close_serial() const;
bool Print_Message(const std::string& message); bool Print_Message(const std::string& message);