diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 604485b04..2bdbf95ba 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -94,7 +94,6 @@ Rtklib_Solver::Rtklib_Solver(int nchannels, std::string dump_filename, bool flag d_dump_filename = std::move(dump_filename); d_flag_dump_enabled = flag_dump_to_file; d_flag_dump_mat_enabled = flag_dump_to_mat; - count_valid_position = 0; this->set_averaging_flag(false); rtk_ = rtk; @@ -443,9 +442,9 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ int valid_obs = 0; // valid observations counter int glo_valid_obs = 0; // GLONASS L1/L2 valid observations counter - std::array obs_data{}; - std::vector eph_data(MAXOBS); - std::vector geph_data(MAXOBS); + obs_data.fill({}); + eph_data.fill({}); + geph_data.fill({}); // Workaround for NAV/CNAV clash problem bool gps_dual_band = false; @@ -914,7 +913,13 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ } /* update carrier wave length using native function call in RTKlib */ - uniqnav(&nav_data); + for (int i = 0; i < MAXSAT; i++) + { + for (int j = 0; j < NFREQ; j++) + { + nav_data.lam[i][j] = satwavelen(i + 1, j, &nav_data); + } + } result = rtkpos(&rtk_, obs_data.data(), valid_obs + glo_valid_obs, &nav_data); diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 1fa4ba8dd..146a96b04 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -126,8 +126,6 @@ public: Beidou_Dnav_Iono beidou_dnav_iono; std::map beidou_dnav_almanac_map; - int count_valid_position; - private: rtk_t rtk_{}; std::string d_dump_filename; @@ -137,6 +135,9 @@ private: bool d_flag_dump_mat_enabled; int d_nchannels; // Number of available channels for positioning std::array dop_{}; + std::array obs_data{}; + std::array eph_data{}; + std::array geph_data{}; Monitor_Pvt monitor_pvt{}; };