-
Notifications
You must be signed in to change notification settings - Fork 2
/
NE_test.m
47 lines (28 loc) · 1.12 KB
/
NE_test.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
function NE_test
load rob2;
tau1 = [];
tau2 = [];
error = [];
N = 2;
for i=(0:10),
for j=(0:10),
for k=(0:pi/10:2*pi),
rq = rand(1,N)*2*pi;
rqd = rand(1,N)*2*pi;
rqdd = rand(1,N)*2*pi;
[t,W,Wd,Wmd,Pdd,Pcdd,Rici,Rij,Rot] = NewtonEulerAux(N,1,1,1,1,1,[0;-9.81;0],rq,rqd,rqdd);
index = i*10+j+1;
tau1 = [tau1 t];
t2 = two_link_example_siciliano(1,1,1,9.81,1,1,rq,rqd,rqdd);
tau2 = [tau2 t2];
error = [error norm(t - t2)];
end
end
end
subplot(1,2,1);
plot(tau2','b+');
hold on;
plot(tau1','ro');
subplot(1,2,2);
plot(1:length(error),error,'r-');
title(sprintf('Error (Mean: %g Std: %g',mean(error),std(error)));