How to retrieve high quality compass orientation (as in Google Maps)?

前端 未结 4 1861
青春惊慌失措
青春惊慌失措 2021-02-09 07:53

All of the guides to getting compass orientation in Android I\'ve found have a bug: when you hold the phone in portrait mode and \"look\" above the horizon, the compass arrow tu

4条回答
  •  广开言路
    2021-02-09 08:17

    Compasses will give you what you want, but it's so noisy. It is noisy for 2 reasons, one of reason is, it is picking up, real noise, real signal. So, we live in an environment that's magnetically very noisy. So, this compasses, picking up everything that's magnetic. The other reason is that, it's not integrated, so it doesn't have benefit of dropping the frequency component. So, try to combine your compass with gyroscope data. This video will help you so much for using these sensors.

    Some more details, you can combine accelerometers also. So in summary, Gyroscopes provide orientation, Accelerometers provide a correction due to gravity, and compasses provide a correction due to magnetic North.

提交回复
热议问题