简体   繁体   English

在Android中检查并启用磁传感器校准

[英]Check and enable Magnetic sensor calibration in Android

I'm using Magnetic Sensor calibration in my Android app to implement Augmented reality. 我在Android应用中使用磁传感器校准来实现增强现实。 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? 有什么方法可以检查校准并自动启用或提示用户再次执行手动校准?

Unfortunately for an AR type app I can't see how you can know if the magnetic sensor is correctly calibrated or not. 不幸的是,对于AR类型的应用程序,我看不到如何知道磁传感器是否已正确校准。 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. 由于有很多事情会导致磁传感器失准(请参阅: https : //stackoverflow.com/a/9583998/295004 ),地图/导航应用程序可以做的一件事是使用GPS传感器检测到用户正在XYZ道路上行驶,该道路的指南针方位角为x,并且如果与磁传感器所说的不符,则这是要重新校准的指示器。

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. 对于您的AR应用程序,您可能只想拥有一个初始屏幕状态,即如果用户遇到任何旋转问题来执行Figure 8模式并打开您的磁性传感器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM