문제

I can't seem to manage to make my compass application function anywhere near as smoothly as Apple's, and I haven't seen any compass applications from independent developers that don't lag and sometimes jump erratically like mine does.

Is there any open source that demonstrates how to achieve such fluidity? Accuracy isn't quite so important, but smooth animation is.

도움이 되었습니까?

해결책

More general direction advice:

  • Easy: Apply a low pass filter to discard erratic readings.
  • Tricky: The compass updates slower than the gyroscope yaw, so you can measure the drift between compass updates to improve the response. Sample code.
  • Trickier: The proper way to fuse the gyroscope and the compass would be using a Kalman filter, but it isn't trivial. There is a talk about it at http://talkminer.com/viewtalk.jsp?videoid=C7JQ7Rpwn2k
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top