姿态角

机器人、传感器都会用到姿态角的相关知识,近期实习也在接触了这些东西,同时自己对这些也非常感兴趣,故进行梳理一下。

前提

本文提到作如下定义:

旋转矩阵:这是用于坐标系转换变换的矩阵\({R_{B}^{A}}\),即\([ \bar{x}_{A}\, \bar{y}_{A}\bar{z}_{A} ]{R_{B}^{A}}=[ \bar{x}_{B}\, \bar{y}_{B}\bar{z}_{B}  ]\),A坐标系通过旋转矩阵\(R_{B}^{A}\)转换为B坐标系

惯性坐标系:\(n-\bar{x}_{n}\bar{y}_{n}\bar{z}_{n}\)

体(机体)坐标系:\(b-\bar{x}_{b}\bar{y}_{b}\bar{z}_{b}\)

航姿系统中的翻滚角(Roll)、俯仰角(Pitch)和航向角(Yaw),通常使用φ,θ,ψ这3个符号进行表示,为了方便阅读,使用\(\theta_{x}\),(\theta_{y}\)和(\theta_{z}\)进行表示。

简介

欧拉角用来确定定点转动刚体位置的3个一组独立角参量,为欧拉首先提出而得名。欧拉角大致分为两大类,一类是基于机体自身坐标系的旋转组合,另一类是基于外界坐标系(如世界坐标系)的旋转组合。今天我们主要介绍介于自身坐标系(体坐标系)旋转,其组合有12种:

  • 常规欧拉角            (Z-X-Z, X-Y-X, Y-Z-Y, Z-Y-Z, X-Z-X, Y-X-Y)
  • 泰特 - 布赖恩角     (X-Y-Z, Y-Z-X, Z-X-Y, X-Z-Y, Z-Y-X, Y-X-Z)

这里,我们提到了绕体坐标系上的X、Y或Z轴进行旋转。其旋转矩阵如下:

绕X轴旋转矩阵

\( ^{A}_{B}{\left [R_{x}  \right ]}(\theta_{x})=\left [\begin{array}{ccc}
1 & 0 & 0\\
0 & cos\theta_{x} & -sin\theta_{x}\\
0 & sin\theta_{x} & cos\theta_{x}
\end{array} \right] \)

绕Y轴旋转矩阵

\( ^{A}_{B}{\left [R_{y}  \right ]}(\theta_{y})=\left [\begin{array}{ccc}
cos\theta_{y} & 0 & sin\theta_{y}\\
0 & 1 & 0\\
-sin\theta_{y} & 0 & cos\theta_{y}
\end{array} \right ] \)


绕Z轴旋转矩阵

\( ^{A}_{B}{\left [R_{z}  \right ]}(\theta_{z})= \left [\begin{array}{ccc}
cos\theta_{z} & -sin\theta_{z} & 0\\
sin\theta_{z} & cos\theta_{z} & 0\\
0 & 0 & 1
\end{array} \right] \)

 有了这些,就可以开始使用3个绕自身体坐标系旋转的角的组合描述机体相对与目标的旋转矩阵,航姿对应的旋转矩阵是唯一的,可以用12种欧拉角进行表示,航模和机器人中比较常用的是Z‘Y’X‘和Z’X‘Y’这两种。

欧拉角Z'Y'X'

\(n-\bar{x}_{n}\bar{y}_{n}\bar{z}_{n}\overset{\bar{z}_{n}\,\theta_{z} }{\longrightarrow}1-\bar{x}_{1}\bar{y}_{1}\bar{z}_{1}\overset{\bar{y}_{1}\,\theta_{y}}{\longrightarrow}2-\bar{x}_{2}\bar{y}_{2}\bar{z}_{2}\overset{\bar{x}_{2}\,\theta_{x}}{\longrightarrow}b-\bar{x}_{b}\bar{y}_{b}\bar{z}_{b}\)

先绕轴 \( \bar{z}_{n}\)转\(\theta_{z})\)得到新坐标系\( 1-\bar{x}_{1}\bar{y}_{1}\bar{z}_{1} \),再绕轴\( \bar{y}_{1}\)转\(\theta_{y})\)得到新坐标系\( 2-\bar{x}_{2}\bar{y}_{2}\bar{z}_{2} \),最后绕\( \bar{x}_{2}\)转\(\theta_{y})\)得到体坐标系\( b-\bar{x}_{b}\bar{y}_{b}\bar{z}_{b} \)。惯性坐标系\(n-\bar{x}_{n}\bar{y}_{n}\bar{z}_{n}\)和体坐标系之间的关系表示如下。

\( { [\bar{x}_{n} \, \bar{y}_{n} \, \bar{z}_{n} ] } {R^{n}_{b}}{( \theta_{z},\theta_{y},\theta_{x} )}  ={[\bar{x}_{b}\, \bar{y}_{b}\, \bar{z}_{b} ]}  \)

其中\({R^{n}_{b}}{ (\theta_{z},\theta_{y},\theta_{x})} ={R_{z}}{R_{y}}{R_{x}} \) 

\(=\left [\begin{array}{ccc}
cos\theta_{z} & -sin\theta_{z} & 0\\
sin\theta_{z} & cos\theta_{z} & 0\\
0 & 0 & 1
\end{array} \right]
\left [\begin{array}{ccc}
cos\theta_{y} & 0 & sin\theta_{y}\\
0 & 1 & 0\\
-sin\theta_{y} & 0 & cos\theta_{y}
\end{array} \right]
\left[ \begin{array}{ccc}
1 & 0 & 0\\
0 & cos\theta_{x} & -sin\theta_{x}\\
0 & sin\theta_{x} & cos\theta_{x}
\end{array} \right ]\)

\(=\left [\begin{array}{ccc}
cos\theta_{z} cos\theta_{y}& cos\theta_{z}sin\theta_{y}sin\theta_{x}-sin\theta_{z}cos\theta_{x} & sin\theta_{z}sin\theta_{x}+cos\theta_{z}cos\theta_{y}sin\theta_{x}\\
sin\theta_{z}cos\theta_{y} & -sin\theta_{z}sin\theta_{y}sin\theta_{x} +cos\theta_{z}cos\theta_{x}& -sin\theta_{z}sin\theta_{y}cos\theta_{x}-cos\theta_{z}sin\theta_{x} \\
-sin\theta_{y} & cos\theta_{y}sin\theta_{x} & cos\theta_{y}cos\theta_{x}
\end{array} \right]\)

 

\({R^{n}_{b}}{ (\theta_{z},\theta_{x},\theta_{y})} ={R_{z}}{R_{x}}{R_{y}}\) 
\(=\left [\begin{array}{ccc}
cos\theta_{z} & -sin\theta_{z} & 0\\
sin\theta_{z} & cos\theta_{z} & 0\\
0 & 0 & 1
\end{array} \right]
\left[ \begin{array}{ccc}
1 & 0 & 0\\
0 & cos\theta_{x} & -sin\theta_{x}\\
0 & sin\theta_{x} & cos\theta_{x}
\end{array} \right ]
\left [\begin{array}{ccc}
cos\theta_{y} & 0 & sin\theta_{y}\\
0 & 1 & 0\\
-sin\theta_{y} & 0 & cos\theta_{y}
\end{array} \right]\)

\(=\left [\begin{array}{ccc}
-sin\theta_{z}sin\theta_{x}sin\theta_{y}+cos\theta_{z}cos\theta_{y} & -sin\theta_{z}cos\theta_{x} &
sin\theta_{z}sin\theta_{x}cos\theta_{y}+cos\theta_{z}sin\theta_{y}\\
cos\theta_{z}sin\theta_{x}sin\theta_{y}+sin\theta_{z}cos\theta_{y} & cos\theta_{z}cos\theta_{x} & -cos\theta_{z}sin\theta_{x}cos\theta_{y}+sin\theta_{z}sin\theta_{y} \\
-cos\theta_{x}sin\theta_{y} & sin\theta_{x} & cos\theta_{x}cos\theta_{y}
\end{array} \right]\)

参考链接:http://www.gaolab.pro/archives/73

 

posted @ 2018-08-03 00:40  GaoLab  阅读(2451)  评论(0编辑  收藏  举报