在Android中检查并启用磁传感器校准 [英] Check and enable Magnetic sensor calibration in Android

查看:219
本文介绍了在Android中检查并启用磁传感器校准的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Android应用中使用磁传感器校准来实现增强现实.长时间使用该应用程序后,传感器校准会逐渐降低.有什么方法可以检查校准并自动启用或提示用户再次执行手动校准?

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?

推荐答案

不幸的是,对于AR类型的应用程序,我看不到如何知道磁传感器是否已正确校准.由于有很多事情会导致磁传感器失准(请参阅: https://stackoverflow.com/a/9583998/295004 ),地图/导航应用可以做的一件事是使用GPS传感器来检测用户正在XYZ道路上行驶,该道路的罗盘方向为x,并且如果该方向与磁场方向不匹配传感器说这就是要重新校准的指示器.

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.

对于您的AR应用程序,您可能只希望具有一个初始屏幕状态,即如果用户遇到任何旋转问题来执行Figure 8模式并打开您的磁性传感器.

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.

这篇关于在Android中检查并启用磁传感器校准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆