-
Notifications
You must be signed in to change notification settings - Fork 0
/
script_ang_acc.m
31 lines (23 loc) · 1.04 KB
/
script_ang_acc.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
% A script for producing angular accelerations (ACC)
% Neda Darbeheshti & Henry Wegener, AEI Hannover, 2018-10-22
%% computing angular accelerations
ddq_pure_A = NumDiff2(q_A_pure,5);
acc_ang_A = zeros(L,4);
for i = 1:L
wqua = [ -q_A_pure(i,2) q_A_pure(i,1) q_A_pure(i,4) -q_A_pure(i,3);
-q_A_pure(i,3) -q_A_pure(i,4) q_A_pure(i,1) q_A_pure(i,2);
-q_A_pure(i,4) q_A_pure(i,3) -q_A_pure(i,2) q_A_pure(i,1);
q_A_pure(i,1) q_A_pure(i,2) q_A_pure(i,3) q_A_pure(i,4) ];
acc_ang_A(i,:) = 2*wqua*ddq_pure_A(i,:)';
end
ddq_pure_B = NumDiff2(q_B_pure,5);
acc_ang_B = zeros(L,4);
for i = 1:L
wqub = [ -q_B_pure(i,2) q_B_pure(i,1) q_B_pure(i,4) -q_B_pure(i,3);
-q_B_pure(i,3) -q_B_pure(i,4) q_B_pure(i,1) q_B_pure(i,2);
-q_B_pure(i,4) q_B_pure(i,3) -q_B_pure(i,2) q_B_pure(i,1);
q_B_pure(i,1) q_B_pure(i,2) q_B_pure(i,3) q_B_pure(i,4) ];
acc_ang_B(i,:) = 2*wqub*ddq_pure_B(i,:)';
end
acc_ang_A = acc_ang_A(:,1:3);
acc_ang_B = acc_ang_B(:,1:3);