forked from marcociccone/2D-tracking-EKF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.m
53 lines (44 loc) · 1.86 KB
/
main.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
%% main script with parameters
clear all;
close all;
clc;
%% define the positions of the sensors
beacons_position = [7.5,3.5; ...
15,5; ...
20,3.5; ...
20,7.5; ...
7.5,7.5; ...
10,10; ...
10,2; ...
17.5,10; ...
17.5,2; ...
];
beacons_radius = 7;
sampling_time = 1;
var_z = 0.1;
motion_model = 'P';
motion_model = 'PV';
%measurement_model = 'rssi';
measurement_model = 'euclidean';
%name_trajectory = 'easy2.mat';
name_trajectory = 'hard2.mat';
[prediction, dist_err, dist_max, RMSE_x, RMSE_y, RMSE_net] = ekf_tracking( name_trajectory, ...
beacons_position, ...
beacons_radius, ...
motion_model, ...
measurement_model, ...
sampling_time, ...
var_z ...
);
disp(['Distance Error Avg: ',num2str(dist_err)]);
disp(['Distance Error Max : ',num2str(dist_max)]);
disp(['RMSE_x : ',num2str(RMSE_x)]);
disp(['RMSE_y : ',num2str(RMSE_y)]);
disp(['RMSE_net : ',num2str(RMSE_net)]);
if (strcmp(measurement_model, 'euclidean'))
plot(prediction(:,1),prediction(:,2),'Color','Green');
elseif (strcmp(measurement_model, 'rssi'))
plot(prediction(:,1),prediction(:,2),'Color','Red');
end
xlabel('x coordinate [m]');
ylabel('y coordinate [m]');