Here is the list of devices and the corresponded Sensor.TYPE_XXX:
1.Accelerometer (TYPE_ACCELEROMETER, TYPE_GRAVITY and
TYPE_LINEAR_ACCELERATION)
2.Magnetic field sensor (TYPE_MAGNETIC_FIELD,TYPE_ORIENTATION)
3.Gyroscope (TYPE_GYROSCOPE, TYPE_ROTATION_VECTOR)
4.Light sensor (TYPE_LIGHT)
5.Proximity (TYPE_PROXIMITY)
> Does TYPE_LINEAR_ACCELERATION uses both Acceleromter and Gyroscope
> hardware at its best?
No. TYPE_ACCELEROMETER reports absolute (raw) acceleration. According
to Android on-line docs, "The output of the accelerometer, gravity and
linear-acceleration sensors must obey the following relation:
acceleration = gravity + linear-acceleration"
It looks like there is a common misunderstanding of MEMS gyro. It only
measures angular speed and nothing else. So if you do not rotate the
phone gyro output should be 0 even if you are accelerating. In other
words, gyro gives you the changes in orientation when the compass
(TYPE_ORIENTATION) - the absolute orientation. It seems to be a very
subtle difference but gyro gives better results in a real world due to
less sensitivity to the magnetic fields.
> Also when tested on device ( Nexus S ) linear accelerations found to
> give high values for minor shakes , so assuming this removes gravity
> vector, this was not expected.
Why not? A shake can have large acceleration value, here is an example
I recorded on my phone:
7.1234417,6.033814,3.5140498
while in rest the same device shows:
0.20430522,0.47671217,9.493382
Removing gravity from the acceleration is only one issue.
You also need to take care about noise, orientation and variable
timing.
On Mar 13, 3:03 am, Pritam <[email protected]> wrote:
> Could someone help to know which sensor uses which part of phone's
> hardware or in what combination of this on Nexus S in android 2.3 ?
>
> Following are the sensor events:
>
> TYPE_ACCELEROMETER
>
> TYPE_GYROSCOPE
>
> TYPE_GRAVITY
>
> TYPE_LINEAR_ACCELERATION
>
> TYPE_ORIENTATION
>
> TYPE_ROTATION_VECTOR
>
> I assume first 2 corresponds to separate hardware (accelerometer and
> gyroscope),
>
> but how with the other remaining ones ?
>
> Does TYPE_LINEAR_ACCELERATION uses both Acceleromter and Gyroscope
> hardware at its best?
>
> I am actually interested in "linear aceleration" so should I need not
> worry about gyro events, if "linear acceleration" internally uses gyro
> to give out values ?
>
> Also when tested on device ( Nexus S ) linear accelerations found to
> give high values for minor shakes , so assuming this removes gravity
> vector, this was not expected.
>
> Thanks.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en