mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-22 03:00:36 +08:00
matlab: Fix derivation for 321 Euler rotation sequence
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user