Skip to content

Commit 82929a0

Browse files
committed
update RTH and add GPS Rescue velocity
1 parent 15b199d commit 82929a0

File tree

3 files changed

+105
-3
lines changed

3 files changed

+105
-3
lines changed

js/flightlog_fielddefs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ var
339339
"TIMING_ACCURACY",
340340
"RX_EXPRESSLRS_SPI",
341341
"RX_EXPRESSLRS_PHASELOCK",
342+
"GPS_RESCUE_VELOCITY",
342343
]),
343344

344345
SUPER_EXPO_YAW = makeReadOnly([

js/flightlog_fields_presenter.js

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,13 @@ function FlightLogFieldPresenter() {
626626
'debug[2]':'Frequency Offset',
627627
'debug[3]':'Phase Shift',
628628
},
629+
'GPS_RESCUE_VELOCITY' : {
630+
'debug[all]':'GPS Rescue Velocity PIDs',
631+
'debug[0]':'Velocity P',
632+
'debug[1]':'Velocity I',
633+
'debug[2]':'Velocity D',
634+
'debug[3]':'GroundSpeed',
635+
},
629636
};
630637

631638
let DEBUG_FRIENDLY_FIELD_NAMES = null;
@@ -1006,8 +1013,12 @@ function FlightLogFieldPresenter() {
10061013
}
10071014
case 'RTH':
10081015
switch(fieldName) {
1016+
case 'debug[0]':
1017+
return value.toFixed(0) + 'us';
10091018
case 'debug[1]':
10101019
return (value / 100).toFixed(1) + 'deg';
1020+
case 'debug[2]':
1021+
return value.toFixed(0) + 'us';
10111022
default:
10121023
return value.toFixed(0);
10131024
}
@@ -1063,7 +1074,15 @@ function FlightLogFieldPresenter() {
10631074
return value.toFixed(0) + "Hz";
10641075
}
10651076
case 'GPS_RESCUE_THROTTLE_PID':
1066-
return value.toFixed(0);
1077+
switch (fieldName) {
1078+
// debug 0 = Throttle P
1079+
// debug 1 = Throttle I
1080+
// debug 3 = Throttle D
1081+
case 'debug[3]': // current altitude
1082+
return (value / 100).toFixed(2) + 'm';
1083+
default:
1084+
return value.toFixed(0);
1085+
}
10671086
case 'DYN_IDLE':
10681087
switch (fieldName) {
10691088
case 'debug[3]': // minRPS
@@ -1132,6 +1151,16 @@ function FlightLogFieldPresenter() {
11321151
default:
11331152
return value.toFixed(0) + 'us';
11341153
}
1154+
case 'GPS_RESCUE_VELOCITY':
1155+
switch (fieldName) {
1156+
// debug 0 = Velocity P
1157+
// debug 1 = Velocity I
1158+
// debug 2 = Velocity D
1159+
case 'debug[3]': // Velocity
1160+
return (value / 100).toFixed(0) + 'm/s';
1161+
default:
1162+
return value.toFixed(0);
1163+
}
11351164
}
11361165
return value.toFixed(0);
11371166
}

js/graph_config.js

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ GraphConfig.load = function(config) {
736736
default:
737737
return getCurveForMinMaxFields(fieldName);
738738
}
739-
case 'GPS_RESCUE_THROTTLE_PID':
739+
case 'GPS_RESCUE_THROTTLE_PID':
740740
switch (fieldName) {
741741
case 'debug[0]': // Throttle P
742742
return {
@@ -759,7 +759,79 @@ GraphConfig.load = function(config) {
759759
inputRange: 500,
760760
outputRange: 1.0,
761761
};
762-
case 'debug[0]': // Altitude
762+
case 'debug[3]': // Altitude
763+
return {
764+
offset: -10000,
765+
power: 1.0,
766+
inputRange: 10000,
767+
outputRange: 1.0,
768+
};
769+
default:
770+
return getCurveForMinMaxFields(fieldName);
771+
}
772+
case 'GPS_RESCUE_VELOCITY':
773+
switch (fieldName) {
774+
case 'debug[0]': // Throttle P
775+
return {
776+
offset: 0,
777+
power: 1.0,
778+
inputRange: 500,
779+
outputRange: 1.0,
780+
};
781+
case 'debug[1]': // Throttle I
782+
return {
783+
offset: 0,
784+
power: 1.0,
785+
inputRange: 500,
786+
outputRange: 1.0,
787+
};
788+
case 'debug[2]': // Throttle D
789+
return {
790+
offset: 0,
791+
power: 1.0,
792+
inputRange: 500,
793+
outputRange: 1.0,
794+
};
795+
case 'debug[3]': // Velocity cm/s
796+
return {
797+
offset: -1000,
798+
power: 1.0,
799+
inputRange: 1000,
800+
outputRange: 1.0,
801+
};
802+
default:
803+
return getCurveForMinMaxFields(fieldName);
804+
}
805+
case 'RTH':
806+
switch (fieldName) {
807+
case 'debug[0]': // FailureState
808+
return {
809+
offset: -5,
810+
power: 1.0,
811+
inputRange: 5,
812+
outputRange: 1.0,
813+
};
814+
case 'debug[1]': // Rescue throttle us
815+
return {
816+
offset: -1500,
817+
power: 1.0,
818+
inputRange: 500,
819+
outputRange: 1.0,
820+
};
821+
case 'debug[2]': // Rescue angle decidegrees
822+
return {
823+
offset: 0,
824+
power: 1.0,
825+
inputRange: 450,
826+
outputRange: 1.0,
827+
};
828+
case 'debug[3]': // Throttle adjustment us
829+
return {
830+
offset: 0,
831+
power: 1.0,
832+
inputRange: 500,
833+
outputRange: 1.0,
834+
};
763835
default:
764836
return getCurveForMinMaxFields(fieldName);
765837
}

0 commit comments

Comments
 (0)