1

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?

Community
  • 1
  • 1

2 Answers2

0

read the docs the result is within the sent parameters, send empty arrays and they'll get filled if method returns true.

Chen Kinnrot
  • 20,609
  • 17
  • 79
  • 141
  • Thank you, This is clear to me now! Have you got any advice on how to use the values that are returned. How can I use these values to work out the orientation of the user in comparison magnetic north – CompSci2015 Dec 22 '15 at 15:48
0

This answer I wrote sometime before should help you out for some other will help you in understanding Coordinate frames and explanation of sensor values.

Here is good resource which contains detailed explanation of Roll, pitch and yaw values returned by sensor-manager.

Community
  • 1
  • 1
nbsrujan
  • 1,179
  • 1
  • 12
  • 26