From f716b040027a569b11e7aec33859d45fd45205cf Mon Sep 17 00:00:00 2001 From: "M.A.Gomez" Date: Thu, 24 Nov 2022 17:04:18 +0000 Subject: [PATCH] ADD: vtl file output --- src/algorithms/PVT/libs/rtklib_solver.cc | 29 +++++----- src/algorithms/PVT/libs/vtl_engine.cc | 73 +++++++++++++++++------- 2 files changed, 68 insertions(+), 34 deletions(-) diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 7e438035d..f9030d641 100755 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -1053,6 +1053,9 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ dops(index_aux, azel.data(), 0.0, d_dop.data()); } this->set_valid_position(true); + //this->set_averaging_flag(true); + //this->set_averaging_depth(100); + //this->perform_pos_averaging(); std::array rx_position_and_time{}; rx_position_and_time[0] = pvt_sol.rr[0]; // [m] rx_position_and_time[1] = pvt_sol.rr[1]; // [m] @@ -1119,10 +1122,8 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ new_vtl_data.sat_health_flag(n) = svh.at(n); new_vtl_data.sat_CN0_dB_hz(n) = d_obs_data.at(n).SNR[0]; // TODO: first version of VTL works only with ONE frequency band (band #0 is L1) - //new_vtl_data.pr_m(n) = d_obs_data.at(n).P[0]; //RAW pseudoranges //To.Do: check it VTL uses all the information as in rtklib rescode function: v[nv] = P - (r + dtr - SPEED_OF_LIGHT_M_S * dts[i * 2] + dion + dtrp); //corrected pr with code bias, iono and tropo. Still needs the dtr(rx clock bias) and satellite clock bias (dts) - //cout<<"dtr "< &gnss_observables_ //new_vtl_data.debug_print(); double PVT[6]={0}; vtl_engine.vtl_loop(new_vtl_data, PVT); - pvt_sol.rr[0]=PVT[0]; - pvt_sol.rr[1]=PVT[1]; - pvt_sol.rr[2]=PVT[2]; - pvt_sol.rr[3]=PVT[3]; - pvt_sol.rr[4]=PVT[4]; - pvt_sol.rr[5]=PVT[5]; + // pvt_sol.rr[0]=PVT[0]; + // pvt_sol.rr[1]=PVT[1]; + // pvt_sol.rr[2]=PVT[2]; + // pvt_sol.rr[3]=PVT[3]; + // pvt_sol.rr[4]=PVT[4]; + // pvt_sol.rr[5]=PVT[5]; } else{ //MAGL: the code should not enter here once the vtl has started // .. but it does! //and not only that but pvt_sol.rr seems to have NOT reasonable values - pvt_sol.rr[0]=rx_position_and_time[0]; // [m] - pvt_sol.rr[1]=rx_position_and_time[1]; // [m] - pvt_sol.rr[2]=rx_position_and_time[2]; // [m] - pvt_sol.rr[3]=4.2e6; - pvt_sol.rr[4]=4.2e6; - pvt_sol.rr[5]=4.2e6; + // pvt_sol.rr[0]=rx_position_and_time[0]; // [m] + // pvt_sol.rr[1]=rx_position_and_time[1]; // [m] + // pvt_sol.rr[2]=rx_position_and_time[2]; // [m] + // pvt_sol.rr[3]=4.2e6; + // pvt_sol.rr[4]=4.2e6; + // pvt_sol.rr[5]=4.2e6; } // compute Ground speed and COG double ground_speed_ms = 0.0; diff --git a/src/algorithms/PVT/libs/vtl_engine.cc b/src/algorithms/PVT/libs/vtl_engine.cc index 7deb893d9..817f0cbe0 100755 --- a/src/algorithms/PVT/libs/vtl_engine.cc +++ b/src/algorithms/PVT/libs/vtl_engine.cc @@ -16,6 +16,7 @@ #include "vtl_engine.h" #include "iostream" +#include using namespace std; @@ -37,7 +38,7 @@ bool Vtl_Engine::vtl_loop(Vtl_Data new_data, double PVT_out[6]) kf_P_x = arma::eye(8, 8); //TODO: use a real value. kf_x = arma::zeros(8, 1); kf_R = arma::zeros(2*new_data.sat_number, 2*new_data.sat_number); - double kf_dt=1e-1; + double kf_dt=0.1; kf_Q = arma::zeros(8, 8); kf_F = arma::zeros(8, 8); @@ -59,8 +60,9 @@ bool Vtl_Engine::vtl_loop(Vtl_Data new_data, double PVT_out[6]) // ################## Kalman Tracking ###################################### static uint32_t counter=0; //counter + static double prueba[6]={0}; //counter counter=counter+1; //uint64_t - cout << "counter" << counter; + cout << "counter" << counter<