OSDN Git Service

libsensors: Integrate the quaternion sensor and use for compass
authorAndy Ross <andrew.j.ross@intel.com>
Thu, 17 Oct 2013 18:38:21 +0000 (11:38 -0700)
committerMattias Pettersson <mattias.pettersson@intel.com>
Wed, 4 Dec 2013 14:13:12 +0000 (15:13 +0100)
commit8464eb7bdd94f2ce375d88c56293e6d168e75336
tree3a0827d9b17ccd853e2e5a6f7b96e307a6afce53
parent8aa41d6e2fa3728a8260220b10de0527560fad60
libsensors: Integrate the quaternion sensor and use for compass

The sensor hub has a built-in integrated sensor integration scheme
which emits a unified quaternion orientation.  Use this in lieu of
Google's SensorFusion software implementation.

Also: the sensor hub magnetometer emits uncalibrated data because of
requirements on other platforms, but Android demands calibrated
numbers.  Instead of doing magnetometer calibration in the HAL, use
the orientation output to derive a faked "magenetometer" which always
points to magnetic north along the ground plane.  Call this a "leveled
compass".  This behavior is apparently kosher: future (JB 4.3+) API
versions separate the existing "calibrated" compass output from a new
"raw" one which matches the sensor hub behavior.

Finally, the leveled compass implementation requires a little rework
to the SensorIIODev class to allow for reference counting of the
stream (so that it can be active when the sensor itself is disabled).

Issue: AXIA-3283
Change-Id: I16e90fa1119f908e979ca1fa010b2dea7f136deb
Depends-Change-Id: Id4feb36f32d0033f744752e238717bcd163aebb5
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Reviewed-on: https://otc-android.intel.com/gerrit/22344
Tested-by: jenkins autobuilder
Reviewed-by: Brian E Woodruff <brian.e.woodruff@intel.com>
Works-for-me: jenkins autobuilder
Reviewed-by: Daniel Leung <daniel.leung@intel.com>
Reviewed-by: Robert Chiras <robert.chiras@intel.com>
bigcore/libsensors/Android.mk
bigcore/libsensors/BoardConfig.cpp
bigcore/libsensors/SensorConfig.h
common/libsensors/RotVecSensor.cpp [new file with mode: 0644]
common/libsensors/RotVecSensor.h [new file with mode: 0644]
common/libsensors/SensorIIODev.cpp
common/libsensors/SensorIIODev.h
common/libsensors/SynthCompassSensor.cpp [new file with mode: 0644]
common/libsensors/SynthCompassSensor.h [new file with mode: 0644]
common/libsensors/common.h
common/libsensors/sensors.cpp