sensor - Question about the rotation of X axis on Android -


I want to find the right rotation around the x axis with the Android sensor, after googling, I get this code :

Public Zero (Sensor Event Event) on Sensor Convert {sensor sensor = event.sensor; Switch (sensor.Tip ()) {case sensor. TEP_ACCLARMAMRAM: MACC = Event.valuesclone (); break; Case sensor TEP_MAGANTICIiILD: MMIG = Event.values.clone (); break; } If (MAAC == faucet || MMAG == blank) return; Float r [] = new float [9]; If (Censor Manager Matrix Matrix (R, Blank, MACC, MMAG)) {CensorGet.Oriteration (R, MORITATION); }}

Moorification [1] represents radians around the x axis, however, the price is very weird

  1. when the phone is flat on the table , So this is 0.
  2. When the head of the phone points to the ground, then it is PI / 2.
  3. When the phone is flat on the table, it is 0.
  4. When the head of the phone points to the sky, then it pi / 2.

In the states of 1,2, there are 2,3 rotation values ​​equal to how can I tell which state my phone is in?

Please verify your readings.

Signal & amp; The range you reported is out of sync altogether - what is expected on Android device.

Note: This sensor type exists for reasons of legacy, please getRotationMatrix


Comments