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

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

问题描述

如何计算与齐次变换矩阵相关的滚转、俯仰和偏航角?

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.

推荐答案

你的方程是正确的仅当旋转顺序是:滚动,然后俯仰,然后偏航.作为记录,与欧拉角的对应关系(相对于用变换矩阵隐式给出的参考系)如下:

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 度之间);
  • Pitch 是绕 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).

给定这些,第一句中提到的顺序roll, pitch, yaw 对应于矩阵乘积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.

图取自维基百科

按照您对 这个 链接,我认为 这篇论文可能有助于理解您所指的程序.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天全站免登陆