4

Background: My aim is to figure out the tilted angles of a phone, for example for a game where tilting the phone backwards implies "stepping on the gas" and tilting left/right implies turning a steering wheel left and right.

I was watching this talk about sensor fusion between different Android sensors.

Based on the very end of the talk, it appears that I can use "vectors from rotation matrix to figure out which way I'm pointing".

Question: By that, are they implying that the correct approach for getting these angles would be by "Using the Rotation Vector Sensor"/TYPE_ROTATION_VECTOR?

If yes, my question is now specifically: which sensors does a device require to use sensor TYPE_ROTATION_VECTOR? My guess is accelerometer for initial values plus gyroscope for correction (plus optionally compass for additional correction)?

Extra credit question: Is anywhere I can find a list of devices that meet that criteria? and/or does anyone have a suggestion for a super cheap device that has the required sensors?

1 Answers1

3

Short answer:

Rotation vector sensor: accelerometer, gyroscope, and geomagnetic field.

Game rotation vector sensor: accelerometer, and gyroscope.

Geomagnetic rotation vector sensor: accelerometer, and geomagnetic field.

Long answer:

According to the Sensor Documentation, the rotation vector sensor uses accelerometer, and both the gyroscope and geomagnetic field for absolute rotation calibration.

They also provided game rotation vector sensor and geomagnetic rotation vector sensor, which are very similar to it, but are different and are often used for other purposes.

The game rotation vector sensor only uses gyroscope for calibration, and is better at measuring relative rotations, and are not impacted by magnetic field changes.

The geomagnetic rotation vector sensor uses a magnetometer instead of a gyroscope for calibration, so the power consumption is reduced. And it’s suggested to be used in the background, and in conjunction with batching.

Now, most devices have 9-axis IMU, which includes accelerometer, gyroscope, and magnetometer x 3-axis each. So you should be fine using that sensor. The only concern is that, maybe some of the devices doesn't provide the above "software sensors" implementation, so you might need to do the sensor fusion yourself.

Hope this helps!

Anhong
  • 232
  • 3
  • 10
  • Thanks for the response Anhong. Question: when you say "you should be fine using that sensor", which sensor are you referring to? The **rotational vector sensor**, the **game rotation vector sensor**, or the **geomagnetic rotation vector sensor**? – Loisaida Sam Sandberg Jun 22 '15 at 14:04
  • @LoisaidaSam I mean all of them, if you have 9-axis IMU, you can use or do sensor fusion for all three! – Anhong Jun 22 '15 at 19:32