Android: understanding the function remapCoordinateSystem

stephie picture stephie · Feb 28, 2011 · Viewed 8.7k times · Source

I have been trying to understand these 2 lines of code

SensorManager.getRotationMatrix(RTmp, I, grav, mag); 
SensorManager.remapCoordinateSystem(RTmp, SensorManager.AXIS_X,SensorManager.AXIS_MINUS_Z, Rot);

I read the documentation of remapCoordinateSystem(), however I am lost.

Can anyone explain to me what exactly getRotationMatrix and remapCoordinateSystem do? Specially the SensorManager.AXIS_X, SensorManager.AXIS_MINUS_Z?

Answer

Noname picture Noname · Jul 25, 2011

I believe getRotationMatrix() returns a rotation matrix that converts device coordinate to world coordinate, as mentioned in android documentation, not "world" to "device".

Computes the inclination matrix I as well as the rotation matrix R transforming a vector from the device coordinate system to the world's coordinate system which is defined as a direct orthonormal basis, where