quaternion has two definitions Hamilton and JPL
definition
q = q o + q 1 i + q 2 j + q 3 z \mathbf q = q_o + q_1i+q_2j+q_3z q=qo+q1i+q2j+q3z
for Hamilton: i j k = − 1 ijk = -1 ijk=−1
for JPL: i j k = 1 ijk = 1 ijk=1
so:
for Hamilton:
R
H
a
m
i
l
t
o
n
=
[
1
−
2
q
2
2
−
2
q
3
2
2
q
1
q
2
−
2
q
0
q
3
2
q
1
q
3
+
2
q
0
q
2
2
q
1
q
2
+
2
q
0
q
3
1
−
2
q
1
2
−
2
q
3
2
2
q
2
q
3
−
2
q
0
q
1
2
q
1
q
3
−
2
q
0
q
2
2
q
2
q
3
+
2
q
0
q
1
1
−
2
q
1
2
−
2
q
2
2
]
\mathbf R_{Hamilton} =\left[\begin{array}{ccc} 1-2 q_{2}^{2}-2 q_{3}^{2} & 2 q_{1} q_{2}-2 q_{0} q_{3} & 2 q_{1} q_{3}+2 q_{0} q_{2} \\ 2 q_{1} q_{2}+2 q_{0} q_{3} & 1-2 q_{1}^{2}-2 q_{3}^{2} & 2 q_{2} q_{3}-2 q_{0} q_{1} \\ 2 q_{1} q_{3}-2 q_{0} q_{2} & 2 q_{2} q_{3}+2 q_{0} q_{1} & 1-2 q_{1}^{2}-2 q_{2}^{2} \end{array}\right]
RHamilton=⎣⎡1−2q22−2q322q1q2+2q0q32q1q3−2q0q22q1q2−2q0q31−2q12−2q322q2q3+2q0q12q1q3+2q0q22q2q3−2q0q11−2q12−2q22⎦⎤
for JPL:
R
J
P
L
=
[
1
−
2
q
2
2
−
2
q
3
2
2
q
1
q
2
+
2
q
0
q
3
2
q
1
q
3
−
2
q
0
q
2
2
q
1
q
2
−
2
q
0
q
3
1
−
2
q
1
2
−
2
q
3
2
2
q
2
q
3
+
2
q
0
q
1
2
q
1
q
3
+
2
q
0
q
2
2
q
2
q
3
−
2
q
0
q
1
1
−
2
q
1
2
−
2
q
2
2
]
\mathbf R_{JPL} =\left[\begin{array}{ccc} 1-2 q_{2}^{2}-2 q_{3}^{2} & 2 q_{1} q_{2}+2 q_{0} q_{3} & 2 q_{1} q_{3}-2 q_{0} q_{2} \\ 2 q_{1} q_{2}-2 q_{0} q_{3} & 1-2 q_{1}^{2}-2 q_{3}^{2} & 2 q_{2} q_{3}+2 q_{0} q_{1} \\ 2 q_{1} q_{3}+2 q_{0} q_{2} & 2 q_{2} q_{3}-2 q_{0} q_{1} & 1-2 q_{1}^{2}-2 q_{2}^{2} \end{array}\right]
RJPL=⎣⎡1−2q22−2q322q1q2−2q0q32q1q3+2q0q22q1q2+2q0q31−2q12−2q322q2q3−2q0q12q1q3−2q0q22q2q3+2q0q11−2q12−2q22⎦⎤
so actually there is :(Conversion of the two kinds quaternions)
q
H
a
m
i
l
t
o
n
(
q
o
+
q
1
i
+
q
2
j
+
q
3
z
)
↔
q
J
P
L
(
q
o
−
q
1
i
−
q
2
j
−
q
3
z
)
\mathbf q_{Hamilton} ( q_o + q_1i+q_2j+q_3z)\leftrightarrow \mathbf q_{JPL}(q_o - q_1i-q_2j-q_3z)
qHamilton(qo+q1i+q2j+q3z)↔qJPL(qo−q1i−q2j−q3z)
so in hybird case, there is wording of C q T {C_{q}}^T CqT
C q C_q Cq mean change the quaternions to Rotation matrix by Hamilton rules.
If the quaternions is in JPL, but change to R by Hamilton rules, it should to Transpose
ps:
library or files | Hamilton or JPL |
---|---|
Eigen | Hamilton |
Ros | Hamilton |
Indirect kalman filter for 3D Attitude Estimation | JPL |
Ethzasl-msf | Hybird |