Skip to content

Commit

Permalink
Update ATTITUDE debug (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis authored Nov 14, 2024
1 parent 0020595 commit d27ef30
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 8 deletions.
39 changes: 31 additions & 8 deletions src/flightlog_fields_presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,21 @@ FlightLogFieldPresenter.adjustDebugDefsList = function (
"debug[7]": "Not Used",
};
}

if (semver.gte(firmwareVersion, '4.5.0')) {
DEBUG_FRIENDLY_FIELD_NAMES.ATTITUDE = {
"debug[all]": "Attitude",
"debug[0]": "Roll angle",
"debug[1]": "Pitch angle",
"debug[2]": "Ground speed factor",
"debug[3]": "Heading error",
"debug[4]": "Velocity to home",
"debug[5]": "Ground speed error ratio",
"debug[6]": "Pitch forward angle",
"debug[7]": "dcmKp gain",
};
}

if (semver.gte(firmwareVersion, '4.6.0')) {
// FFT_FREQ updated in firmware #13750
DEBUG_FRIENDLY_FIELD_NAMES.FFT_FREQ = {
Expand Down Expand Up @@ -2026,10 +2041,14 @@ FlightLogFieldPresenter.decodeDebugFieldToFriendly = function (
}
case "ATTITUDE":
switch (fieldName) {
case "debug[0]": // accADC X
case "debug[1]": // accADC Y
case "debug[2]": // setpoint Roll
case "debug[3]": // setpoint Pitch
case "debug[0]": // Roll Angle
case "debug[1]": // Pitch Angle
case "debug[2]": // Ground speed factor
case "debug[3]": // Heading error
case "debug[4]": // Velocity to home
case "debug[5]": // Ground speed error ratio
case "debug[6]": // Pitch forward angle
case "debug[7]": // dcmKp gain
default:
return value.toFixed(0);
}
Expand Down Expand Up @@ -2686,10 +2705,14 @@ FlightLogFieldPresenter.ConvertDebugFieldValue = function (
}
case "ATTITUDE":
switch (fieldName) {
case "debug[0]": // accADC X
case "debug[1]": // accADC Y
case "debug[2]": // setpoint Roll
case "debug[3]": // setpoint Pitch
case "debug[0]": // Roll Angle
case "debug[1]": // Pitch Angle
case "debug[2]": // Ground speed factor
case "debug[3]": // Heading error
case "debug[4]": // Velocity to home
case "debug[5]": // Ground speed error ratio
case "debug[6]": // Pitch forward angle
case "debug[7]": // dcmKp gain
default:
return value;
}
Expand Down
14 changes: 14 additions & 0 deletions src/graph_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,20 @@ GraphConfig.getDefaultCurveForField = function (flightLog, fieldName) {
inputRange: 5000,
outputRange: 1.0,
};
case "ATTITUDE":
switch (fieldName) {
case "debug[0]": // Roll angle
case "debug[1]": // Pitch angle
return {
power: 1.0,
MinMax: {
min: -180,
max: 180,
},
};
default:
return getCurveForMinMaxFields(fieldName);
}
}
}
// if not found above then
Expand Down

0 comments on commit d27ef30

Please sign in to comment.