20221005 Two rotations represented by quaternions


Quaternion definition

The definition of quaternion comes from Euler's theorem, q = [ cos ⁡ ( ϕ 2 ) , n sin ⁡ ( ϕ 2 ) ] \boldsymbol{q}=[\operatorname{cos}(\frac{\phi}{2 }), \boldsymbol{n}\operatorname{sin}(\frac{\phi}{2})]q=[cos(2ϕ),nsin(2ϕ)] wheren \boldsymbol{n}n is the (vector) axis,ϕ \phiϕ is aroundn \boldsymbol{n}Euler angles of n .


Quaternion multiplication rule

The specific derivation of the quaternion multiplication rule will not be given here. The understanding is to perform two rotations. The specific rule is q ′ ⊗ q = [ q 0 ′ ∗ q 0 − qv ′ ⋅ qvq 0 ′ ∗ qv + q 0 ∗ qv ′ + qv ′ × qv ] \boldsymbol{q}'\otimes\boldsymbol{q} = \left[\begin{array}{l} q'_0*q_0- \boldsymbol q'_v \cdot \boldsymbol q_v\\ q'_0*\boldsymbol q_v+q_0*\boldsymbol q'_v+\boldsymbol q'_v \times \boldsymbol q_v \end{array}\right]qq=[q0q0qvqvq0qv+q0qv+qv×qv]


rotation transform

One of the reasons why readers are confused about the understanding of rotation is that different books use different rotation transformations.

There are generally two types of rotation transformations: (the second type is more commonly used in attitude description)
1. The coordinate system does not move, and the vector rotates;
2. The vector does not move, and the coordinate system rotates.


Detailed explanation:

1. The coordinate system does not move, and the vector rotates.
For the first type, the initial vector is r 0 \boldsymbol{r}_0r0, becomes r 1 \boldsymbol{r}_1 after spatial rotationr1, based on r 0 \boldsymbol{r}_0r0Rotate to r 1 \boldsymbol{r}_1r1The process is described as a quaternion q \boldsymbol{q}q。则有 vec ⁡ ( r 1 ) = q ∗ ⊗ vec ⁡ ( r 0 ) ⊗ q \operatorname{vec}(\boldsymbol{r}_1)=\boldsymbol{q}^*\otimes \operatorname{vec} (\boldsymbol{r}_0)\otimes \boldsymbol{q} thing ( r1)=qthing ( r0)q展开可得
r 1 = ( ( q 0 2 − q v T q v ) I + 2 q v q v T + 2 q 0 q v × ) r 0 \boldsymbol{r}_1 = \left( (q_0^2-\boldsymbol{q}_v^T\boldsymbol{q}_v)\boldsymbol{I}+2\boldsymbol{q}_v \boldsymbol{q}_v^T + 2 q_0 \boldsymbol{q}_v^\times \right) \boldsymbol{r}_0 r1=((q02qvTqv)I+2qvqvT+2q0qv×)r0

2. The vector does not move, and the coordinate system rotates.
For the second type, the fixed vector r \boldsymbol{r}The projection of r in the initial coordinate system isrr \boldsymbol{r}^rrr , after the initial coordinate system is rotated in space, the fixed vectorr \boldsymbol{r}r is projected in the new coordinate system asrb \boldsymbol{r}^brb , the process of rotating to a new coordinate system based on the initial coordinate system is expressed asq \boldsymbol{q}q . Pay attention to two points:1. The vector has not moved in space, but the coordinate system used for reference has changed; 2. The projection we use to express is just a mathematical representation in different coordinate systems, and does not mean that the vector has moved.
vec ⁡ ( rb ) = q ⊗ vec ⁡ ( rr ) ⊗ q ∗ \operatorname{vec}(\boldsymbol{r}^b)=\boldsymbol{q}\otimes \operatorname{vec} (\boldsymbol{r}^ r)\otimes \boldsymbol{q}^*thing ( rb)=qthing ( rr)q展开可得
r b = ( ( q 0 2 − q v T q v ) I + 2 q v q v T − 2 q 0 q v × ) r r \boldsymbol{r}^b = \left( (q_0^2-\boldsymbol{q}_v^T\boldsymbol{q}_v)\boldsymbol{I}+2\boldsymbol{q}_v \boldsymbol{q}_v^T - 2 q_0 \boldsymbol{q}_v^\times \right) \boldsymbol{r}^r rb=((q02qvTqv)I+2qvqvT2q0qv×)rr

注: vec ⁡ ( r ) = [ 0 , r ] T \operatorname{vec}(\boldsymbol{r})=[0,\boldsymbol{r}]^T thing ( r )=[0,r]T

Guess you like

Origin blog.csdn.net/weixin_44382195/article/details/127173900