-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathekf_ukf_eif.m
56 lines (43 loc) · 1.31 KB
/
ekf_ukf_eif.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
close all; clc; clear;
addpath('common_function');
addpath('filter_folder');
%% simul
vel_noise = 2.0;
yaw_rate_noize = 6.0*pi/180.0;
position_noise = 0.5;
heading_noise_deg = 5;
% vel_noise = 0.0;
% yaw_rate_noize = 0.0*pi/180.0;
%
% position_noise = 0.0;
% heading_noise_deg = 0;
[GT_val, sensor_val, input_val] = simul(vel_noise, yaw_rate_noize, position_noise, heading_noise_deg);
%% init
Pval = 10000;
P0 = [Pval 0 0
0 Pval 0
0 0 Pval];
Qvar = 0.1;
Q = [Qvar 0 0
0 Qvar 0
0 0 Qvar/2];
R_var = 1;
R_head_var_rad = (5*pi/180)^2;
R = [R_var 0 0
0 R_var 0
0 0 R_head_var_rad];
%% EKF
[ekf_estimated_state, ekf_error] = ekf(P0, Q, R, GT_val, sensor_val, input_val);
[ekf_abs_mean_error] = calMeanError('EKF', ekf_error);
%% UKF
% UKF Parameters
alpha = 0.25;
beta = 2;
kappa = 0;
[ukf_estimated_state, ukf_error] = ukf(P0, Q, R, GT_val, sensor_val, input_val, alpha, beta, kappa);
[ukf_abs_mean_error] = calMeanError('UKF', ukf_error);
%% EIF
[eif_estimated_state, eif_error] = eif(P0, Q, R, GT_val, sensor_val, input_val);
[eif_abs_mean_error] = calMeanError('EIF', eif_error);
%% Error 비교
visualize_error_result(ekf_error, ukf_error, eif_error, ekf_abs_mean_error, ukf_abs_mean_error, eif_abs_mean_error);