使用四元数来计算iPhone的偏航,俯仰和横滚? [英] Use Quaternions to compute yaw, pitch and roll from iphone?

查看:226
本文介绍了使用四元数来计算iPhone的偏航,俯仰和横滚?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到许多问题和文章提到四元数可用于从iPhone得出更好,准确和稳定的偏航,俯仰和横滚读数,而不是直接读取偏航,俯仰和横滚读数.但是同时,我还没有看到在iPhone平台上实现四元数的任何适当方法.作为一个初学者,真的很难知道,这些四元数是如何工作的,并在一段代码中实现它们? (很抱歉没有提供任何代码,因为我不知道它如何在苹果的xcode平台中工作)

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!

提前谢谢!

推荐答案

您无需执行任何操作,API为您提供了四元数:

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

CMAttitude类参考,四元数属性

我个人更喜欢旋转矩阵,因为我发现它们更易于理解和使用.

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.

这篇关于使用四元数来计算iPhone的偏航,俯仰和横滚?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆