Skip to content

Commit c56fc8e

Browse files
authored
rename DUAL_GYRO to MULTI_GYRO (debug mode) (#846)
feat: add MULTI_GYRO debug mode support for firmware 4.6.0+ Add version-gated DUAL_GYRO to MULTI_GYRO debug mode renaming with display names supporting up to 4 gyros. Debug modes show proper axis labels like 'Gyro 1 Diff [roll]' and maintain backward compatibility with existing DUAL_GYRO modes.
1 parent 95cbf3a commit c56fc8e

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

src/flightlog_fielddefs.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,12 @@ export function adjustFieldDefsList(firmwareType, firmwareVersion) {
550550
DEBUG_MODE.push('WING_SETPOINT');
551551
DEBUG_MODE.push('AUTOPILOT_POSITION');
552552
}
553+
if (semver.gte(firmwareVersion, "4.6.0")) {
554+
//rename DUAL_GYRO_ to MULTI_GYRO
555+
DEBUG_MODE.splice(DEBUG_MODE.indexOf("DUAL_GYRO_RAW"), 1, "MULTI_GYRO_RAW");
556+
DEBUG_MODE.splice(DEBUG_MODE.indexOf("DUAL_GYRO_DIFF"), 1, "MULTI_GYRO_DIFF");
557+
DEBUG_MODE.splice(DEBUG_MODE.indexOf("DUAL_GYRO_SCALED"), 1, "MULTI_GYRO_SCALED");
558+
}
553559

554560
ACC_HARDWARE = makeReadOnly(ACC_HARDWARE);
555561
DEBUG_MODE = makeReadOnly(DEBUG_MODE);

src/flightlog_fields_presenter.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,39 @@ FlightLogFieldPresenter.adjustDebugDefsList = function (
13971397
'debug[4]': 'Processed flow rates Y',
13981398
'debug[5]': 'Delta time',
13991399
};
1400+
DEBUG_FRIENDLY_FIELD_NAMES.MULTI_GYRO_RAW = {
1401+
'debug[all]': 'Debug Multi Gyro Raw',
1402+
'debug[0]': 'Gyro 1 Raw [roll]',
1403+
'debug[1]': 'Gyro 1 Raw [pitch]',
1404+
'debug[2]': 'Gyro 2 Raw [roll]',
1405+
'debug[3]': 'Gyro 2 Raw [pitch]',
1406+
'debug[4]': 'Gyro 3 Raw [roll]',
1407+
'debug[5]': 'Gyro 3 Raw [pitch]',
1408+
'debug[6]': 'Gyro 4 Raw [roll]',
1409+
'debug[7]': 'Gyro 4 Raw [pitch]',
1410+
};
1411+
DEBUG_FRIENDLY_FIELD_NAMES.MULTI_GYRO_DIFF = {
1412+
'debug[all]': 'Debug Multi Gyro Diff',
1413+
'debug[0]': 'Gyro 1 Diff [roll]',
1414+
'debug[1]': 'Gyro 1 Diff [pitch]',
1415+
'debug[2]': 'Gyro 2 Diff [roll]',
1416+
'debug[3]': 'Gyro 2 Diff [pitch]',
1417+
'debug[4]': 'Gyro 3 Diff [roll]',
1418+
'debug[5]': 'Gyro 3 Diff [pitch]',
1419+
'debug[6]': 'Gyro 4 Diff [roll]',
1420+
'debug[7]': 'Gyro 4 Diff [pitch]',
1421+
};
1422+
DEBUG_FRIENDLY_FIELD_NAMES.MULTI_GYRO_SCALED = {
1423+
'debug[all]': 'Multi Gyro Scaled',
1424+
'debug[0]': 'Gyro 1 [roll]',
1425+
'debug[1]': 'Gyro 1 [pitch]',
1426+
'debug[2]': 'Gyro 2 [roll]',
1427+
'debug[3]': 'Gyro 2 [pitch]',
1428+
'debug[4]': 'Gyro 3 [roll]',
1429+
'debug[5]': 'Gyro 3 [pitch]',
1430+
'debug[6]': 'Gyro 4 [roll]',
1431+
'debug[7]': 'Gyro 4 [pitch]',
1432+
};
14001433
DEBUG_FRIENDLY_FIELD_NAMES.AUTOPILOT_POSITION = {
14011434
'debug[all]': 'Autopilot Position',
14021435
'debug[0]': 'Distance',
@@ -1840,6 +1873,9 @@ FlightLogFieldPresenter.decodeDebugFieldToFriendly = function (
18401873
case "DUAL_GYRO_COMBINED":
18411874
case "DUAL_GYRO_DIFF":
18421875
case "DUAL_GYRO_RAW":
1876+
case "MULTI_GYRO_DIFF":
1877+
case "MULTI_GYRO_RAW":
1878+
case "MULTI_GYRO_SCALED":
18431879
case "NOTCH":
18441880
case "GYRO_SAMPLE":
18451881
return `${Math.round(flightLog.gyroRawToDegreesPerSecond(value))} °/s`;
@@ -2538,6 +2574,9 @@ FlightLogFieldPresenter.ConvertDebugFieldValue = function (
25382574
case "DUAL_GYRO_COMBINED":
25392575
case "DUAL_GYRO_DIFF":
25402576
case "DUAL_GYRO_RAW":
2577+
case "MULTI_GYRO_DIFF":
2578+
case "MULTI_GYRO_RAW":
2579+
case "MULTI_GYRO_SCALED":
25412580
case "NOTCH":
25422581
case "GYRO_SAMPLE":
25432582
return toFriendly

src/flightlog_parser.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,12 @@ export function FlightLogParser(logData) {
446446
chirp_frequency_start_deci_hz : "chirp_frequency_start_deci_hz",
447447
chirp_frequency_end_deci_hz : "chirp_frequency_end_deci_hz",
448448
chirp_time_seconds : "chirp_time_seconds",
449+
// MULTI_GYRO to DUAL_GYRO debug mode aliases
450+
multi_gyro: "dual_gyro",
451+
multi_gyro_raw: "dual_gyro_raw",
452+
multi_gyro_combined: "dual_gyro_combined",
453+
multi_gyro_diff: "dual_gyro_diff",
454+
multi_gyro_scaled: "dual_gyro_scaled",
449455
},
450456
frameTypes,
451457
// Blackbox state:

0 commit comments

Comments
 (0)