-
Notifications
You must be signed in to change notification settings - Fork 1
/
AndrewPlotterComplexPaper2.m
53 lines (44 loc) · 1.43 KB
/
AndrewPlotterComplexPaper2.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
clc; clear all;
t = linspace(0,20-20/2000,2000);
pydata = csvread('EE_complex_paper_2.csv');
dFpy = pydata(:,1) - 0.025;
dRpy = pydata(:,2) - 0.0395;
dFpy = downsample(dFpy,10);
dRpy = downsample(dRpy,10);
load('Paperbot_Complex2_Data_Trial1.mat');
dF1 = distance_F_library/409.6;
dR1 = distance_R_library/409.6;
dF1 = downsample(dF1,10);
dR1 = downsample(dR1,10);
load('Paperbot_Complex2_Data_Trial2.mat');
dF2 = distance_F_library/409.6;
dR2 = distance_R_library/409.6;
dF2 = downsample(dF2,10);
dR2 = downsample(dR2,10);
load('Paperbot_Complex2_Data_Trial3.mat');
dF3 = distance_F_library/409.6;
dR3 = distance_R_library/409.6;
dF3 = downsample(dF3,10);
dR3 = downsample(dR3,10);
figure(1)
subplot(2,1,1)
plot(t,dF1,'.',t,dF2,'.',t,dF3,'.','MarkerSize',3); hold on;
plot(t,dFpy,'k','Linewidth',1.5)
title('Front Sensor')
xlabel('Time, {\it t} [s]')
ylabel('Lidar Distance [m]')
legend('Simulation 1','Simulation 2','Simulation 3','Model','location','best')
% plot(tEE,M(:,1)-.025,'k')
subplot(2,1,2)
plot(t,dR1,'.',t,dR2,'.',t,dR3,'.','MarkerSize',3); hold on;
plot(t,dRpy,'k','Linewidth',1.5)
title('Right Sensor')
xlabel('Time, {\it t} [s]')
ylabel('Lidar Distance [m]')
muF = mean([dF1; dF2; dF3]);
PEF = 100*abs(dFpy - muF')./((dFpy+muF')/2);
disp(mean(PEF))
muR = mean([dR1; dR2; dR3]);
PER = 100*abs(dRpy - muR')./((dRpy+muR')/2);
disp(mean(PER))
saveas(gcf,'Lab3_PaperComplicated2_Lidar.pdf')