MATLAB Answers

Plotting orientation in 3-D plot using quaternion

75 views (last 30 days)
Ofir Yaish
Ofir Yaish on 5 Aug 2018
Commented: Hutin Puy on 21 Feb 2020
Hello, I getting a real time information from 9DoF IMU sensor (gyro, magnetometer and accelerometer), and I'm using a well known function "MahonyQuaternionUpdate" to get the Quaternion coordination: q0, q1, q2 and q4. I know how to translate the Quaternion coordination to euler angles (pitch, yaw and roll), and plot by then the orientation of the object in 3D. My problem is that pitch, yaw and roll are has limited range of angels. pitch- from -90 to 90,and once you get angel over 90, the angel start to reduce to 0. roll- from -180 to 180, and it's working fine. Yaw- I think that is the same as pitch. I read that this limited range situation is due to problem called gimbal lock, and I understood that if I will not translate the Quaternion coordination to euler angles, I can get full orientation of the body in 3-D.
Therefore, My question is how I can plot orientation in 3-D using quaternion without losing the full orientation that I lost using euler angles. thank you.


Jon White
Jon White on 12 Aug 2019
If anyone had an answer for this that would be great!
Hutin Puy
Hutin Puy on 21 Feb 2020
I have the same question.
Does anybody solve this problem??

Sign in to comment.

Answers (1)

Joel Handy
Joel Handy on 12 Aug 2019
Edited: Joel Handy on 12 Aug 2019
Check out this link which explains the quaternion mah required.


Sign in to comment.


Translated by