the Android SDK actually offers a nice interface to access the sensors. But e.g. the linear acceleration-sensor can be evaluated as the documentation describes from gravity and acceleration - so there is no real physical counterpart for this Sensor, it is rather a - let's call it - "virtual sensor".
For the proximity-sensor things are rather clear, i can't imagine it is influenced by some other values.
But the GPS-sensor could be influenced by the accleremoter sensor when the GPS-signal is rather weaks I think values are somehow estimated supported by other sensors.
So basically my question is: which sensors do get direct input from physical sensors and which are somehow altered or totally calculated by the Andro开发者_如何学Pythonid-SDK? And how do I get raw input from the sensors?
I appended a list of the sensors available through the Sensor-class. GPS, W-LAN, Camera, etc. missing
//API-Level: 3
TYPE_ACCELEROMETER
TYPE_GYROSCOPE
TYPE_LIGHT
TYPE_MAGNETIC_FIELD
TYPE_PRESSURE
TYPE_PROXIMITY
TYPE_TEMPERATURE
//API-Level: 9 (2.3)
TYPE_GRAVITY
TYPE_LINEAR_ACCELERATION // can be calculated via acc. and grav. (link above)
TYPE_ROTATION_VECTOR
I am pretty sure the GPS at the moment is a stand alone or give raw data output.
The orientation sensor is one that I know that is not a raw from a single sensor but is actually the fusion of 2 sensors and in the future possibly more (gyro). As of now the orientation is a combination of the magnetic field sensor (compass) and the accelerometer. Any modern day compass will use both the compass and accelerometer to calculate its final direction and to compensate for drift, noise and other interference. If you notice when calculating the orientation with get rotation matrix and get orientation it requires you to listen for both magnetic field and accelerometer sensors.
I would say the gravity, linear acceleration and rotation vector sensors are not actual sensors and just parts of data from other sensors separated out, mostly from accelerometer and compass.
Lastly the pressure and temperature sensor are actually calculated through a single sensor.
精彩评论