mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-19 05:33:02 +00:00
Fix performance inefficiency detected by Coverity Scan
This commit is contained in:
parent
392b557a0a
commit
955770eb11
@ -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
|
// 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_type_of_rx, d_dump, d_dump_mat, conf_);
|
d_user_pvt_solver = std::make_shared<Rtklib_Solver>(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);
|
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, d_type_of_rx, false, false, conf_);
|
d_internal_pvt_solver = std::make_shared<Rtklib_Solver>(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);
|
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_type_of_rx, d_dump, d_dump_mat, conf_);
|
d_internal_pvt_solver = std::make_shared<Rtklib_Solver>(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_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;
|
||||||
}
|
}
|
||||||
|
@ -45,16 +45,16 @@
|
|||||||
|
|
||||||
|
|
||||||
Rtklib_Solver::Rtklib_Solver(const rtk_t &rtk,
|
Rtklib_Solver::Rtklib_Solver(const rtk_t &rtk,
|
||||||
|
const Pvt_Conf &conf,
|
||||||
const std::string &dump_filename,
|
const std::string &dump_filename,
|
||||||
uint32_t type_of_rx,
|
uint32_t type_of_rx,
|
||||||
bool flag_dump_to_file,
|
bool flag_dump_to_file,
|
||||||
bool flag_dump_to_mat,
|
bool flag_dump_to_mat) : d_dump_filename(dump_filename),
|
||||||
Pvt_Conf conf) : d_dump_filename(dump_filename),
|
d_rtk(rtk),
|
||||||
d_rtk(rtk),
|
d_conf(std::move(conf)),
|
||||||
d_conf(std::move(conf)),
|
d_type_of_rx(type_of_rx),
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
// see freq index at src/algorithms/libs/rtklib/rtklib_rtkcmn.cc
|
// see freq index at src/algorithms/libs/rtklib/rtklib_rtkcmn.cc
|
||||||
// function: satwavelen
|
// function: satwavelen
|
||||||
|
@ -82,11 +82,12 @@ class Rtklib_Solver : public Pvt_Solution
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Rtklib_Solver(const rtk_t& rtk,
|
Rtklib_Solver(const rtk_t& rtk,
|
||||||
|
const Pvt_Conf& conf,
|
||||||
const std::string& dump_filename,
|
const std::string& dump_filename,
|
||||||
uint32_t type_of_rx,
|
uint32_t type_of_rx,
|
||||||
bool flag_dump_to_file,
|
bool flag_dump_to_file,
|
||||||
bool flag_dump_to_mat,
|
bool flag_dump_to_mat);
|
||||||
Pvt_Conf conf);
|
|
||||||
~Rtklib_Solver();
|
~Rtklib_Solver();
|
||||||
|
|
||||||
bool get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_map, double kf_update_interval_s);
|
bool get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_map, double kf_update_interval_s);
|
||||||
|
@ -147,7 +147,7 @@ TEST_F(NmeaPrinterTest, PrintLine)
|
|||||||
std::string filename("nmea_test.nmea");
|
std::string filename("nmea_test.nmea");
|
||||||
Pvt_Conf conf;
|
Pvt_Conf conf;
|
||||||
conf.use_e6_for_pvt = false;
|
conf.use_e6_for_pvt = false;
|
||||||
std::shared_ptr<Rtklib_Solver> pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 1, false, false, conf);
|
std::shared_ptr<Rtklib_Solver> pvt_solution = std::make_shared<Rtklib_Solver>(rtk, conf, "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));
|
||||||
|
@ -145,7 +145,7 @@ TEST_F(RinexPrinterTest, GalileoObsHeader)
|
|||||||
{
|
{
|
||||||
Pvt_Conf conf;
|
Pvt_Conf conf;
|
||||||
conf.use_e6_for_pvt = false;
|
conf.use_e6_for_pvt = false;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 4, false, false, conf);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, conf, "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;
|
||||||
@ -233,7 +233,7 @@ TEST_F(RinexPrinterTest, GlonassObsHeader)
|
|||||||
{
|
{
|
||||||
Pvt_Conf conf;
|
Pvt_Conf conf;
|
||||||
conf.use_e6_for_pvt = false;
|
conf.use_e6_for_pvt = false;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 28, false, false, conf);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, conf, "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;
|
||||||
@ -295,7 +295,7 @@ TEST_F(RinexPrinterTest, MixedObsHeader)
|
|||||||
eph_gps.PRN = 1;
|
eph_gps.PRN = 1;
|
||||||
Pvt_Conf conf;
|
Pvt_Conf conf;
|
||||||
conf.use_e6_for_pvt = false;
|
conf.use_e6_for_pvt = false;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 106, false, false, conf);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, conf, "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;
|
||||||
@ -367,7 +367,7 @@ TEST_F(RinexPrinterTest, MixedObsHeaderGpsGlo)
|
|||||||
eph_gps.PRN = 1;
|
eph_gps.PRN = 1;
|
||||||
Pvt_Conf conf;
|
Pvt_Conf conf;
|
||||||
conf.use_e6_for_pvt = false;
|
conf.use_e6_for_pvt = false;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 26, false, false, conf);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, conf, "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;
|
||||||
@ -436,7 +436,7 @@ TEST_F(RinexPrinterTest, GalileoObsLog)
|
|||||||
eph.PRN = 1;
|
eph.PRN = 1;
|
||||||
Pvt_Conf conf;
|
Pvt_Conf conf;
|
||||||
conf.use_e6_for_pvt = false;
|
conf.use_e6_for_pvt = false;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 4, false, false, conf);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, conf, "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;
|
||||||
|
|
||||||
@ -518,7 +518,7 @@ TEST_F(RinexPrinterTest, GlonassObsLog)
|
|||||||
eph.PRN = 22;
|
eph.PRN = 22;
|
||||||
Pvt_Conf conf;
|
Pvt_Conf conf;
|
||||||
conf.use_e6_for_pvt = false;
|
conf.use_e6_for_pvt = false;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 23, false, false, conf);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, conf, "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;
|
||||||
|
|
||||||
@ -602,7 +602,7 @@ TEST_F(RinexPrinterTest, GpsObsLogDualBand)
|
|||||||
eph_cnav.PRN = 1;
|
eph_cnav.PRN = 1;
|
||||||
Pvt_Conf conf;
|
Pvt_Conf conf;
|
||||||
conf.use_e6_for_pvt = false;
|
conf.use_e6_for_pvt = false;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 7, false, false, conf);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, conf, "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;
|
||||||
@ -692,7 +692,7 @@ TEST_F(RinexPrinterTest, GalileoObsLogDualBand)
|
|||||||
{
|
{
|
||||||
Pvt_Conf conf;
|
Pvt_Conf conf;
|
||||||
conf.use_e6_for_pvt = false;
|
conf.use_e6_for_pvt = false;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 14, false, false, conf);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, conf, "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;
|
||||||
@ -794,7 +794,7 @@ TEST_F(RinexPrinterTest, MixedObsLog)
|
|||||||
eph_gal.PRN = 1;
|
eph_gal.PRN = 1;
|
||||||
Pvt_Conf conf;
|
Pvt_Conf conf;
|
||||||
conf.use_e6_for_pvt = false;
|
conf.use_e6_for_pvt = false;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 9, false, false, conf);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, conf, "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;
|
||||||
@ -920,7 +920,7 @@ TEST_F(RinexPrinterTest, MixedObsLogGpsGlo)
|
|||||||
eph_glo.PRN = 1;
|
eph_glo.PRN = 1;
|
||||||
Pvt_Conf conf;
|
Pvt_Conf conf;
|
||||||
conf.use_e6_for_pvt = false;
|
conf.use_e6_for_pvt = false;
|
||||||
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, "filename", 26, false, false, conf);
|
auto pvt_solution = std::make_shared<Rtklib_Solver>(rtk, conf, "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;
|
||||||
|
@ -386,7 +386,7 @@ TEST(RTKLibSolverTest, test1)
|
|||||||
|
|
||||||
Pvt_Conf conf;
|
Pvt_Conf conf;
|
||||||
conf.use_e6_for_pvt = false;
|
conf.use_e6_for_pvt = false;
|
||||||
auto d_ls_pvt = std::make_unique<Rtklib_Solver>(rtk, nchannels, dump_filename, 1, flag_dump_to_file, save_to_mat, conf);
|
auto d_ls_pvt = std::make_unique<Rtklib_Solver>(rtk, conf, 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