I am reading yaw, pitch and roll values from a mobile device. If I perform a yaw of 90 degrees and then any roll, the roll value is not changing but only the pitch value. That is because the device is always referencing to a non turning coordinate system. Therefore a turn around the z axis (yaw) of 90 degrees causes the pitch and roll readings to be "switched". Therefore lifting the iPhone at the top where the selfie camera is located is now no more changing the pitch value but the roll value as the referencing coordinate system is still the same. I can't change that programmatically.

So is there a mathematical way to turn the coordinate system with the device without loosing the turn value around for example the z-axis? I think I can do this by getting the transformation matrix and multiply it with its inverse but keeping the rotation around z. However how can I do this for combined rotations around all three axis? Because with combined rotations every element(yaw, pitch and roll) is already containing a part of the other two elements because the axis are switched with every rotation. Has anyone an idea??? Help is greatly appreciated!

  • $\begingroup$ I am sure this is already answered here: math.stackexchange.com/questions/2390852/… $\endgroup$ – Brethlosze Oct 22 '17 at 13:29
  • $\begingroup$ Thank you, @hyprfrcb . The provided link shows how to generate a transformation matrix from yaw, pitch and roll. I have no problem doing this. If I followed the description I end up having the same matrix I already have in which my two axes are still switched when the third is rotated by 90 degrees. $\endgroup$ – Ulbertain Oct 22 '17 at 14:01
  • $\begingroup$ So you still have the problem? DO you have any graphics? $\endgroup$ – Brethlosze Oct 23 '17 at 3:37
  • $\begingroup$ Yes I am still trying to figure it out @hyprfrcb ... Check my other question for more info about the issue : stackoverflow.com/questions/46863891/… $\endgroup$ – Ulbertain Oct 23 '17 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.