Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: understanding the function remapCoordinateSystem

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?

like image 438
stephie Avatar asked May 13 '26 21:05

stephie


1 Answers

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

like image 115
Noname Avatar answered May 15 '26 11:05

Noname



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!