Android:磁力计数据有偏差 [英] Android: Magnetometer data deviates

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

问题描述

我正在尝试根据加速度计、陀螺仪和磁力计数据估计航向.我已经从这里实现了一个互补过滤器.

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.

我曾经遇到过将指南针向下移动三英尺会导致它摆动 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.

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

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