Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/iNavFlight/inav-configurator.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorKonstantin Sharlaimov (DigitalEntity) <konstantin.sharlaimov@gmail.com>2019-05-01 22:42:31 +0300
committerKonstantin Sharlaimov (DigitalEntity) <konstantin.sharlaimov@gmail.com>2019-05-01 22:42:31 +0300
commit5916100b226f1cd6dabf4851d85f961f9157638b (patch)
treefec11fec62e44d2e2cbd26e487fd17068897d55e /js
parent79c39486db35cc3d91a5a738a4ccfe18a2b5529d (diff)
[OPFLOW] Initial cut on optic flow calibration
Diffstat (limited to 'js')
-rw-r--r--js/fc.js3
-rw-r--r--js/msp/MSPCodes.js4
-rw-r--r--js/msp/MSPHelper.js13
3 files changed, 19 insertions, 1 deletions
diff --git a/js/fc.js b/js/fc.js
index b7580feb..41dfc469 100644
--- a/js/fc.js
+++ b/js/fc.js
@@ -400,6 +400,9 @@ var FC = {
X: null,
Y: null,
Z: null
+ },
+ opflow: {
+ Scale: null
}
};
diff --git a/js/msp/MSPCodes.js b/js/msp/MSPCodes.js
index 9308719b..f774120d 100644
--- a/js/msp/MSPCodes.js
+++ b/js/msp/MSPCodes.js
@@ -209,5 +209,7 @@ var MSPCodes = {
MSP2_INAV_SET_LOGIC_CONDITIONS: 0x2023,
MSP2_PID: 0x2030,
- MSP2_SET_PID: 0x2031
+ MSP2_SET_PID: 0x2031,
+
+ MSP2_INAV_OPFLOW_CALIBRATION: 0x2032
};
diff --git a/js/msp/MSPHelper.js b/js/msp/MSPHelper.js
index e1dc856d..943e0612 100644
--- a/js/msp/MSPHelper.js
+++ b/js/msp/MSPHelper.js
@@ -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: