Project

General

Profile

User Story #36 » 0001-AoA-convention-default-boresight-to-the-screen-norma.patch

knight8241, 08/07/2026 18:31

View differences:

common/src/commonMain/kotlin/com/aether/mofe/engine/AoaCalibration.kt
* Fields are @Volatile so the HUD (UI thread) can retune while the engine thread reads.
*/
object AoaCalibration {
/** Body axis the boresight points along. Default X_POS = the engine's historical
* assumption (az=el=0 ⇒ +X); most phones actually key AoA to the screen-normal. */
@Volatile var boresight: AoaBoresight = AoaBoresight.X_POS
/** Body axis the boresight (az=el=0) points along. Default Z_NEG = the screen-normal
* out the back of the device — the phone's UWB antenna boresight, and now the aim
* ("lens") axis. FIELD-CONFIRMED on the Pixel 8 Pro: aiming −Z straight at an anchor
* reads az≈0, el≈0 (the definition of boresight). The old X_POS default decoded a
* boresight target to body +X, ~90° off, which anchored yaw ~110° wrong even though the
* AoA was perfectly centred (mofe_aim_localizer). With Z_NEG the AIMED target decodes to
* −Z regardless of the az/el signs, so "point −Z at X" anchors correctly; the signs +
* [azimuthOffsetDeg] only tune the OFF-boresight anchors and are best set by the
* on-device auto-cal (now well-conditioned because the aim keeps the target at boresight). */
@Volatile var boresight: AoaBoresight = AoaBoresight.Z_NEG
/** Added to the measured azimuth (deg) — the fine dial that rotates the anchored
* heading in the boresight plane; nudge until headErr → 0. Normalized to (−180,180]. */
@Volatile var azimuthOffsetDeg: Double = 0.0
(1-1/2)