Skip to content

Commit 1139d88

Browse files
Add Tait-Bryan conv. and quat formula
Signed-off-by: Thomas Sedlmayer <[email protected]>
1 parent e78dff7 commit 1139d88

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/usecases/transforming_coordinate_systems.adoc

+15
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ Get Tait–Bryan angles from rotation matrix cite:[wiki_euler_angles]:
7171
\phi = \arctan2(R_{23}/\cos(\theta),R_{33}/\cos(\theta))
7272
++++
7373

74+
Note that OSI uses the following convention on choosing rotation axes for Tait-Bryan angles: *z-y'-x''* intrinsic rotations (equivalent to *x-y-z* extrinsic rotations); see cite:[tait_bryan_convention].
75+
7476
**Relative orientation**:
7577

7678
Object rotation Matrix: latexmath:[\boldsymbol{R}_{object}^{src}] +
@@ -80,6 +82,19 @@ Resulting rotation matrix between object and host: latexmath:[\boldsymbol{R}_{ob
8082
To transform from world coordinates into host vehicle coordinates and back use the formulas from above with the world coordinates frame latexmath:[w] as source system latexmath:[src] and host vehicle coordinates frame latexmath:[v] as target system latexmath:[trg].
8183
To transform from host vehicle coordinates into sensor coordinates and back use the formulas from above with the host vehicle coordinates frame latexmath:[v] as source system latexmath:[src] and sensor coordinates frame latexmath:[s] as target system latexmath:[trg].
8284

85+
**Converting orientation to quaternions**:
86+
87+
To transform OSI's orientation representation from Tait-Bryan angles to quaternions, the following formula can be used [cite:euler_to_quaternion]:
88+
89+
[latexmath]
90+
++++
91+
\begin{align}
92+
q_i &= \sin \frac{\phi}{2} \cos \frac{\theta}{2} \cos \frac{\psi}{2} - \cos \frac{\phi}{2} \sin \frac{\theta}{2} \sin \frac{\psi}{2}\\
93+
q_j &= \cos \frac{\phi}{2} \sin \frac{\theta}{2} \cos \frac{\psi}{2} + \sin \frac{\phi}{2} \cos \frac{\theta}{2} \sin \frac{\psi}{2}\\
94+
q_k &= \cos \frac{\phi}{2} \cos \frac{\theta}{2} \sin \frac{\psi}{2} - \sin \frac{\phi}{2} \sin \frac{\theta}{2} \cos \frac{\psi}{2}\\
95+
q_r &= \cos \frac{\phi}{2} \cos \frac{\theta}{2} \cos \frac{\psi}{2} + \sin \frac{\phi}{2} \sin \frac{\theta}{2} \sin \frac{\psi}{2}
96+
\end{align}
97+
++++
8398

8499
**Corresponding messages**
85100

0 commit comments

Comments
 (0)