Improve magnetometer logic
Now that I've created the little sensor demo that visualises the sensor output it's clear more work needs to be done on processing the magnetometer.
From what I've read so far and understand so far, the magnetometer is the product of all magnetic forces on the phone. As the magnetic field of the earth is relatively weak compared to other magnetic sources there is a lot of interference. Some you can't do anything about, if you hold a magnet close to your phone, thats what the magnetometer will point to (which is an interesting way to interact with your phone), it'll just mean what the phone things is north isn't north.
But the components of the phone itself are magnetic as well and that is seriously throwing the readings off. Need to investigate different methods of filtering the data.
Would be possible to filter that based on gyroscopic sensors too? And maybe also GPS position. For example magnetic north pole should never be above horizon line, but always below. And based on GPS position most likely you may be able to filter more angles. this article from a NASA website mention the Kalman Filter as an effective way of filtering noise reading gyroscopic and magnetometer's input. I haven't red accurately, but I remember that something similar was also applied to UAVs (autonomous drones).
Toshio, i’ve read about the Kalman Filter too, just haven’t had any time to understand how to implement it. Thanks for adding the links.
Cheers, Bas
On Wed, 6 Dec 2017 at 5:58 am, Toshio Araki [email protected] wrote:
Would be possible to filter that based on gyroscopic sensors too? And maybe also GPS position. For example magnetic north pole should never be above horizon line, but always below. And based on GPS position most likely you may be able to filter more angles. this https://ntrs.nasa.gov/search.jsp?R=19970017212 article from a NASA website mention the Kalman Filter http://www.ece.montana.edu/seniordesign/archive/SP14/UnderwaterNavigation/kalman_filter.html as an effective way of filtering noise reading gyroscopic and magnetometer's input. I haven't red accurately, but I remember that something similar was also applied to UAVs (autonomous drones).
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot-demo-projects/issues/91#issuecomment-349405435, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2vacLZd_ssFF3rccvw_Yza-o-PutyOks5s9ZJPgaJpZM4QY-_v .
-- Kindest regards,
Bastiaan Olij
https://www.facebook.com/bastiaan.olij https://www.youtube.com/channel/UCrbLJYzJjDf2p-vJC011lYw https://github.com/BastiaanOlij
As far as filters go, the 1 Euro filter might be another option: http://cristal.univ-lille.fr/~casiez/1euro/
@firefly2442 cool! thanks man, I'll find some time to experiment with that soon.
@BastiaanOlij Any progress on this? Also, shouldn't this kind of filtering be done within the engine itself? There could be project settings or methods in a singleton to control it.
None at all @Calinou
My stake in this was around AR and VR and as the SDKs now all handle this it's not been on my radar. I think it's worth doing at some point in time because it is the only way the magnetometer data becomes usable but I won't have time for it any time soon.