diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index b4246cd7a..023f4842f 100755 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -204,7 +204,7 @@ bool Rtklib_Solver::save_matfile() const { // READ DUMP FILE const std::string dump_filename = d_dump_filename; - const int32_t number_of_double_vars = 22; //+1 MAGL + const int32_t number_of_double_vars = 23; //+2 MAGL const int32_t number_of_double_vars_sat = 8; //+ pos/vel/psrange/doppler for sat const int32_t number_of_uint32_vars = 2; const int32_t number_of_uint8_vars = 3; @@ -256,7 +256,8 @@ bool Rtklib_Solver::save_matfile() const auto cov_yz = std::vector(num_epoch); auto cov_zx = std::vector(num_epoch); - auto vel_z2 = std::vector(num_epoch); + auto clk_bias = std::vector(num_epoch); + auto clk_rate = std::vector(num_epoch); auto sat_posX_m = std::vector>(5, std::vector(num_epoch)); auto sat_posY_m = std::vector>(5, std::vector(num_epoch)); auto sat_posZ_m = std::vector>(5, std::vector(num_epoch)); @@ -302,7 +303,8 @@ bool Rtklib_Solver::save_matfile() const dump_file.read(reinterpret_cast(&cov_yz[i]), sizeof(double)); dump_file.read(reinterpret_cast(&cov_zx[i]), sizeof(double)); - dump_file.read(reinterpret_cast(&vel_z2[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&clk_bias[i]), sizeof(double)); + dump_file.read(reinterpret_cast(&clk_rate[i]), sizeof(double)); for (uint32_t chan = 0; chan < 5; chan++) { dump_file.read(reinterpret_cast(&sat_posX_m[chan][i]), sizeof(double)); @@ -436,7 +438,11 @@ bool Rtklib_Solver::save_matfile() const Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); - matvar = Mat_VarCreate("clk_bias_s", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), vel_z2.data(), 0); + matvar = Mat_VarCreate("clk_bias_s", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), clk_bias.data(), 0); + Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE + Mat_VarFree(matvar); + + matvar = Mat_VarCreate("clk_rate_s", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims.data(), clk_rate.data(), 0); Mat_VarWrite(matfp, matvar, MAT_COMPRESSION_ZLIB); // or MAT_COMPRESSION_NONE Mat_VarFree(matvar); @@ -1403,6 +1409,8 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ tmp_double = vtl_data.rx_dts(0); d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); + tmp_double = vtl_data.rx_dts(1); + d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); for (int n = 0; n<5; n++) { tmp_double = vtl_data.sat_p(n, 0);