Android getOrientation() method returns bad results

前端 未结 4 499
小蘑菇
小蘑菇 2020-12-13 22:32

I\'m creating 3D Compass application.

I\'m using getOrientation method to get orientation (almost same implementation like here). If I place phone on the table it wo

4条回答
  •  北海茫月
    2020-12-13 22:44

    Few words about filtering, with your permissions.

    1. I would suggest to do averaging on Magnetic Field Vector itself before turning it into angles.
    2. It is wrong to do averaging/smoothing only on angles without use of some sort of magnitude. Angles themselves are not providing enough data to detect direction/heading/bearing. Example: When you want to know average wind direction during the whole day you must use the strength of the wind, not just only angles. If you will average only angles you will get absolutely wrong wind direction. As for bearing direction I would use the speed for magnitude.

提交回复
热议问题