偏航、俯仰和滚转值的延迟 [英] Delay in yaw, pitch and roll values

查看:21
本文介绍了偏航、俯仰和滚转值的延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Windows Phone 7.1 中开发一个应用程序,我需要手机在 x 和 y 轴上的当前度数旋转.我尝试使用运动 API 并使用它提供的偏航俯仰和滚转中的适当值.但是它提供的值在某种意义上是延迟的,如果我将手机移动得太快并将其旋转到 90 度,相应的值需要一点时间才能到达那里,这违背了我的目的.

I am developing an application in windows phone 7.1 which I require the current degree rotation of the phone in x and y axis. I tried using the motion API and use the appropriate values from yaw pitch and roll it provides. But the values it provide are delayed in the sense that if I move the phone too fast and rotate it to 90 degrees the corresponding value takes a little time to reach there, which defeats my purpose.

我在 Android 中做了同样的事情,我可以使用类似的东西来计算手机的即时旋转.

I have done the same thing in Android where I am able to use something similar to calculate the immediate rotation of phone.

这个东西可以在wp7上使用陀螺仪来完成,但我想使用加速度计,这样我就可以满足更多设备的需求.

This thing can be done using gyroscope on wp7 but I want to use accelerometer so that I can cater to more devices.

对如何实现目标的任何帮助将不胜感激

Any help on how to achieve the goal would be appreciated

推荐答案

我在 WP8 Motion API 上遇到了类似的问题.延迟并不是唯一的问题.似乎 Motion API 对各种罗盘(或磁力计)错误也非常敏感.更糟糕的是,这些不仅仅影响偏航.运动类 AHRS 算法似乎将俯仰和滚转与偏航耦合.结果,当指南针延迟或以其他方式疯狂时,俯仰和滚动也是如此.

I've got similar problems with WP8 Motion API. The delay is not the only problem. It seems Motion API is also very sensitive to compass (or magnetometer) errors of all kinds. And worse, these don't affect the yaw only. Motion class AHRS algorithm seems to couple the pitch and roll with yaw. As a result, when compass delays or goes other ways crazy, so do pitch and roll.

我怀疑你不能没有陀螺仪.理论上,您只能从加速度计获得欧拉角(偏航、俯仰和滚转),但前提是手机静止不动.最轻微的移动都会导致线性/向心加速度,这会破坏您的方向计算.我想说的是,任何使用手机等手持设备进行的尝试都注定要失败.此外,除了加速度计之外,Motion API 本身还需要指南针和陀螺仪硬件.

I doubt you can do without gyroscope. In theory, you could get Euler angles (yaw, pitch and roll) from accelerometer only, but ONLY IF the phone is standing still. A slightest movement causes linear/centripetal accelerations that will ruin your orientation calculations. I'd say any attempts to do that with a hand held device such as phone are doomed to fail. Moreover, Motion API in itself requires both compass and gyro hardware in addition to accelerometer.

无论如何,一切都没有丢失.我一起摆脱了 Motion 类,并按照 Sebastian Madgwick 的 IMU 算法实现了我自己的"IMU.此处带有 C 代码的 IMU/AHRS 报告:

Anyways, all is not lost. I got rid of Motion class all together and implemented "my own" IMU a la Sebastian Madgwick's IMU algorithm. The IMU / AHRS report with C-code here:

http://www.x-io.co.uk/res/doc/madgwick_internal_report.pdf

C 源代码可以在这里找到:

C source code can be found here:

http://www.x-io.co.uk/open-source-imu-and-ahrs-algorithms/

通过适当的 Beta 增益,Madgwick 的 IMU 就像 Windows Phone 上的魅力一样.IMU 不提供偏航,只提供俯仰和滚转.它只使用陀螺仪和加速度计硬件.如果您也需要偏航,您可以实现上述两个源中包含的完整 AHRS 算法.这当然也需要指南针.

With proper beta gain Madgwick's IMU works like charm on Windows Phone. IMU doesn't provide yaw, just pitch and roll. And it uses only gyro and accelerometer hardware. If you need yaw too, you can implement the full AHRS algorithm included in both the above sources. That of course needs compass too.

Madgwick 算法不包括欧拉角计算(只是描述地球和传感器框架之间旋转的四元数),但您可以从 Madgwick 的报告中找到方程.

The Madgwick algorithms do not include Euler angle calculations (just a quaternion describing rotation between earth and sensor frames), but you'll find the equations from the Madgwick's report.

我没有使用完整的 AHRS(或 Madgwick 所称的 MARG)的经验.然而,该算法将罗盘偏航与俯仰和滚转计算分离,因此即使存在磁干扰,人们也可以期望获得合理的俯仰/滚转读数.

I do not have experience with the full AHRS (or MARG, as Madgwick calls it). However, the algorithm decouples compass yaw from pitch and roll calculations, so one could expect to have sane pitch/roll readings even there's magnetic disturbances.

请注意,坐标系是不同的.在WP中,X=俯仰轴,Y=滚动轴,Z=偏航轴.在上述算法中,Y=pitch,X=roll 和 Z=yaw.因此,您需要交换 X 和 Y 以及反转 Z 加速度的方向.您还需要反转陀螺仪速率(并交换 X 和 Y 速率).

Please, note that coordinate systems are different. In WP, X=pitch axis, Y=roll axis and Z=yaw axis. In above algorithms, Y=pitch, X=roll and Z=yaw. So, you'll need to swap the X and Y as well as invert the direction of Z acceleration. You need to reverse the gyroscope rates as well (and swap the X and Y rates).

希望这有帮助:)

这篇关于偏航、俯仰和滚转值的延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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