Wednesday, June 17, 2009

Magnetometer

While waiting for the myTouch to come out I have been researching the magnetometer in the G1. I haven't been able to find any information on people who have done tests on how fast/accurate it is. The only examples I have seen are the augmented reality browsers that most likely simply use the SENSOR_ORIENTATION.

For the purposes of the game I have in mind depending on the accelerometer to help calculate the orientation of the phone won't really work if the user is moving the phone around quickly while playing. So the basic problem is simply to find the rotation that aligns the magnetometer data with what the magnetic field at that location should be ( calculated by http://www.ngdc.noaa.gov/geomagmodels/struts/calcIGRFWMM ).

Right now I'm trying to figure out how exactly the getRotationMatrix method in the SensorManager class works, it uses the magnetometer and accelerometer data to produce the orientation without even needing the WMM data
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/hardware/SensorManager.java#l931

No comments:

Post a Comment