I did some testing, and it seems like the camera drifting is related to quaternion.
When these commands are used, the drifting occurs:
GetRawRotationVectorW2()
GetRawRotationVectorX2()
GetRawRotationVectorY2()
GetRawRotationVectorZ2()
SetCameraRotationQuat()
But when I rotate the camera with these commands, the drifting seems to disappears
gyroX# = GetRawGyroVelocityX()
gyroY# = GetRawGyroVelocityY()
gyroZ# = GetRawGyroVelocityZ()
RotSensorX# = - gyroX#
RotSensorY# = - gyroY#
RotSensorZ# = gyroZ#
RotateCameraLocalX(1, RotSensorX#)
RotateCameraLocalY(1, RotSensorY#)
RotateCameraLocalZ(1, RotSensorZ#)
Is there really a problem with quarternion?