compass calibration

hi,

I have a sort of a compass app.

in IOS my app asks for calibration without me doing nothing special about it. (btw it asks a lot when I’m moving)

in Android, it doesn’t ask anything. can I use this variable for that?

https://docs.coronalabs.com/api/event/location/accuracy.html

it seems more a variable to show distance accuracy not fitted for calibration (showing the correct direction of north). (if it’s directly related to the calibration I could use something like this: if accuracy > 50 then callCallibrationWarning() end

I can have a warning in the beginning to all android users to calibrate their devices but wanted to show that if the device needs it not all the time.

regards Carlos.

The compass and GPS are completely unrelated devices. GPS accuracy has nothing to do with the compass.

Rob

Thanks Rob for the answer,

but my question still remains. how can i know if the compass is not calibrated as i see in other apps? i didnt seen any variables in the API, but i could missed some.

I am unaware of any calibration controls. I’m pretty sure they are OS triggered.

Rob

I’m pretty sure that on IOS that it’s true…on Android not really. that depends on the maker if they provide some native app for that or not.

Almost all apps on Android, show only what to do to calibrate. They don’t provide any info about if they are calibrated or not, but I saw a few that provided some calibration status…so I was curious if we could have access to those variables if they exist.

i can do a calibration check if event.direction from “location” is provided from one sensor, and event.magnetic  from “heading” is provided from another sensor. I just need to compare them, and if the difference is larger than X the device needs to be calibrated. Ofc this only works if the user is moving, but it’s better than nothing. i just need to confirm that this data is provided from different sensors.

According to this article:

https://android.stackexchange.com/questions/30329/how-does-compass-calibration-work

There really isn’t a calibration mode on Android. You can wave your device around in a pattern any time to calibrate it. I didn’t find any API’s that could be called to determine if you need to calibrate or not other than watching the accelerometer.  One article suggested using the GPS to get the heading and compare it to the compass, but that a) requires your device to be able to sync to the GPS satellites (which while indoors is tough to do) and you probably have to be moving to get a real heading.

Maybe you should periodically just suggest people rotate their phone around in a figure 8 pattern, or whatever you want!

Rob

thanks, Rob. if you read my last post, using GPS to get the heading and compare it with compass, i thought already about it. i just wanted to make sure the data provided on corona are from those 2 different sensors. guess they are, so i’m confident that will work. right now, i’ve a background image (watermark) suggesting to improve precision the user can rotate their phone 8 times. i’m always curious if there is a better approach because in this case, we depend on the people doing or not…and in my app case. if the phone is not calibrated it will not work well because it will depend on heading.

The compass and GPS are completely unrelated devices. GPS accuracy has nothing to do with the compass.

Rob

Thanks Rob for the answer,

but my question still remains. how can i know if the compass is not calibrated as i see in other apps? i didnt seen any variables in the API, but i could missed some.

I am unaware of any calibration controls. I’m pretty sure they are OS triggered.

Rob

I’m pretty sure that on IOS that it’s true…on Android not really. that depends on the maker if they provide some native app for that or not.

Almost all apps on Android, show only what to do to calibrate. They don’t provide any info about if they are calibrated or not, but I saw a few that provided some calibration status…so I was curious if we could have access to those variables if they exist.

i can do a calibration check if event.direction from “location” is provided from one sensor, and event.magnetic  from “heading” is provided from another sensor. I just need to compare them, and if the difference is larger than X the device needs to be calibrated. Ofc this only works if the user is moving, but it’s better than nothing. i just need to confirm that this data is provided from different sensors.

According to this article:

https://android.stackexchange.com/questions/30329/how-does-compass-calibration-work

There really isn’t a calibration mode on Android. You can wave your device around in a pattern any time to calibrate it. I didn’t find any API’s that could be called to determine if you need to calibrate or not other than watching the accelerometer.  One article suggested using the GPS to get the heading and compare it to the compass, but that a) requires your device to be able to sync to the GPS satellites (which while indoors is tough to do) and you probably have to be moving to get a real heading.

Maybe you should periodically just suggest people rotate their phone around in a figure 8 pattern, or whatever you want!

Rob

thanks, Rob. if you read my last post, using GPS to get the heading and compare it with compass, i thought already about it. i just wanted to make sure the data provided on corona are from those 2 different sensors. guess they are, so i’m confident that will work. right now, i’ve a background image (watermark) suggesting to improve precision the user can rotate their phone 8 times. i’m always curious if there is a better approach because in this case, we depend on the people doing or not…and in my app case. if the phone is not calibrated it will not work well because it will depend on heading.