@@ -107,8 +107,8 @@ function GraphConfig(graphConfig) {
107
107
108
108
for ( var k = 0 ; k < logFieldNames . length ; k ++ ) {
109
109
if ( logFieldNames [ k ] . match ( nameRegex ) ) {
110
- // add special condition for rcCommand as each of the fields requires a different scaling.
111
- newGraph . fields . push ( adaptField ( $ . extend ( { } , field , { name : logFieldNames [ k ] } ) , colorIndexOffset , ( nameRoot == 'rcCommand ' ) ) ) ;
110
+ // add special condition for rcCommands as each of the fields requires a different scaling.
111
+ newGraph . fields . push ( adaptField ( $ . extend ( { } , field , { name : logFieldNames [ k ] } ) , colorIndexOffset , ( nameRoot == 'rcCommands ' ) ) ) ;
112
112
colorIndexOffset ++ ;
113
113
}
114
114
}
@@ -181,7 +181,11 @@ GraphConfig.load = function(config) {
181
181
label : "Gyros" ,
182
182
fields : [ "gyroADC[all]" ]
183
183
} ,
184
- { /* Add custom graph configurations to the main menu ! */
184
+ { /* Add custom graph configurations to the main menu ! */
185
+ label : "RC Rates" ,
186
+ fields : [ "rcCommands[all]" ]
187
+ } ,
188
+ {
185
189
label : "RC Command" ,
186
190
fields : [ "rcCommand[all]" ]
187
191
} ,
@@ -248,27 +252,30 @@ GraphConfig.load = function(config) {
248
252
inputRange : 500 ,
249
253
outputRange : 1.0
250
254
} ;
251
- } else if ( fieldName . match ( / ^ g y r o A D C \[ / ) ) {
252
- return {
253
- offset : 0 ,
254
- power : 0.25 , /* Make this 1.0 to scale linearly */
255
- inputRange : ( 2.0e-3 * Math . PI / 180 ) / sysConfig . gyroScale ,
256
- outputRange : 1.0
257
- } ;
258
255
} else if ( fieldName . match ( / ^ a c c S m o o t h \[ / ) ) {
259
256
return {
260
257
offset : 0 ,
261
258
power : 0.5 ,
262
259
inputRange : sysConfig . acc_1G * 16.0 , /* Reasonable typical maximum for acc */
263
260
outputRange : 1.0
264
261
} ;
265
- } else if ( fieldName . match ( / ^ a x i s E r r o r \[ / ) || // Custom Gyro, rcCommand and axisError Scaling
262
+ } else if ( fieldName == "rcCommands[3]" ) { // Throttle scaled
263
+ return {
264
+ offset : - 50 ,
265
+ power : 1.0 , /* Make this 1.0 to scale linearly */
266
+ inputRange : 50 ,
267
+ outputRange : 1.0
268
+ } ;
269
+ } else if ( fieldName . match ( / ^ a x i s E r r o r \[ / ) || // Gyro, Gyro Scaled, RC Command Scaled and axisError
266
270
fieldName . match ( / ^ r c C o m m a n d s \[ / ) || // These use the same scaling as they are in the
267
- fieldName . match ( / ^ g y r o A D C s \[ / ) ) { // same range.
271
+ fieldName . match ( / ^ g y r o A D C s \[ / ) || // same range.
272
+ fieldName . match ( / ^ g y r o A D C \[ / ) ) {
268
273
return {
269
274
offset : 0 ,
270
275
power : 0.25 , /* Make this 1.0 to scale linearly */
271
- inputRange : flightLog . gyroRawToDegreesPerSecond ( ( 2.0e-3 * Math . PI / 180 ) / sysConfig . gyroScale ) ,
276
+ inputRange : Math . max ( flightLog . rcCommandRawToDegreesPerSecond ( 500 , 0 ) * 1.20 ,
277
+ flightLog . rcCommandRawToDegreesPerSecond ( 500 , 1 ) * 1.20 ,
278
+ flightLog . rcCommandRawToDegreesPerSecond ( 500 , 2 ) * 1.20 ) , // Maximum grad/s + 20%
272
279
outputRange : 1.0
273
280
} ;
274
281
} else if ( fieldName . match ( / ^ a x i s .+ \[ / ) ) {
@@ -282,21 +289,14 @@ GraphConfig.load = function(config) {
282
289
return {
283
290
offset : - 1500 ,
284
291
power : 1.0 ,
285
- inputRange : 500 ,
286
- outputRange : 1.0
287
- } ;
288
- } else if ( fieldName == "rcCommand[2]" ) { // Yaw
289
- return {
290
- offset : 0 ,
291
- power : 0.8 ,
292
- inputRange : 500 * ( sysConfig . rcYawRate ? sysConfig . rcYawRate : 100 ) / 100 ,
292
+ inputRange : 500 ,
293
293
outputRange : 1.0
294
294
} ;
295
295
} else if ( fieldName . match ( / ^ r c C o m m a n d \[ / ) ) {
296
296
return {
297
297
offset : 0 ,
298
- power : 0.8 ,
299
- inputRange : 500 * ( sysConfig . rcRate ? sysConfig . rcRate : 100 ) / 100 ,
298
+ power : 0.25 ,
299
+ inputRange : 500 * 1.20 , // +20% to let compare in the same scale with the rccommands
300
300
outputRange : 1.0
301
301
} ;
302
302
} else if ( fieldName == "heading[2]" ) {
0 commit comments