From 33bd8d49376901b7f13495e29c8fae44648a146d Mon Sep 17 00:00:00 2001 From: miguekf Date: Mon, 19 Dec 2022 18:56:45 +0100 Subject: [PATCH] MOD: matlab file kf_vtl parameter for state number --- src/utils/matlab/vtl/kf_prototype.m | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/utils/matlab/vtl/kf_prototype.m b/src/utils/matlab/vtl/kf_prototype.m index 0c89c9451..422f0ff26 100644 --- a/src/utils/matlab/vtl/kf_prototype.m +++ b/src/utils/matlab/vtl/kf_prototype.m @@ -2,17 +2,27 @@ %% sat_number=5; %% ################## Kalman filter initialization ###################################### +st_nmbr=8; % covariances (static) -kf_P_x = eye(8); %TODO: use a real value. -kf_x = zeros(8, 1); +kf_P_x = eye(st_nmbr); %TODO: use a real value. +kf_x = zeros(st_nmbr, 1); kf_R = zeros(2*sat_number, 2*sat_number); kf_dt=0.1; -% kf_F = eye(8, 8); +% kf_F = eye(st_nmbr, st_nmbr); % kf_F(1, 4) = kf_dt; % kf_F(2, 5) = kf_dt; % kf_F(3, 6) = kf_dt; % kf_F(7, 8) = kf_dt; +% kf_F=[ 1 0 0 kf_dt 0 0 0 0 0 +% 0 1 0 0 kf_dt 0 0 0 0 +% 0 0 1 0 0 kf_dt 0 0 0 +% 0 0 0 1 0 0 0 0 0 +% 0 0 0 0 1 0 0 0 0 +% 0 0 0 0 0 1 0 0 0 +% 0 0 0 0 0 0 1 kf_dt kf_dt^2/2 +% 0 0 0 0 0 0 0 kf_dt 1]; + kf_F=[ 1 0 0 kf_dt 0 0 0 0 0 1 0 0 kf_dt 0 0 0 0 0 1 0 0 kf_dt 0 0 @@ -22,7 +32,7 @@ kf_F=[ 1 0 0 kf_dt 0 0 0 0 0 0 0 0 0 0 1 kf_dt 0 0 0 0 0 0 0 1]; -kf_H = zeros(2*sat_number,8); +kf_H = zeros(2*sat_number,st_nmbr); kf_y = zeros(2*sat_number, 1); kf_yerr = zeros(2*sat_number, 1); % kf_xerr = zeros(8, 1); @@ -48,7 +58,7 @@ for t=2:length(navSolution.RX_time) %% State error Covariance Matrix Q (PVT) and R (MEASUREMENTS) if (t