歐拉角與旋轉矩陣


一、歐拉角與旋轉矩陣

 

1、歐拉角的定義
     定義一個歐拉角,需要明確下面5條:

           1.三個旋轉角的組合方式
           2.旋轉角度的參考坐標系統(旋轉是相對於固定的坐標系還是相對於自身的坐標系)
           3.使用旋轉角度是左手系還是右手系
           4.三個旋轉角的記法
           5.主動旋轉還是被動旋轉
1.1 表示旋轉的歐拉角旋轉順序有12種

     Proper/classic Euler angle
                                                  z-x-z,x-y-x,y-z-y,z-y-z, x-z-x,y-x-y
    Tait-Bryan angle(也稱作:Cardan angles; nautical angles; heading、elevation、bank; yaw、pitch、rooll)
                                                 x-y-z,y-z-x,z-x-y,x-z-y,z-y-x,y-x-z
      
        Proper/classic Euler angle說明這些角度並不是獨立的,例如當下面的旋轉組合:先繞x軸旋轉90度,再繞y軸旋轉90度,最后繞x軸旋轉-90度,
這一些列組合得到的效果與只繞z軸旋轉-90度是一樣的。
       也就是說我們僅僅在2個平面上進行旋轉(其中一個平面上必須進行兩次旋轉)就可以得到任意的三維旋轉!

1.2 內在旋轉(intrinsic rotations)和外在旋轉(extrinsic rotations)
       內在旋轉每次旋轉圍繞的軸是上次旋轉之后坐標系的某個軸,外在旋轉每次旋轉的軸是固定坐標系中的軸。內在旋轉與外在旋轉的轉換關系:
互換第一次和第三次旋轉的位置則兩者結果相同。例如Z-Y-X旋轉的內部旋轉和X-Y-Z旋轉的外部旋轉的旋轉矩陣相同:

 

                                                             

 

 

                                                                                                                                                     Fig.2外在旋轉

 

1.3 使用旋轉角度是左手系還是右手系

    使用右手的大拇指指向旋轉軸,其他4個手指在握拳過程中的指向便是正的角度

 

  • 右手系是逆時針
  • 左手系是順時針

 

1.4 主動旋轉和被動旋轉

 

     主動旋轉是指將向量逆時針圍繞旋轉軸旋轉,被動旋轉是對坐標軸進行的逆時針旋轉,相當於主動旋轉的逆操作

2、不同軸的歐拉角轉換成旋轉矩陣

     給出逆時針旋轉的角度為正時(與右手系旋轉方向相同的為旋轉正方向),繞不同軸的旋轉結果:

 

      

 

 

3、旋轉的本質
 

 

4、內部旋轉(Z-Y-X)對應的旋轉矩陣

 

5、為什么內部旋轉(Z-Y-X)和外部旋轉(X-Y-Z)對應的旋轉矩陣是相同的

  

 

 6.相機坐標系中歐拉角與旋轉矩陣的關系

    對於兩個三維點 p_1(x_1,y_1,z_1)p_2(x_2,y_2,z_2)由點p_1經過旋轉矩陣R旋轉到p_2則有:

 

                                                  R=\begin{bmatrix}r_{11} & r_{12} & r_{13} \\ r_{21} & r_{22} & r_{23} \\ r_{31} & r_{32} & r_{33} \end{bmatrix}

                                                     \begin{bmatrix}x_2 \\ y_2 \\ z_2 \end{bmatrix} = R\begin{bmatrix}x_1 \\ y_1 \\ z_1 \end{bmatrix}

       任何一個旋轉可以表示為依次繞着三個旋轉軸旋三個角度的組合。這三個角度稱為歐拉角。 對於在三維空間里的一個參考系,任何坐標系的取向,都可以用三個歐拉角來表現,

如下圖(藍色是起始坐標系,而紅色的是旋轉之后的坐標系) :

                                                                               
                                                                       

                                                   R_x({\theta}) =\begin{bmatrix}1 & 0 & 0 \\ 0 & cos\theta & -sin\theta \\0 & sin\theta & cos\theta \end{bmatrix}
                                                   R_y({\theta}) =\begin{bmatrix}cos\theta & 0 & sin\theta \\ 0 & 1 & 0 \\ -sin\theta & 0 & cos\theta \end{bmatrix}
                                                   R_z({\theta}) =\begin{bmatrix}cos\theta & -sin\theta & 0 \\ sin\theta & cos\theta & 0 \\ 0 & 0 & 1 \end{bmatrix}

 

因此歐拉角轉旋轉矩陣如下:
R =R_z(\phi)R_y(\theta)R_x(\psi)=\begin{bmatrix} cos\theta cos\phi & sin\psi sin\theta cos\phi - cos\psi sin\theta & cos \psi sin\theta cos\phi +sin\psi sin\phi \\cos\theta sin\phi & sin\psi sin\theta sin\phi+cos\psi cos\phi & cos\psi sin\theta sin\phi -sin\psi cos\theta \\ -sin\theta & sin\psi cos\theta & cos\psi cos\theta\end{bmatrix}
則可以如下表示歐拉角:
                                                         \theta_x=atan2(r_{32},r_{33})
                                                        \theta_y=atan2(-r_{31},\sqrt{r_{32}^2+r_{33}^2})
                                                        \theta_z=atan2(r_{21},r_{11})

 
 
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM