Skip to content

Commit 7888887

Browse files
authored
Update kalman_filter.m
Revert
1 parent 33d5cde commit 7888887

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

plugins/Kalman/m/kalman_filter.m

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
1-
function [P_store,z_inverse] = kalman_filter(m,P,A,Q,L,R, timeSteps ,number_of_frames, smoothing, q_given)
1+
function [P_store,z_inverse] = kalman_filter(m,P,A,Q,L,R, timeSteps ,number_of_frames, smoothing)
22
P_store = cell(0);
33
z_inverse = cell(0);
4-
if not(q_given)
5-
q_values = Q;
6-
end
7-
h = zef_waitbar(0, 'Filtering');
4+
h = zef_waitbar(0,1, 'Filtering');
85
for f_ind = 1: number_of_frames
9-
zef_waitbar(f_ind/number_of_frames,h,...
6+
zef_waitbar(f_ind,number_of_frames,h,...
107
['Filtering ' int2str(f_ind) ' of ' int2str(number_of_frames) '.']);
118
f = timeSteps{f_ind};
12-
if not(q_given)
13-
Q = diag(q_values(:,f_ind));
14-
end
159
% Prediction
16-
%[m,P] = zeffiro.plugins.Kalman.m.kf_predict(m, P, A, Q);
1710
[m,P] = kf_predict(m, P, A, Q);
1811
% Update
19-
%[m, P] = zeffiro.plugins.Kalman.m.kf_update(m, P, f, L, R);
2012
[m, P] = kf_update(m, P, f, L, R);
2113
if (smoothing == 2)
2214
P_store{f_ind} = gather(P);
2315
end
2416
z_inverse{f_ind} = gather(m);
2517
end
2618
close(h);
27-
end
19+
end

0 commit comments

Comments
 (0)