结合陀螺仪和加速计来获得航向
我正在使用 Android 设备来获取航向(方位角或偏航角)。
Android API 使用加速度计值 + 磁场来计算矩阵旋转,然后从该矩阵中提取方位角(又名 SensorManager.getOrientation(...)),但结果非常不准确!特别是当手机受到某些磁性物质干扰时。
然后我有了陀螺仪,如果我整合陀螺仪波谷时间的值,我就能得到一个实际的角度,但就像每个人都知道的那样:p,这可能会发生漂移...... 10 秒后甚至很难我'我没有移动角度漂移了10°...
所以这里我在一侧有加速+磁电机的结果,它在磁场附近非常糟糕 另一方面,我得到的陀螺仪结果非常好,但随着时间的推移而漂移......
所以我的问题是,是否有一种简单或智能的方法将两个结果组合在一起以获得一种“稳健”的航向估计?我说简单是因为我知道有卡尔曼滤波器..但即使很难,我读了这个理论 50 遍,但我什么也得不到:)。
谢谢你!
I'm using an Android device to get the heading(azimuth, or yaw angle).
Android API used the Accelerometer value + the mganetic field to compute a matrix rotation, the azimuth is then extracted form that matrix (aka SensorManager.getOrientation(...)) But the result is very inaccurate! especially if the phone is perturbed by some magnetic stuff.
And then I have the Gyroscope, If I integrate the value of the gyro trough time, I'm able to get an actual Angle, but like everybody knows :p, this is subject to drift... after 10 seconds even tough I'm not moving the angle drifted of 10°...
So here I have in one side the result of the accel + magneto, it's quite crap near magnetic field
and on the other side I have the result of the gyro that are really good, but drift over time...
So my question is, is there an easy or smart way to combine the two results together to get a kind of "robust" heading estimation? I say easy because I know there is kalman filters.. but even tough i read the theory 50 times I can't get a damn thing :).
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
据我所知,卡尔曼滤波器或类似的东西是在 SensorManager 中实现的。请查看Android 设备上的传感器融合:运动处理的革命。
你正试图解决一个已经解决的问题。
As far as I know, either the Kalman filter or something similar is implemented in the SensorManager. Check out Sensor Fusion on Android Devices: A Revolution in Motion Processing.
You are trying to solve a problem that is already solved.
简而言之:
不可能结合陀螺仪+加速度计来获得方位角(我精确地说),只是因为加速度计无法感应 XY 轴上的加速度。
一种方法是将陀螺仪与指南针融合在一起,但是如果存在磁扰的话,效果不会很好
TO make it short:
It is not possible to combine Gyroscope + accelerometer TO GET THE AZIMUTH (I precise) Simply because the accelerometer can't sense acceleration on the XY axis..
A method would be to fuse the Gyroscope with the Compass but that won't work really good if there is magnetic pertubation
似乎对陀螺仪传感器有一个非常普遍的困惑。我最近在这里回答了类似的问题,所以我推荐给任何感兴趣的人这些主题看看那个问题和答案。
我已经在此应用程序中使用了所描述的技术(指南针它集成了陀螺仪读数以改善结果)。结果并不完美,但总的来说比其他指南针要好得多。
It seems to have a very generalized confusion about gyroscope sensor. I have recently answered a similar question here, so I recommend to anybody interested in these topics to have a look at that question and answer.
I have used the described technique in this application (a compass which integrates gyroscope readings to improve results). The result is not perfect, but is much better in general than other compasses.