What sensors are used for Sensor.TYPE_ROTATION_VECTOR

I'm developing for Honeycomb Gingerbread, and I was wondering what physical sensors are used when I use Sensor.TYPE_ROTATION_VECTOR?

Is a combination of compasses and accelerometers used? Or a gyroscope + acceleration? Or all three? Or something different? The reason I'm asking is because my application behaves differently on two different hardware, and in fact they should have the same types of sensors.

Thanks Mark

+7
source share
4 answers

I understand that some time has passed since the question was asked, but I do not see a clear answer, therefore ...

It uses all three sensors, if available. The use of a magnetic field sensor is critical to providing an absolute reference point. The "rotation sensor" must first orient itself and then eliminate the drift that the gyro introduces over time. The gyroscope is still in use due to its accuracy and good response time. An accelerometer helps determine the vector of gravity.

+6
source

Theory:

In order to find out the telephone orientation, including azimuth, you need to turn to the plane in the real world. This plane is calculated from two non-linear vectors: gravity (accelerometer) and magnetic field. These DO GET vectors are colinear in two โ€œplacesโ€ on earth, but, fortunately, it is close to the poles of the Earth.

Practice:

With a magnetic and an accelerometer you can get orientation. Unfortunately, if you send your phone to any linear acceleration or if there is magnetic interference, then the measures become noisy. Using a gyroscope significantly improves response time / accuracy (since this is a compromise), but this is not important for all applications.

+3
source

It looks like it uses any sensors that you define for use with your SensorManager. In turn, the sensor manager will broadcast a sensor event that will listen to your code.

See the demo code below to see an example.

Sources:

http://developer.android.com/reference/android/hardware/SensorManager.html

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/os/RotationVectorDemo.html

+2
source

From the https://source.android.com/devices/sensors/sensor-types.html that OEMs use to implement various types of Android sensors:

The rotation vector (SENSOR_TYPE_ROTATION_VECTOR) - the basic physical sensors: accelerometer, magnetometer and gyroscope ... This is usually achieved by integrating the readings of the accelerometer, gyroscope and magnetometer ... Basic physical sensors -
Accelerometer, Magnetometer, And (if available) Gyroscope.

...

The rotation vector of the game (SENSOR_TYPE_GAME_ROTATION_VECTOR) is the basic physical sensors: accelerometer and gyroscope (without magnetometer). The game's rotation vector sensor is similar to the rotation vector sensor, but does not use a geomagnetic field. Therefore, the Y axis does not point to the north, but instead to another link. This link allows you to drift in the same order of magnitude as the gyroscope, moves around the Z axis ... Basic physical sensors -
Accelerometer, gyroscope SHOULD NOT USE Magnetometer.

...

Geomagnetic rotation vector (SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR) - Basic physical sensors: accelerometer and magnetometer (without gyroscope). The geomagnetic rotation vector is similar to the rotation vector vector, but using a magnetometer and gyroscope. This sensor must be based on a magnetometer. It cannot be implemented using a gyroscope, and the gyroscope input cannot be used by this sensor ... Basic physical sensors - Accelerometer, magnetometer, SHOULD NOT USE Gyroscope.

...

If the device does not have a gyroscope, and only when there is no gyroscope, you can implement the rotation vector, linear acceleration and gravity sensors without using a gyroscope.

Thus, the exact implementation may depend on the device - some devices may not have gyroscopes.

+1
source

All Articles