Delay in yaw, pitch and roll values

ε祈祈猫儿з 提交于 2019-12-04 05:41:39

问题


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.

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

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


回答1:


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.

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.

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 source code can be found here:

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

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.

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.

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.

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).

Hope this helps :)



来源:https://stackoverflow.com/questions/13499838/delay-in-yaw-pitch-and-roll-values

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