安卓:磁强计数据偏离 [英] Android: Magnetometer data deviates

查看:316
本文介绍了安卓:磁强计数据偏离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图估算加速度计,陀螺仪和磁力计的数据标题。我在这里实现从一个互补滤波器。

I am trying to estimate heading from the accelerometer, gyro and magnetometer data. I have implemented A Complementary Filter from here.

我试图的是,我捧在手上的手机,我在一条直线上走了15步,我想估计欧拉角在上面的链接给出。但是,当我绘制的原始数据,我观察到了磁数据偏离。这里有原始传感器数据的图像。

What I am trying is that I am holding the phone in my hand and I walked 15 steps in a straight line and I am trying to estimate Euler angles as given in the link above. But when I plot the raw data, I observe that the magnetometer data deviates. Here are the images of raw sensor data.

我的问题是:我怎么估计欧拉角,使他们表示我走在一条直线

推荐答案

是你走在室内,或某个地方可能存在的电场或磁场?通过磁力图来看,这是发生了什么。如果是的话,恐怕就没有解决您的问题。

Were you walking indoors, or somewhere there might be electrical or magnetic fields? Judging by the magnetometer graph, that's what's happening. If so, I'm afraid there's no solution to your problem.

尝试运行指南针的应用程序,甚至背着玩具指南针,走相同的路径。我敢打赌,你会看到罗盘摆动,你走。

Try running a compass app, or even carrying a toy compass, and then walk the same path. I bet you'll see the compass swing as you walk.

我一直在环境中移动指南针3英尺下表可能会导致它摆动180度。

I've been environments where moving a compass three feet down a table can cause it to swing 180 degrees.

顺便说一句:你几乎永远不希望欧拉角。他们有退化情况。尝试使用变换矩阵或四元,如果你能。

As an aside: you almost never want Euler angles. They have degenerate cases. Try to use transformation matrices or quaternions if you can.

这篇关于安卓:磁强计数据偏离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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