fix(commander): scale mag cal offset limit with sensor full-scale range (#28549)

* fix(commander): scale mag cal offset limit with sensor full-scale range

The hard 1.3 Ga offset limit assumes ~1.9 Ga full scale, so modern mags (5-49 Ga full scale) fail calibration on large hard-iron offsets they can measure without saturating.

Drivers now report their range in sensor_mag and the limit becomes range minus
0.65 Ga worst-case earth field, keeping the 1.3 Ga fallback when the
range is unknown.

* fix(drivers): correct ADIS16448 and AK8963 mag ranges

* refactor(sensors): address review comments

- kConstant cal limits
- uT conversion helper
This commit is contained in:
Mahima Yoga authored and GitHub committed 2026-09-09 09:59:30 +02:00
1 parent 0d2c7058b3
commit b0b46cc9ce
26 files changed
+55 -10

No files matched your search

+2
View File
@@ -10,6 +10,8 @@ float32 z # [Gauss] magnetic field in the FRD board frame Z-axis
float32 temperature # [°C] Temperature.
float32 range # [Gauss] full-scale measurement range, 0 if unknown
uint32 error_count
uint8 ORB_QUEUE_LENGTH = 4