Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions js/flightlog_fielddefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ var
"TIMING_ACCURACY",
"RX_EXPRESSLRS_SPI",
"RX_EXPRESSLRS_PHASELOCK",
"DEBUG_RX_STATE_TIME",
"GPS_RESCUE_VELOCITY",
"GPS_RESCUE_HEADING",
"GPS_RESCUE_TRACKING",
]),

SUPER_EXPO_YAW = makeReadOnly([
Expand Down
100 changes: 85 additions & 15 deletions js/flightlog_fields_presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,8 @@ function FlightLogFieldPresenter() {
'RTH' : {
'debug[all]':'RTH',
'debug[0]':'Rescue Throttle',
'debug[1]':'Rescue Angle',
'debug[2]':'Altitude Adjustment',
'debug[1]':'Rescue Pitch Angle',
'debug[2]':'Throttle adjustment',
'debug[3]':'Rescue State',
},
'ITERM_RELAX' : {
Expand Down Expand Up @@ -626,6 +626,27 @@ function FlightLogFieldPresenter() {
'debug[2]':'Frequency Offset',
'debug[3]':'Phase Shift',
},
'GPS_RESCUE_VELOCITY' : {
'debug[all]':'GPS Rescue Velocity',
'debug[0]':'Velocity P',
'debug[1]':'Velocity D',
'debug[2]':'Velocity to Home',
'debug[3]':'Target Velocity',
},
'GPS_RESCUE_HEADING' : {
'debug[all]':'GPS Rescue Heading',
'debug[0]':'Rescue Yaw',
'debug[1]':'Rescue Roll',
'debug[2]':'Attitude',
'debug[3]':'Angle to home',
},
'GPS_RESCUE_TRACKING' : {
'debug[all]':'GPS Rescue Tracking',
'debug[0]':'Velocity to home',
'debug[1]':'Target velocity',
'debug[2]':'Altitude',
'debug[3]':'Target altitude',
},
};

let DEBUG_FRIENDLY_FIELD_NAMES = null;
Expand Down Expand Up @@ -678,6 +699,13 @@ function FlightLogFieldPresenter() {
'debug[2]':'Notch 3 Center Freq [dbg-axis]',
'debug[3]':'Gyro Pre Dyn Notch [dbg-axis]',
};
DEBUG_FRIENDLY_FIELD_NAMES.GPS_RESCUE_THROTTLE_PID = {
'debug[all]':'GPS Rescue Altitude',
'debug[0]':'Throttle P',
'debug[1]':'Throttle D',
'debug[2]':'Altitude',
'debug[3]':'Target Altitude',
};
} else if (semver.gte(firmwareVersion, '4.2.0')) {
DEBUG_FRIENDLY_FIELD_NAMES.FF_INTERPOLATED = {
'debug[all]':'Feedforward [roll]',
Expand Down Expand Up @@ -999,10 +1027,13 @@ function FlightLogFieldPresenter() {
}
case 'RTH':
switch(fieldName) {
case 'debug[0]': // rescue throttle 1000-2000
case 'debug[2]': // altitude adjustment min to max throttle
return value.toFixed(0) + 'us';
case 'debug[1]':
return (value / 100).toFixed(1) + 'deg';
return (value / 100).toFixed(1) + 'deg'; // rescue pitch angle
default:
return value.toFixed(0);
return value.toFixed(0); // coded values to 2000
}
case 'ITERM_RELAX':
switch (fieldName) {
Expand Down Expand Up @@ -1056,7 +1087,16 @@ function FlightLogFieldPresenter() {
return value.toFixed(0) + "Hz";
}
case 'GPS_RESCUE_THROTTLE_PID':
return value.toFixed(0);
switch (fieldName) {
case 'debug[0]': // Throttle P added us
case 'debug[1]': // Throttle D added * us
return value.toFixed(0) + 'us';
case 'debug[2]': // current altitude in m
case 'debug[3]': // TARGET altitude in m
return (value / 100).toFixed(1) + 'm';
default:
return value.toFixed(0);
}
case 'DYN_IDLE':
switch (fieldName) {
case 'debug[3]': // minRPS
Expand All @@ -1078,12 +1118,12 @@ function FlightLogFieldPresenter() {
}
case 'GHST':
switch (fieldName) {
// debug 0 is CRC error count 0 to int16_t
// debug 1 is unknown frame count 0 to int16_t
// debug 2 is RSSI 0 to -128 -> 0 to 128
case 'debug[3]': // LQ 0-100
return value.toFixed(0) + '%';
default:
// debug 0 is CRC error count 0 to int16_t
// debug 1 is unknown frame count 0 to int16_t
// debug 2 is RSSI 0 to -128 -> 0 to 128
return value.toFixed(0);
}
case 'SCHEDULER_DETERMINISM':
Expand All @@ -1092,8 +1132,8 @@ function FlightLogFieldPresenter() {
case 'debug[2]': // task delay time in us*10
case 'debug[3]': // task delay time in us*10
return (value / 10).toFixed(1) + 'us';
// debug 1 is task ID of late task
default:
// debug 1 is task ID of late task
return value.toFixed(0);
}
case 'TIMING_ACCURACY':
Expand All @@ -1109,22 +1149,52 @@ function FlightLogFieldPresenter() {
switch (fieldName) {
case 'debug[3]': // uplink LQ %
return value.toFixed(1) + '%';
// debug 0 = Lost connection count
// debug 1 = RSSI
// debug 2 = SNR
default:
// debug 0 = Lost connection count
// debug 1 = RSSI
// debug 2 = SNR
return value.toFixed(0);
}
case 'RX_EXPRESSLRS_PHASELOCK':
switch (fieldName) {
case 'debug[2]': // Frequency offset in ticks
return value.toFixed(0) + 'ticks';
// debug 0 = Phase offset us
// debug 1 = Filtered phase offset us
// debug 3 = Pphase shift in us
default:
// debug 0 = Phase offset us
// debug 1 = Filtered phase offset us
// debug 3 = Pphase shift in us
return value.toFixed(0) + 'us';
}
case 'GPS_RESCUE_VELOCITY':
switch (fieldName) {
case 'debug[0]': // Pitch P degrees * 100
case 'debug[1]': // Pitch D degrees * 100
return (value / 100).toFixed(1) + 'deg';
case 'debug[2]': // velocity to home cm/s
case 'debug[3]': // velocity target cm/s
return (value / 100).toFixed(1) + 'm/s';
}
case 'GPS_RESCUE_HEADING':
switch (fieldName) {
case 'debug[0]': // Rescue yaw rate deg/s * 10 up to +/- 90
return (value / 10).toFixed(1) + 'deg/s';
case 'debug[1]': // Rescue roll deg * 100 up to +/- 20 deg
return (value / 100).toFixed(1) + 'deg';
case 'debug[2]': // Attitude in degrees * 10
case 'debug[3]': // Angle to home in degrees * 10
return (value / 10).toFixed(1) + 'deg';
}
case 'GPS_RESCUE_TRACKING':
switch (fieldName) {
case 'debug[0]': // velocity to home cm/s
case 'debug[1]': // velocity target cm/s
return (value / 100).toFixed(1) + 'm/s';
case 'debug[2]': // altitude cm
case 'debug[3]': // altitude target cm
return (value / 100).toFixed(1) + 'm';
default:
return value.toFixed(0);
}
}
return value.toFixed(0);
}
Expand Down
123 changes: 123 additions & 0 deletions js/graph_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,129 @@ GraphConfig.load = function(config) {
default:
return getCurveForMinMaxFields(fieldName);
}
case 'GPS_RESCUE_THROTTLE_PID':
switch (fieldName) {
case 'debug[0]': // Throttle P uS added
case 'debug[1]': // Throttle D uS added
return {
offset: 0,
power: 1.0,
inputRange: 300,
outputRange: 1.0,
};
case 'debug[2]': // Altitude
case 'debug[3]': // Target Altitude
return {
offset: 0,
power: 1.0,
inputRange: 5000,
outputRange: 1.0,
};
default:
return getCurveForMinMaxFields(fieldName);
}
case 'GPS_RESCUE_VELOCITY':
switch (fieldName) {
case 'debug[0]': // Pitch P deg * 100
case 'debug[1]': // Pitch D deg * 100
return {
offset: 0,
power: 1.0,
inputRange: 2000,
outputRange: 1.0,
};
case 'debug[2]': // Velocity in cm/s
case 'debug[3]': // Velocity to home in cm/s
return {
offset: 0,
power: 1.0,
inputRange: 500,
outputRange: 1.0,
};
default:
return getCurveForMinMaxFields(fieldName);
}
case 'GPS_RESCUE_HEADING':
switch (fieldName) {
case 'debug[0]': // Rescue yaw rate deg/s * 10 up to +/- 90
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sonar issue: trailing space at the end

return {
offset: 0,
power: 1.0,
inputRange: 1000,
outputRange: 1.0,
};
case 'debug[1]': // Rescue roll deg * 10 up to +/- 20 deg
return {
offset: 0,
power: 1.0,
inputRange: 10000,
outputRange: 1.0,
};
case 'debug[2]': // Yaw attitude * 10
case 'debug[3]': // Angle to home * 10
return {
offset: -1800,
power: 1.0,
inputRange: 1800,
outputRange: 1.0,
};
default:
return getCurveForMinMaxFields(fieldName);
}
case 'RTH':
switch (fieldName) {
case 'debug[0]': // Rescue throttle 1000-2000 us
return {
offset: -1500,
power: 1.0,
inputRange: 500,
outputRange: 1.0,
};
case 'debug[2]': // Altitude adjustment or positive of negative
return {
offset: 0,
power: 1.0,
inputRange: 500,
outputRange: 1.0,
};
case 'debug[1]': // rescue pitch angle
return {
offset: 0,
power: 1.0,
inputRange: 5000,
outputRange: 1.0,
};
case 'debug[3]': // Failure counters coded
return {
offset: -1000,
power: 1.0,
inputRange: 1000,
outputRange: 1.0,
};
default:
return getCurveForMinMaxFields(fieldName);
}
case 'GPS_RESCUE_TRACKING':
switch (fieldName) {
case 'debug[0]': // velocity to home cm/s
case 'debug[1]': // target velocity cm/s
return {
offset: 0,
power: 1.0,
inputRange: 500,
outputRange: 1.0,
};
case 'debug[2]': // altitude m
case 'debug[3]': // Target altitude m
return {
offset: 0,
power: 1.0,
inputRange: 5000,
outputRange: 1.0,
};
default:
return getCurveForMinMaxFields(fieldName);
}
}
}
// if not found above then
Expand Down