summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-11-22 15:55:32 -0800
committerMathias Agopian <mathias@google.com>2010-11-22 15:55:32 -0800
commit42b743c85597e982ff1122b972862396f131db34 (patch)
tree530160fee97db47605f53c38712a17bb825d3845
parent2d1e978e3229bb524c6415580ad91fab051f944c (diff)
downloadlibhardware-42b743c85597e982ff1122b972862396f131db34.tar.gz
update rotation-vector documentation.
the rotation-vector sensor must transmit the W component of the unit quaternion in data[4]. This change doesn't cause a compatibility issue because nothing in the system relies on the W component being present. Change-Id: If4f699ac8d41d8b957925b375e355a138a82dcf8
-rw-r--r--include/hardware/sensors.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h
index 90568eb8..7f9706b9 100644
--- a/include/hardware/sensors.h
+++ b/include/hardware/sensors.h
@@ -233,12 +233,19 @@ __BEGIN_DECLS
* A gravity output indicates the direction of and magnitude of gravity in the devices's
* coordinates. On Earth, the magnitude is 9.8. Units are m/s^2. The coordinate system
* is the same as is used for the acceleration sensor.
+ * When the device is at rest, the output of the gravity sensor should be identical
+ * to that of the accelerometer.
*
* Linear Acceleration
* -------------------
* Indicates the linear acceleration of the device in device coordinates, not including gravity.
* This output is essentially Acceleration - Gravity. Units are m/s^2. The coordinate system is
* the same as is used for the acceleration sensor.
+ * The output of the accelerometer, gravity and linear-acceleration sensors must obey the
+ * following relation:
+ *
+ * acceleration = gravity + linear-acceleration
+ *
*
* Rotation Vector
* ---------------
@@ -252,6 +259,14 @@ __BEGIN_DECLS
* unit quaternion <cos(theta/2), x*sin(theta/2), y*sin(theta/2), z*sin(theta/2)>.
* Elements of the rotation vector are unitless. The x, y, and z axis are defined
* in the same was as for the acceleration sensor.
+ *
+ * The rotation-vector is stored as:
+ *
+ * sensors_event_t.data[0] = x*sin(theta/2)
+ * sensors_event_t.data[1] = y*sin(theta/2)
+ * sensors_event_t.data[2] = z*sin(theta/2)
+ * sensors_event_t.data[3] = cos(theta/2)
+ *
*/
typedef struct {