mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-14 20:20:35 +00:00
Merge branch 'improve-pvt' into next
This commit is contained in:
commit
16b6e71cae
@ -524,21 +524,21 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
|
|||||||
{
|
{
|
||||||
// setup two PVT solvers: internal solver for rx clock and user solver
|
// setup two PVT solvers: internal solver for rx clock and user solver
|
||||||
// user PVT solver
|
// user PVT solver
|
||||||
d_user_pvt_solver = std::make_shared<Rtklib_Solver>(rtk, dump_ls_pvt_filename, d_dump, d_dump_mat);
|
d_user_pvt_solver = std::make_shared<Rtklib_Solver>(rtk, dump_ls_pvt_filename, d_type_of_rx, d_dump, d_dump_mat);
|
||||||
d_user_pvt_solver->set_averaging_depth(1);
|
d_user_pvt_solver->set_averaging_depth(1);
|
||||||
d_user_pvt_solver->set_pre_2009_file(conf_.pre_2009_file);
|
d_user_pvt_solver->set_pre_2009_file(conf_.pre_2009_file);
|
||||||
|
|
||||||
// internal PVT solver, mainly used to estimate the receiver clock
|
// internal PVT solver, mainly used to estimate the receiver clock
|
||||||
rtk_t internal_rtk = rtk;
|
rtk_t internal_rtk = rtk;
|
||||||
internal_rtk.opt.mode = PMODE_SINGLE; // use single positioning mode in internal PVT solver
|
internal_rtk.opt.mode = PMODE_SINGLE; // use single positioning mode in internal PVT solver
|
||||||
d_internal_pvt_solver = std::make_shared<Rtklib_Solver>(internal_rtk, dump_ls_pvt_filename, false, false);
|
d_internal_pvt_solver = std::make_shared<Rtklib_Solver>(internal_rtk, dump_ls_pvt_filename, d_type_of_rx, false, false);
|
||||||
d_internal_pvt_solver->set_averaging_depth(1);
|
d_internal_pvt_solver->set_averaging_depth(1);
|
||||||
d_internal_pvt_solver->set_pre_2009_file(conf_.pre_2009_file);
|
d_internal_pvt_solver->set_pre_2009_file(conf_.pre_2009_file);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// only one solver, customized by the user options
|
// only one solver, customized by the user options
|
||||||
d_internal_pvt_solver = std::make_shared<Rtklib_Solver>(rtk, dump_ls_pvt_filename, d_dump, d_dump_mat);
|
d_internal_pvt_solver = std::make_shared<Rtklib_Solver>(rtk, dump_ls_pvt_filename, d_type_of_rx, d_dump, d_dump_mat);
|
||||||
d_internal_pvt_solver->set_averaging_depth(1);
|
d_internal_pvt_solver->set_averaging_depth(1);
|
||||||
d_internal_pvt_solver->set_pre_2009_file(conf_.pre_2009_file);
|
d_internal_pvt_solver->set_pre_2009_file(conf_.pre_2009_file);
|
||||||
d_user_pvt_solver = d_internal_pvt_solver;
|
d_user_pvt_solver = d_internal_pvt_solver;
|
||||||
@ -2146,7 +2146,6 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
|
|||||||
}
|
}
|
||||||
while (fabs(delta_rxtime_to_tag_ms) >= 100 and !d_TimeChannelTagTimestamps.empty());
|
while (fabs(delta_rxtime_to_tag_ms) >= 100 and !d_TimeChannelTagTimestamps.empty());
|
||||||
|
|
||||||
|
|
||||||
// 2. If both timestamps (relative to the receiver's start) are closer than 100 ms (the granularituy of the PVT)
|
// 2. If both timestamps (relative to the receiver's start) are closer than 100 ms (the granularituy of the PVT)
|
||||||
if (fabs(delta_rxtime_to_tag_ms) <= 100) // [ms]
|
if (fabs(delta_rxtime_to_tag_ms) <= 100) // [ms]
|
||||||
{
|
{
|
||||||
@ -2222,11 +2221,6 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// debug code
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// DLOG(INFO) << "Internal PVT solver error";
|
|
||||||
// }
|
|
||||||
|
|
||||||
// compute on the fly PVT solution
|
// compute on the fly PVT solution
|
||||||
if (flag_compute_pvt_output == true)
|
if (flag_compute_pvt_output == true)
|
||||||
@ -2234,7 +2228,6 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
|
|||||||
flag_pvt_valid = d_user_pvt_solver->get_PVT(d_gnss_observables_map, false);
|
flag_pvt_valid = d_user_pvt_solver->get_PVT(d_gnss_observables_map, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (flag_pvt_valid == true)
|
if (flag_pvt_valid == true)
|
||||||
{
|
{
|
||||||
// experimental VTL tests
|
// experimental VTL tests
|
||||||
|
@ -11762,33 +11762,6 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
|
|||||||
gs.PRN = prn_;
|
gs.PRN = prn_;
|
||||||
total_map.insert(std::pair<uint32_t, Gnss_Synchro>(prn_, gs));
|
total_map.insert(std::pair<uint32_t, Gnss_Synchro>(prn_, gs));
|
||||||
}
|
}
|
||||||
if (found_E5a != std::string::npos)
|
|
||||||
{
|
|
||||||
Gnss_Synchro gs = Gnss_Synchro();
|
|
||||||
gs.System = 'E';
|
|
||||||
gs.Signal[0] = '5';
|
|
||||||
gs.Signal[1] = 'X';
|
|
||||||
gs.Signal[2] = '\0';
|
|
||||||
gs.PRN = prn_;
|
|
||||||
total_map.insert(std::pair<uint32_t, Gnss_Synchro>(prn_, gs));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// if 5X is listed but empty
|
|
||||||
if (found_E5a != std::string::npos)
|
|
||||||
{
|
|
||||||
if ((total_map.count(prn_)) == 1)
|
|
||||||
{
|
|
||||||
Gnss_Synchro gs = Gnss_Synchro();
|
|
||||||
gs.System = 'E';
|
|
||||||
gs.Signal[0] = '5';
|
|
||||||
gs.Signal[1] = 'X';
|
|
||||||
gs.Signal[2] = '\0';
|
|
||||||
gs.PRN = prn_;
|
|
||||||
total_map.insert(std::pair<uint32_t, Gnss_Synchro>(prn_, gs));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
total_map.insert(std::pair<uint32_t, Gnss_Synchro>(prn_, observables_iter->second));
|
total_map.insert(std::pair<uint32_t, Gnss_Synchro>(prn_, observables_iter->second));
|
||||||
}
|
}
|
||||||
|
@ -45,14 +45,99 @@
|
|||||||
|
|
||||||
Rtklib_Solver::Rtklib_Solver(const rtk_t &rtk,
|
Rtklib_Solver::Rtklib_Solver(const rtk_t &rtk,
|
||||||
const std::string &dump_filename,
|
const std::string &dump_filename,
|
||||||
|
uint32_t type_of_rx,
|
||||||
bool flag_dump_to_file,
|
bool flag_dump_to_file,
|
||||||
bool flag_dump_to_mat) : d_rtk(rtk),
|
bool flag_dump_to_mat) : d_dump_filename(dump_filename),
|
||||||
d_dump_filename(dump_filename),
|
d_rtk(rtk),
|
||||||
|
d_type_of_rx(type_of_rx),
|
||||||
d_flag_dump_enabled(flag_dump_to_file),
|
d_flag_dump_enabled(flag_dump_to_file),
|
||||||
d_flag_dump_mat_enabled(flag_dump_to_mat)
|
d_flag_dump_mat_enabled(flag_dump_to_mat)
|
||||||
{
|
{
|
||||||
this->set_averaging_flag(false);
|
this->set_averaging_flag(false);
|
||||||
|
|
||||||
|
// see freq index at src/algorithms/libs/rtklib/rtklib_rtkcmn.cc
|
||||||
|
// function: satwavelen
|
||||||
|
d_rtklib_freq_index[0] = 0;
|
||||||
|
d_rtklib_freq_index[1] = 1;
|
||||||
|
d_rtklib_freq_index[2] = 2;
|
||||||
|
|
||||||
|
d_rtklib_band_index["1G"] = 0;
|
||||||
|
d_rtklib_band_index["1C"] = 0;
|
||||||
|
d_rtklib_band_index["1B"] = 0;
|
||||||
|
d_rtklib_band_index["B1"] = 0;
|
||||||
|
d_rtklib_band_index["B3"] = 2;
|
||||||
|
d_rtklib_band_index["2G"] = 1;
|
||||||
|
d_rtklib_band_index["2S"] = 1;
|
||||||
|
d_rtklib_band_index["7X"] = 2;
|
||||||
|
d_rtklib_band_index["5X"] = 2;
|
||||||
|
d_rtklib_band_index["L5"] = 2;
|
||||||
|
d_rtklib_band_index["E6"] = 0;
|
||||||
|
|
||||||
|
if (d_type_of_rx == 6) // E5b only
|
||||||
|
{
|
||||||
|
d_rtklib_freq_index[2] = 4;
|
||||||
|
}
|
||||||
|
if (d_type_of_rx == 11) // GPS L1 C/A + Galileo E5b
|
||||||
|
{
|
||||||
|
d_rtklib_freq_index[2] = 4;
|
||||||
|
}
|
||||||
|
if (d_type_of_rx == 15) // Galileo E1B + Galileo E5b
|
||||||
|
{
|
||||||
|
d_rtklib_freq_index[2] = 4;
|
||||||
|
}
|
||||||
|
if (d_type_of_rx == 18) // GPS L2C + Galileo E5b
|
||||||
|
{
|
||||||
|
d_rtklib_freq_index[2] = 4;
|
||||||
|
}
|
||||||
|
if (d_type_of_rx == 19) // Galileo E5a + Galileo E5b
|
||||||
|
{
|
||||||
|
d_rtklib_band_index["5X"] = 0;
|
||||||
|
d_rtklib_freq_index[0] = 2;
|
||||||
|
d_rtklib_freq_index[2] = 4;
|
||||||
|
}
|
||||||
|
if (d_type_of_rx == 20) // GPS L5 + Galileo E5b
|
||||||
|
{
|
||||||
|
d_rtklib_band_index["L5"] = 0;
|
||||||
|
d_rtklib_freq_index[0] = 2;
|
||||||
|
d_rtklib_freq_index[2] = 4;
|
||||||
|
}
|
||||||
|
if (d_type_of_rx == 100) // E6B only
|
||||||
|
{
|
||||||
|
d_rtklib_freq_index[0] = 3;
|
||||||
|
}
|
||||||
|
if (d_type_of_rx == 101) // E1 + E6B
|
||||||
|
{
|
||||||
|
d_rtklib_band_index["E6"] = 1;
|
||||||
|
d_rtklib_freq_index[1] = 3;
|
||||||
|
}
|
||||||
|
if (d_type_of_rx == 102) // E5a + E6B
|
||||||
|
{
|
||||||
|
d_rtklib_band_index["E6"] = 1;
|
||||||
|
d_rtklib_freq_index[1] = 3;
|
||||||
|
}
|
||||||
|
if (d_type_of_rx == 103) // E5b + E6B
|
||||||
|
{
|
||||||
|
d_rtklib_band_index["E6"] = 1;
|
||||||
|
d_rtklib_freq_index[1] = 3;
|
||||||
|
d_rtklib_freq_index[2] = 4;
|
||||||
|
}
|
||||||
|
if (d_type_of_rx == 104) // Galileo E1B + Galileo E5a + Galileo E6B
|
||||||
|
{
|
||||||
|
d_rtklib_band_index["E6"] = 1;
|
||||||
|
d_rtklib_freq_index[1] = 3;
|
||||||
|
}
|
||||||
|
if (d_type_of_rx == 105) // Galileo E1B + Galileo E5b + Galileo E6B
|
||||||
|
{
|
||||||
|
d_rtklib_freq_index[2] = 4;
|
||||||
|
d_rtklib_band_index["E6"] = 1;
|
||||||
|
d_rtklib_freq_index[1] = 3;
|
||||||
|
}
|
||||||
|
if (d_type_of_rx == 106) // GPS L1 C/A + Galileo E1B + Galileo E6B
|
||||||
|
{
|
||||||
|
d_rtklib_band_index["E6"] = 1;
|
||||||
|
d_rtklib_freq_index[1] = 3;
|
||||||
|
}
|
||||||
|
|
||||||
// ############# ENABLE DATA FILE LOG #################
|
// ############# ENABLE DATA FILE LOG #################
|
||||||
if (d_flag_dump_enabled == true)
|
if (d_flag_dump_enabled == true)
|
||||||
{
|
{
|
||||||
@ -406,8 +491,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
bool gps_dual_band = false;
|
bool gps_dual_band = false;
|
||||||
bool band1 = false;
|
bool band1 = false;
|
||||||
bool band2 = false;
|
bool band2 = false;
|
||||||
bool gal_e5_is_e5b = false;
|
|
||||||
bool gal_e6 = false;
|
|
||||||
for (gnss_observables_iter = gnss_observables_map.cbegin();
|
for (gnss_observables_iter = gnss_observables_map.cbegin();
|
||||||
gnss_observables_iter != gnss_observables_map.cend();
|
gnss_observables_iter != gnss_observables_map.cend();
|
||||||
++gnss_observables_iter)
|
++gnss_observables_iter)
|
||||||
@ -460,7 +544,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
galileo_ephemeris_iter->second.WN,
|
galileo_ephemeris_iter->second.WN,
|
||||||
0);
|
d_rtklib_band_index[sig_]);
|
||||||
valid_obs++;
|
valid_obs++;
|
||||||
}
|
}
|
||||||
else // the ephemeris are not available for this SV
|
else // the ephemeris are not available for this SV
|
||||||
@ -484,7 +568,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(d_obs_data[i + glo_valid_obs],
|
d_obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(d_obs_data[i + glo_valid_obs],
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
galileo_ephemeris_iter->second.WN,
|
galileo_ephemeris_iter->second.WN,
|
||||||
2); // Band 3 (L5/E5)
|
d_rtklib_band_index[sig_]);
|
||||||
found_E1_obs = true;
|
found_E1_obs = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -502,7 +586,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
galileo_ephemeris_iter->second.WN,
|
galileo_ephemeris_iter->second.WN,
|
||||||
2); // Band 3 (L5/E5)
|
d_rtklib_band_index[sig_]);
|
||||||
valid_obs++;
|
valid_obs++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -510,14 +594,9 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
{
|
{
|
||||||
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
|
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
|
||||||
}
|
}
|
||||||
if (sig_ == "7X")
|
|
||||||
{
|
|
||||||
gal_e5_is_e5b = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (sig_ == "E6")
|
if (sig_ == "E6")
|
||||||
{
|
{
|
||||||
gal_e6 = true;
|
|
||||||
galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
|
galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
|
||||||
if (galileo_ephemeris_iter != galileo_ephemeris_map.cend())
|
if (galileo_ephemeris_iter != galileo_ephemeris_map.cend())
|
||||||
{
|
{
|
||||||
@ -529,7 +608,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(d_obs_data[i + glo_valid_obs],
|
d_obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(d_obs_data[i + glo_valid_obs],
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
galileo_ephemeris_iter->second.WN,
|
galileo_ephemeris_iter->second.WN,
|
||||||
2); // Band E6
|
d_rtklib_band_index[sig_]);
|
||||||
found_E1_obs = true;
|
found_E1_obs = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -547,8 +626,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
galileo_ephemeris_iter->second.WN,
|
galileo_ephemeris_iter->second.WN,
|
||||||
2); // Band E6
|
d_rtklib_band_index[sig_]);
|
||||||
// std::cout << "Week " << galileo_ephemeris_iter->second.WN << '\n';
|
|
||||||
valid_obs++;
|
valid_obs++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -576,7 +654,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
gps_ephemeris_iter->second.WN,
|
gps_ephemeris_iter->second.WN,
|
||||||
0,
|
d_rtklib_band_index[sig_],
|
||||||
this->is_pre_2009());
|
this->is_pre_2009());
|
||||||
valid_obs++;
|
valid_obs++;
|
||||||
}
|
}
|
||||||
@ -606,7 +684,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(d_obs_data[i + glo_valid_obs],
|
d_obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(d_obs_data[i + glo_valid_obs],
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
eph_data[i].week,
|
eph_data[i].week,
|
||||||
1); // Band 2 (L2)
|
d_rtklib_band_index[sig_]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -625,7 +703,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
gps_cnav_ephemeris_iter->second.WN,
|
gps_cnav_ephemeris_iter->second.WN,
|
||||||
1); // Band 2 (L2)
|
d_rtklib_band_index[sig_]);
|
||||||
valid_obs++;
|
valid_obs++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -654,7 +732,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(d_obs_data[i],
|
d_obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(d_obs_data[i],
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
gps_cnav_ephemeris_iter->second.WN,
|
gps_cnav_ephemeris_iter->second.WN,
|
||||||
2); // Band 3 (L5)
|
d_rtklib_band_index[sig_]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -672,7 +750,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
gps_cnav_ephemeris_iter->second.WN,
|
gps_cnav_ephemeris_iter->second.WN,
|
||||||
2); // Band 3 (L5)
|
d_rtklib_band_index[sig_]);
|
||||||
valid_obs++;
|
valid_obs++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -700,7 +778,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
glonass_gnav_ephemeris_iter->second.d_WN,
|
glonass_gnav_ephemeris_iter->second.d_WN,
|
||||||
0); // Band 0 (L1)
|
d_rtklib_band_index[sig_]);
|
||||||
glo_valid_obs++;
|
glo_valid_obs++;
|
||||||
}
|
}
|
||||||
else // the ephemeris are not available for this SV
|
else // the ephemeris are not available for this SV
|
||||||
@ -723,7 +801,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[i + valid_obs] = insert_obs_to_rtklib(d_obs_data[i + valid_obs],
|
d_obs_data[i + valid_obs] = insert_obs_to_rtklib(d_obs_data[i + valid_obs],
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
glonass_gnav_ephemeris_iter->second.d_WN,
|
glonass_gnav_ephemeris_iter->second.d_WN,
|
||||||
1); // Band 1 (L2)
|
d_rtklib_band_index[sig_]);
|
||||||
found_L1_obs = true;
|
found_L1_obs = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -738,7 +816,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
glonass_gnav_ephemeris_iter->second.d_WN,
|
glonass_gnav_ephemeris_iter->second.d_WN,
|
||||||
1); // Band 1 (L2)
|
d_rtklib_band_index[sig_]);
|
||||||
glo_valid_obs++;
|
glo_valid_obs++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -766,7 +844,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
beidou_ephemeris_iter->second.WN + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET,
|
beidou_ephemeris_iter->second.WN + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET,
|
||||||
0);
|
d_rtklib_band_index[sig_]);
|
||||||
valid_obs++;
|
valid_obs++;
|
||||||
}
|
}
|
||||||
else // the ephemeris are not available for this SV
|
else // the ephemeris are not available for this SV
|
||||||
@ -788,7 +866,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(d_obs_data[i + glo_valid_obs],
|
d_obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(d_obs_data[i + glo_valid_obs],
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
beidou_ephemeris_iter->second.WN + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET,
|
beidou_ephemeris_iter->second.WN + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET,
|
||||||
2); // Band 3 (L2/G2/B3)
|
d_rtklib_band_index[sig_]);
|
||||||
found_B1I_obs = true;
|
found_B1I_obs = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -806,7 +884,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
d_obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||||
gnss_observables_iter->second,
|
gnss_observables_iter->second,
|
||||||
beidou_ephemeris_iter->second.WN + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET,
|
beidou_ephemeris_iter->second.WN + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET,
|
||||||
2); // Band 2 (L2/G2)
|
d_rtklib_band_index[sig_]);
|
||||||
valid_obs++;
|
valid_obs++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -922,20 +1000,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
{
|
{
|
||||||
for (int j = 0; j < NFREQ; j++)
|
for (int j = 0; j < NFREQ; j++)
|
||||||
{
|
{
|
||||||
if (j == 2 && gal_e6)
|
nav_data.lam[i][j] = satwavelen(i + 1, d_rtklib_freq_index[j], &nav_data);
|
||||||
{
|
|
||||||
// frq = 3 corresponds to E6 in that function
|
|
||||||
nav_data.lam[i][j] = satwavelen(i + 1, 3, &nav_data);
|
|
||||||
}
|
|
||||||
if (j == 2 && gal_e5_is_e5b)
|
|
||||||
{
|
|
||||||
// frq = 4 corresponds to E5B in that function
|
|
||||||
nav_data.lam[i][j] = satwavelen(i + 1, 4, &nav_data);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nav_data.lam[i][j] = satwavelen(i + 1, j, &nav_data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
#include "pvt_solution.h"
|
#include "pvt_solution.h"
|
||||||
#include "rtklib.h"
|
#include "rtklib.h"
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <cstdint>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -75,7 +76,11 @@
|
|||||||
class Rtklib_Solver : public Pvt_Solution
|
class Rtklib_Solver : public Pvt_Solution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Rtklib_Solver(const rtk_t& rtk, const std::string& dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat);
|
Rtklib_Solver(const rtk_t& rtk,
|
||||||
|
const std::string& dump_filename,
|
||||||
|
uint32_t type_of_rx,
|
||||||
|
bool flag_dump_to_file,
|
||||||
|
bool flag_dump_to_mat);
|
||||||
~Rtklib_Solver();
|
~Rtklib_Solver();
|
||||||
|
|
||||||
bool get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_map, bool flag_averaging);
|
bool get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_map, bool flag_averaging);
|
||||||
@ -118,10 +123,13 @@ private:
|
|||||||
|
|
||||||
std::array<obsd_t, MAXOBS> d_obs_data{};
|
std::array<obsd_t, MAXOBS> d_obs_data{};
|
||||||
std::array<double, 4> d_dop{};
|
std::array<double, 4> d_dop{};
|
||||||
rtk_t d_rtk{};
|
std::map<int, int> d_rtklib_freq_index;
|
||||||
Monitor_Pvt d_monitor_pvt{};
|
std::map<std::string, int> d_rtklib_band_index;
|
||||||
std::string d_dump_filename;
|
std::string d_dump_filename;
|
||||||
std::ofstream d_dump_file;
|
std::ofstream d_dump_file;
|
||||||
|
rtk_t d_rtk{};
|
||||||
|
Monitor_Pvt d_monitor_pvt{};
|
||||||
|
uint32_t d_type_of_rx;
|
||||||
bool d_flag_dump_enabled;
|
bool d_flag_dump_enabled;
|
||||||
bool d_flag_dump_mat_enabled;
|
bool d_flag_dump_mat_enabled;
|
||||||
};
|
};
|
||||||
|
@ -143,7 +143,7 @@ void NmeaPrinterTest::conf()
|
|||||||
TEST_F(NmeaPrinterTest, PrintLine)
|
TEST_F(NmeaPrinterTest, PrintLine)
|
||||||
{
|
{
|
||||||
std::string filename("nmea_test.nmea");
|
std::string filename("nmea_test.nmea");
|
||||||
std::shared_ptr<Rtklib_Solver> pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", false, false);
|
std::shared_ptr<Rtklib_Solver> pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 1, false, false);
|
||||||
|
|
||||||
boost::posix_time::ptime pt(boost::gregorian::date(1994, boost::date_time::Nov, 19),
|
boost::posix_time::ptime pt(boost::gregorian::date(1994, boost::date_time::Nov, 19),
|
||||||
boost::posix_time::hours(22) + boost::posix_time::minutes(54) + boost::posix_time::seconds(46));
|
boost::posix_time::hours(22) + boost::posix_time::minutes(54) + boost::posix_time::seconds(46));
|
||||||
|
@ -141,7 +141,7 @@ void RinexPrinterTest::conf()
|
|||||||
|
|
||||||
TEST_F(RinexPrinterTest, GalileoObsHeader)
|
TEST_F(RinexPrinterTest, GalileoObsHeader)
|
||||||
{
|
{
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", false, false);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 4, false, false);
|
||||||
auto eph = Galileo_Ephemeris();
|
auto eph = Galileo_Ephemeris();
|
||||||
eph.PRN = 1;
|
eph.PRN = 1;
|
||||||
pvt_solution->galileo_ephemeris_map[1] = eph;
|
pvt_solution->galileo_ephemeris_map[1] = eph;
|
||||||
@ -227,7 +227,7 @@ TEST_F(RinexPrinterTest, GalileoObsHeader)
|
|||||||
|
|
||||||
TEST_F(RinexPrinterTest, GlonassObsHeader)
|
TEST_F(RinexPrinterTest, GlonassObsHeader)
|
||||||
{
|
{
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", false, false);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 28, false, false);
|
||||||
auto eph = Glonass_Gnav_Ephemeris();
|
auto eph = Glonass_Gnav_Ephemeris();
|
||||||
eph.PRN = 1;
|
eph.PRN = 1;
|
||||||
pvt_solution->glonass_gnav_ephemeris_map[1] = eph;
|
pvt_solution->glonass_gnav_ephemeris_map[1] = eph;
|
||||||
@ -287,7 +287,7 @@ TEST_F(RinexPrinterTest, MixedObsHeader)
|
|||||||
auto eph_gps = Gps_Ephemeris();
|
auto eph_gps = Gps_Ephemeris();
|
||||||
eph_gal.PRN = 1;
|
eph_gal.PRN = 1;
|
||||||
eph_gps.PRN = 1;
|
eph_gps.PRN = 1;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", false, false);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 106, false, false);
|
||||||
pvt_solution->galileo_ephemeris_map[1] = eph_gal;
|
pvt_solution->galileo_ephemeris_map[1] = eph_gal;
|
||||||
|
|
||||||
pvt_solution->gps_ephemeris_map[1] = eph_gps;
|
pvt_solution->gps_ephemeris_map[1] = eph_gps;
|
||||||
@ -357,7 +357,7 @@ TEST_F(RinexPrinterTest, MixedObsHeaderGpsGlo)
|
|||||||
auto eph_gps = Gps_Ephemeris();
|
auto eph_gps = Gps_Ephemeris();
|
||||||
eph_glo.PRN = 1;
|
eph_glo.PRN = 1;
|
||||||
eph_gps.PRN = 1;
|
eph_gps.PRN = 1;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", false, false);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 26, false, false);
|
||||||
pvt_solution->glonass_gnav_ephemeris_map[1] = eph_glo;
|
pvt_solution->glonass_gnav_ephemeris_map[1] = eph_glo;
|
||||||
|
|
||||||
pvt_solution->gps_ephemeris_map[1] = eph_gps;
|
pvt_solution->gps_ephemeris_map[1] = eph_gps;
|
||||||
@ -424,7 +424,7 @@ TEST_F(RinexPrinterTest, GalileoObsLog)
|
|||||||
bool no_more_finds = false;
|
bool no_more_finds = false;
|
||||||
auto eph = Galileo_Ephemeris();
|
auto eph = Galileo_Ephemeris();
|
||||||
eph.PRN = 1;
|
eph.PRN = 1;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", false, false);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 4, false, false);
|
||||||
pvt_solution->galileo_ephemeris_map[1] = eph;
|
pvt_solution->galileo_ephemeris_map[1] = eph;
|
||||||
std::map<int, Gnss_Synchro> gnss_observables_map;
|
std::map<int, Gnss_Synchro> gnss_observables_map;
|
||||||
|
|
||||||
@ -504,7 +504,7 @@ TEST_F(RinexPrinterTest, GlonassObsLog)
|
|||||||
bool no_more_finds = false;
|
bool no_more_finds = false;
|
||||||
auto eph = Glonass_Gnav_Ephemeris();
|
auto eph = Glonass_Gnav_Ephemeris();
|
||||||
eph.PRN = 22;
|
eph.PRN = 22;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", false, false);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 23, false, false);
|
||||||
pvt_solution->glonass_gnav_ephemeris_map[1] = eph;
|
pvt_solution->glonass_gnav_ephemeris_map[1] = eph;
|
||||||
std::map<int, Gnss_Synchro> gnss_observables_map;
|
std::map<int, Gnss_Synchro> gnss_observables_map;
|
||||||
|
|
||||||
@ -586,7 +586,7 @@ TEST_F(RinexPrinterTest, GpsObsLogDualBand)
|
|||||||
auto eph_cnav = Gps_CNAV_Ephemeris();
|
auto eph_cnav = Gps_CNAV_Ephemeris();
|
||||||
eph.PRN = 1;
|
eph.PRN = 1;
|
||||||
eph_cnav.PRN = 1;
|
eph_cnav.PRN = 1;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", false, false);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 7, false, false);
|
||||||
pvt_solution->gps_ephemeris_map[1] = eph;
|
pvt_solution->gps_ephemeris_map[1] = eph;
|
||||||
pvt_solution->gps_cnav_ephemeris_map[1] = eph_cnav;
|
pvt_solution->gps_cnav_ephemeris_map[1] = eph_cnav;
|
||||||
std::map<int, Gnss_Synchro> gnss_observables_map;
|
std::map<int, Gnss_Synchro> gnss_observables_map;
|
||||||
@ -674,7 +674,7 @@ TEST_F(RinexPrinterTest, GpsObsLogDualBand)
|
|||||||
|
|
||||||
TEST_F(RinexPrinterTest, GalileoObsLogDualBand)
|
TEST_F(RinexPrinterTest, GalileoObsLogDualBand)
|
||||||
{
|
{
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", false, false);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 14, false, false);
|
||||||
auto eph = Galileo_Ephemeris();
|
auto eph = Galileo_Ephemeris();
|
||||||
eph.PRN = 1;
|
eph.PRN = 1;
|
||||||
pvt_solution->galileo_ephemeris_map[1] = eph;
|
pvt_solution->galileo_ephemeris_map[1] = eph;
|
||||||
@ -774,7 +774,7 @@ TEST_F(RinexPrinterTest, MixedObsLog)
|
|||||||
auto eph_gal = Galileo_Ephemeris();
|
auto eph_gal = Galileo_Ephemeris();
|
||||||
eph_gps.PRN = 1;
|
eph_gps.PRN = 1;
|
||||||
eph_gal.PRN = 1;
|
eph_gal.PRN = 1;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", false, false);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 9, false, false);
|
||||||
pvt_solution->gps_ephemeris_map[1] = eph_gps;
|
pvt_solution->gps_ephemeris_map[1] = eph_gps;
|
||||||
pvt_solution->galileo_ephemeris_map[1] = eph_gal;
|
pvt_solution->galileo_ephemeris_map[1] = eph_gal;
|
||||||
std::map<int, Gnss_Synchro> gnss_observables_map;
|
std::map<int, Gnss_Synchro> gnss_observables_map;
|
||||||
@ -898,7 +898,7 @@ TEST_F(RinexPrinterTest, MixedObsLogGpsGlo)
|
|||||||
auto eph_glo = Glonass_Gnav_Ephemeris();
|
auto eph_glo = Glonass_Gnav_Ephemeris();
|
||||||
eph_gps.PRN = 1;
|
eph_gps.PRN = 1;
|
||||||
eph_glo.PRN = 1;
|
eph_glo.PRN = 1;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", false, false);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 26, false, false);
|
||||||
pvt_solution->gps_ephemeris_map[1] = eph_gps;
|
pvt_solution->gps_ephemeris_map[1] = eph_gps;
|
||||||
pvt_solution->glonass_gnav_ephemeris_map[1] = eph_glo;
|
pvt_solution->glonass_gnav_ephemeris_map[1] = eph_glo;
|
||||||
std::map<int, Gnss_Synchro> gnss_observables_map;
|
std::map<int, Gnss_Synchro> gnss_observables_map;
|
||||||
|
@ -383,7 +383,7 @@ TEST(RTKLibSolverTest, test1)
|
|||||||
bool save_to_mat = false;
|
bool save_to_mat = false;
|
||||||
rtk_t rtk = configure_rtklib_options();
|
rtk_t rtk = configure_rtklib_options();
|
||||||
|
|
||||||
auto d_ls_pvt = std::make_unique<Rtklib_Solver>(rtk, nchannels, dump_filename, flag_dump_to_file, save_to_mat);
|
auto d_ls_pvt = std::make_unique<Rtklib_Solver>(rtk, nchannels, dump_filename, 1, flag_dump_to_file, save_to_mat);
|
||||||
d_ls_pvt->set_averaging_depth(1);
|
d_ls_pvt->set_averaging_depth(1);
|
||||||
|
|
||||||
// load ephemeris
|
// load ephemeris
|
||||||
|
Loading…
Reference in New Issue
Block a user