I'm creating a GPS enabled tour guide android mobile application, I have decided to use the accelerometer and the magnetic field sensor.
I am aware that I can use the rotation matrix to find the orientation of the user. This post helped my understanding of what the values mean. Convert magnetic field X, Y, Z values from device into global reference frame
However I can't seem to get the rotation matrix,the getRotationMatrix(float I,float R, float gravity, float accel) method has the return type boolean which is not the float[] return value I need/expected. Secondly, should the I and R parameters be empty float arrays?
To clarify, I want to get 2 matrices, the rotation and inclination. I have x,y,z values from both the (accelerometer/gyroscope) and Magnetometer.
Anyone who can help me with this specific issue I would be very grateful!
Any theoretical/further explanation of what each value of the rotation matrix corresponds to and how they can be used to work out where the user is compared to the magnetic north would be appreciated!
All help is very appreciated! I can post code if this would help people understand my problem
Here is an addition, I am receiving the Rotation matrix. Here are my values enter image description here xyzorientation are acceleration values magnetic field is the ambient magnetic field values Ro is the Rotation Matrix, should I be getting all these 0 values. My phone was stationary when I got these values.
All help is appreciated. Could these values be correct?