summaryrefstree
path: root/vendor/etc/sensors/proto/sns_rotv.proto
blob: abe0ff84926201fdd75fe6e7bd6107ffcf5cc1f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// @file sns_rotv.proto
//
// Defines the API for Rotation Vector sensors.
//
// Copyright (c) 2017-2018 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.

syntax = "proto2";
import "sns_std_sensor.proto";

// A ROTV sensor reports the orientation of the device relative to the
// East-North-Up coordinates frame. It is obtained by integration of
// accelerometer, gyroscope, and magnetometer readings.
//
// ## ROTV sensor attributes:
// SNS_STD_SENSOR_ATTRID_TYPE is "rotv"
//
// ## Request Message: sns_std_sensor_config
// sns_std_sensor_config::sample_rate is used to specify the sampling rate (Hz)
// of the ROTV sensor. Sensor will generate data events at this rate.
//
// ## Event Message: sns_std_sensor_event
// Output of the ROTV sensor will be populated in sns_std_sensor_event
//
// The East-North-Up coordinate system is defined as a direct orthonormal
// basis where:
// - X points east and is tangential to the ground.
// - Y points north and is tangential to the ground.
// - Z points towards the sky and is perpendicular to the ground.
//
// The orientation is represented by the rotation necessary to align
// the East-North-Up coordinates with the device's coordinates. That is,
// applying the rotation to the world frame (X,Y,Z) would align them with
// the device coordinates (x,y,z).
//
// The rotation can be seen as rotating the device by an angle theta around an
// axis rot_axis to go from the reference device orientation to the current
// device orientation. The rotation is encoded as the four unitless x, y, z, w
// components of a unit quaternion:
// sns_std_sensor_event::data[0] = rot_axis.x*sin(theta/2)
// sns_std_sensor_event::data[1] = rot_axis.y*sin(theta/2)
// sns_std_sensor_event::data[2] = rot_axis.z*sin(theta/2)
// sns_std_sensor_event::data[3] = cos(theta/2)
//
// Where:
// - the x, y and z fields of rot_axis are the East-North-Up coordinates
// of a unit length vector representing the rotation axis
// - theta is the rotation angle
//
// sns_std_sensor_event::status specifies the reliability of the sample value
// value is of type sns_std_sensor_sample_status. see sns_std_sensor.proto for
// details.