I am using a motion tracking device equipped with a gyrometer/accelerometer/magnetometer. The device outputs its rotational orientation at any timepoint as a quaternion.