Compass cal progress grid - #4454
Draft
Williangalvani wants to merge 9 commits into
Draft
Williangalvani wants to merge 9 commits into
Williangalvani wants to merge 9 commits into
Conversation
Williangalvani
commented
Sep 14, 2026
Member
Park the geodesic MAG_CAL_PROGRESS viewer on its own branch so it is not lost as untracked WIP.
…brating Feed MAG_CAL_PROGRESS completion mask and direction into the grid, so the operator can see which orientations are still missing instead of only a percentage. Co-authored-by: Cursor <cursoragent@cursor.com>
OrientationPicker built its own Draco-enabled GLTFLoader, and the compass calibration grid needs the same one to show the vehicle. Co-authored-by: Cursor <cursoragent@cursor.com>
The section numbering has to match AP_GeodesicGrid or the completion mask lights up the wrong triangles, so it now sits in a module a self-check can import. The check reuses the expectations from ArduPilot's own test of the grid. Also fixes the lookup reporting section 0 for the null vector, which satisfies its test for every section. Co-authored-by: Cursor <cursoragent@cursor.com>
… the vehicle The grid was drawn straight from ArduPilot body frame coordinates into three.js, which put the vehicle's right axis on screen up and its down axis towards the viewer. Rotate what is drawn into the model frame, keeping lookups in body frame so the section indices still match the mask. The direction in MAG_CAL_PROGRESS is always zero, so the arrow never appeared and the null vector kept section 0 highlighted. Take the direction from the field reading in RAW_IMU instead, which is the body frame vector the autopilot bins the samples in. With the frames agreed, load the vehicle model inside the grid as a reference for which way the sections sit relative to the vehicle. Co-authored-by: Cursor <cursoragent@cursor.com>
…ld around the vehicle The grid is body fixed, so drawing it in body frame meant the vehicle sat still while the field marker swept over it, leaving the operator to work out the rotation backwards. Rotate the vehicle and its grid by ATTITUDE instead, and draw the field through the same rotation. The field then holds still in the world, the vehicle turns under it, and bringing a grey section onto the arrow is the rotation to actually perform. Both get the same rotation, so which section is lit stays correct even when the heading estimate is off, which it can be while the compass feeding it is the one being calibrated. Drops the camera tween onto newly completed sections, chasing a section around a scene that is already turning was disorienting. Co-authored-by: Cursor <cursoragent@cursor.com>
The models face +z, but the calibration grid draws the body frame with forward on x, so the model sat a quarter turn off and a roll read as a pitch. OrientationPicker already turns them the same way. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Each calibrating compass runs its own calibrator and reports its own mask and percentage, so the grid no longer follows whichever compass reported first. A section reaches full colour only once every compass has it, and the bar follows the compass with the most left to do. Co-authored-by: Cursor <cursoragent@cursor.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.