advanced tuning tab done

pull/108/head
Pawel Spychalski (DzikuVx) 8 years ago
parent ff95022b86
commit c977b19432

@ -1966,5 +1966,69 @@
},
"dtermNotchCutoffHelp": {
"message": "Defines band of filter. <br><br>Has to be kept below notch filter frequency."
},
"positionHoldConfiguration": {
"message": "Basic Navigation Settings"
},
"userControlMode": {
"message": "User Control Mode"
},
"posholdMaxSpeed": {
"message": "Max. navigation speed [cm/s]"
},
"posholdMaxManualSpeed": {
"message": "Max. CRUISE speed [cm/s]"
},
"posholdMaxClimbRate": {
"message": "Max. navigation climb rate [cm/s]"
},
"posholdMaxManualClimbRate": {
"message": "Max. ALTHOLD climb rate [cm/s]"
},
"posholdMaxBankAngle": {
"message": "Multirotor max. banking angle [deg]"
},
"posholdHoverThrottle": {
"message": "Hover throttle"
},
"posholdHoverMidThrottle": {
"message": "Use mid. throttle for ALTHOLD"
},
"positionEstimatorConfiguration": {
"message": "Position Estimator"
},
"w_z_baro_p": {
"message": "Vertical Position Baro Weight"
},
"w_z_gps_p": {
"message": "Vertical Position GPS Weight"
},
"w_z_gps_v": {
"message": "Vertical Speed GPS Weight"
},
"w_xy_gps_p": {
"message": "Horizontal Position GPS Weight"
},
"w_xy_gps_v": {
"message": "Horizontal Speed GPS Weight"
},
"positionEstimatorConfigurationDisclaimer": {
"message": "Those value should be changed very carefully. In most cases there is not need to change them. For advanced users only!"
},
"gps_min_sats": {
"message": "Min. GPS sats for valid fix"
},
"use_gps_velned": {
"message": "Use GPS data for velocity calculation"
},
"use_gps_velned_help": {
"message": "Defined if iNav should use velocity data provided by GPS module for doing position and speed estimation. If set to OFF iNav will fallback to calculating velocity from GPS coordinates. Using native velocity data may improve performance on some GPS modules. Some GPS modules introduce significant delay and using native velocity may actually result in much worse performance."
},
"w_z_baro_p_help": {
"message": "When this value is set to <strong>0</strong>, barometer is not used for altitude computation"
},
"w_z_gos_p_help": {
"message": "When this value is set to <strong>0</strong>, GPS is not used for altitude computation"
}
}

@ -708,5 +708,11 @@ var FC = {
}
return retVal;
},
getUserControlMode: function () {
return [
"Attitude",
"Cruise"
]
}
};

@ -901,11 +901,11 @@ var mspHelper = (function (gui) {
break;
case MSPCodes.MSP_POSITION_ESTIMATION_CONFIG:
POSITION_ESTIMATOR.w_z_baro_p = data.getUint16(0, true);
POSITION_ESTIMATOR.w_z_gps_p = data.getUint16(2, true);
POSITION_ESTIMATOR.w_z_gps_v = data.getUint16(4, true);
POSITION_ESTIMATOR.w_xy_gps_p = data.getUint16(6, true);
POSITION_ESTIMATOR.w_xy_gps_v = data.getUint16(8, true);
POSITION_ESTIMATOR.w_z_baro_p = data.getUint16(0, true) / 100;
POSITION_ESTIMATOR.w_z_gps_p = data.getUint16(2, true) / 100;
POSITION_ESTIMATOR.w_z_gps_v = data.getUint16(4, true) / 100;
POSITION_ESTIMATOR.w_xy_gps_p = data.getUint16(6, true) / 100;
POSITION_ESTIMATOR.w_xy_gps_v = data.getUint16(8, true) / 100;
POSITION_ESTIMATOR.gps_min_sats = data.getUint8(10);
POSITION_ESTIMATOR.use_gps_velned = data.getUint8(11);
break;
@ -1234,20 +1234,20 @@ var mspHelper = (function (gui) {
break;
case MSPCodes.MSP_SET_POSITION_ESTIMATION_CONFIG:
buffer.push(lowByte(POSITION_ESTIMATOR.w_z_baro_p));
buffer.push(highByte(POSITION_ESTIMATOR.w_z_baro_p));
buffer.push(lowByte(POSITION_ESTIMATOR.w_z_baro_p * 100));
buffer.push(highByte(POSITION_ESTIMATOR.w_z_baro_p * 100));
buffer.push(lowByte(POSITION_ESTIMATOR.w_z_gps_p));
buffer.push(highByte(POSITION_ESTIMATOR.w_z_gps_p));
buffer.push(lowByte(POSITION_ESTIMATOR.w_z_gps_p * 100));
buffer.push(highByte(POSITION_ESTIMATOR.w_z_gps_p * 100));
buffer.push(lowByte(POSITION_ESTIMATOR.w_z_gps_v));
buffer.push(highByte(POSITION_ESTIMATOR.w_z_gps_v));
buffer.push(lowByte(POSITION_ESTIMATOR.w_z_gps_v * 100));
buffer.push(highByte(POSITION_ESTIMATOR.w_z_gps_v * 100));
buffer.push(lowByte(POSITION_ESTIMATOR.w_xy_gps_p));
buffer.push(highByte(POSITION_ESTIMATOR.w_xy_gps_p));
buffer.push(lowByte(POSITION_ESTIMATOR.w_xy_gps_p * 100));
buffer.push(highByte(POSITION_ESTIMATOR.w_xy_gps_p * 100));
buffer.push(lowByte(POSITION_ESTIMATOR.w_xy_gps_v));
buffer.push(highByte(POSITION_ESTIMATOR.w_xy_gps_v));
buffer.push(lowByte(POSITION_ESTIMATOR.w_xy_gps_v * 100));
buffer.push(highByte(POSITION_ESTIMATOR.w_xy_gps_v * 100));
buffer.push(POSITION_ESTIMATOR.gps_min_sats);
buffer.push(POSITION_ESTIMATOR.use_gps_velned);
@ -1987,5 +1987,21 @@ var mspHelper = (function (gui) {
}
};
self.loadPositionEstimationConfig = function (callback) {
if (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) {
MSP.send_message(MSPCodes.MSP_POSITION_ESTIMATION_CONFIG, false, false, callback);
} else {
callback();
}
};
self.savePositionEstimationConfig = function (callback) {
if (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) {
MSP.send_message(MSPCodes.MSP_SET_POSITION_ESTIMATION_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_POSITION_ESTIMATION_CONFIG), false, callback);
} else {
callback();
}
};
return self;
})(GUI);

@ -295,23 +295,25 @@ function onOpen(openInfo) {
console.log('Failed to open serial port');
GUI.log(chrome.i18n.getMessage('serialPortOpenFail'));
$('div#connectbutton a.connect_state').text(chrome.i18n.getMessage('connect'));
$('div#connectbutton a.connect').removeClass('active');
var $connectButton = $('#connectbutton');
$connectButton.find('.connect_state').text(chrome.i18n.getMessage('connect'));
$connectButton.find('.connect').removeClass('active');
// unlock port select & baud
$('#port, #baud, #delay').prop('disabled', false);
// reset data
$('div#connectbutton a.connect').data("clicks", false);
$connectButton.find('.connect').data("clicks", false);
}
}
function onConnect() {
helper.timeout.remove('connecting'); // kill connecting timer
$('div#connectbutton a.connect_state').text(chrome.i18n.getMessage('disconnect')).addClass('active');
$('div#connectbutton a.connect').addClass('active');
$('#tabs ul.mode-disconnected').hide();
$('#tabs ul.mode-connected').show();
$('#connectbutton a.connect_state').text(chrome.i18n.getMessage('disconnect')).addClass('active');
$('#connectbutton a.connect').addClass('active');
$('.mode-disconnected').hide();
$('.mode-connected').show();
MSP.send_message(MSPCodes.MSP_DATAFLASH_SUMMARY, false, false);
@ -334,8 +336,8 @@ function onClosed(result) {
GUI.log(chrome.i18n.getMessage('serialPortClosedFail'));
}
$('#tabs ul.mode-connected').hide();
$('#tabs ul.mode-disconnected').show();
$('.mode-connected').hide();
$('.mode-disconnected').show();
$('#sensor-status').hide();
$('#portsinput').show();
@ -457,35 +459,6 @@ function lowByte(num) {
return 0x00FF & num;
}
function update_dataflash_global() {
var supportsDataflash = DATAFLASH.totalSize > 0;
if (supportsDataflash) {
$(".noflash_global").css({
display: 'none'
});
$(".dataflash-contents_global").css({
display: 'block'
});
$(".dataflash-free_global").css({
width: (100 - (DATAFLASH.totalSize - DATAFLASH.usedSize) / DATAFLASH.totalSize * 100) + "%",
display: 'block'
});
$(".dataflash-free_global div").text('Dataflash: free ' + formatFilesize(DATAFLASH.totalSize - DATAFLASH.usedSize));
} else {
$(".noflash_global").css({
display: 'block'
});
$(".dataflash-contents_global").css({
display: 'none'
});
}
}
function specificByte(num, pos) {
return 0x000000FF & (num >> (8 * pos));
}

@ -1907,4 +1907,8 @@ select {
.jBox-Tooltip {
max-width: 180px;
}
.spacebottom {
margin-bottom: 15px;
}

@ -112,7 +112,3 @@
.tab-adjustments .adjustment .functionSwitchChannel {
width: 5%;
}
.tab-adjustments .spacebottom {
margin-bottom: 15px;
}

@ -2,17 +2,130 @@
<div class="content_wrapper">
<div class="tab_title" data-i18n="tabAdvancedTuningTitle">Advanced tuning</div>
</div>
<div class="leftWrapper">
<div class="config-section gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" data-i18n="positionHoldConfiguration"></div>
</div>
<div class="spacer_box">
<div class="select">
<select id="user-control-mode"></select>
<label for="user-control-mode"> <span data-i18n="userControlMode"></span></label>
</div>
<div class="number">
<input id="max-speed" type="number" data-simple-bind="NAV_POSHOLD.maxSpeed" step="1" min="10" max="2000">
<label for="max-speed">
<span data-i18n="posholdMaxSpeed"></span>
</label>
</div>
<div class="number">
<input id="max-manual-speed" type="number" data-simple-bind="NAV_POSHOLD.maxManualSpeed" step="1" min="10" max="2000">
<label for="max-manual-speed">
<span data-i18n="posholdMaxManualSpeed"></span>
</label>
</div>
<div class="number">
<input id="max-climb-rate" type="number" data-simple-bind="NAV_POSHOLD.maxClimbRate" step="1" min="10" max="2000">
<label for="max-climb-rate">
<span data-i18n="posholdMaxClimbRate"></span>
</label>
</div>
<div class="number">
<input id="max-manual-climb-rate" type="number" data-simple-bind="NAV_POSHOLD.maxManualClimbRate" step="1" min="10" max="2000">
<label for="max-manual-climb-rate">
<span data-i18n="posholdMaxManualClimbRate"></span>
</label>
</div>
<div class="number">
<input id="max-bank-angle" type="number" data-simple-bind="NAV_POSHOLD.maxBankAngle" step="1" min="15" max="45">
<label for="max-bank-angle">
<span data-i18n="posholdMaxBankAngle"></span>
</label>
</div>
<div class="checkbox">
<input type="checkbox" id="use-mid-throttle" class="toggle" />
<label for="use-mid-throttle">
<span data-i18n="posholdHoverMidThrottle"></span>
</label>
</div>
<div class="number">
<input id="hover-throttle" type="number" data-simple-bind="NAV_POSHOLD.hoverThrottle" step="1" min="1000" max="2000">
<label for="hover-throttle">
<span data-i18n="posholdHoverThrottle"></span>
</label>
</div>
</div>
</div>
</div>
<div class="leftWrapper">
<div class="rightWrapper">
</div>
<div class="config-section gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" data-i18n="positionEstimatorConfiguration"></div>
</div>
<div class="rightWrapper">
<div class="spacer_box">
<div class="note spacebottom">
<div class="note_spacer" >
<p data-i18n="positionEstimatorConfigurationDisclaimer"></p>
</div>
</div>
<div class="number">
<input id="w_z_baro_p" type="number" data-simple-bind="POSITION_ESTIMATOR.w_z_baro_p" step="0.01" min="0" max="10">
<label for="w_z_baro_p">
<span data-i18n="w_z_baro_p"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="w_z_baro_p_help"></div>
</div>
<div class="number">
<input id="w_z_gps_p" type="number" data-simple-bind="POSITION_ESTIMATOR.w_z_gps_p" step="0.01" min="0" max="10">
<label for="w_z_gps_p">
<span data-i18n="w_z_gps_p"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="w_z_gos_p_help"></div>
</div>
<div class="number">
<input id="w_z_gps_v" type="number" data-simple-bind="POSITION_ESTIMATOR.w_z_gps_v" step="0.01" min="0" max="10">
<label for="w_z_gps_v">
<span data-i18n="w_z_gps_v"></span>
</label>
</div>
<div class="number">
<input id="w_xy_gps_p" type="number" data-simple-bind="POSITION_ESTIMATOR.w_xy_gps_p" step="0.01" min="0" max="10">
<label for="w_xy_gps_p">
<span data-i18n="w_xy_gps_p"></span>
</label>
</div>
<div class="number">
<input id="w_xy_gps_v" type="number" data-simple-bind="POSITION_ESTIMATOR.w_xy_gps_v" step="0.01" min="0" max="10">
<label for="w_xy_gps_v">
<span data-i18n="w_xy_gps_v"></span>
</label>
</div>
<div class="number">
<input id="gps_min_sats" type="number" data-simple-bind="POSITION_ESTIMATOR.gps_min_sats" step="1" min="5" max="10">
<label for="gps_min_sats">
<span data-i18n="gps_min_sats"></span>
</label>
</div>
<div class="checkbox">
<input type="checkbox" id="use_gps_velned" class="toggle" />
<label for="use_gps_velned">
<span data-i18n="use_gps_velned"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="use_gps_velned_help"></div>
</div>
</div>
</div>
</div>
<div class="clear-both"></div>
</div>
<div class="clear-both"></div>
<div class="content_toolbar">
<div class="btn save_btn">

@ -2,7 +2,7 @@
TABS.advanced_tuning = {};
TABS.advanced_tuning.initialize = function (callback, scrollPosition) {
TABS.advanced_tuning.initialize = function (callback) {
var loadChainer = new MSPChainerClass(),
saveChainer = new MSPChainerClass();
@ -13,13 +13,15 @@ TABS.advanced_tuning.initialize = function (callback, scrollPosition) {
}
loadChainer.setChain([
mspHelper.loadNavPosholdConfig
mspHelper.loadNavPosholdConfig,
mspHelper.loadPositionEstimationConfig
]);
loadChainer.setExitPoint(loadHtml);
loadChainer.execute();
saveChainer.setChain([
mspHelper.saveNavPosholdConfig,
mspHelper.savePositionEstimationConfig,
mspHelper.saveToEeprom
]);
saveChainer.setExitPoint(reboot);
@ -39,14 +41,48 @@ TABS.advanced_tuning.initialize = function (callback, scrollPosition) {
function reinitialize() {
//noinspection JSUnresolvedVariable
GUI.log(chrome.i18n.getMessage('deviceRebooting'));
GUI.handleReconnect($('.tab_setup a'));
GUI.handleReconnect($('.tab_advanced_tuning a'));
}
function processHtml() {
localize();
var $userControlMode = $('#user-control-mode'),
$useMidThrottle = $("#use-mid-throttle"),
$useGpsVelned = $('#use_gps_velned');
GUI.fillSelect($userControlMode, FC.getUserControlMode(), NAV_POSHOLD.userControlMode);
$userControlMode.val(NAV_POSHOLD.userControlMode);
$userControlMode.change(function () {
NAV_POSHOLD.userControlMode = $userControlMode.val();
});
$useMidThrottle.prop("checked", NAV_POSHOLD.useThrottleMidForAlthold);
$useMidThrottle.change(function () {
if ($(this).is(":checked")) {
NAV_POSHOLD.useThrottleMidForAlthold = 1;
} else {
NAV_POSHOLD.useThrottleMidForAlthold = 0;
}
});
$useMidThrottle.change();
$useGpsVelned.prop("checked", POSITION_ESTIMATOR.use_gps_velned);
$useGpsVelned.change(function () {
if ($(this).is(":checked")) {
POSITION_ESTIMATOR.use_gps_velned = 1;
} else {
POSITION_ESTIMATOR.use_gps_velned = 0;
}
});
$useGpsVelned.change();
GUI.simpleBind();
localize();
$('#advanced-tuning-save-button').click(function () {
saveChainer.execute();
});
GUI.content_ready(callback);
}

@ -193,11 +193,6 @@
line-height: 28px;
}
.tab-auxiliary .spacebottom {
margin-bottom: 15px;
}
@media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) {
.tab-auxiliary .fixed_band {
width: calc(100% - -30px);

@ -20,6 +20,7 @@
font-weight: bold;
}
.config-section .number input,
.tab-configuration .number input {
width: 65px;
padding-left: 3px;
@ -38,10 +39,12 @@
background-color: #ececec;
}
.config-section input,
.tab-configuration input {
float: left;
}
.config-section .spacer_box,
.tab-configuration .spacer_box {
padding-bottom: 10px;
float: left;
@ -62,6 +65,8 @@
border-bottom: 1px solid #ddd;
}
.config-section .number,
.config-section .select,
.tab-configuration .number,
.tab-configuration .select,
.tab-configuration .radio,
@ -75,6 +80,8 @@ hr {
float: left;
}
.config-section .number:last-child,
.config-section .select:last-child,
.tab-configuration .number:last-child,
.tab-configuration .select:last-child,
.tab-configuration .radio:last-child,

@ -425,8 +425,4 @@
position: absolute;
z-index: 100;
border: 1px dotted white;
}
.tab-led-strip .spacebottom {
margin-bottom: 20px;
}

@ -90,10 +90,6 @@
border-right: 0px;
}
.tab-ports .spacebottom {
margin-bottom: 20px;
}
@media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) {
.tab-ports table thead tr:first-child {
font-size: 12px;

Loading…
Cancel
Save