欧拉角转旋转矩阵
绕x,y,z轴的旋转角转换成对应的旋转矩阵
角度的正负
逆时针为正,顺时针为负。
相乘顺序
比如Z-X-Y的旋转顺序如果是先转z,再转x,最后转y的话,那组合旋转应该是 R = R y × R x × R z R=Ry\times Rx\times Rz R=Ry×Rx×Rz
euroc中例子:
相机到imu绕z轴旋转
9
0
o
90^{o}
90o
R
=
R
z
=
[
cos
9
0
∘
−
sin
9
0
∘
0
sin
9
0
∘
cos
9
0
∘
0
0
0
1
]
=
[
0
−
1
0
1
0
0
0
0
1
]
R=R_{z}= \left[\begin{array}{ccc} \cos 90^\circ & -\sin 90^\circ & 0 \\ \sin 90^\circ & \cos 90^\circ & 0 \\ 0 & 0 & 1 \end{array}\right] =\left[ \begin{matrix} 0 & -1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{matrix} \right]
R=Rz=⎣⎡cos90∘sin90∘0−sin90∘cos90∘0001⎦⎤=⎣⎡010−100001⎦⎤
相机到imu先绕y转-90度,再绕x转90度.
R
=
R
x
×
R
y
=
[
1
0
0
0
0
−
1
0
1
0
]
×
[
0
0
−
1
0
1
0
1
0
0
]
=
[
0
0
−
1
−
1
0
0
0
1
0
]
R=R_{x}\times R_{y}= \left[ \begin{matrix} 1 & 0 & 0 \\ 0 & 0 & -1 \\ 0 & 1 & 0 \end{matrix} \right] \times \left[ \begin{matrix} 0 & 0 & -1 \\ 0 & 1 & 0 \\ 1 & 0 & 0 \end{matrix} \right] = \left[ \begin{matrix} 0 & 0 & -1 \\ -1 & 0 & 0 \\ 0 & 1 & 0 \end{matrix} \right]
R=Rx×Ry=⎣⎡1000010−10⎦⎤×⎣⎡001010−100⎦⎤=⎣⎡0−10001−100⎦⎤