• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps SensorManager.getRotationMatrix gravity parameter or accelerometer parameter values in android?

polonskyg

Lurker
In Android Documentation is specified the third parameter as

float[] gravity
then is specifies

[0 0 g] = R * gravity (g = magnitude of gravity)
Now, in most of the examples online I can see everyone sending accelerometer values to getRotationMatrix, but, Isn't suppose that I should send only gravity values?

For example, if the mobile phone has the gravity sensor, Should I send it raw output to getRotationMatrix? If it hasn't one, Should I send accelerometer values? Should I extract non gravity components first? (as accelerometer values are Acceleration minus G).

Will the use of gravity sensor values be more reliable than using accelerometer values in mobile phones that have that sensor?

Thanks in advance! Guillermo.
 
Back
Top Bottom