Igalia / wolvic

A fast and secure browser for standalone virtual-reality and augmented-reality headsets.
https://wolvic.org
Mozilla Public License 2.0
796 stars 100 forks source link

[VisionGlass] Recalibrate controller after restarting IMU #1424

Closed svillar closed 4 months ago

svillar commented 4 months ago

In order to recalibrate the controller we used to do two things:

  1. restart phone IMU, to get a new initial orientation
  2. 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.