坐標(biāo)變換(5)—用旋轉(zhuǎn)軸和旋轉(zhuǎn)角表示旋轉(zhuǎn)

任何旋轉(zhuǎn),都可以用一個旋轉(zhuǎn)軸\hat \omega和一個旋轉(zhuǎn)角\theta來描述。

1. 坐標(biāo)系的線速度和角速度

如上圖,在旋轉(zhuǎn)的剛體上,附加一個body frameb,記為\hat{x},\hat{y},\hat{z}。對于三個軸而言,繞著\hat \omega旋轉(zhuǎn)的軌跡為圓。當(dāng)然,上述坐標(biāo)軸\hat{x},\hat{y},\hat{z}\hat \omega是在fixed frameS坐標(biāo)系下的,下面將\hat \omega記為\hat \omega_s,

繞著軸\hat \omega的角速度為,
w_s=\hat{w}\dot{\theta} \tag{1}
運動的線速度記為\dot{\hat{x}},三個軸的線速度則為,
\begin{aligned} \dot{\hat{x}}&=w_s \times \hat{x} \\ \dot{\hat{y}}&=w_s \times \hat{y} \\ \dot{\hat{z}}&=w_s \times \hat{z} \end{aligned} \tag{2}
將三個軸的線速度統(tǒng)一寫為,
\dot{R}= \begin{bmatrix} w_s \times \hat{x} & w_s \times \hat{y} & w_s \times \hat{z} \end{bmatrix}=w_s \times R \tag{3}
為了簡化公式(3)中的叉乘,特引入了[]符號,將w \times R可以記為矩陣的乘法[w]R,其中[w]的定義如下:
對于\mathbb{R}^3中的向量x=\begin{bmatrix}x_1 & x_2 &x_3\end{bmatrix},定義[x]為一個反對稱矩陣,
[x]=\left[\begin{array}{ccc} 0 & -x_{3} & x_{2} \\ x_{3} & 0 & -x_{1} \\ -x_{2} & x_{1} & 0 \end{array}\right]\tag{4}
[x]=-[x]^T \tag{5}
上述所有3 \times 3的反對稱矩陣統(tǒng)稱為so(3),小的。前面說過,旋轉(zhuǎn)矩陣屬于SO(3),大的。下面有一個兩者結(jié)合起來有趣的性質(zhì),假定r_i^TR的第i行,即r_iR^T的第i列,則
\begin{aligned} R[w]R^T &= R\begin{bmatrix} w_s\times r_1 & w_s\times r_2 &w_s\times r_3 \end{bmatrix}\\ &= \begin{bmatrix} r_1^{T}(w_s\times r_1) & r_1^T(w_s\times r_2) & r_1^T (w_s\times r_3) \\ r_2^{T}(w_s\times r_1) & r_2^T(w_s\times r_2) & r_2^T (w_s\times r_3) \\ r_3^{T}(w_s\times r_1) & r_3^T(w_s\times r_2) & r_3^T (w_s\times r_3) \end{bmatrix} \\ &= \begin{bmatrix} 0 & -r_3^Tw_s & r_2^Tw_s\\ r_3^Tw_s & 0 &-r_1^Tw_s\\ -r_2^Tw_s&r_1^Tw_s&0 \end{bmatrix}\\ &=[Rw_s] \end{aligned} \tag{6}

對于(6)中矩陣中的r_1^{T}(w_s\times r_2),是三個向量r_1,w_s,r_2的混合積,也就是三個向量組成的六面體的體積,而我們知道矩陣的行列式的值的物理意義就是體積。根據(jù)下面的混合積的圖,很容易得到矩陣中對應(yīng)元素的反對稱的關(guān)系。

下面我們將三個軸的線速度表示為[w]的寫法,
\dot{R}=[w_s]R \tag{7}

[w_s]=\dot{R}R^{-1} \tag{8}
前面我們提到的所有的向量和R都是在fixed frameS下描述的,下面我們將w_s在body frameb下進行描述,易得,
w_s=R_{sb}w_b\tag{9}
則旋轉(zhuǎn)軸在body frameb下,
w_b=R_{sb}^{-1}w_s=R^{-1}w_s=R^{T}w_s \tag{10}
因此可以得到,
\begin{aligned} [w_b]&=[R^{T}w_s] \\ &= R^T[w_s]R \\ &= R^T(\dot{R}R^{T})R \\ &=R^T\dot{R} \\ &=R^{-1}\dot{R} \end{aligned}\tag{11}

需要注意的是w_b是在body frameb下的描述,所以它描述的角速度不是一個旋轉(zhuǎn)的坐標(biāo)系的角速度(例如b相對于S旋轉(zhuǎn)),而是在某一瞬時,w_b相對于body frameb的旋轉(zhuǎn)。

2. 微分方程的解

給定下面一個簡單的線性微分方程,其中x(t) \in \mathbb{R},a \in \mathbb{R},初始狀態(tài)x(t) =x(0),
\dot x(t)=ax(t) \tag{12}
易得上述的解為,
x(t)=e^{at}x(0) \tag{13}
e^{at}0附近進行泰勒展開,可得,
e^{a t}=1+a t+\frac{(a t)^{2}}{2 !}+\frac{(a t)^{3}}{3 !}+\cdots \tag{14}
同理,當(dāng)a為矩陣A時,x(t)為列向量,
\dot x(t)=Ax(t) \tag{15}
可得解為,
x(t)=e^{At}x(0) \tag{16}
其中,
e^{A t}=1+A t+\frac{(A t)^{2}}{2 !}+\frac{(A t)^{3}}{3 !}+\cdots \tag{17}

3. 指數(shù)形式的旋轉(zhuǎn)

任何旋轉(zhuǎn),都可以用一個旋轉(zhuǎn)軸\hat \omega和一個旋轉(zhuǎn)角\theta來描述。其中\hat \omega \in \mathbb{R^3},\Vert{\hat \omega}\Vert=1,\theta \in \mathbb{R^3}。
下面我們來分析如何利用一根旋轉(zhuǎn)軸和旋轉(zhuǎn)角來描述旋轉(zhuǎn),

假設(shè)向量p(t)p(0)繞著\hat{\omega}以恒定的角速度1rad/s旋轉(zhuǎn)了\theta秒,最終到p(\theta),定義p(t)間斷的線速度為,
\dot{p}= \hat{\omega} \times p \tag{18}
由前面的分析,引入[\hat{\omega}],則
\dot{p}= [\hat{\omega}] p \tag{19}
該微分方程如前面介紹為,
p(t)=e^{[\hat{\omega}] t} p(0) \tag{20}

則,
p(\theta)=e^{[\hat{\omega}] \theta} p(0) \tag{21}

容易得到[\hat{\omega}]兩個計算性質(zhì),如下,
[\hat{\omega}][\hat{\omega}]=\hat{\omega}\hat{\omega}^{T}-I \tag{22}

[\hat{\omega}][\hat{\omega}][\hat{\omega}]= [\hat{\omega}]^{3}=-[\hat{\omega}] \tag{23}
所以公式21可以化簡為,
\begin{aligned} e^{[\hat{\omega}] \theta} &=I+[\hat{\omega}] \theta+[\hat{\omega}]^{2} \frac{\theta^{2}}{2 !}+[\hat{\omega}]^{3} \frac{\theta^{3}}{3 !}+\cdots \\ &=I+\left(\theta-\frac{\theta^{3}}{3 !}+\frac{\theta^{5}}{5 !}-\cdots\right)[\hat{\omega}]+\left(\frac{\theta^{2}}{2 !}-\frac{\theta^{4}}{4 !}+\frac{\theta^{6}}{6 !}-\cdots\right)[\hat{\omega}]^{2} \\ &= I+sin(\theta)[\hat{\omega}]+(1-cos(\theta))[\hat{\omega}]^{2} \end{aligned} \tag{24}
上式就是著名的羅德里格斯公式,即指數(shù)形式的旋轉(zhuǎn),
\operatorname{Rot}(\hat{\omega}, \theta)=e^{[\hat{\omega}] \theta}=I+\sin \theta[\hat{\omega}]+(1-\cos \theta)[\hat{\omega}]^{2} \in S O(3) \tag{25}
經(jīng)過指數(shù)映射,將s o(3)和旋轉(zhuǎn)的角度\theta通過指數(shù)映射為S O(3),即三維的旋轉(zhuǎn)矩陣。

在前面文章中介紹過,旋轉(zhuǎn)矩陣左乘和右乘的區(qū)別,這里也是類似的,假設(shè)body frameb在fixed frameS中的描述為R_{sb},則\operatorname{Rot}(\hat{\omega}, \theta)R_{sb},左乘,表示將R_{sb}順著S中的\hat{\omega}旋轉(zhuǎn)\theta。而R_{sb}\operatorname{Rot}(\hat{\omega}, \theta),右乘,表示將R_{sb}順著b中的\hat{\omega}旋轉(zhuǎn)\theta。

4. 旋轉(zhuǎn)矩陣的對數(shù)

上面描述的是從\hat{\omega}\theta到旋轉(zhuǎn)矩陣R的過程,下面介紹從旋轉(zhuǎn)矩陣R\hat{\omega}\theta的過程,也就是求得旋轉(zhuǎn)向量和具體的旋轉(zhuǎn)角度,求R矩陣的“對數(shù)”。可以將兩個對應(yīng)的過程描述成下面的形式,

\begin{array}{cll} \exp : & [\hat{\omega}] \theta \in s o(3) & \rightarrow & R \in S O(3) \\ \log : & R \in S O(3) & \rightarrow & [\hat{\omega}] \theta \in \operatorname{so}(3) \end{array}

下面將公式(25)展開,如下,
\left[\begin{array}{ccc} c_{\theta}+\hat{\omega}_{1}^{2}\left(1-c_{\theta}\right) & \hat{\omega}_{1} \hat{\omega}_{2}\left(1-c_{\theta}\right)-\hat{\omega}_{3} \mathrm{s}_{\theta} & \hat{\omega}_{1} \hat{\omega}_{3}\left(1-c_{\theta}\right)+\hat{\omega}_{2} \mathrm{s}_{\theta} \\ \hat{\omega}_{1} \hat{\omega}_{2}\left(1-\mathrm{c}_{\theta}\right)+\hat{\omega}_{3} \mathrm{S}_{\theta} & c_{\theta}+\hat{\omega}_{2}^{2}\left(1-c_{\theta}\right) & \hat{\omega}_{2} \hat{\omega}_{3}\left(1-\mathrm{c}_{\theta}\right)-\hat{\omega}_{1} \mathrm{s}_{\theta} \\ \hat{\omega}_{1} \hat{\omega}_{3}\left(1-\mathrm{c}_{\theta}\right)-\hat{\omega}_{2} \mathrm{S}_{\theta} & \hat{\omega}_{2} \hat{\omega}_{3}\left(1-\mathrm{c}_{\theta}\right)+\hat{\omega}_{1} \mathrm{s}_{\theta} & \mathrm{c}_{\theta}+\hat{\omega}_{3}^{2}\left(1-\mathrm{c}_{\theta}\right) \end{array}\right] \tag{26}
其中,\hat{\omega} = \begin{bmatrix} \hat{w_1} \\ \hat{w_2} \\ \hat{w_3} \end{bmatrix}\mathrm{c}_{\theta}=cos(\theta),\mathrm{s}_{\theta}=sin(\theta)
記旋轉(zhuǎn)矩陣Rr_{ij},則可以得到,
\begin{aligned} r_{32}-r_{23}&=2 \hat{\omega}_{1}sin(\theta) \\ r_{13}-r_{31}&=2 \hat{\omega}_{2}sin(\theta) \\ r_{21}-r_{12}&=2 \hat{\omega}_{3}sin(\theta) \end{aligned} \tag{27}
上式在sin(\theta)\ne 0的情況下,可以得到,
\begin{aligned} \hat{\omega}_{1}=\frac{1}{2sin(\theta)}(r_{32}-r_{23}) \\ \hat{\omega}_{2}=\frac{1}{2sin(\theta)}(r_{13}-r_{31}) \\ \hat{\omega}_{3}=\frac{1}{2sin(\theta)}(r_{21}-r_{12}) \end{aligned} \tag{28}
上式也可以寫成,
[\hat{\omega}]=\left[\begin{array}{ccc} 0 & -\hat{\omega}_{3} & \hat{\omega}_{2} \\ \hat{\omega}_{3} & 0 & -\hat{\omega}_{1} \\ -\hat{\omega}_{2} & \hat{\omega}_{1} & 0 \end{array}\right]=\frac{1}{2 \sin \theta}\left(R-R^{\mathrm{T}}\right) \tag{29}

此外,由式(26)可以得到另外一個計算\theta的公式,
\operatorname{tr} R=r_{11}+r_{22}+r_{33}=1+2 \cos \theta \tag{30}
至此,sin(\theta)\ne 0的情況下,利用旋轉(zhuǎn)矩陣R,我們計算出了\hat{\omega}\theta。接下來討論sin(\theta) = 0的情況:

  1. 當(dāng)\theta=k\pi,且k是偶數(shù)的情況下,此時相當(dāng)于沒有旋轉(zhuǎn),回到了原位置,R=I;
  2. 當(dāng)\theta=k\pi,且k是奇數(shù)的情況下,此時有,
    R=e^{[\hat{\omega}] \pi}=I+2[\hat{\omega}]^{2} \tag{31}
    因為式(31)三個矩陣都是對角矩陣,所以可以得到下面的結(jié)果(利用R對角元素)
    \hat{\omega}_{i}=\pm \sqrt{\frac{r_{i i}+1}{2}}, \quad i=1,2,3 \tag{32}
    利用R非對角元素,可得,
    \begin{aligned} 2 \hat{\omega}_{1} \hat{\omega}_{2} &=r_{12} \\ 2 \hat{\omega}_{2} \hat{\omega}_{3} &=r_{23} \\ 2 \hat{\omega}_{1} \hat{\omega}_{3} &=r_{13} \end{aligned} \tag{33}
    利用式(32)和式(33)我們就能計算出\hat{\omega},同時此時旋轉(zhuǎn)的角為\theta=\pm \pi, \pm 3 \pi, \ldots。
    從上面的計算過程很容易看出來,旋轉(zhuǎn)角度是以2\pi為周期,其實也是符合物理意義的,旋轉(zhuǎn)\pi和旋轉(zhuǎn)3\pi的效果是一樣的,因此我們可以將旋轉(zhuǎn)的角度限定在[-\pi,\pi]。此時計算的\hat{\omega}\theta的長度是\le\pi的。因此我們可以把S O (3)想象為一個半徑為\pi實心球,如下圖所示,

當(dāng)給定球中的一點r\in\mathbb{R}^3,我們可以將\hat{\omega}=\frac{r}{\Vert r\Vert}作為單位長度的旋轉(zhuǎn)軸,\Vert r\Vert作為\theta。和r相對應(yīng)的旋轉(zhuǎn)矩陣R可以被看作是繞著\hat{\omega}旋轉(zhuǎn)了\theta角。對于R\in SO(3),同時trR \ne -1,此時在實心球中總能找到一個唯一的r,使得e^{[r]}=R。當(dāng)trR = -1時,此時\Vert r\Vert=\pi,在實心球的表面有一對正好相反的一對點,兩者的效果是一樣的,r-r都對應(yīng)了同一個R。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容