matlab: Fix derivation for 321 Euler rotation sequence

This commit is contained in:
Paul Riseborough 2017-07-21 10:48:54 +10:00
parent 26b5f26891
commit 5aeeebf7ac
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ syms q0 q1 q2 q3 'real'
Tbn_quat = Quat2Tbn([q0;q1;q2;q3]);
% calculate the y,x terms required for calculation fo the yaw angle
yaw_input_321 = [Tbn_quat(1,2);Tbn_quat(1,1)];
yaw_input_321 = [Tbn_quat(2,1);Tbn_quat(1,1)];
% convert to c code and save
ccode(yaw_input_321,'file','yaw_input_321.c');

View File

@ -1,2 +1,2 @@
A0[0][0] = q0*q3*-2.0+q1*q2*2.0;
A0[0][0] = q0*q3*2.0+q1*q2*2.0;
A0[1][0] = q0*q0+q1*q1-q2*q2-q3*q3;