Android: Magnetometer data deviates

时光怂恿深爱的人放手 提交于 2019-12-08 06:11:39

问题


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

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.

My question is: how do I estimate Euler angles so that they indicate I am walking in straight line.


回答1:


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.

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.



来源:https://stackoverflow.com/questions/30529272/android-magnetometer-data-deviates

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