Skip to content

Compass cal progress grid - #4454

Draft
Williangalvani wants to merge 9 commits into
bluerobotics:masterfrom
Williangalvani:compass_cal_progress_grid
Draft

Williangalvani wants to merge 9 commits into
bluerobotics:masterfrom
Williangalvani:compass_cal_progress_grid

Conversation

@Williangalvani

Copy link
Copy Markdown
Member
Screenshot 2026-09-14 at 18 24 10

Williangalvani and others added 9 commits September 14, 2026 15:29
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>
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