In order to recalibrate the controller we used to do two things:
restart phone IMU, to get a new initial orientation
call native calibrateController() to compute calibration quaternion
The way it was done was incorrect because the calibration call was so fast that it was happening before the IMU issued new reads. So the calibration quaternion was computed with old values. That's why a correct calibration required 2 clicks on the calibration button.
Now we wait until the first read after IMU restart arrives, and then we perform the controller calibration.
In order to recalibrate the controller we used to do two things:
The way it was done was incorrect because the calibration call was so fast that it was happening before the IMU issued new reads. So the calibration quaternion was computed with old values. That's why a correct calibration required 2 clicks on the calibration button.
Now we wait until the first read after IMU restart arrives, and then we perform the controller calibration.