1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-24 16:55:22 +03:00

[OPFLOW] Initial cut on optic flow calibration

This commit is contained in:
Konstantin Sharlaimov (DigitalEntity) 2019-05-01 21:42:31 +02:00
parent 79c39486db
commit 5916100b22
6 changed files with 102 additions and 2 deletions

View file

@ -642,6 +642,9 @@ var mspHelper = (function (gui) {
case MSPCodes.MSP_MAG_CALIBRATION:
console.log('Mag calibration executed');
break;
case MSPCodes.MSP2_INAV_OPFLOW_CALIBRATION:
console.log('Optic flow calibration executed');
break;
case MSPCodes.MSP_SET_MISC:
console.log('MISC Configuration saved');
break;
@ -1293,6 +1296,11 @@ var mspHelper = (function (gui) {
CALIBRATION_DATA.magZero.X = data.getInt16(13, true);
CALIBRATION_DATA.magZero.Y = data.getInt16(15, true);
CALIBRATION_DATA.magZero.Z = data.getInt16(17, true);
if (semver.gte(CONFIG.flightControllerVersion, "2.2.0")) {
CALIBRATION_DATA.opflow.Scale = (data.getInt16(19, true) / 256.0);
}
break;
case MSPCodes.MSP_SET_CALIBRATION_DATA:
@ -1945,6 +1953,11 @@ var mspHelper = (function (gui) {
buffer.push(lowByte(CALIBRATION_DATA.magZero.Z));
buffer.push(highByte(CALIBRATION_DATA.magZero.Z));
if (semver.gte(CONFIG.flightControllerVersion, "2.2.0")) {
buffer.push(lowByte(Math.round(CALIBRATION_DATA.opflow.Scale * 256)));
buffer.push(highByte(Math.round(CALIBRATION_DATA.opflow.Scale * 256)));
}
break;
case MSPCodes.MSP_SET_POSITION_ESTIMATION_CONFIG: