旋转矩阵的导数(机器人学)
假设旋转矩阵为 R ( θ ) R(\theta) R(θ),旋转矩阵有 R R T = I RR^T=I RRT=I,即旋转矩阵是正交矩阵。现求 R R R对 θ \theta θ的导数:
[ d d θ R ( θ ) ] R ( θ ) T + R ( θ ) [ d d θ R ( θ ) T ] = 0 (1) \lbrack \frac{d}{d\theta} R(\theta)\rbrack R(\theta)^T +R(\theta)\lbrack \frac{d}{d\theta} R(\theta)^T\rbrack=0 \tag{1} [dθdR(θ)]R(θ)T+R(θ)[dθdR(θ)T]=0(1)
令 S = [ d d θ R ( θ ) ] R ( θ ) T S= \lbrack\frac{d}{d\theta} R(\theta)\rbrack R(\theta)^T S=[dθdR(θ)]R(θ)T,则:
S + S T = 0 (2) S+S^T=0 \tag{2} S+ST=0(2)
即:
S = − S T (3) S=-S^T \tag{3} S=−ST(3)
即S是一个反对称矩阵。由 S = [ d d θ R ( θ ) ] R ( θ ) T S= \lbrack\frac{d}{d\theta} R(\theta)\rbrack R(\theta)^T S=[dθdR(θ)]R(θ)T两边同时右乘 R ( θ ) R(\theta) R(θ),则
d d θ R = S R ( θ ) (4) \frac{d}{d\theta}R=SR(\theta) \tag{4} dθdR=SR(θ)(4)
例如, R R R为绕着 X X X轴旋转的旋转矩阵,即:
R
(
θ
)
=
[
1
0
0
0
c
o
s
θ
−
s
i
n
θ
0
s
i
n
θ
c
o
s
θ
]
(5)
R(\theta) = \begin{bmatrix} 1 &0&0\\ 0&cos\theta&-sin\theta\\ 0&sin\theta&cos\theta \end{bmatrix} \tag{5}
R(θ)=⎣⎡1000cosθsinθ0−sinθcosθ⎦⎤(5)
S
=
[
d
d
θ
R
(
θ
)
]
R
(
θ
)
T
=
[
0
0
0
0
−
s
i
n
θ
−
c
o
s
θ
0
c
o
s
θ
−
s
i
n
θ
]
.
[
1
0
0
0
c
o
s
θ
s
i
n
θ
0
−
s
i
n
θ
c
o
s
θ
]
=
[
0
0
0
0
0
−
1
0
1
0
]
(6)
S= \lbrack\frac{d}{d\theta} R(\theta)\rbrack R(\theta)^T= \begin{bmatrix} 0 &0&0\\ 0&-sin\theta&-cos\theta\\ 0&cos\theta&-sin\theta \end{bmatrix} . \begin{bmatrix} 1 &0&0\\ 0&cos\theta&sin\theta\\ 0&-sin\theta&cos\theta \end{bmatrix} = \begin{bmatrix} 0 &0&0\\ 0&0&-1\\ 0&1&0 \end{bmatrix} \tag{6}
S=[dθdR(θ)]R(θ)T=⎣⎡0000−sinθcosθ0−cosθ−sinθ⎦⎤.⎣⎡1000cosθ−sinθ0sinθcosθ⎦⎤=⎣⎡0000010−10⎦⎤(6)
d d θ R = S R ( θ ) = [ 0 0 0 0 0 − 1 0 1 0 ] . [ 1 0 0 0 c o s θ − s i n θ 0 s i n θ c o s θ ] = [ 0 0 0 0 − s i n θ − c o s θ 0 c o s θ − s i n θ ] (7) \frac{d}{d\theta}R=SR(\theta)= \begin{bmatrix} 0 &0&0\\ 0&0&-1\\ 0&1&0 \end{bmatrix}. \begin{bmatrix} 1 &0&0\\ 0&cos\theta&-sin\theta\\ 0&sin\theta&cos\theta \end{bmatrix}= \begin{bmatrix} 0 &0&0\\ 0&-sin\theta&-cos\theta\\ 0&cos\theta&-sin\theta \end{bmatrix} \tag{7} dθdR=SR(θ)=⎣⎡0000010−10⎦⎤.⎣⎡1000cosθsinθ0−sinθcosθ⎦⎤=⎣⎡0000−sinθcosθ0−cosθ−sinθ⎦⎤(7)
进一步,如果 θ \theta θ也是时间 t t t的函数,即 θ ( t ) \theta(t) θ(t),那么在之前的基础上,求:
R ˙ = d R d t = d R d θ d θ d t = S R θ ˙ = θ ˙ S R = S ( ω ( t ) ) R (8) \dot{R}=\frac{dR}{dt}=\frac{dR}{d\theta}\frac{d\theta}{dt}=SR\dot{\theta}=\dot{\theta}SR=S(\omega(t))R\tag{8} R˙=dtdR=dθdRdtdθ=SRθ˙=θ˙SR=S(ω(t))R(8)
其中, S ( ω ( t ) ) S(\omega(t)) S(ω(t))为反对称矩阵, ω ( t ) \omega(t) ω(t)为角速度。
反对称矩阵
定义
向量
a
=
(
a
x
,
a
y
,
a
z
)
T
a=(a_x,a_y,a_z)^T
a=(ax,ay,az)T,则反对称矩阵
S
(
a
)
=
[
0
−
a
z
a
y
a
z
0
−
a
x
−
a
y
a
x
0
]
S(a)= \begin{bmatrix} 0&-a_z&a_y\\ a_z &0&-a_x\\ -a_y&a_x&0 \end{bmatrix}
S(a)=⎣⎡0az−ay−az0axay−ax0⎦⎤
性质
1.
S
(
α
a
+
β
b
)
=
α
S
(
a
)
+
β
S
(
b
)
S(\alpha a+\beta b) =\alpha S(a) +\beta S(b)
S(αa+βb)=αS(a)+βS(b)
2.
S
(
a
)
b
=
a
×
b
S(a)b=a\times b
S(a)b=a×b
3.
R
(
a
×
b
)
=
R
(
a
)
×
R
(
b
)
R(a\times b)=R(a) \times R(b)
R(a×b)=R(a)×R(b)
4.
R
S
(
a
)
R
T
=
S
(
R
a
)
RS(a)R^T=S(Ra)
RS(a)RT=S(Ra)
其中 R R R是3阶仿真, a a a和 b b b是向量, α \alpha α和 β \beta β是常数。