Android getOrientation() method returns bad results

前端 未结 4 498
小蘑菇
小蘑菇 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 23:06

    You should probably try a longer delay like Game and/or keep/increase the size of your circular buffer. The sensors (accelerometer, compass, etc.) on mobile devices are inherently noisy so when I asked about 'low pass filter', I meant do you use more data to decrease the frequency of your app usable updates. Your video was done inside, I would also recommend going to a place with less EM interference such as a park just to check that the behavior is consistent as well as the standard compass reset action (rotate device in figure-8). In the end you may have to apply some heuristics to throw out the 'bad' data to make a smoother experience for the user.

提交回复
热议问题