Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tait-Bryan convention and quaternion formula to documentation #850

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions doc/usecases/transforming_coordinate_systems.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ Get Tait–Bryan angles from rotation matrix cite:[wiki_euler_angles]:
\phi = \arctan2(R_{23}/\cos(\theta),R_{33}/\cos(\theta))
++++

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].

**Relative orientation**:

Object rotation Matrix: latexmath:[\boldsymbol{R}_{object}^{src}] +
Expand All @@ -80,6 +82,19 @@ Resulting rotation matrix between object and host: latexmath:[\boldsymbol{R}_{ob
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].
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].

**Converting orientation to quaternions**:

To transform OSI's orientation representation from Tait-Bryan angles to quaternions, the following formula can be used [cite:euler_to_quaternion]:

[latexmath]
++++
\begin{align}
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}\\
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}\\
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}\\
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}
\end{align}
++++

**Corresponding messages**

Expand Down
Loading