Compass and Accelerometer precision

前端 未结 3 1976
耶瑟儿~
耶瑟儿~ 2021-02-11 10:14

i made my own application in Android that use compass and accelerometer sensors to display the degrees of rotation and inclination of my device. I initialized all the listener a

3条回答
  •  旧巷少年郎
    2021-02-11 11:06

    See my answer here: Smoothing data from a sensor

    I run this filter on both the accelerometer and magetometer event values before passing them to SensorManager.getRotationMatrix(). I think this algorithm has the advantage of not having to keep a large array of historic values, just the prior low-pass output array.

    The algorithm was derived from this Wikipedia entry: http://en.wikipedia.org/wiki/Low-pass_filter#Algorithmic_implementation

提交回复
热议问题