What do the x, y, z values ​​obtained on the accelerometer in Android mean?

At first I thought:

  • x - tilt the phone from left to right and vice versa
  • y - upside down and vice versa
  • z - lifting the phone up and down

But this is not like that. Can anyone fix me if I am wrong.

I want to know these values ​​to find out the angle of the phone. Is it possible to find out using these values?

+4
source share
2 answers

After obtaining the values ​​from the accelerometer in mValuesAccel [3] and the gravity values ​​in mValuesMagnet [3], perform the following methods.

enter code here
SensorManager.getRotationMatrix(mRotationMatrix, null, mValuesAccel,ValuesMagnet);   
SensorManager.getOrientation(mRotationMatrix, mValuesOrientation);

After executing the above methods, the values ​​obtained in mValuesOrientation are as follows:

mValuesOrientation [0]: i) -ve X , 0 ; ii) , -90 ; iii) , -180 180 ;
iv) , 90 ; , -180 180 . 1) X, , . 2) , .

mValuesOrientation [1]: ( ), , -ve + ve mValuesOrientation [2]: ( ), , , -ve, + ve.

+1

, .. , , .

, , , - X, - Y, - Z.

Force = mass x acceleration

= /

. , , "OPPOSITE".

, , ( ), Z. , - / Z. , , , . = x 9,8 (). , , +10 Z , .

. , , , ( ). , , X (, X ​​ ). , , -10 X .

(, a) (, ), x 9,8 x Cos (a), "a" , X . , 9.8 x Cos (a). Cos (a) = 1 ( a = 0 ), 9,8 X . a = 60 (), X , 5, Cos (60) = 0,5.

.

X, Y Z (, ).

, X 6. aCos (6/9.8) ( Cos , ). 180/pi. , 'a' = aCos (6/9.8) * (180/pi) .

. , , .

+5

Source: https://habr.com/ru/post/1542046/


All Articles