SensorAdditionalInfo | API reference | Android Developers
public
class
SensorAdditionalInfo
extends Object
This class represents a Sensor additional information frame,
which is reported through listener callback onSensorAdditionalInfo.
Summary
Constants | |
|---|---|
int |
TYPE_FRAME_BEGIN
Mark the beginning of a set of additional info frames. |
int |
TYPE_FRAME_END
Mark the end of a set of additional info frames. |
int |
TYPE_INTERNAL_TEMPERATURE
Internal temperature. |
int |
TYPE_SAMPLING
Sampling parameter. |
int |
TYPE_SENSOR_PLACEMENT
Sensor placement. |
int |
TYPE_UNTRACKED_DELAY
Untracked delay. |
int |
TYPE_VEC3_CALIBRATION
Vector calibration parameter. |
Fields | |
|---|---|
public
final
float[] |
floatValues
Additional info payload data represented in float values. |
public
final
int[] |
intValues
Additional info payload data represented in int values. |
public
final
Sensor |
sensor
The sensor that generated this event. |
public
final
int |
serial
Sequence number of frame for a certain type. |
public
final
int |
type
Type of this additional info frame. |
Inherited methods | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
From class
| |||||||||||||||||||||||
Constants
TYPE_FRAME_BEGIN
public static final int TYPE_FRAME_BEGIN
Mark the beginning of a set of additional info frames.
Constant Value: 0 (0x00000000)
TYPE_FRAME_END
public static final int TYPE_FRAME_END
Mark the end of a set of additional info frames.
Constant Value: 1 (0x00000001)
TYPE_INTERNAL_TEMPERATURE
public static final int TYPE_INTERNAL_TEMPERATURE
Internal temperature. Sensor hardware device internal temperature. Payload: floatValues[0]: internal temperature in Celsius.
Constant Value: 65537 (0x00010001)
TYPE_SAMPLING
public static final int TYPE_SAMPLING
Sampling parameter. Describes the raw sample period and estimated jitter of sample time in terms of standard deviation. Payload: floatValues[0]: raw sample period in seconds. floatValues[1]: standard deviation of sampling period.
Constant Value: 65540 (0x00010004)
TYPE_SENSOR_PLACEMENT
public static final int TYPE_SENSOR_PLACEMENT
Sensor placement. Provides the orientation and location of the sensor element in terms of the Android coordinate system. This data is given as a 3x4 matrix consisting of a 3x3 rotation matrix (R) concatenated with a 3x1 location vector (t). The rotation matrix provides the orientation of the Android device coordinate frame relative to the local coordinate frame of the sensor. Note that assuming the axes conventions of the sensor are the same as Android, this is the inverse of the matrix applied to raw samples read from the sensor to convert them into the Android representation. The location vector represents the translation from the origin of the Android sensor coordinate system to the geometric center of the sensor, specified in millimeters (mm).
Payload:
floatValues[0..11]: 3x4 matrix in row major order [R; t]
Example:
This raw buffer: {0, 1, 0, 0, -1, 0, 0, 10, 0, 0, 1, -2.5}
Corresponds to this 3x4 matrix:
| Orientation | Location | ||
| 0 | 1 | 0 | 0 |
| -1 | 0 | 0 | 10 |
| 0 | 0 | 1 | -2.5 |
The sensor is oriented such that:
- The device X axis corresponds to the sensor's local -Y axis
- The device Y axis corresponds to the sensor's local X axis
- The device Z axis and sensor's local Z axis are equivalent
In other words, if viewing the origin of the Android coordinate system from the positive Z direction, the device coordinate frame is to be rotated 90° counter-clockwise about the Z axis to align with the sensor's local coordinate frame. Equivalently, a vector in the Android coordinate frame may be multiplied with R to rotate it 90° clockwise (270° counter-clockwise), yielding its representation in the sensor's coordinate frame. Relative to the origin of the Android coordinate system, the physical center of the sensor is located 10mm in the positive Y direction, and 2.5mm in the negative Z direction.
Constant Value: 65539 (0x00010003)
TYPE_UNTRACKED_DELAY
public static final int TYPE_UNTRACKED_DELAY
Untracked delay. Delays that are introduced by data processing, such as filtering, which is not taken into account by sensor timestamps. Payload: floatValues[0]: delay estimation in seconds floatValues[1]: delay estimation standard deviation
Constant Value: 65536 (0x00010000)
TYPE_VEC3_CALIBRATION
public static final int TYPE_VEC3_CALIBRATION
Vector calibration parameter. Calibration applied to a sensor with 3 elements vector output, such as accelerometer, gyro, etc. Payload: floatValues[0..11]: First 3 rows of a homogeneous matrix in row major order that captures any linear transformation, including rotation, scaling, shear, shift.
Constant Value: 65538 (0x00010002)
Fields
floatValues
public final float[] floatValues
Additional info payload data represented in float values. Depending on the type of information, this may be null.
intValues
public final int[] intValues
Additional info payload data represented in int values. Depending on the type of information, this may be null.
sensor
public final Sensor sensor
The sensor that generated this event. See
SensorManager for details.
serial
public final int serial
Sequence number of frame for a certain type.
type
public final int type
Type of this additional info frame.