Skip to content

Commit 6ebd05a

Browse files
authored
Add formatting for unfiltered gyroscope field (#643)
* Add formatting for unfiltered gyroscope field * Rename UFGYRO and GyroUf to gyroUnfilt
1 parent 6876aa2 commit 6ebd05a

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

js/flightlog.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,5 +1337,6 @@ FlightLog.prototype.isFieldDisabled = function() {
13371337
MOTORS : (disabledFields & (1 << 10))!==0,
13381338
GPS : (disabledFields & (1 << 11))!==0,
13391339
RPM : (disabledFields & (1 << 12))!==0,
1340+
GYROUNFILT : (disabledFields & (1 << 13))!==0,
13401341
};
13411342
};

js/flightlog_fields_presenter.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ function FlightLogFieldPresenter() {
5757
'gyroADC[1]': 'Gyro [pitch]',
5858
'gyroADC[2]': 'Gyro [yaw]',
5959

60+
'gyroUnfilt[all]': 'Unfiltered Gyros',
61+
'gyroUnfilt[0]': 'Unfiltered Gyro [roll]',
62+
'gyroUnfilt[1]': 'Unfiltered Gyro [pitch]',
63+
'gyroUnfilt[2]': 'Unfiltered Gyro [yaw]',
64+
6065
//End-users prefer 1-based indexing
6166
'motor[all]': 'Motors',
6267
'motor[0]': 'Motor [1]',
@@ -1271,6 +1276,9 @@ function FlightLogFieldPresenter() {
12711276
case 'gyroADC[0]':
12721277
case 'gyroADC[1]':
12731278
case 'gyroADC[2]':
1279+
case 'gyroUnfilt[0]':
1280+
case 'gyroUnfilt[1]':
1281+
case 'gyroUnfilt[2]':
12741282
return flightLog.gyroRawToDegreesPerSecond(value / highResolutionScale).toFixed(highResolutionAddPrecision) + " °/s";
12751283

12761284
case 'gyroADCs[0]':

js/graph_config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ GraphConfig.load = function(config) {
179179
return 5000;
180180
} else if (fieldName.match(/^gyroADC.*\[/)) {
181181
return 3000;
182+
} else if (fieldName.match(/^gyroUnfilt.*\[/)) {
183+
return 3000;
182184
} else if (fieldName.match(/^accSmooth\[/)) {
183185
return 3000;
184186
} else if (fieldName.match(/^axis.+\[/)) {
@@ -292,7 +294,8 @@ GraphConfig.load = function(config) {
292294
};
293295
} else if (fieldName.match(/^axisError\[/) || // Gyro, Gyro Scaled, RC Command Scaled and axisError
294296
fieldName.match(/^rcCommands\[/) || // These use the same scaling as they are in the
295-
fieldName.match(/^gyroADC\[/)) { // same range.
297+
fieldName.match(/^gyroADC\[/) || // same range.
298+
fieldName.match(/^gyroUnfilt\[/)) {
296299
return {
297300
offset: 0,
298301
power: 0.25, /* Make this 1.0 to scale linearly */
@@ -963,6 +966,9 @@ GraphConfig.load = function(config) {
963966
if (!flightLog.isFieldDisabled().GYRO) {
964967
EXAMPLE_GRAPHS.push({label: "Gyros",fields: ["gyroADC[all]"]});
965968
}
969+
if (!flightLog.isFieldDisabled().GYROUNFILT) {
970+
EXAMPLE_GRAPHS.push({label: "Unfiltered Gyros",fields: ["gyroUnfilt[all]"]});
971+
}
966972
if (!flightLog.isFieldDisabled().SETPOINT) {
967973
EXAMPLE_GRAPHS.push({label: "Setpoint",fields: ["rcCommands[all]"]});
968974
}

js/header_dialog.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,12 +454,13 @@ function HeaderDialog(dialog, onSave) {
454454
{name: 'Magnetometer', description: ''},
455455
{name: 'Altitude', description: 'Barometer and rangefinder'},
456456
{name: 'RSSI', description: ''},
457-
{name: 'Gyroscope', description: 'Raw gyro data'},
457+
{name: 'Filtered Gyroscope', description: 'Filtered gyro data'},
458458
{name: 'Accelerometer', description: 'Raw accelerometer data'},
459459
{name: 'Debug', description: 'Debug values'},
460460
{name: 'Motors', description: 'Motors and tricopter servo values'},
461461
{name: 'GPS', description: 'All GPS-related values'},
462462
{name: 'RPM', description: 'Angular velocity for all motors'},
463+
{name: 'Unfiltered Gyroscope', description: 'Unfiltered gyro data'},
463464
];
464465

465466
const fieldsList_e = $('.fields_list');

0 commit comments

Comments
 (0)