iphone - 偏航,俯仰和滚动的核心运动范围 [英] iphone - core motion range of yaw, pitch and roll

查看:272
本文介绍了iphone - 偏航,俯仰和滚动的核心运动范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在没有iPhone 4,我正在尝试找到一个文档,显示偏航,俯仰和滚动的范围以及设备的相应位置。

I don't have an iPhone 4 with me right now and I am trying to find a documentation that shows the ranges of yaw, pitch and roll and the correspondent positions of the device.

我知道加速度计从-1到+1不等,但是昨天在我的iPhone上进行的测试显示,滚动从-M_PI变化到+ M_PI,但偏航和俯仰范围是其中的一半。这是正确的吗?

I know that the accelerometer varies from -1 to +1 but on my tests yesterday on my iPhone, showed me that the roll varies from -M_PI to +M_PI, but yaw and pitch ranges are half of that. Is this correct?

我在哪里可以找到有关这些范围的文档?我没有在Apple模糊的文档上看到它。

Where do I find documentation about these ranges? I don't see it on Apple vague docs.

谢谢。

推荐答案

这不是一个完整的答案,但为了开始滚球:

This is not a full answer, but in the interest of starting the ball rolling:

我假设你在谈论设备态度而不是原始陀螺仪数据。

I'm assuming you are talking about the device attitude rather than the raw gyro data.

有趣(我有一个ipod touch 4 gen坐在我面前显示这些值):

Anecdotally (I have an ipod touch 4 gen sitting in front of me displaying these values):

音高:看起来是 - (M_PI / 2) - > +(M_PI / 2)的范围,尽管我的上限是〜+ 1.55 / -1.51

pitch: looks to be a range of -(M_PI/2) -> +(M_PI/2) although mine caps at ~ +1.55 / -1.51

roll:-M_PI - > + M_PI

roll: -M_PI -> +M_PI

yaw:-M_PI - > + M_PI

yaw: -M_PI -> +M_PI

只是一个音符,至少在我的设备音高上没有区分倾斜向前与向后,只是给出设备相对于设备的角度重力方向。要弄清楚屏幕是指向还是向上,你当然可以检查gravity.z。

Just a note, at least on my device pitch doesn't differentiate tilt "forward" vs "backward", just gives the angle of the device relative to the direction of gravity. To figure out if the screen is pointed down or up, you can of course check gravity.z.

如果您正在使用CMDeviceMotion,则会有一个名为gravity的属性,只需抓住gravity.z即可。如果设备的显示器向上倾斜(远离重力)则为负,如果显示器朝下(朝向重力)则为正

If you're using CMDeviceMotion there is a property called gravity on it, just grab gravity.z. It will be negative if the device's display is tilting upward (away from gravity) and positive if the display is facing down (toward gravity)

请注意CMDeviceMotion使用的算法非常擅长将重力与用户加速分开,但在某些运动之下,在值变得正确之前可能会有一些滞后,我希望能有更好解决方案的人来这里。

Note that the algorithms used by CMDeviceMotion are pretty good at separating gravity from user acceleration but under certain kinds of motion there may be some lag before the values become correct, I would love to here from someone with a better solution.

这篇关于iphone - 偏航,俯仰和滚动的核心运动范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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