diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index 050e474e8..fc79642ea 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -534,19 +534,19 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, { // setup two PVT solvers: internal solver for rx clock and user solver // user PVT solver - d_user_pvt_solver = std::make_shared(rtk, dump_ls_pvt_filename, d_type_of_rx, d_dump, d_dump_mat, conf_); + d_user_pvt_solver = std::make_shared(rtk, conf_, dump_ls_pvt_filename, d_type_of_rx, d_dump, d_dump_mat); d_user_pvt_solver->set_pre_2009_file(conf_.pre_2009_file); // internal PVT solver, mainly used to estimate the receiver clock rtk_t internal_rtk = rtk; internal_rtk.opt.mode = PMODE_SINGLE; // use single positioning mode in internal PVT solver - d_internal_pvt_solver = std::make_shared(internal_rtk, dump_ls_pvt_filename, d_type_of_rx, false, false, conf_); + d_internal_pvt_solver = std::make_shared(internal_rtk, conf_, dump_ls_pvt_filename, d_type_of_rx, false, false); d_internal_pvt_solver->set_pre_2009_file(conf_.pre_2009_file); } else { // only one solver, customized by the user options - d_internal_pvt_solver = std::make_shared(rtk, dump_ls_pvt_filename, d_type_of_rx, d_dump, d_dump_mat, conf_); + d_internal_pvt_solver = std::make_shared(rtk, conf_, dump_ls_pvt_filename, d_type_of_rx, d_dump, d_dump_mat); d_internal_pvt_solver->set_pre_2009_file(conf_.pre_2009_file); d_user_pvt_solver = d_internal_pvt_solver; } diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index faf8af5f0..c7528749c 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -45,16 +45,16 @@ Rtklib_Solver::Rtklib_Solver(const rtk_t &rtk, + const Pvt_Conf &conf, const std::string &dump_filename, uint32_t type_of_rx, bool flag_dump_to_file, - bool flag_dump_to_mat, - Pvt_Conf conf) : d_dump_filename(dump_filename), - d_rtk(rtk), - d_conf(std::move(conf)), - d_type_of_rx(type_of_rx), - d_flag_dump_enabled(flag_dump_to_file), - d_flag_dump_mat_enabled(flag_dump_to_mat) + bool flag_dump_to_mat) : d_dump_filename(dump_filename), + d_rtk(rtk), + d_conf(std::move(conf)), + d_type_of_rx(type_of_rx), + d_flag_dump_enabled(flag_dump_to_file), + d_flag_dump_mat_enabled(flag_dump_to_mat) { // see freq index at src/algorithms/libs/rtklib/rtklib_rtkcmn.cc // function: satwavelen diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index f24a37b2a..3fcb50172 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -82,11 +82,12 @@ class Rtklib_Solver : public Pvt_Solution { public: Rtklib_Solver(const rtk_t& rtk, + const Pvt_Conf& conf, const std::string& dump_filename, uint32_t type_of_rx, bool flag_dump_to_file, - bool flag_dump_to_mat, - Pvt_Conf conf); + bool flag_dump_to_mat); + ~Rtklib_Solver(); bool get_PVT(const std::map& gnss_observables_map, double kf_update_interval_s); diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc index 5c56c6f7f..eac226411 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc @@ -147,7 +147,7 @@ TEST_F(NmeaPrinterTest, PrintLine) std::string filename("nmea_test.nmea"); Pvt_Conf conf; conf.use_e6_for_pvt = false; - std::shared_ptr pvt_solution = std::make_shared(rtk, "filename", 1, false, false, conf); + std::shared_ptr pvt_solution = std::make_shared(rtk, conf, "filename", 1, false, false); 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)); diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc index a4a4fe90a..8885e7367 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc @@ -145,7 +145,7 @@ TEST_F(RinexPrinterTest, GalileoObsHeader) { Pvt_Conf conf; conf.use_e6_for_pvt = false; - auto pvt_solution = std::make_shared(rtk, "filename", 4, false, false, conf); + auto pvt_solution = std::make_shared(rtk, conf, "filename", 4, false, false); auto eph = Galileo_Ephemeris(); eph.PRN = 1; pvt_solution->galileo_ephemeris_map[1] = eph; @@ -233,7 +233,7 @@ TEST_F(RinexPrinterTest, GlonassObsHeader) { Pvt_Conf conf; conf.use_e6_for_pvt = false; - auto pvt_solution = std::make_shared(rtk, "filename", 28, false, false, conf); + auto pvt_solution = std::make_shared(rtk, conf, "filename", 28, false, false); auto eph = Glonass_Gnav_Ephemeris(); eph.PRN = 1; pvt_solution->glonass_gnav_ephemeris_map[1] = eph; @@ -295,7 +295,7 @@ TEST_F(RinexPrinterTest, MixedObsHeader) eph_gps.PRN = 1; Pvt_Conf conf; conf.use_e6_for_pvt = false; - auto pvt_solution = std::make_shared(rtk, "filename", 106, false, false, conf); + auto pvt_solution = std::make_shared(rtk, conf, "filename", 106, false, false); pvt_solution->galileo_ephemeris_map[1] = eph_gal; pvt_solution->gps_ephemeris_map[1] = eph_gps; @@ -367,7 +367,7 @@ TEST_F(RinexPrinterTest, MixedObsHeaderGpsGlo) eph_gps.PRN = 1; Pvt_Conf conf; conf.use_e6_for_pvt = false; - auto pvt_solution = std::make_shared(rtk, "filename", 26, false, false, conf); + auto pvt_solution = std::make_shared(rtk, conf, "filename", 26, false, false); pvt_solution->glonass_gnav_ephemeris_map[1] = eph_glo; pvt_solution->gps_ephemeris_map[1] = eph_gps; @@ -436,7 +436,7 @@ TEST_F(RinexPrinterTest, GalileoObsLog) eph.PRN = 1; Pvt_Conf conf; conf.use_e6_for_pvt = false; - auto pvt_solution = std::make_shared(rtk, "filename", 4, false, false, conf); + auto pvt_solution = std::make_shared(rtk, conf, "filename", 4, false, false); pvt_solution->galileo_ephemeris_map[1] = eph; std::map gnss_observables_map; @@ -518,7 +518,7 @@ TEST_F(RinexPrinterTest, GlonassObsLog) eph.PRN = 22; Pvt_Conf conf; conf.use_e6_for_pvt = false; - auto pvt_solution = std::make_shared(rtk, "filename", 23, false, false, conf); + auto pvt_solution = std::make_shared(rtk, conf, "filename", 23, false, false); pvt_solution->glonass_gnav_ephemeris_map[1] = eph; std::map gnss_observables_map; @@ -602,7 +602,7 @@ TEST_F(RinexPrinterTest, GpsObsLogDualBand) eph_cnav.PRN = 1; Pvt_Conf conf; conf.use_e6_for_pvt = false; - auto pvt_solution = std::make_shared(rtk, "filename", 7, false, false, conf); + auto pvt_solution = std::make_shared(rtk, conf, "filename", 7, false, false); pvt_solution->gps_ephemeris_map[1] = eph; pvt_solution->gps_cnav_ephemeris_map[1] = eph_cnav; std::map gnss_observables_map; @@ -692,7 +692,7 @@ TEST_F(RinexPrinterTest, GalileoObsLogDualBand) { Pvt_Conf conf; conf.use_e6_for_pvt = false; - auto pvt_solution = std::make_shared(rtk, "filename", 14, false, false, conf); + auto pvt_solution = std::make_shared(rtk, conf, "filename", 14, false, false); auto eph = Galileo_Ephemeris(); eph.PRN = 1; pvt_solution->galileo_ephemeris_map[1] = eph; @@ -794,7 +794,7 @@ TEST_F(RinexPrinterTest, MixedObsLog) eph_gal.PRN = 1; Pvt_Conf conf; conf.use_e6_for_pvt = false; - auto pvt_solution = std::make_shared(rtk, "filename", 9, false, false, conf); + auto pvt_solution = std::make_shared(rtk, conf, "filename", 9, false, false); pvt_solution->gps_ephemeris_map[1] = eph_gps; pvt_solution->galileo_ephemeris_map[1] = eph_gal; std::map gnss_observables_map; @@ -920,7 +920,7 @@ TEST_F(RinexPrinterTest, MixedObsLogGpsGlo) eph_glo.PRN = 1; Pvt_Conf conf; conf.use_e6_for_pvt = false; - auto pvt_solution = std::make_shared(rtk, "filename", 26, false, false, conf); + auto pvt_solution = std::make_shared(rtk, conf, "filename", 26, false, false); pvt_solution->gps_ephemeris_map[1] = eph_gps; pvt_solution->glonass_gnav_ephemeris_map[1] = eph_glo; std::map gnss_observables_map; diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc index 805ffdb9e..fe2aa27af 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc @@ -386,7 +386,7 @@ TEST(RTKLibSolverTest, test1) Pvt_Conf conf; conf.use_e6_for_pvt = false; - auto d_ls_pvt = std::make_unique(rtk, nchannels, dump_filename, 1, flag_dump_to_file, save_to_mat, conf); + auto d_ls_pvt = std::make_unique(rtk, conf, nchannels, dump_filename, 1, flag_dump_to_file, save_to_mat); d_ls_pvt->set_averaging_depth(1); // load ephemeris