Friday, June 20, 2014

Android ROTATION_VECTOR values different across devices

I recently changed from calculating the rotation matrix by myself on the host pc side, with accelerometer and magnetometer values, to Sensor type ROTATION_VECTOR and just converting that into a matrix on the host pc.

I've noticed something strange though. The sensor event array values are different between the LG Nexus 5 and the Samsung S2. So if the ROTATION_VECTOR values array on the Nexus is:


  • values[0] //x-axis
  • values[1] //y-axis
  • values[2] //z-axis


then on the S2 it's something like:


  • values[0] //x-axis
  • values[1] //z-axis
  • values[2] //y-axis


These are just random examples, I'm not exactly sure what the axes are, just saying that the order is not the same within the array across devices.


On the Samsung Galaxy S2 I have installed an omnirom with kitkat which isn't officially supported so I'm thinking that could be one of the causes.

No comments:

Post a Comment