Check and enable Magnetic sensor calibration in Android

我只是一个虾纸丫 提交于 2019-12-02 15:19:25

问题


I'm using Magnetic Sensor calibration in my Android app to implement Augmented reality. When the app is used for a long time, the sensor calibration is reduced gradually. Is there any way to check the calibration and automatically enable or prompt the user to perform manual calibration again?


回答1:


Unfortunately for an AR type app I can't see how you can know if the magnetic sensor is correctly calibrated or not. Since there are lots of things which can cause the magnetic sensors to go out of alignment (see: https://stackoverflow.com/a/9583998/295004) one thing that a map/navigation app could do is use the GPS sensor to detect that the user is moving on XYZ road which has a compass bearing of x and if that doesn't match what the magnetic sensor says then that is an indicator to recalibrate.

For your AR app you may just want to have a splash screen state that if the user is having any rotation problems to do the figure 8 pattern and have your magnetic sensor on.



来源:https://stackoverflow.com/questions/34012677/check-and-enable-magnetic-sensor-calibration-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!