如何计算roll
、pitch
、yaw
?我们需要找到符号变量roll
、pitch
、yaw
的数值。
syms roll pitch yaw
C1i=[cos(yaw) sin(yaw) 0;
-sin(yaw) cos(yaw) 0;
0 0 1];
C21=[cos(pitch) 0 -sin(pitch);
0 1 0;
sin(pitch) 0 cos(pitch)];
Cb2=[1 0 0;
0 cos(roll) sin(roll);
0 -sin(roll) cos(roll)];
Cequivalent = Cb2*C21*C1i
R = [ 0.8748 -0.4636 0.1410; 0.4779 0.8735 -0.0933; -0.0799 0.1490 0.9856];
R == Cequivalent
您只需求解变量的方程组:
res = solve( vpa(R) == Cequivalent, roll, pitch, yaw);
然而,没有解决方案,所以我想你在某个地方犯了错误。
结果将采用可变精度算术(VPA(,并可转换为双精度:
res = double(res);