1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-29 02:14:51 +00:00

Implementation of dynamic memory for RTKLIB

This commit is contained in:
Carles Fernandez 2019-07-29 18:46:29 +02:00
parent 68410f81d0
commit 2223a66f64
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 8 additions and 4 deletions

View File

@ -83,6 +83,7 @@ target_link_libraries(pvt_libs
Gflags::gflags Gflags::gflags
Glog::glog Glog::glog
Matio::matio Matio::matio
Volkgnsssdr::volkgnsssdr
) )
get_filename_component(PROTO_INCLUDE_HEADERS ${PROTO_HDRS} DIRECTORY) get_filename_component(PROTO_INCLUDE_HEADERS ${PROTO_HDRS} DIRECTORY)

View File

@ -63,6 +63,7 @@
#include "rtklib_solution.h" #include "rtklib_solution.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <matio.h> #include <matio.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <exception> #include <exception>
#include <utility> #include <utility>
#include <vector> #include <vector>
@ -443,8 +444,8 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
int glo_valid_obs = 0; // GLONASS L1/L2 valid observations counter int glo_valid_obs = 0; // GLONASS L1/L2 valid observations counter
obs_data.fill({}); obs_data.fill({});
eph_data.fill({}); auto eph_data = static_cast<eph_t *>(volk_gnsssdr_malloc(MAXOBS * sizeof(eph_t), volk_gnsssdr_get_alignment()));
geph_data.fill({}); auto geph_data = static_cast<geph_t *>(volk_gnsssdr_malloc(MAXOBS * sizeof(geph_t), volk_gnsssdr_get_alignment()));
// Workaround for NAV/CNAV clash problem // Workaround for NAV/CNAV clash problem
bool gps_dual_band = false; bool gps_dual_band = false;
@ -828,8 +829,8 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
{ {
int result = 0; int result = 0;
nav_t nav_data{}; nav_t nav_data{};
nav_data.eph = eph_data.data(); nav_data.eph = eph_data;
nav_data.geph = geph_data.data(); nav_data.geph = geph_data;
nav_data.n = valid_obs; nav_data.n = valid_obs;
nav_data.ng = glo_valid_obs; nav_data.ng = glo_valid_obs;
if (gps_iono.valid) if (gps_iono.valid)
@ -1154,5 +1155,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
} }
} }
} }
volk_gnsssdr_free(eph_data);
volk_gnsssdr_free(geph_data);
return is_valid_position(); return is_valid_position();
} }