forked from Archive/PX4-Autopilot
matlab: Fix derivation for 321 Euler rotation sequence
This commit is contained in:
parent
26b5f26891
commit
5aeeebf7ac
|
@ -22,7 +22,7 @@ syms q0 q1 q2 q3 'real'
|
||||||
Tbn_quat = Quat2Tbn([q0;q1;q2;q3]);
|
Tbn_quat = Quat2Tbn([q0;q1;q2;q3]);
|
||||||
|
|
||||||
% calculate the y,x terms required for calculation fo the yaw angle
|
% 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
|
% convert to c code and save
|
||||||
ccode(yaw_input_321,'file','yaw_input_321.c');
|
ccode(yaw_input_321,'file','yaw_input_321.c');
|
||||||
|
|
|
@ -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;
|
A0[1][0] = q0*q0+q1*q1-q2*q2-q3*q3;
|
||||||
|
|
Loading…
Reference in New Issue