Share via


SensorAdditionalInfo.TypeSensorPlacement Field

Definition

Caution

This constant will be removed in the future version. Use Android.Hardware.SensorAdditionalInfoType enum directly instead of this field.

Sensor placement.

[Android.Runtime.Register("TYPE_SENSOR_PLACEMENT", ApiSince=24)]
[System.Obsolete("This constant will be removed in the future version. Use Android.Hardware.SensorAdditionalInfoType enum directly instead of this field.", true)]
public const Android.Hardware.SensorAdditionalInfoType TypeSensorPlacement = 65539;
[<Android.Runtime.Register("TYPE_SENSOR_PLACEMENT", ApiSince=24)>]
[<System.Obsolete("This constant will be removed in the future version. Use Android.Hardware.SensorAdditionalInfoType enum directly instead of this field.", true)>]
val mutable TypeSensorPlacement : Android.Hardware.SensorAdditionalInfoType

Field Value

Value = 65539
Attributes

Remarks

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).

<b>Payload</b>: floatValues[0..11]: 3x4 matrix in row major order [R; t]

<b>Example</b>: This raw buffer: {0, 1, 0, 0, -1, 0, 0, 10, 0, 0, 1, -2.5}<br> Corresponds to this 3x4 matrix: <table> <thead> <tr><td colspan="3">Orientation</td><td>Location</tr> </thead> <tbody> <tr><td>0</td><td>1</td><td>0</td><td>0</td></tr> <tr><td>-1</td><td>0</td><td>0</td><td>10</td></tr> <tr><td>0</td><td>0</td><td>1</td><td>-2.5</td></tr> </tbody> </table> The sensor is oriented such that: <ul> <li>The device X axis corresponds to the sensor's local -Y axis <li>The device Y axis corresponds to the sensor's local X axis <li>The device Z axis and sensor's local Z axis are equivalent </ul> 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.

Java documentation for android.hardware.SensorAdditionalInfo.TYPE_SENSOR_PLACEMENT.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to