1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-19 14:25:13 +03:00

Merge pull request #1044 from iNavFlight/dzikuvx-mag-gain-calibration

Add support for MAG gain calibration
This commit is contained in:
Paweł Spychalski 2020-08-14 20:48:38 +02:00 committed by GitHub
commit 0cd7cc0903
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 5 deletions

View file

@ -1254,6 +1254,12 @@ var mspHelper = (function (gui) {
CALIBRATION_DATA.magZero.Y = data.getInt16(15, true);
CALIBRATION_DATA.magZero.Z = data.getInt16(17, true);
CALIBRATION_DATA.opflow.Scale = (data.getInt16(19, true) / 256.0);
if (semver.gte(CONFIG.flightControllerVersion, "2.6.0")) {
CALIBRATION_DATA.magGain.X = data.getInt16(21, true);
CALIBRATION_DATA.magGain.Y = data.getInt16(23, true);
CALIBRATION_DATA.magGain.Z = data.getInt16(25, true);
}
break;
@ -1901,8 +1907,20 @@ var mspHelper = (function (gui) {
buffer.push(lowByte(CALIBRATION_DATA.magZero.Z));
buffer.push(highByte(CALIBRATION_DATA.magZero.Z));
buffer.push(lowByte(Math.round(CALIBRATION_DATA.opflow.Scale * 256)));
buffer.push(highByte(Math.round(CALIBRATION_DATA.opflow.Scale * 256)));
buffer.push(lowByte(Math.round(CALIBRATION_DATA.opflow.Scale * 256)));
buffer.push(highByte(Math.round(CALIBRATION_DATA.opflow.Scale * 256)));
if (semver.gte(CONFIG.flightControllerVersion, "2.6.0")) {
buffer.push(lowByte(CALIBRATION_DATA.magGain.X));
buffer.push(highByte(CALIBRATION_DATA.magGain.X));
buffer.push(lowByte(CALIBRATION_DATA.magGain.Y));
buffer.push(highByte(CALIBRATION_DATA.magGain.Y));
buffer.push(lowByte(CALIBRATION_DATA.magGain.Z));
buffer.push(highByte(CALIBRATION_DATA.magGain.Z));
}
break;
case MSPCodes.MSP_SET_POSITION_ESTIMATION_CONFIG: