0

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?

Jas
  • 3,207
  • 2
  • 15
  • 45

1 Answers1

2

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.

Community
  • 1
  • 1
Morrison Chang
  • 11,691
  • 3
  • 41
  • 77
  • That's exactly what I'm asking about. How does the app detect it if the magnetic sensor goes out of calibration? I have a dialog box which prompts user to make the 8 motion which is shown when the app is first installed. I can use that again if required. But the problem is, how to detect that?? – Jas Dec 01 '15 at 05:12
  • The problem is that you can't. Not without some outside or a different sensor giving you a hint that it isn't calibrated. GPS could be such a sensor but doesn't apply to your case. Your phone doesn't know its next to a giant magnet or was near one recently and screwed up calibration. Only the user can tell if the compass needs to be 'reset' by poor performance of all apps requiring compass (maps, AR, games, etc.) – Morrison Chang Dec 01 '15 at 05:16