Seed the mag heading anchor with Vancouver declination - #66
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 assertsheading + offset = -yaw, so a true-north heading needsoffset = -declination(Vancouver ~15.5 deg E, 2026).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;
pico2builds.