横滚,俯仰,偏航计算 [英] Roll, pitch, yaw calculation

查看:713
本文介绍了横滚,俯仰,偏航计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何计算与均匀变换矩阵相关的侧倾角,俯仰角和偏航角?

How can I calculate the roll, pitch and yaw angles associated with a homogeneous transformation matrix?

目前我使用以下公式,但我没有确定它们是否正确。

I am using the following formulas at the moment, but I am not sure whether they are correct or not.

pitch = atan2( -r20, sqrt(r21*r21+r22*r22) );
yaw   = atan2(  r10, r00 );
roll  = atan2(  r21, r22 );

r10表示第二行和第一列。

r10 means second row and first column.

推荐答案

仅当旋转顺序为:滚动,俯仰,然后偏航时,您的方程式才正确。对于记录,与Euler角的对应关系(相对于转换矩阵隐式给出的参照系)如下:

Your equations are correct only if the order of rotations is: roll, then pitch, then yaw. For the record, the correspondence with Euler angles (with respect to the frame of reference implicitly given with the transformation matrix) is as follows:


  • Roll 是绕 x轴(在-180至180度之间)的旋转;

  • 俯仰是绕 y轴的旋转(在-90和90度之间);

  • Yaw 是绕的旋转z轴(在-180和180之间)。

  • Roll is the rotation about the x axis (between -180 and 180 deg);
  • Pitch is the rotations about the y axis (between -90 and 90 deg);
  • Yaw is the rotation about the z axis (between -180 and 180).

鉴于这些,顺序侧倾,俯仰,偏航第一句中提到的对应于由矩阵乘积 Rz Ry Rx 获得的旋转矩阵(按此顺序)。请注意,您的公式会以弧度给出这些角度的值(乘以180,然后除以pi,以度为单位)。所有旋转都是相对于轴逆时针旋转的。

Given these, the order roll, pitch, yaw mentioned in the first sentence corresponds to the rotation matrix obtain by the matrix product Rz Ry Rx (in this order). Note that your formula give the values of these angles in radians (multiply by 180 and divide by pi to obtain values in degrees). All rotations are counter-clockwise with respect to the axis.


该图取自 Wikipedia

在您对链接,我认为本文可能有助于理解您所指的程序。 Matlab函数的输入应该是您的变换矩阵,如果您希望以度为单位返回角度,则后跟 deg,如果旋转顺序是围绕z,然后围绕y,则过时的选项 zyx ,然后绕x。

Following your comment about this link, I think this paper might help to understand the program you are referring to. The input to the Matlab function is supposed to be your transformation matrix, followed by 'deg' if you want the angles to be returned in degrees, and an obsolete option 'zyx' if the order of the rotations is around z, then around y, then around x.

这篇关于横滚,俯仰,偏航计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆