From 8f4866151ddbfbdf030d6287a14ba0238e2ebbf9 Mon Sep 17 00:00:00 2001 From: miguekf Date: Tue, 14 Mar 2023 16:14:21 +0100 Subject: [PATCH] MOD: format in vtl_engine --- src/algorithms/PVT/libs/vtl_engine.cc | 104 +++++++++----------------- 1 file changed, 37 insertions(+), 67 deletions(-) diff --git a/src/algorithms/PVT/libs/vtl_engine.cc b/src/algorithms/PVT/libs/vtl_engine.cc index 66d20189d..3e9f2ab88 100644 --- a/src/algorithms/PVT/libs/vtl_engine.cc +++ b/src/algorithms/PVT/libs/vtl_engine.cc @@ -69,20 +69,29 @@ bool Vtl_Engine::vtl_loop(Vtl_Data new_data) kf_F = arma::eye(n_of_states, n_of_states); kf_F_fill(kf_F, kf_dt); - //kf_H = arma::zeros(3 * new_data.sat_number, n_of_states); kf_y = arma::zeros(3 * new_data.sat_number, 1); kf_yerr = arma::zeros(3 * new_data.sat_number, 1); kf_xerr = arma::zeros(n_of_states, 1); kf_S = arma::zeros(3 * new_data.sat_number, 3 * new_data.sat_number); // kf_P_y innovation covariance matrix kf_K = arma::zeros(n_of_states, 3 * new_data.sat_number); - ; + d = arma::zeros(new_data.sat_number, 1); + rho_pri = arma::zeros(new_data.sat_number, 1); + rhoDot_pri = arma::zeros(new_data.sat_number, 1); + rhoDot2_pri = arma::zeros(new_data.sat_number, 1); + + rho_pri_filt = arma::zeros(new_data.sat_number, 1); + rhoDot_pri_filt = arma::zeros(new_data.sat_number, 1); + doppler_hz_filt = arma::zeros(new_data.sat_number, 1); + + a_x = arma::zeros(new_data.sat_number, 1); + a_y = arma::zeros(new_data.sat_number, 1); + a_z = arma::zeros(new_data.sat_number, 1); // ################## Kalman Tracking ###################################### counter++; //uint64_t if (counter>2500){ flag_time_cmd = true; } - //new_data.kf_state.print("new_data kf initial"); uint32_t closure_point = 3; if (counter < closure_point) @@ -120,7 +129,6 @@ bool Vtl_Engine::vtl_loop(Vtl_Data new_data) } // State error Covariance Matrix Q (PVT) - //careful, values for V and T could not be adecuate. kf_Q(0, 0) = 100.0; kf_Q(1, 1) = 100.0; kf_Q(2, 2) = 100.0; @@ -136,39 +144,15 @@ bool Vtl_Engine::vtl_loop(Vtl_Data new_data) // Measurement error Covariance Matrix R assembling for (int32_t i = 0; i < new_data.sat_number; i++) { - // It is diagonal 2*NSatellite x 2*NSatellite (NSat psudorange error;NSat pseudo range rate error) - kf_R(i, i) = 80.0; //*50.0/new_data.sat_CN0_dB_hz(i); //TODO: fill with real values. - kf_R(i + new_data.sat_number, i + new_data.sat_number) = 20.0; //*50.0/new_data.sat_CN0_dB_hz(i); - kf_R(i + 2 * new_data.sat_number, i + 2 * new_data.sat_number) = 400.0; //*50.0/new_data.sat_CN0_dB_hz(i); - - // if(80.0*50.0/new_data.sat_CN0_dB_hz(i)>90||20.0*50.0/new_data.sat_CN0_dB_hz(i)>25){ - // kf_R(i, i) = 10e4; - // kf_R(i + new_data.sat_number, i + new_data.sat_number) = 10e4; - // kf_R(i + 2*new_data.sat_number, i + 2*new_data.sat_number) = 10e4; - // cout<<"channel: "<