Use Quaternions to compute yaw, pitch and roll from iphone?

爱⌒轻易说出口 提交于 2019-12-19 11:23:21

问题


I have seen many questions and articles mentioning that Quaternions can be used to derive better,accurate and stable yaw, pitch and roll readings from the iPhone rather than reading it's direct yaw, pitch and roll readings. But at the same time, I haven't seen any proper methods of implementing Quaternions in iPhone platform. As a beginner, It's really hard to know, How these Quaternions works and implementing them in a piece of code? (Sorry for not providing any code as i have no idea of how it works in xcode platform of apple)

So please be kind enough to provide an answer to my question that most of the users will benefit from it!

Thanks in advance!


回答1:


You don't have to implement anything, the API provides the quaternion for you:

CMAttitude Class Reference, quaternion propery

I personally like rotation matrices better because I find them easier to understand and to work with.

As I am reading your question, I still have the impression that you somehow want yaw, pitch and roll. You have to use quaternions everywhere in your code to get rid of the problems yaw, pitch and roll cause.



来源:https://stackoverflow.com/questions/12322797/use-quaternions-to-compute-yaw-pitch-and-roll-from-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!