forked from mfkiwl/OpenRTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSPP_RTS.m
73 lines (60 loc) · 1.78 KB
/
SPP_RTS.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
% initialize with final estimation
x_N = kf.X;
P_N = kf.P;
N = size(X_post,1);
F = eye(nStates);
P_RTS = zeros(nStates,nStates,N);
X_RTS = zeros(N,nStates);
P_RTS(:,:,end) = kf.P;
X_RTS(end,:) = kf.X.';
for k = N-1:-1:1
% RTS
K_k = (P_post(:,:,k) * F.') / P_pri(:,:,k+1);
P_RTS(:,:,k) = P_post(:,:,k) - K_k * (P_pri(:,:,k+1) - P_RTS(:,:,k+1)) * K_k.';
X_RTS(k,:) = (X_post(k,:).' + K_k * (X_RTS(k+1,:)' - X_pri(k+1,:).')).';
end
%%
afigure(42);
subplot(4,2,1);
hold on; grid on;
yline(station_pos__m(1), 'Color', Color.BLACK, 'HandleVisibility','off')
plot(X_RTS(:,1), 'DisplayName', 'RTS (5 States)')
ylim([station_pos__m(1)-50, station_pos__m(1)+50])
legend('show')
subplot(4,2,2);
hold on; grid on;
plot(station_pos__m(1) - X_RTS(:,1), 'DisplayName', 'RTS (5 States)')
ylim([-20 20])
legend('show')
subplot(4,2,3);
hold on; grid on;
yline(station_pos__m(2), 'Color', Color.BLACK, 'HandleVisibility','off')
plot(X_RTS(:,2), 'DisplayName', 'RTS (5 States)')
ylim([station_pos__m(2)-50, station_pos__m(2)+50])
legend('show')
subplot(4,2,4);
hold on; grid on;
plot(station_pos__m(2) - X_RTS(:,2), 'DisplayName', 'RTS (5 States)')
ylim([-20 20])
legend('show')
subplot(4,2,5);
hold on; grid on;
yline(station_pos__m(3), 'Color', Color.BLACK, 'HandleVisibility','off')
plot(X_RTS(:,3), 'DisplayName', 'RTS (5 States)')
ylim([station_pos__m(3)-50, station_pos__m(3)+50])
legend('show')
subplot(4,2,6);
hold on; grid on;
plot(station_pos__m(3) - X_RTS(:,3), 'DisplayName', 'RTS (5 States)')
ylim([-20 20])
legend('show')
subplot(4,2,7);
hold on; grid on;
title('dt_r')
plot(X_RTS(:,4) ./ Transformation.SpeedOfLight__mDs, 'DisplayName', 'RTS (5 States)')
legend('show')
subplot(4,2,8);
hold on; grid on;
title('ZTD_w')
plot(X_RTS(:,5), 'DisplayName', 'RTS (5 States)')
legend('show')