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

Fix generation of GPGSV and GAGSV messages (NMEA)

This commit is contained in:
Carles Fernandez 2018-11-07 16:03:45 +01:00
parent fa7320b184
commit 2bdbaaf9a5
3 changed files with 12 additions and 59 deletions

View File

@ -565,7 +565,7 @@ std::string Nmea_Printer::get_GPGSV()
// Notice that NMEA 2.1 only supports 12 channels // Notice that NMEA 2.1 only supports 12 channels
std::stringstream sentence_str; std::stringstream sentence_str;
unsigned char buff[200]; unsigned char buff[200];
outnmea_gsv(buff, &d_PVT_data->pvt_sol, *d_PVT_data->pvt_ssat); outnmea_gsv(buff, &d_PVT_data->pvt_sol, d_PVT_data->pvt_ssat);
sentence_str << buff; sentence_str << buff;
return sentence_str.str(); return sentence_str.str();
} }

View File

@ -75,7 +75,11 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag
rtk_ = rtk; rtk_ = rtk;
for (unsigned int i = 0; i < 4; i++) dop_[i] = 0.0; for (unsigned int i = 0; i < 4; i++) dop_[i] = 0.0;
pvt_sol = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0}; pvt_sol = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0};
ssat_t ssat0 = {0, 0, {0.0}, {0.0}, {0.0}, {'0'}, {'0'}, {'0'}, {'0'}, {'0'}, {}, {}, {}, {}, 0.0, 0.0, 0.0, 0.0, {{{0, 0}}, {{0, 0}}}, {{}, {}}};
for (unsigned int i = 0; i < MAXSAT; i++)
{
pvt_ssat[i] = ssat0;
}
// ############# ENABLE DATA FILE LOG ################# // ############# ENABLE DATA FILE LOG #################
if (d_flag_dump_enabled == true) if (d_flag_dump_enabled == true)
{ {
@ -795,7 +799,11 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
unsigned int used_sats = 0; unsigned int used_sats = 0;
for (unsigned int i = 0; i < MAXSAT; i++) for (unsigned int i = 0; i < MAXSAT; i++)
{ {
if (rtk_.ssat[i].vs == 1) used_sats++; if (rtk_.ssat[i].vs == 1)
{
pvt_ssat[i] = rtk_.ssat[i];
used_sats++;
}
} }
std::vector<double> azel; std::vector<double> azel;
@ -811,61 +819,6 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
} }
} }
for (gnss_observables_iter = gnss_observables_map.cbegin();
gnss_observables_iter != gnss_observables_map.cend();
++gnss_observables_iter) // CHECK INCONSISTENCY when combining GLONASS + other system
{
switch (gnss_observables_iter->second.System)
{
case 'E':
{
std::string sig_(gnss_observables_iter->second.Signal);
if (sig_.compare("1B") == 0)
{
unsigned int snr = static_cast<unsigned int>(std::round(gnss_observables_iter->second.CN0_dB_hz / 0.25));
rtk_.ssat[gnss_observables_iter->second.PRN - 1].snr[0] = snr;
pvt_ssat[gnss_observables_iter->second.PRN - 1] = &rtk_.ssat[gnss_observables_iter->second.PRN - 1];
}
break;
}
case 'G':
{
// GPS L1
std::string sig_(gnss_observables_iter->second.Signal);
if (sig_.compare("1C") == 0)
{
unsigned int snr = static_cast<unsigned int>(std::round(gnss_observables_iter->second.CN0_dB_hz / 0.25));
rtk_.ssat[gnss_observables_iter->second.PRN - 1].snr[0] = snr;
pvt_ssat[gnss_observables_iter->second.PRN - 1] = &rtk_.ssat[gnss_observables_iter->second.PRN - 1];
}
// GPS L2
if (sig_.compare("2S") == 0)
{
}
// GPS L5
if (sig_.compare("L5") == 0)
{
}
break;
}
case 'R':
{
std::string sig_(gnss_observables_iter->second.Signal);
// GLONASS GNAV L1
if (sig_.compare("1G") == 0)
{
}
// GLONASS GNAV L2
if (sig_.compare("2G") == 0)
{
}
break;
}
default:
break;
}
}
if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_); if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_);
this->set_valid_position(true); this->set_valid_position(true);
arma::vec rx_position_and_time(4); arma::vec rx_position_and_time(4);

View File

@ -86,7 +86,7 @@ private:
public: public:
sol_t pvt_sol; sol_t pvt_sol;
ssat_t* pvt_ssat[MAXSAT]; ssat_t pvt_ssat[MAXSAT];
rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, rtk_t& rtk); rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, rtk_t& rtk);
~rtklib_solver(); ~rtklib_solver();