1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-15 12:25:13 +03:00

Yaw Expo Feature

This commit is contained in:
borisbstyle 2015-05-08 01:11:43 +02:00 committed by ProDrone
parent d749304ec4
commit 34c6077b5c
5 changed files with 20 additions and 2 deletions

View file

@ -624,6 +624,9 @@
}, },
"receiverRcExpo": { "receiverRcExpo": {
"message": "RC Expo" "message": "RC Expo"
},
"receiverRcYawExpo": {
"message": "RC Yaw Expo"
}, },
"receiverChannelMap": { "receiverChannelMap": {
"message": "Channel Map" "message": "Channel Map"

View file

@ -75,7 +75,8 @@ var RC_tuning = {
dynamic_THR_PID: 0, dynamic_THR_PID: 0,
throttle_MID: 0, throttle_MID: 0,
throttle_EXPO: 0, throttle_EXPO: 0,
dynamic_THR_breakpoint: 0 dynamic_THR_breakpoint: 0,
RC_YAW_EXPO: 0
}; };
var AUX_CONFIG = []; var AUX_CONFIG = [];

View file

@ -309,6 +309,9 @@ var MSP = {
RC_tuning.throttle_EXPO = parseFloat((data.getUint8(offset++) / 100).toFixed(2)); RC_tuning.throttle_EXPO = parseFloat((data.getUint8(offset++) / 100).toFixed(2));
if (semver.gte(CONFIG.apiVersion, "1.7.0")) { if (semver.gte(CONFIG.apiVersion, "1.7.0")) {
RC_tuning.dynamic_THR_breakpoint = data.getUint16(offset++, 1); RC_tuning.dynamic_THR_breakpoint = data.getUint16(offset++, 1);
}
if (semver.gte(CONFIG.apiVersion, "1.10.0")) {
RC_tuning.RC_YAW_EXPO = parseFloat((data.getUint8(offset++) / 100).toFixed(2));
} }
break; break;
case MSP_codes.MSP_PID: case MSP_codes.MSP_PID:
@ -965,6 +968,9 @@ MSP.crunch = function (code) {
if (semver.gte(CONFIG.apiVersion, "1.7.0")) { if (semver.gte(CONFIG.apiVersion, "1.7.0")) {
buffer.push(lowByte(RC_tuning.dynamic_THR_breakpoint)); buffer.push(lowByte(RC_tuning.dynamic_THR_breakpoint));
buffer.push(highByte(RC_tuning.dynamic_THR_breakpoint)); buffer.push(highByte(RC_tuning.dynamic_THR_breakpoint));
}
if (semver.gte(CONFIG.apiVersion, "1.10.0")) {
buffer.push(parseInt(RC_tuning.RC_YAW_EXPO * 100));
} }
break; break;
// Disabled, cleanflight does not use MSP_SET_BOX. // Disabled, cleanflight does not use MSP_SET_BOX.

View file

@ -17,10 +17,12 @@
<tr> <tr>
<th i18n="receiverRcRate"></th> <th i18n="receiverRcRate"></th>
<th i18n="receiverRcExpo"></th> <th i18n="receiverRcExpo"></th>
<th i18n="receiverRcYawExpo"></th>
</tr> </tr>
<tr> <tr>
<td><input type="number" name="rate" step="0.01" min="0" max="2.5" /></td> <td><input type="number" name="rate" step="0.01" min="0" max="2.5" /></td>
<td><input type="number" name="expo" step="0.01" min="0" max="1" /></td> <td><input type="number" name="expo" step="0.01" min="0" max="1" /></td>
<td><input type="number" name="yaw_expo" step="0.01" min="0" max="1" /></td>
</tr> </tr>
</table> </table>
<div class="rssi_channel_wrapper"> <div class="rssi_channel_wrapper">

View file

@ -37,7 +37,12 @@ TABS.receiver.initialize = function (callback) {
$('.tunings .rate input[name="rate"]').val(RC_tuning.RC_RATE.toFixed(2)); $('.tunings .rate input[name="rate"]').val(RC_tuning.RC_RATE.toFixed(2));
$('.tunings .rate input[name="expo"]').val(RC_tuning.RC_EXPO.toFixed(2)); $('.tunings .rate input[name="expo"]').val(RC_tuning.RC_EXPO.toFixed(2));
$('.tunings .rate input[name="yaw_expo"]').val(RC_tuning.RC_YAW_EXPO.toFixed(2));
if (semver.lt(CONFIG.apiVersion, "1.10.0")) {
$('.tunings .rate input[name="yaw_expo"]').hide();
}
chrome.storage.local.get('rx_refresh_rate', function (result) { chrome.storage.local.get('rx_refresh_rate', function (result) {
if (result.rx_refresh_rate) { if (result.rx_refresh_rate) {
$('select[name="rx_refresh_rate"]').val(result.rx_refresh_rate).change(); $('select[name="rx_refresh_rate"]').val(result.rx_refresh_rate).change();
@ -268,6 +273,7 @@ TABS.receiver.initialize = function (callback) {
RC_tuning.RC_RATE = parseFloat($('.tunings .rate input[name="rate"]').val()); RC_tuning.RC_RATE = parseFloat($('.tunings .rate input[name="rate"]').val());
RC_tuning.RC_EXPO = parseFloat($('.tunings .rate input[name="expo"]').val()); RC_tuning.RC_EXPO = parseFloat($('.tunings .rate input[name="expo"]').val());
RC_tuning.RC_YAW_EXPO = parseFloat($('.tunings .rate input[name="yaw_expo"]').val());
// catch rc map // catch rc map
var RC_MAP_Letters = ['A', 'E', 'R', 'T', '1', '2', '3', '4']; var RC_MAP_Letters = ['A', 'E', 'R', 'T', '1', '2', '3', '4'];