本文主要是介绍四元数导数,四元数变化率运动学方程,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
四元数乘法
这里首先需要介绍四元数乘法,假设有两个四元数 q a , q b q_a, q_b qa,qb,如下所示:
q a = q a 0 + q a 1 i + q a 2 j + q a 3 k = [ s a , v a ] T q b = q b 0 + q b 1 i + q b 2 j + q b 3 k = [ s b , v b ] T \begin{aligned} q_a &= q_{a0} + q_{a1}i + q_{a2}j + q_{a3}k = [s_a,v_a]^T \\ q_b &= q_{b0} + q_{b1}i + q_{b2}j + q_{b3}k = [s_b,v_b]^T \end{aligned} qaqb=qa0+qa1i+qa2j+qa3k=[sa,va]T=qb0+qb1i+qb2j+qb3k=[sb,vb]T
乘法运算为 ⊗ \otimes ⊗,则有
q a ⊗ q b = [ s a s b − v a T v b , s a v b + s b v a + v a × v b ] T q_a\otimes q_b = [s_as_b-v_a^Tv_b,s_av_b+s_bv_a+v_a \times v_b]^T qa⊗qb=[sasb−vaTvb,savb+sbva+va×vb]T
四元数变化率运动学方程
q ∙ = 1 2 [ 0 , ω ] T ⊗ q \mathop q\limits^ \bullet = \frac{1}{2}[0,\omega]^T\otimes q q∙=21[0,ω]T⊗q
假设 q = [ s , v ] T q=[s,v]^T q=[s,v]T,即
q ∙ = 1 2 [ − ω T ⋅ v , s ⋅ ω + ω × v ] T \mathop q\limits^ \bullet = \frac{1}{2}[-\omega^T\cdot v, s\cdot \omega+\omega \times v]^T q∙=21[−ωT⋅v,s⋅ω+ω×v]T
证明
假设机器人在当前Body系下 t t t 时刻的位姿四元数为 q = [ s , v ] T q=[s,v]^T q=[s,v]T,在接下来的 δ t \delta t δt时间内,发生了 δ q \delta q δq四元数表示的旋转,假设该旋转以 n n n 为轴,旋转了 δ θ \delta \theta δθ 度,即 δ q = [ c o s δ θ 2 , n ⋅ s i n δ θ 2 ] \delta q = [cos\frac{\delta \theta}{2},n\cdot sin\frac{\delta \theta}{2}] δq=[cos2δθ,n⋅sin2δθ]。则有
q ∙ = lim δ t → 0 δ q ⊗ q − q δ t = lim δ t → 0 [ c o s δ θ 2 , n ⋅ s i n δ θ 2 ] ⊗ [ s , v ] T − [ s , v ] δ t = lim δ t → 0 [ s ⋅ c o s δ θ 2 − ( n ⋅ s i n δ θ 2 ) T ⋅ v , c o s δ θ 2 ⋅ v + s ⋅ ( n ⋅ s i n δ θ 2 ) + ( n ⋅ s i n δ θ 2 ) × v ] − [ s , v ] δ t = lim δ t → 0 [ s ( ⋅ c o s δ θ 2 − 1 ) − ( n ⋅ s i n δ θ 2 ) T ⋅ v , ( c o s δ θ 2 − 1 ) ⋅ v + s ⋅ ( n ⋅ s i n δ θ 2 ) + ( n ⋅ s i n δ θ 2 ) × v ] δ t \begin{aligned} \mathop q\limits^ \bullet &= \mathop {\lim }\limits_{\delta t \to 0} \frac{\delta q \otimes q- q}{\delta t } \\ & = \mathop {\lim }\limits_{\delta t \to 0} \frac{[cos\frac{\delta \theta}{2},n\cdot sin\frac{\delta \theta}{2}]\otimes [s,v]^T - [s,v]}{\delta t} \\ & = \mathop {\lim }\limits_{\delta t \to 0} \frac{[s \cdot cos\frac{\delta \theta}{2} - \left(n\cdot sin\frac{\delta \theta}{2}\right)^T\cdot v, cos\frac{\delta \theta}{2}\cdot v + s\cdot \left(n\cdot sin\frac{\delta \theta}{2}\right) + \left(n\cdot sin\frac{\delta \theta}{2}\right)\times v] - [s,v]}{\delta t} \\ & = \mathop {\lim }\limits_{\delta t \to 0} \frac{[s \left(\cdot cos\frac{\delta \theta}{2} - 1\right) - \left(n\cdot sin\frac{\delta \theta}{2}\right)^T\cdot v, \left(cos\frac{\delta \theta}{2} - 1\right)\cdot v + s\cdot \left(n\cdot sin\frac{\delta \theta}{2}\right) + \left(n\cdot sin\frac{\delta \theta}{2}\right)\times v]}{\delta t} \\ \end{aligned} q∙=δt→0limδtδq⊗q−q=δt→0limδt[cos2δθ,n⋅sin2δθ]⊗[s,v]T−[s,v]=δt→0limδt[s⋅cos2δθ−(n⋅sin2δθ)T⋅v,cos2δθ⋅v+s⋅(n⋅sin2δθ)+(n⋅sin2δθ)×v]−[s,v]=δt→0limδt[s(⋅cos2δθ−1)−(n⋅sin2δθ)T⋅v,(cos2δθ−1)⋅v+s⋅(n⋅sin2δθ)+(n⋅sin2δθ)×v]
将 c o s , s i n cos, sin cos,sin泰勒展开,只保留一阶以下部分,即:
c o s δ θ 2 ≈ 1 s i n δ θ 2 ≈ δ θ 2 \begin{aligned} cos\frac{\delta \theta}{2} &\approx 1 \\ sin\frac{\delta \theta}{2} &\approx \frac{\delta \theta}{2} \end{aligned} cos2δθsin2δθ≈1≈2δθ
代入上式,得:
q ∙ = lim δ t → 0 [ − ( n ⋅ δ θ 2 ) T ⋅ v , s ⋅ n ⋅ δ θ 2 + ( n ⋅ δ θ 2 ) × v ] δ t = 1 2 lim δ t → 0 [ − ( n ⋅ δ θ ) T ⋅ v , s ⋅ n ⋅ δ θ + ( n ⋅ δ θ ) × v ] δ t = 1 2 [ − ( lim δ t → 0 n ⋅ δ θ δ t ) T ⋅ v , s ⋅ ( lim δ t → 0 n ⋅ δ θ δ t ) + ( lim δ t → 0 n ⋅ δ θ δ t ) × v ] \begin{aligned} \mathop q\limits^ \bullet &= \mathop {\lim }\limits_{\delta t \to 0} \frac{[- \left(n\cdot \frac{\delta \theta}{2}\right)^T\cdot v, s\cdot n\cdot \frac{\delta \theta}{2} + \left(n\cdot \frac{\delta \theta}{2}\right)\times v]}{\delta t} \\ &= \frac{1}{2}\mathop {\lim }\limits_{\delta t \to 0} \frac{[- \left(n\cdot \delta \theta\right)^T\cdot v, s\cdot n\cdot \delta \theta + \left(n\cdot \delta \theta\right)\times v]}{\delta t} \\ &=\frac{1}{2}[ - \left(\mathop {\lim }\limits_{\delta t \to 0}n\cdot \frac{\delta \theta}{\delta t}\right)^T\cdot v, s\cdot \left(\mathop {\lim }\limits_{\delta t \to 0}n\cdot \frac{\delta \theta}{\delta t}\right) + \left(\mathop {\lim }\limits_{\delta t \to 0}n\cdot \frac{\delta \theta}{\delta t}\right)\times v] \\ \end{aligned} q∙=δt→0limδt[−(n⋅2δθ)T⋅v,s⋅n⋅2δθ+(n⋅2δθ)×v]=21δt→0limδt[−(n⋅δθ)T⋅v,s⋅n⋅δθ+(n⋅δθ)×v]=21[−(δt→0limn⋅δtδθ)T⋅v,s⋅(δt→0limn⋅δtδθ)+(δt→0limn⋅δtδθ)×v]
已知
lim δ t → 0 n ⋅ δ θ δ t = ω \mathop {\lim }\limits_{\delta t \to 0}n\cdot \frac{\delta \theta}{\delta t} = \omega δt→0limn⋅δtδθ=ω
原式变为:
q ∙ = 1 2 [ − ω T ⋅ v , s ⋅ ω + ω × v ] = 1 2 [ 0 , ω ] T ⊗ [ s , v ] T = 1 2 [ 0 , ω ] T ⊗ q \begin{aligned} \mathop q\limits^ \bullet &=\frac{1}{2}[ - \omega^T\cdot v, s\cdot \omega + \omega\times v] \\ & = \frac{1}{2} [0, \omega]^T \otimes [s,v]^T \\ & = \frac{1}{2} [0, \omega]^T \otimes q \end{aligned} q∙=21[−ωT⋅v,s⋅ω+ω×v]=21[0,ω]T⊗[s,v]T=21[0,ω]T⊗q
这篇关于四元数导数,四元数变化率运动学方程的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!