Interpreting positional and motion data - matthewkwan/waterbuddy GitHub Wiki

Positional Data

Rotation Vector

The rotation vector determines how the device is currently oriented compared to magnetic field of the earth - setting the phone FLAT with it pointing to the magnetic NORTH is defined as 0.

(Below is from android documentation)

Rotation vector uses information from the android system under TYPE_ROTATION_VECTOR sensor. The rotation vector represents the orientation of the device as a combination of an angle and an axis, in which the device has rotated through an angle θ around an axis <x, y, z>.

The three elements of the rotation vector are <xsin(θ/2), ysin(θ/2), z*sin(θ/2)>, such that the magnitude of the rotation vector is equal to sin(θ/2), and the direction of the rotation vector is equal to the direction of the axis of rotation.

The three elements of the rotation vector are equal to the last three components of a unit quaternion <cos(θ/2), xsin(θ/2), ysin(θ/2), z*sin(θ/2)>.

Elements of the rotation vector are unitless. The x,y, and z axis are defined in the same way as the acceleration sensor.

The reference coordinate system is defined as a direct orthonormal basis, where:

  • X is defined as the vector product Y.Z (It is tangential to the ground at the device's current location and roughly points East).
  • Y is tangential to the ground at the device's current location and points towards magnetic north.
  • Z points towards the sky and is perpendicular to the ground.

The values depicted on the app interface and exported CVS means:

  • X: Rotation vector component along the x axis (x * sin(θ/2))
  • Y: Rotation vector component along the y axis (y * sin(θ/2))
  • Z: Rotation vector component along the z axis (z * sin(θ/2))
  • (The W component of the quaternion is currently omitted for simplicity)
  • Range of value of X/Y/Z: -1 to 1.

Motion Data

Angular Velocity

The angular velocity data, as name suggests, reflects the current angular velocity along the X, Y and Z axes. Angular velocity uses information from the hardware sensor under TYPE_GYROSCOPE sensor.

(Below is from android documentation)

All values are in radians/second and measure the rate of rotation around the device's local X, Y and Z axis. The coordinate system is the same as is used for the acceleration sensor. Rotation is positive in the counter-clockwise direction. That is, an observer looking from some positive location on the x, y or z axis at a device positioned on the origin would report positive rotation if the device appeared to be rotating counter clockwise. Note that this is the standard mathematical definition of positive rotation and does not agree with the definition of roll given earlier.

The values depicted on the app interface and exported CVS means:

  • vX: Angular speed around the x-axis
  • vY: Angular speed around the y-axis
  • vZ: Angular speed around the z-axis
⚠️ **GitHub.com Fallback** ⚠️