mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-22 07:45:19 +03:00
Merge pull request #1126 from McGiverGim/add_antigravity_type
Add Anti Gravity Mode
This commit is contained in:
commit
d76546bef9
5 changed files with 49 additions and 3 deletions
|
@ -1245,6 +1245,17 @@
|
|||
"message": "Profile independent PID Controller Settings"
|
||||
},
|
||||
|
||||
"pidTuningAntiGravityMode": {
|
||||
"message": "Anti Gravity Mode"
|
||||
},
|
||||
"pidTuningAntiGravityModeOptionSmooth": {
|
||||
"message": "Smooth",
|
||||
"description": "One of the modes of anti gravity"
|
||||
},
|
||||
"pidTuningAntiGravityModeOptionStep": {
|
||||
"message": "Step",
|
||||
"description": "One of the modes of anti gravity"
|
||||
},
|
||||
"pidTuningAntiGravityGain": {
|
||||
"message": "Anti Gravity Gain"
|
||||
},
|
||||
|
|
|
@ -380,6 +380,7 @@ var FC = {
|
|||
feedforwardPitch: 0,
|
||||
feedforwardYaw: 0,
|
||||
feedforwardTransition: 0,
|
||||
antiGravityMode: 0,
|
||||
};
|
||||
|
||||
SENSOR_CONFIG = {
|
||||
|
|
|
@ -911,6 +911,7 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
|||
ADVANCED_TUNING.feedforwardRoll = data.readU16();
|
||||
ADVANCED_TUNING.feedforwardPitch = data.readU16();
|
||||
ADVANCED_TUNING.feedforwardYaw = data.readU16();
|
||||
ADVANCED_TUNING.antiGravityMode = data.readU8();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1585,7 +1586,8 @@ MspHelper.prototype.crunch = function(code) {
|
|||
.push8(ADVANCED_TUNING.acroTrainerAngleLimit)
|
||||
.push16(ADVANCED_TUNING.feedforwardRoll)
|
||||
.push16(ADVANCED_TUNING.feedforwardPitch)
|
||||
.push16(ADVANCED_TUNING.feedforwardYaw);
|
||||
.push16(ADVANCED_TUNING.feedforwardYaw)
|
||||
.push8(ADVANCED_TUNING.antiGravityMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -272,6 +272,22 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
feedforwardTransitionNumberElement.val($(this).val());
|
||||
});
|
||||
|
||||
// AntiGravity Mode
|
||||
var antiGravityModeSelect = $('.antigravity select[id="antiGravityMode"]');
|
||||
antiGravityModeSelect.change(function () {
|
||||
var antiGravityModeValue = $('.antigravity select[id="antiGravityMode"]').val();
|
||||
|
||||
// Smooth
|
||||
if (antiGravityModeValue == 0) {
|
||||
$('.antigravity table th:nth-child(3)').hide();
|
||||
$('.antigravity table td:nth-child(3)').hide();
|
||||
} else {
|
||||
$('.antigravity table th:nth-child(3)').show();
|
||||
$('.antigravity table td:nth-child(3)').show();
|
||||
}
|
||||
});
|
||||
|
||||
antiGravityModeSelect.val(ADVANCED_TUNING.antiGravityMode).change();
|
||||
|
||||
} else {
|
||||
$('.itermrotation').hide();
|
||||
|
@ -288,6 +304,9 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
$('#pid_main .pid_titlebar2 th').attr("colspan", 8);
|
||||
|
||||
$('#pid-tuning .feedforwardTransition').hide();
|
||||
|
||||
$('.antigravity table th:first-child').hide();
|
||||
$('.antigravity table td:first-child').hide();
|
||||
}
|
||||
|
||||
$('input[id="gyroNotch1Enabled"]').change(function() {
|
||||
|
@ -497,6 +516,8 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
ADVANCED_TUNING.feedforwardYaw = parseInt($('.pid_tuning .YAW input[name="f"]').val());
|
||||
|
||||
ADVANCED_TUNING.feedforwardTransition = parseInt($('input[name="feedforwardTransition-number"]').val() * 100);
|
||||
|
||||
ADVANCED_TUNING.antiGravityMode = $('select[id="antiGravityMode"]').val();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -456,14 +456,25 @@
|
|||
<table class="cf">
|
||||
<thead>
|
||||
<tr>
|
||||
<th i18n="pidTuningAntiGravityMode"></th>
|
||||
<th i18n="pidTuningAntiGravityGain"></th>
|
||||
<th i18n="pidTuningAntiGravityThres"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr style="height: 35px;">
|
||||
<td><input type="number" name="itermAcceleratorGain" step="0.1" min="1" max="30" /></td>
|
||||
<td><input type="number" name="itermThrottleThreshold" step="10" min="20" max="1000" /></td>
|
||||
<td>
|
||||
<select id="antiGravityMode">
|
||||
<option i18n="pidTuningAntiGravityModeOptionSmooth" value="0">
|
||||
<option i18n="pidTuningAntiGravityModeOptionStep" value="1">
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="itermAcceleratorGain" step="0.1" min="1" max="30" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="itermThrottleThreshold" step="10" min="20" max="1000" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue