Sensor (draft)

1.sensor type
TYPE_ACCELEROMETER=1 
TYPE_MAGNETIC_FIELD=2 (what's value mean at x and z axis)
TYPE_ORIENTATION=3
TYPE_GYROSCOPE=4 
TYPE_LIGHT=5(in )
TYPE_PRESSURE=6
TYPE_TEMPERATURE=7
TYPE_PROXIMITY=8
TYPE_GRAVITY=9

TYPE_LINEAR_ACCELERATION=10

TYPE_ROTATION_VECTOR=11

some function of the sensor may be Overlaped.

2.TYPE_ACCELEROMETER
it has value[] to descripte the change.
the value is measured by the force applied to the sensor (F=G+A up,G-F=A down,F=A right,left,front,back)
take TYPE_ACCELEROMETER for example.
assume the phone lies flat on the table, the the force of gravity is 9.8,

the acceleration value is +9.8N/s^2. 

3.TYPE_GYROSCOPE
(not like TYPE_ACCELEROMETER, report positibve value )
we usually use time to calculate the acutal angle.
angle=angular*elapsedtime.

(if it's not a constant speed movement, we can use definite integral to get the total change.)

4.TYPE_GRAVITY

GRAVITY only include gravity, ACCELEROMETRE includes all force.

5.TYPE_LINEAR_ACCELERATION (not include gravity)

acceleration = gravity + linear-acceleration.

6.TYPE_ROTATION_VECTOR

?change 3 to an vector?
7.TYPE_ORIENTATION 
(maybe it can use gravity and magnetic to calculate the current orientation)

value are angles in degrees.

posted @ 2012-04-06 21:41  cascais  阅读(232)  评论(0编辑  收藏  举报