diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index d20cac4c6..368fbabe7 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -83,6 +83,7 @@ target_link_libraries(pvt_libs Gflags::gflags Glog::glog Matio::matio + Volkgnsssdr::volkgnsssdr ) get_filename_component(PROTO_INCLUDE_HEADERS ${PROTO_HDRS} DIRECTORY) diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 2bdbf95ba..6aadfcea8 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -63,6 +63,7 @@ #include "rtklib_solution.h" #include #include +#include #include #include #include @@ -443,8 +444,8 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ int glo_valid_obs = 0; // GLONASS L1/L2 valid observations counter obs_data.fill({}); - eph_data.fill({}); - geph_data.fill({}); + auto eph_data = static_cast(volk_gnsssdr_malloc(MAXOBS * sizeof(eph_t), volk_gnsssdr_get_alignment())); + auto geph_data = static_cast(volk_gnsssdr_malloc(MAXOBS * sizeof(geph_t), volk_gnsssdr_get_alignment())); // Workaround for NAV/CNAV clash problem bool gps_dual_band = false; @@ -828,8 +829,8 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ { int result = 0; nav_t nav_data{}; - nav_data.eph = eph_data.data(); - nav_data.geph = geph_data.data(); + nav_data.eph = eph_data; + nav_data.geph = geph_data; nav_data.n = valid_obs; nav_data.ng = glo_valid_obs; if (gps_iono.valid) @@ -1154,5 +1155,7 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ } } } + volk_gnsssdr_free(eph_data); + volk_gnsssdr_free(geph_data); return is_valid_position(); }