Skip to content

Seed the mag heading anchor with Vancouver declination - #66

Merged
georgesleen merged 1 commit into
mainfrom
dev/georgesleen/vancouver-mag-seed
Jul 27, 2026
Merged

Seed the mag heading anchor with Vancouver declination#66
georgesleen merged 1 commit into
mainfrom
dev/georgesleen/vancouver-mag-seed

Conversation

@georgesleen

Copy link
Copy Markdown
Collaborator

Sets the boot-time mag heading anchor (mti_yaw.offset_seed_deg, added in #65) to Vancouver's magnetic declination so the pre-GNSS heading is roughly true-north instead of magnetic-north.

  • offset_seed_deg = -15.5: the measurement asserts heading + offset = -yaw, so a true-north heading needs offset = -declination (Vancouver ~15.5 deg E, 2026).
  • This fixes only the declination term. Boat iron and the BNO-to-boat frame constant are still unknown and only GNSS refines them, so heading is not absolutely correct until a fix arrives. With GNSS present from boot the seed washes out within seconds (verified: identical mean heading error to seed=0), so the synthetic sim demos are unaffected; it only matters before the first fix.

Follow-up worth doing (not here): persist the GNSS-refined offset to flash and restore it at boot, so a reset recovers the full offset (declination + iron + frame) immediately rather than coasting to a static guess.

Verification: 208 sim + native fusion tests green; pico2 builds.

Set offset_seed_deg to -15.5 (Vancouver magnetic declination ~15.5 deg E; the
measurement asserts heading + offset = -yaw, so a true-north heading needs
offset = -declination). This fixes the declination term of the pre-GNSS heading;
boat iron and the BNO-to-boat frame constant still need GNSS to refine, so
heading is not absolutely correct until a fix arrives (or a persisted offset is
restored at boot, a planned follow-up). The boot-anchor sim test models a
zero-declination field, so it pins the seed to 0 for that world.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@georgesleen
georgesleen merged commit 3a08529 into main Jul 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant