This application wants to provide an easy way to calibrate the compass of android devices.
Calibration workflow (idea)¶
- User is outside and wants to get a reliable compass direction
- User is instructed to waive an 8 --> find out what this really does!
- If GPS in not available, the workflow is abborted
- The User is instructed to point to a target which is at least ??? meters away.
- The compass value is saved
- How many meters may be calculated using the accuracy of the compass or some constant value
- The User is instructed to walk towards the point he points at until the phone issues a signal or he has reached the point.
- The signal is issued when the worst-case-error based on the GPS data allows a definitive answer for the direction the user has walked.
- The difference between the initial compass value and the angle determined by the GPS-Signals is the calibration Offset.
- The user may want to redo this procedure, this can be requested by shaking the phone or pressing a button.
The following image describes how the procedure works.
the red point is where the user is questioned to point towards the green point. Value a(red) is saved. When marching towards the green point, angle b(green) can be determined after some time. when this angle is known, then offset value c(blue) can be calculated, by subtracting b from a. this offset is added to the raw compass data, every time the compass reports new measurement values.
Issues with this Procedure¶
This only gives a constant offset which will be added to whathever value the compass yields.
- Measure accuracy of GPS signals to find out how much walking will be needed in a series of tests with different Android-Devices Done --> Results Accuracy REsults
- Implement the workflow described above and write an app which displays two compasses, one with the calibrated values and one with the raw compass values. Implementation Details
- Maybe a third compass could be implemented, which does some smoothing of the last values.
Integrate the workflow into mixare(https://github.com/mixare/mixare)No time for that
Algorithm with NMEA¶
The testsscenario was the following:
two Points, which were far away were marked on a map and their direction was determined, using a real map. these points served as reference.
given this data was available, the workflow was performed several times, using different Objects as reference Objects(in Pointing and Walking Step)
When the workflow is done, the angle for both reference points was determined, using the red arrow. this led to the following results:
|Nr||Schloss calibrated||Difference||Schloss Raw||Difference||Kirche calibrated||Difference||Kirche Raw||Difference||Offset||Corrected||Schritte|
|Difference to actual||1.615384615||12.09230769||0.846153846||11.32307692|
|Difference max - min||109||59||136.1||95.1||116||61||155.1||106|