mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-16 04:45:18 +03:00
Add maximum PITCH and ROLL angles to the PID tuning tab
- Add Pitch and Roll angles below the rates - Add help messages indicating that these values constrain the maximum inclination during navigation. - Add help messages for navigation max bank/climb/dive angles - Add help for pitch2thr
This commit is contained in:
parent
b8fd9578c3
commit
be1cb6afc4
10 changed files with 214 additions and 43 deletions
|
@ -957,6 +957,18 @@
|
||||||
"pidTuningYawRate": {
|
"pidTuningYawRate": {
|
||||||
"message": "YAW rate"
|
"message": "YAW rate"
|
||||||
},
|
},
|
||||||
|
"pidTuningMaxRollAngle": {
|
||||||
|
"message": "Max. ROLL angle"
|
||||||
|
},
|
||||||
|
"pidTuningMaxRollAngleHelp": {
|
||||||
|
"message": "Maximum ROLL angle in ANGLE mode. This also constrains the maximum bank in navigation modes."
|
||||||
|
},
|
||||||
|
"pidTuningMaxPitchAngle": {
|
||||||
|
"message": "Max. PITCH angle"
|
||||||
|
},
|
||||||
|
"pidTuningMaxPitchAngleHelp": {
|
||||||
|
"message": "Maximum PITCH angle in ANGLE mode. This also constrains the maximum climb and dive in navigation modes."
|
||||||
|
},
|
||||||
"pidTuningManualRollRate": {
|
"pidTuningManualRollRate": {
|
||||||
"message": "Manual ROLL rate"
|
"message": "Manual ROLL rate"
|
||||||
},
|
},
|
||||||
|
@ -2176,8 +2188,8 @@
|
||||||
"dtermNotchCutoffHelp": {
|
"dtermNotchCutoffHelp": {
|
||||||
"message": "Defines band of filter. <br><br>Has to be kept below notch filter frequency."
|
"message": "Defines band of filter. <br><br>Has to be kept below notch filter frequency."
|
||||||
},
|
},
|
||||||
"positionHoldConfiguration": {
|
"multiRotorNavigationConfiguration": {
|
||||||
"message": "Basic Navigation Settings"
|
"message": "Multirotor Navigation Settings"
|
||||||
},
|
},
|
||||||
"userControlMode": {
|
"userControlMode": {
|
||||||
"message": "User Control Mode"
|
"message": "User Control Mode"
|
||||||
|
@ -2195,7 +2207,10 @@
|
||||||
"message": "Max. ALTHOLD climb rate [cm/s]"
|
"message": "Max. ALTHOLD climb rate [cm/s]"
|
||||||
},
|
},
|
||||||
"posholdMaxBankAngle": {
|
"posholdMaxBankAngle": {
|
||||||
"message": "Multirotor max. banking angle [deg]"
|
"message": "Multirotor max. banking angle [degrees]"
|
||||||
|
},
|
||||||
|
"posholdMaxBankAngleHelp": {
|
||||||
|
"message": "Maximum banking angle in navigation modes. Constrained by maximum ROLL angle in PID tuning tab."
|
||||||
},
|
},
|
||||||
"posholdHoverThrottle": {
|
"posholdHoverThrottle": {
|
||||||
"message": "Hover throttle"
|
"message": "Hover throttle"
|
||||||
|
@ -2300,22 +2315,34 @@
|
||||||
"message": "Max. throttle"
|
"message": "Max. throttle"
|
||||||
},
|
},
|
||||||
"maxBankAngle": {
|
"maxBankAngle": {
|
||||||
"message": "Max. bank angle"
|
"message": "Max. bank angle [degrees]"
|
||||||
|
},
|
||||||
|
"maxBankAngleHelp": {
|
||||||
|
"message": "Maximum banking angle in navigation modes. Constrained by maximum ROLL angle in PID tuning tab."
|
||||||
},
|
},
|
||||||
"maxClimbAngle": {
|
"maxClimbAngle": {
|
||||||
"message": "Max. climb angle"
|
"message": "Max. climb angle [degrees]"
|
||||||
|
},
|
||||||
|
"maxClimbAngleHelp": {
|
||||||
|
"message": "Maximum climb angle in navigation modes. Constrained by maximum PITCH angle in PID tuning tab."
|
||||||
},
|
},
|
||||||
"maxDiveAngle": {
|
"maxDiveAngle": {
|
||||||
"message": "Max. dive angle"
|
"message": "Max. dive angle [degrees]"
|
||||||
|
},
|
||||||
|
"maxDiveAngleHelp": {
|
||||||
|
"message": "Maximum dive angle in navigation modes. Constrained by maximum PITCH angle in PID tuning tab."
|
||||||
},
|
},
|
||||||
"pitchToThrottle": {
|
"pitchToThrottle": {
|
||||||
"message": "Pitch to throttle ratio"
|
"message": "Pitch to throttle ratio"
|
||||||
},
|
},
|
||||||
|
"pitchToThrottleHelp": {
|
||||||
|
"message": "In navigation modes, each degree of climb will add this many units to the cruise throttle. Conversely, each degree of diving will substract from it."
|
||||||
|
},
|
||||||
"loiterRadius": {
|
"loiterRadius": {
|
||||||
"message": "Loiter radius [cm]"
|
"message": "Loiter radius [cm]"
|
||||||
},
|
},
|
||||||
"fixedWingConfiguration": {
|
"fixedWingNavigationConfiguration": {
|
||||||
"message": "Fixed Wing Settings"
|
"message": "Fixed Wing Navigation Settings"
|
||||||
},
|
},
|
||||||
"osdLayoutDefault": {
|
"osdLayoutDefault": {
|
||||||
"message": "Default Layout"
|
"message": "Default Layout"
|
||||||
|
|
5
js/fc.js
5
js/fc.js
|
@ -54,7 +54,8 @@ var CONFIG,
|
||||||
DEBUG_TRACE,
|
DEBUG_TRACE,
|
||||||
MIXER_CONFIG,
|
MIXER_CONFIG,
|
||||||
BATTERY_CONFIG,
|
BATTERY_CONFIG,
|
||||||
OUTPUT_MAPPING;
|
OUTPUT_MAPPING,
|
||||||
|
SETTINGS;
|
||||||
|
|
||||||
var FC = {
|
var FC = {
|
||||||
MAX_SERVO_RATE: 125,
|
MAX_SERVO_RATE: 125,
|
||||||
|
@ -508,6 +509,8 @@ var FC = {
|
||||||
RXFAIL_CONFIG = [];
|
RXFAIL_CONFIG = [];
|
||||||
|
|
||||||
OUTPUT_MAPPING = new OutputMappingCollection();
|
OUTPUT_MAPPING = new OutputMappingCollection();
|
||||||
|
|
||||||
|
SETTINGS = {};
|
||||||
},
|
},
|
||||||
getOutputUsages: function() {
|
getOutputUsages: function() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -89,4 +89,16 @@ DataView.prototype.read32 = function() {
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
DataView.prototype.readString = function() {
|
||||||
|
var s = "";
|
||||||
|
while (this.byteLength > this.offset) {
|
||||||
|
var c = this.readU8();
|
||||||
|
if (!c) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
s += String.fromCharCode(c);
|
||||||
|
}
|
||||||
|
return s;
|
||||||
};
|
};
|
|
@ -161,6 +161,9 @@ var MSPCodes = {
|
||||||
MSP2_COMMON_MOTOR_MIXER: 0x1005,
|
MSP2_COMMON_MOTOR_MIXER: 0x1005,
|
||||||
MSP2_COMMON_SET_MOTOR_MIXER: 0x1006,
|
MSP2_COMMON_SET_MOTOR_MIXER: 0x1006,
|
||||||
|
|
||||||
|
MSP2_COMMON_SETTING_INFO: 0x1007,
|
||||||
|
MSP2_COMMON_PG_LIST: 0x1008,
|
||||||
|
|
||||||
MSPV2_INAV_STATUS: 0x2000,
|
MSPV2_INAV_STATUS: 0x2000,
|
||||||
MSPV2_INAV_OPTICAL_FLOW: 0x2001,
|
MSPV2_INAV_OPTICAL_FLOW: 0x2001,
|
||||||
MSPV2_INAV_ANALOG: 0x2002,
|
MSPV2_INAV_ANALOG: 0x2002,
|
||||||
|
|
|
@ -1347,6 +1347,8 @@ var mspHelper = (function (gui) {
|
||||||
break;
|
break;
|
||||||
case MSPCodes.MSPV2_SETTING:
|
case MSPCodes.MSPV2_SETTING:
|
||||||
break;
|
break;
|
||||||
|
case MSPCodes.MSP2_COMMON_SETTING_INFO:
|
||||||
|
break;
|
||||||
case MSPCodes.MSPV2_SET_SETTING:
|
case MSPCodes.MSPV2_SET_SETTING:
|
||||||
console.log("Setting set");
|
console.log("Setting set");
|
||||||
break;
|
break;
|
||||||
|
@ -2859,12 +2861,66 @@ var mspHelper = (function (gui) {
|
||||||
};
|
};
|
||||||
|
|
||||||
self._getSetting = function (name) {
|
self._getSetting = function (name) {
|
||||||
|
if (semver.lt(CONFIG.flightControllerVersion, '2.0.0')) {
|
||||||
|
return self._getLegacySetting(name);
|
||||||
|
}
|
||||||
|
if (SETTINGS[name]) {
|
||||||
|
return Promise.resolve(SETTINGS[name]);
|
||||||
|
}
|
||||||
|
var data = [];
|
||||||
|
self._encodeSettingReference(name, null, data);
|
||||||
|
return MSP.promise(MSPCodes.MSP2_COMMON_SETTING_INFO, data).then(function (result) {
|
||||||
|
const MODE_LOOKUP = 1 << 6;
|
||||||
|
var settingTypes = {
|
||||||
|
0: "uint8_t",
|
||||||
|
1: "int8_t",
|
||||||
|
2: "uint16_t",
|
||||||
|
3: "int16_t",
|
||||||
|
4: "uint32_t",
|
||||||
|
5: "float",
|
||||||
|
6: "string",
|
||||||
|
};
|
||||||
|
var setting = {};
|
||||||
|
// Discard PG ID
|
||||||
|
result.data.readU16();
|
||||||
|
|
||||||
|
var type = result.data.readU8();
|
||||||
|
setting.type = settingTypes[type];
|
||||||
|
if (!setting.type) {
|
||||||
|
console.log("Unknown setting type " + type + " for setting '" + name + "'");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// Discard section
|
||||||
|
result.data.readU8();
|
||||||
|
setting.mode = result.data.readU8();
|
||||||
|
setting.min = result.data.read32();
|
||||||
|
setting.max = result.data.readU32();
|
||||||
|
|
||||||
|
setting.index = result.data.readU16();
|
||||||
|
|
||||||
|
// Discard profile info
|
||||||
|
result.data.readU8();
|
||||||
|
result.data.readU8();
|
||||||
|
|
||||||
|
if (setting.mode == MODE_LOOKUP) {
|
||||||
|
var values = [];
|
||||||
|
for (var ii = setting.min; ii <= setting.max; ii++) {
|
||||||
|
values.push(result.data.readString());
|
||||||
|
}
|
||||||
|
setting.table = {values: values};
|
||||||
|
}
|
||||||
|
SETTINGS[name] = setting;
|
||||||
|
return setting;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
self._getLegacySetting = function (name) {
|
||||||
var promise;
|
var promise;
|
||||||
if (this._settings) {
|
if (SETTINGS) {
|
||||||
promise = Promise.resolve(this._settings);
|
promise = Promise.resolve(SETTINGS);
|
||||||
} else {
|
} else {
|
||||||
promise = new Promise(function (resolve, reject) {
|
promise = new Promise(function (resolve, reject) {
|
||||||
var $this = this;
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: chrome.runtime.getURL('/resources/settings.json'),
|
url: chrome.runtime.getURL('/resources/settings.json'),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
|
@ -2872,7 +2928,7 @@ var mspHelper = (function (gui) {
|
||||||
reject(error);
|
reject(error);
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$this._settings = data;
|
SETTINGS = data;
|
||||||
resolve(data);
|
resolve(data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -2883,19 +2939,24 @@ var mspHelper = (function (gui) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
self._encodeSettingName = function (name, data) {
|
self._encodeSettingReference = function (name, index, data) {
|
||||||
for (var ii = 0; ii < name.length; ii++) {
|
if (Number.isInteger(index)) {
|
||||||
data.push(name.charCodeAt(ii));
|
data.push8(0);
|
||||||
|
data.push16(index);
|
||||||
|
} else {
|
||||||
|
for (var ii = 0; ii < name.length; ii++) {
|
||||||
|
data.push(name.charCodeAt(ii));
|
||||||
|
}
|
||||||
|
data.push(0);
|
||||||
}
|
}
|
||||||
data.push(0);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
self.getSetting = function (name, callback) {
|
self.getSetting = function (name) {
|
||||||
var $this = this;
|
var $this = this;
|
||||||
return this._getSetting(name).then(function (setting) {
|
return this._getSetting(name).then(function (setting) {
|
||||||
var data = [];
|
var data = [];
|
||||||
$this._encodeSettingName(name, data);
|
$this._encodeSettingReference(name, setting.index, data);
|
||||||
MSP.send_message(MSPCodes.MSPV2_SETTING, data, false, function (resp) {
|
return MSP.promise(MSPCodes.MSPV2_SETTING, data).then(function (resp) {
|
||||||
var value;
|
var value;
|
||||||
switch (setting.type) {
|
switch (setting.type) {
|
||||||
case "uint8_t":
|
case "uint8_t":
|
||||||
|
@ -2925,15 +2986,12 @@ var mspHelper = (function (gui) {
|
||||||
if (setting.table) {
|
if (setting.table) {
|
||||||
value = setting.table.values[value];
|
value = setting.table.values[value];
|
||||||
}
|
}
|
||||||
if (callback) {
|
return {setting: setting, value: value};
|
||||||
callback(value, setting);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
self.encodeSetting = function (name, value) {
|
self.encodeSetting = function (name, value) {
|
||||||
var $this = this;
|
|
||||||
return this._getSetting(name).then(function (setting) {
|
return this._getSetting(name).then(function (setting) {
|
||||||
if (setting.table) {
|
if (setting.table) {
|
||||||
var found = false;
|
var found = false;
|
||||||
|
@ -2949,7 +3007,7 @@ var mspHelper = (function (gui) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var data = [];
|
var data = [];
|
||||||
$this._encodeSettingName(name, data);
|
self._encodeSettingReference(name, setting.index, data);
|
||||||
switch (setting.type) {
|
switch (setting.type) {
|
||||||
case "uint8_t":
|
case "uint8_t":
|
||||||
case "int8_t":
|
case "int8_t":
|
||||||
|
@ -2975,9 +3033,38 @@ var mspHelper = (function (gui) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
self.setSetting = function (name, value, callback) {
|
self.setSetting = function (name, value) {
|
||||||
this.encodeSetting(name, value).then(function (data) {
|
this.encodeSetting(name, value).then(function (data) {
|
||||||
MSP.send_message(MSPCodes.MSPV2_SET_SETTING, data, false, callback);
|
return MSP.promise(MSPCodes.MSPV2_SET_SETTING, data);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
self.configureSettingInputs = function() {
|
||||||
|
var inputs = [];
|
||||||
|
$('input[data-setting!=""][data-setting]').each(function() {
|
||||||
|
inputs.push($(this));
|
||||||
|
});
|
||||||
|
return Promise.mapSeries(inputs, function (input, ii) {
|
||||||
|
var settingName = input.data("setting");
|
||||||
|
return self.getSetting(settingName).then(function (s) {
|
||||||
|
var multiplier = parseFloat(input.data('setting-multiplier') || 1);
|
||||||
|
input.attr("step", 1 / multiplier);
|
||||||
|
input.attr("min", s.setting.min / multiplier);
|
||||||
|
input.attr("max", s.setting.max / multiplier);
|
||||||
|
input.val((s.value / multiplier).toFixed(Math.log10(multiplier)));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
self.saveSettingsInputs = function() {
|
||||||
|
var inputs = [];
|
||||||
|
$('input[data-setting!=""][data-setting]').each(function() {
|
||||||
|
inputs.push($(this));
|
||||||
|
});
|
||||||
|
return Promise.mapSeries(inputs, function (input, ii) {
|
||||||
|
var settingName = input.data("setting");
|
||||||
|
var multiplier = parseFloat(input.data('setting-multiplier') || 1);
|
||||||
|
return self.setSetting(settingName, parseFloat(input.val()) * multiplier);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3032,13 +3119,7 @@ var mspHelper = (function (gui) {
|
||||||
self.getCraftName = function(callback) {
|
self.getCraftName = function(callback) {
|
||||||
if (semver.gt(CONFIG.flightControllerVersion, "1.8.0")) {
|
if (semver.gt(CONFIG.flightControllerVersion, "1.8.0")) {
|
||||||
MSP.send_message(MSPCodes.MSP_NAME, false, false, function(resp) {
|
MSP.send_message(MSPCodes.MSP_NAME, false, false, function(resp) {
|
||||||
var name = "";
|
var name = resp.data.readString();
|
||||||
for (var ii = 0; ii < resp.data.byteLength; ii++) {
|
|
||||||
var c = resp.data.readU8();
|
|
||||||
if (c != 0) {
|
|
||||||
name += String.fromCharCode(c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(name);
|
callback(name);
|
||||||
}
|
}
|
||||||
|
@ -3091,6 +3172,31 @@ var mspHelper = (function (gui) {
|
||||||
} else {
|
} else {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
self.loadParameterGroups = function(callback) {
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "2.0.0")) {
|
||||||
|
MSP.send_message(MSPCodes.MSP2_COMMON_PG_LIST, false, false, function (resp) {
|
||||||
|
var groups = [];
|
||||||
|
while (resp.data.offset < resp.data.byteLength) {
|
||||||
|
var id = resp.data.readU16();
|
||||||
|
var start = resp.data.readU16();
|
||||||
|
var end = resp.data.readU16();
|
||||||
|
groups.push({id: id, start: start, end: end});
|
||||||
|
}
|
||||||
|
if (callback) {
|
||||||
|
callback(groups);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
self.processHtml = function(callback) {
|
||||||
|
return function() {
|
||||||
|
self.configureSettingInputs().then(callback);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<div class="leftWrapper">
|
<div class="leftWrapper">
|
||||||
<div class="config-section gui_box grey">
|
<div class="config-section gui_box grey">
|
||||||
<div class="gui_box_titlebar">
|
<div class="gui_box_titlebar">
|
||||||
<div class="spacer_box_title" data-i18n="positionHoldConfiguration"></div>
|
<div class="spacer_box_title" data-i18n="multiRotorNavigationConfiguration"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="spacer_box">
|
<div class="spacer_box">
|
||||||
<div class="select">
|
<div class="select">
|
||||||
|
@ -41,6 +41,7 @@
|
||||||
<label for="max-bank-angle">
|
<label for="max-bank-angle">
|
||||||
<span data-i18n="posholdMaxBankAngle"></span>
|
<span data-i18n="posholdMaxBankAngle"></span>
|
||||||
</label>
|
</label>
|
||||||
|
<div class="helpicon cf_tip" data-i18n_title="posholdMaxBankAngleHelp"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<input type="checkbox" id="use-mid-throttle" class="toggle" />
|
<input type="checkbox" id="use-mid-throttle" class="toggle" />
|
||||||
|
@ -215,7 +216,7 @@
|
||||||
|
|
||||||
<div class="config-section gui_box grey requires-v1_7_1">
|
<div class="config-section gui_box grey requires-v1_7_1">
|
||||||
<div class="gui_box_titlebar">
|
<div class="gui_box_titlebar">
|
||||||
<div class="spacer_box_title" data-i18n="fixedWingConfiguration"></div>
|
<div class="spacer_box_title" data-i18n="fixedWingNavigationConfiguration"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="spacer_box">
|
<div class="spacer_box">
|
||||||
|
|
||||||
|
@ -245,6 +246,7 @@
|
||||||
<label for="maxBankAngle">
|
<label for="maxBankAngle">
|
||||||
<span data-i18n="maxBankAngle"></span>
|
<span data-i18n="maxBankAngle"></span>
|
||||||
</label>
|
</label>
|
||||||
|
<div class="helpicon cf_tip" data-i18n_title="maxBankAngleHelp"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="number">
|
<div class="number">
|
||||||
|
@ -252,6 +254,7 @@
|
||||||
<label for="maxClimbAngle">
|
<label for="maxClimbAngle">
|
||||||
<span data-i18n="maxClimbAngle"></span>
|
<span data-i18n="maxClimbAngle"></span>
|
||||||
</label>
|
</label>
|
||||||
|
<div class="helpicon cf_tip" data-i18n_title="maxClimbAngleHelp"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="number">
|
<div class="number">
|
||||||
|
@ -259,6 +262,7 @@
|
||||||
<label for="maxDiveAngle">
|
<label for="maxDiveAngle">
|
||||||
<span data-i18n="maxDiveAngle"></span>
|
<span data-i18n="maxDiveAngle"></span>
|
||||||
</label>
|
</label>
|
||||||
|
<div class="helpicon cf_tip" data-i18n_title="maxDiveAngleHelp"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="number">
|
<div class="number">
|
||||||
|
@ -266,6 +270,7 @@
|
||||||
<label for="pitchToThrottle">
|
<label for="pitchToThrottle">
|
||||||
<span data-i18n="pitchToThrottle"></span>
|
<span data-i18n="pitchToThrottle"></span>
|
||||||
</label>
|
</label>
|
||||||
|
<div class="helpicon cf_tip" data-i18n_title="pitchToThrottleHelp"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="number">
|
<div class="number">
|
||||||
|
|
|
@ -97,7 +97,6 @@ TABS.advanced_tuning.initialize = function (callback) {
|
||||||
RTH_AND_LAND_CONFIG.rthAltControlMode = $rthAltControlMode.val();
|
RTH_AND_LAND_CONFIG.rthAltControlMode = $rthAltControlMode.val();
|
||||||
});
|
});
|
||||||
GUI.fillSelect($rthAllowLanding, FC.getRthAllowLanding(), RTH_AND_LAND_CONFIG.rthAllowLanding);
|
GUI.fillSelect($rthAllowLanding, FC.getRthAllowLanding(), RTH_AND_LAND_CONFIG.rthAllowLanding);
|
||||||
console.log("VAL", RTH_AND_LAND_CONFIG.rthAllowLanding);
|
|
||||||
$rthAllowLanding.val(RTH_AND_LAND_CONFIG.rthAllowLanding);
|
$rthAllowLanding.val(RTH_AND_LAND_CONFIG.rthAllowLanding);
|
||||||
$rthAllowLanding.change(function () {
|
$rthAllowLanding.change(function () {
|
||||||
RTH_AND_LAND_CONFIG.rthAllowLanding = $rthAllowLanding.val();
|
RTH_AND_LAND_CONFIG.rthAllowLanding = $rthAllowLanding.val();
|
||||||
|
@ -148,4 +147,4 @@ TABS.advanced_tuning.initialize = function (callback) {
|
||||||
|
|
||||||
TABS.advanced_tuning.cleanup = function (callback) {
|
TABS.advanced_tuning.cleanup = function (callback) {
|
||||||
if (callback) callback();
|
if (callback) callback();
|
||||||
};
|
};
|
||||||
|
|
|
@ -167,6 +167,20 @@
|
||||||
<input type="number" name="yaw" class="rate-tpa_input" step="10" min="20" max="1800" /> degrees per second
|
<input type="number" name="yaw" class="rate-tpa_input" step="10" min="20" max="1800" /> degrees per second
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th data-i18n="pidTuningMaxRollAngle"></th>
|
||||||
|
<td>
|
||||||
|
<input data-setting="max_angle_inclination_rll" data-setting-multiplier="10" type="number" class="rate-tpa_input" /> degrees
|
||||||
|
<div class="helpicon cf_tip" data-i18n_title="pidTuningMaxRollAngleHelp"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th data-i18n="pidTuningMaxPitchAngle"></th>
|
||||||
|
<td>
|
||||||
|
<input data-setting="max_angle_inclination_pit" data-setting-multiplier="10" type="number" class="rate-tpa_input" /> degrees
|
||||||
|
<div class="helpicon cf_tip" data-i18n_title="pidTuningMaxPitchAngleHelp"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="roll" data-i18n="pidTuningManualRollRate"></th>
|
<th class="roll" data-i18n="pidTuningManualRollRate"></th>
|
||||||
<td class="roll">
|
<td class="roll">
|
||||||
|
|
|
@ -33,7 +33,7 @@ TABS.pid_tuning.initialize = function (callback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function load_html() {
|
function load_html() {
|
||||||
$('#content').load("./tabs/pid_tuning.html", process_html);
|
$('#content').load("./tabs/pid_tuning.html", mspHelper.processHtml(process_html));
|
||||||
}
|
}
|
||||||
|
|
||||||
function pid_and_rc_to_form() {
|
function pid_and_rc_to_form() {
|
||||||
|
@ -243,7 +243,11 @@ TABS.pid_tuning.initialize = function (callback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveFilterConfig() {
|
function saveFilterConfig() {
|
||||||
MSP.send_message(MSPCodes.MSP_SET_FILTER_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FILTER_CONFIG), false, save_to_eeprom);
|
MSP.send_message(MSPCodes.MSP_SET_FILTER_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FILTER_CONFIG), false, saveSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveSettings() {
|
||||||
|
mspHelper.saveSettingsInputs().then(save_to_eeprom);
|
||||||
}
|
}
|
||||||
|
|
||||||
function save_to_eeprom() {
|
function save_to_eeprom() {
|
||||||
|
|
|
@ -622,9 +622,7 @@ TABS.profiles.initialize = function (callback, scrollPosition) {
|
||||||
var settings = presets.settings.get(currentPreset.type);
|
var settings = presets.settings.get(currentPreset.type);
|
||||||
Object.keys(settings).forEach(function(key, ii) {
|
Object.keys(settings).forEach(function(key, ii) {
|
||||||
var value = settings[key];
|
var value = settings[key];
|
||||||
promises[key] = mspHelper.encodeSetting(key, value).then(function(data) {
|
promises[key] = mspHelper.setSetting(name, value);
|
||||||
return MSP.promise(MSPCodes.MSPV2_SET_SETTING, data);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Promise.props(promises).then(function () {
|
Promise.props(promises).then(function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue