bluerobotics / bluerobotics/BlueOS
bug: Compass calibration never shows Dismiss after MAG_CAL reports complete
- Dominant language
- Vue
- Stars
- 453
- Forks
- 151
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 174
Description
### Bug description
Onboard compass calibration can finish MAG_CAL reports (progress ~98–99%, fitness 0) and never leave the calibrating state. **Dismiss is never shown**; Cancel stays on screen.
**Affects `1.4-dev` (and the same Vue logic on `master`).** Reproduced live on SITL Vehicle Setup compass calibration.
`FullCompassCalibrator.vue` treats calibration as done when `Object.keys(this.fitness).length === this.compasses.length`. `compasses` is the full list of compass device-id parameters (every `COMPASS_DEV_ID ≠ 0`), not the **calibration mask** used in `MAV_CMD_DO_START_MAG_CAL`. `fitness` is keyed by `this.compasses[message.compass_id].deviceName` from MAG_CAL_REPORT.
If reports arrive for the compasses that were actually calibrated, but that count does not equal the full device-id list (unused IDs, UAVCAN vs onboard, index vs compass_id mismatch), `all_compasses_calibrated` stays false, `calibrationFinished()` never runs, and the Dismiss button (`v-if="state === states.DONE"`) never appears.
### Steps to reproduce
1. On BlueOS `1.4-dev` with an autopilot that has multiple compass device IDs (Navigator SITL is enough).
2. Vehicle Setup → Compass → Start Full Calibration, set a location, Calibrate, spin until MAG_CAL reports complete.
3. Observe: progress near 100%, MAG_CAL_REPORT fitness 0 for the compasses that ran, **Cancel still visible**, **Dismiss never appears**.
Expected: once the compasses selected by the mask have reports, show Dismiss (and mark reboot required).
### Primary pain point(s)
The operator cannot finish the compass wizard even when ArduPilot has reported calibration complete. The only way out is Cancel, which looks like a failed cal.
### Additional context
- Suggested fix: compare completed MAG_CAL_REPORT ids to the **mask** (or to the compasses that were actually started), not to `compasses.length`. Guard `this.compasses[message.compass_id]` (compass_id is not necessarily an index into that array).
- Live: SITL UI journey scored pass-with-finding; MAG_CAL_REPORT rows existed for UAVCAN/LSM303D/AK8963.
### Prerequisites
- [x] I have checked to make sure that a similar request has not already been filed or fixed.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in FullCompassCalibrator.vue by tracing the MAG_CAL_REPORT handling, the calibration mask used by MAV_CMD_DO_START_MAG_CAL, and the state transition that controls Dismiss. Reproduce the flow in SITL, then verify that reports for the selected compasses mark calibration complete, show Dismiss, and mark reboot required.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, robotics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100