Unverified Commit b30c51f0 authored by Paweł Spychalski's avatar Paweł Spychalski Committed by GitHub
Browse files

Merge branch 'master' into add-pre-arm-to-modes-order

parents 5db86696 3fc65476
...@@ -1043,6 +1043,9 @@ ...@@ -1043,6 +1043,9 @@
"portsFunction_DJI_FPV": { "portsFunction_DJI_FPV": {
"message": "DJI FPV VTX" "message": "DJI FPV VTX"
}, },
"portsFunction_IMU2": {
"message": "Secondary IMU"
},
"pidTuningName": { "pidTuningName": {
"message": "Name" "message": "Name"
}, },
...@@ -1129,7 +1132,7 @@ ...@@ -1129,7 +1132,7 @@
}, },
"receiverHelp": { "receiverHelp": {
"message": "Please read receiver chapter of the documentation. Configure serial port (if required), receiver mode (serial/ppm/pwm), provider (for serial receivers), bind receiver, set channel map, configure channel endpoints/range on TX so that all channels go from ~1000 to ~2000. Set midpoint (default 1500), trim channels to 1500, configure stick deadband, verify behaviour when TX is off or out of range.<br /><span style=\"color: red\">IMPORTANT:</span> Before flying read failsafe chapter of documentation and configure failsafe." "message": "Please read receiver chapter of the documentation. Configure serial port (if required), receiver mode (serial/ppm/pwm), provider (for serial receivers), bind receiver, set channel map, configure channel endpoints/range on TX so that all channels go from ~1000 to ~2000. Set midpoint (default 1500), trim channels to 1500, configure stick deadband, verify behaviour when TX is off or out of range. Make sure that the channel values all increase when you push the sticks up and to the right. If not, reverse the channel in the TX. Do not apply any other mixing in the TX.<br /><span style=\"color: red\">IMPORTANT:</span> Before flying read failsafe chapter of documentation and configure failsafe."
}, },
"receiverThrottleMid": { "receiverThrottleMid": {
"message": "Throttle MID" "message": "Throttle MID"
...@@ -2363,13 +2366,16 @@ ...@@ -2363,13 +2366,16 @@
"message": "Programming" "message": "Programming"
}, },
"tabAdvancedTuning": { "tabAdvancedTuning": {
"message": "Advanced tuning" "message": "Advanced Tuning"
}, },
"advancedTuningSave": { "advancedTuningSave": {
"message": "Save and Reboot" "message": "Save and Reboot"
}, },
"tabAdvancedTuningTitle": { "tabAdvancedTuningTitle": {
"message": "Advanced tuning" "message": "Advanced Tuning"
},
"tabAdvancedTuningGenericTitle": {
"message": "Generic settings"
}, },
"presetApplyHead": { "presetApplyHead": {
"message": "Applies following settings:" "message": "Applies following settings:"
...@@ -2459,7 +2465,7 @@ ...@@ -2459,7 +2465,7 @@
"message": "Horizontal speed GPS weight" "message": "Horizontal speed GPS weight"
}, },
"positionEstimatorConfigurationDisclaimer": { "positionEstimatorConfigurationDisclaimer": {
"message": "This value should be changed very carefully. In most cases there is not need to change that. For advanced users only!" "message": "These values should be changed very carefully. In most cases there is no need to change them. For advanced users only!"
}, },
"gps_min_sats": { "gps_min_sats": {
"message": "Min. GPS satellites for a valid fix" "message": "Min. GPS satellites for a valid fix"
...@@ -2549,19 +2555,31 @@ ...@@ -2549,19 +2555,31 @@
"message": "Max. throttle" "message": "Max. throttle"
}, },
"maxBankAngle": { "maxBankAngle": {
"message": "Max. bank angle [degrees]" "message": "Max. navigation bank angle [degrees]"
}, },
"maxBankAngleHelp": { "maxBankAngleHelp": {
"message": "Maximum banking angle in navigation modes. Constrained by maximum ROLL angle in PID tuning tab." "message": "Maximum banking angle in navigation modes. Constrained by maximum ROLL angle in PID tuning tab."
}, },
"maxClimbAngle": { "maxClimbAngle": {
"message": "Max. climb angle [degrees]" "message": "Max. navigation climb angle [degrees]"
}, },
"maxClimbAngleHelp": { "maxClimbAngleHelp": {
"message": "Maximum climb angle in navigation modes. Constrained by maximum PITCH angle in PID tuning tab." "message": "Maximum climb angle in navigation modes. Constrained by maximum PITCH angle in PID tuning tab."
}, },
"navManualClimbRate": {
"message": "Max. Alt-hold climb rate [cm/s]"
},
"navManualClimbRateHelp": {
"message": "Maximum climb/descent rate firmware is allowed when processing pilot input for ALTHOLD control mode [cm/s]"
},
"navAutoClimbRate": {
"message": "Max. navigation climb rate [cm/s]"
},
"navAutoClimbRateHelp": {
"message": "Maximum climb/descent rate that UAV is allowed to reach during navigation modes. [cm/s]"
},
"maxDiveAngle": { "maxDiveAngle": {
"message": "Max. dive angle [degrees]" "message": "Max. navigation dive angle [degrees]"
}, },
"maxDiveAngleHelp": { "maxDiveAngleHelp": {
"message": "Maximum dive angle in navigation modes. Constrained by maximum PITCH angle in PID tuning tab." "message": "Maximum dive angle in navigation modes. Constrained by maximum PITCH angle in PID tuning tab."
...@@ -2599,6 +2617,36 @@ ...@@ -2599,6 +2617,36 @@
"controlSmoothnessHelp": { "controlSmoothnessHelp": {
"message": "How smoothly the autopilot controls the airplane to correct the navigation error [0-9]." "message": "How smoothly the autopilot controls the airplane to correct the navigation error [0-9]."
}, },
"powerConfiguration": {
"message": "Battery Estimation Settings"
},
"idlePower": {
"message": "Idle power [cW]"
},
"idlePowerHelp": {
"message": "Power draw at zero throttle used for remaining flight time/distance estimation in 0.01W unit"
},
"cruisePower": {
"message": "Cruise power [cW]"
},
"cruisePowerHelp": {
"message": "Power draw at cruise throttle used for remaining flight time/distance estimation in 0.01W unit"
},
"cruiseSpeed": {
"message": "Cruise speed [cm/s]"
},
"cruiseSpeedHelp": {
"message": "Speed for the plane/wing at cruise throttle used for remaining flight time/distance estimation in cm/s"
},
"rthEnergyMargin": {
"message": "RTH energy margin [%]"
},
"rthEnergyMarginHelp": {
"message": "Energy margin wanted after getting home (percent of battery energy capacity). Use for the remaining flight time/distance calculation."
},
"generalNavigationSettings": {
"message": "General Navigation Settings"
},
"waypointConfiguration": { "waypointConfiguration": {
"message": "Waypoint Navigation Settings" "message": "Waypoint Navigation Settings"
}, },
...@@ -3082,6 +3130,9 @@ ...@@ -3082,6 +3130,9 @@
"osdSettingMainVoltageDecimals": { "osdSettingMainVoltageDecimals": {
"message": "Main voltage decimals" "message": "Main voltage decimals"
}, },
"osdElement_OSD_RANGEFINDER": {
"message": "Rangefinder distance"
},
"osdSettingPLUS_CODE_DIGITS_HELP": { "osdSettingPLUS_CODE_DIGITS_HELP": {
"message": "Precision at the equator: 10=13.9x13.9m; 11=2.8x3.5m; 12=56x87cm; 13=11x22cm." "message": "Precision at the equator: 10=13.9x13.9m; 11=2.8x3.5m; 12=56x87cm; 13=11x22cm."
}, },
...@@ -3641,7 +3692,7 @@ ...@@ -3641,7 +3692,7 @@
"message": "Current Meter Type" "message": "Current Meter Type"
}, },
"rollPitchAdjustmentsMoved": { "rollPitchAdjustmentsMoved": {
"message": "Roll & Pitch board orientation is available only in the CLI. Do not use it to trim the airplane for the level flight! Use <strong>fw_level_pitch_trim</strong> instead" "message": "Roll & Pitch board orientation is available only in the CLI. Do not use it to trim the airplane for the level flight! Use Fixed Wing Level Trim on the PID tuning tab under Mechanics instead (<strong>fw_level_pitch_trim</strong>)."
}, },
"pidId": { "pidId": {
"message": "#" "message": "#"
......
...@@ -67,6 +67,12 @@ var CONFIG, ...@@ -67,6 +67,12 @@ var CONFIG,
var FC = { var FC = {
MAX_SERVO_RATE: 125, MAX_SERVO_RATE: 125,
MIN_SERVO_RATE: 0, MIN_SERVO_RATE: 0,
isAirplane: function () {
return (MIXER_CONFIG.platformType == PLATFORM_AIRPLANE);
},
isMultirotor: function () {
return (MIXER_CONFIG.platformType == PLATFORM_MULTIROTOR || MIXER_CONFIG.platformType == PLATFORM_TRICOPTER);
},
isRpyFfComponentUsed: function () { isRpyFfComponentUsed: function () {
return (MIXER_CONFIG.platformType == PLATFORM_AIRPLANE || MIXER_CONFIG.platformType == PLATFORM_ROVER || MIXER_CONFIG.platformType == PLATFORM_BOAT) || ((MIXER_CONFIG.platformType == PLATFORM_MULTIROTOR || MIXER_CONFIG.platformType == PLATFORM_TRICOPTER) && semver.gte(CONFIG.flightControllerVersion, "2.6.0")); return (MIXER_CONFIG.platformType == PLATFORM_AIRPLANE || MIXER_CONFIG.platformType == PLATFORM_ROVER || MIXER_CONFIG.platformType == PLATFORM_BOAT) || ((MIXER_CONFIG.platformType == PLATFORM_MULTIROTOR || MIXER_CONFIG.platformType == PLATFORM_TRICOPTER) && semver.gte(CONFIG.flightControllerVersion, "2.6.0"));
}, },
...@@ -74,7 +80,7 @@ var FC = { ...@@ -74,7 +80,7 @@ var FC = {
return true; // Currently all platforms use D term return true; // Currently all platforms use D term
}, },
isCdComponentUsed: function () { isCdComponentUsed: function () {
return MIXER_CONFIG.platformType == PLATFORM_MULTIROTOR || MIXER_CONFIG.platformType == PLATFORM_TRICOPTER; return (MIXER_CONFIG.platformType == PLATFORM_MULTIROTOR || MIXER_CONFIG.platformType == PLATFORM_TRICOPTER);
}, },
resetState: function () { resetState: function () {
SENSOR_STATUS = { SENSOR_STATUS = {
......
...@@ -43,6 +43,7 @@ var mspHelper = (function (gui) { ...@@ -43,6 +43,7 @@ var mspHelper = (function (gui) {
'FRSKY_OSD': 20, 'FRSKY_OSD': 20,
'DJI_FPV': 21, 'DJI_FPV': 21,
'SMARTPORT_MASTER': 23, 'SMARTPORT_MASTER': 23,
'IMU2': 24,
}; };
// Required for MSP_DEBUGMSG because console.log() doesn't allow omitting // Required for MSP_DEBUGMSG because console.log() doesn't allow omitting
......
This diff is collapsed.
...@@ -4,109 +4,39 @@ TABS.advanced_tuning = {}; ...@@ -4,109 +4,39 @@ TABS.advanced_tuning = {};
TABS.advanced_tuning.initialize = function (callback) { TABS.advanced_tuning.initialize = function (callback) {
var loadChainer = new MSPChainerClass(),
saveChainer = new MSPChainerClass();
if (GUI.active_tab != 'advanced_tuning') { if (GUI.active_tab != 'advanced_tuning') {
GUI.active_tab = 'advanced_tuning'; GUI.active_tab = 'advanced_tuning';
googleAnalytics.sendAppView('AdvancedTuning'); googleAnalytics.sendAppView('AdvancedTuning');
} }
loadChainer.setChain([ loadHtml();
mspHelper.loadNavPosholdConfig,
mspHelper.loadPositionEstimationConfig,
mspHelper.loadRthAndLandConfig,
mspHelper.loadFwConfig,
mspHelper.loadBrakingConfig
]);
loadChainer.setExitPoint(loadHtml);
loadChainer.execute();
saveChainer.setChain([
mspHelper.saveNavPosholdConfig,
mspHelper.savePositionEstimationConfig,
mspHelper.saveRthAndLandConfig,
mspHelper.saveFwConfig,
mspHelper.saveBrakingConfig,
mspHelper.saveToEeprom
]);
saveChainer.setExitPoint(reboot);
function loadHtml() { function loadHtml() {
GUI.load("./tabs/advanced_tuning.html", Settings.processHtml(function () { GUI.load("./tabs/advanced_tuning.html", Settings.processHtml(function () {
var $userControlMode = $('#user-control-mode'), if (FC.isAirplane()) {
$useMidThrottle = $("#use-mid-throttle"), $('.airplaneTuning').show();
$rthClimbFirst = $('#rth-climb-first'), $('.airplaneTuningTitle').show();
$rthClimbIgnoreEmergency = $('#rthClimbIgnoreEmergency'), $('.multirotorTuning').hide();
$rthTailFirst = $('#rthTailFirst'), $('.multirotorTuningTitle').hide();
$rthAllowLanding = $('#rthAllowLanding'), $('.notFixedWingTuning').hide();
$rthAltControlMode = $('#rthAltControlMode'); } else if (FC.isMultirotor()) {
$('.airplaneTuning').hide();
$rthClimbFirst.prop("checked", RTH_AND_LAND_CONFIG.rthClimbFirst); $('.airplaneTuningTitle').hide();
$rthClimbFirst.change(function () { $('.multirotorTuning').show();
if ($(this).is(":checked")) { $('.multirotorTuningTitle').show();
RTH_AND_LAND_CONFIG.rthClimbFirst = 1; $('.notFixedWingTuning').show();
} else { } else {
RTH_AND_LAND_CONFIG.rthClimbFirst = 0; $('.airplaneTuning').show();
} $('.airplaneTuningTitle').hide();
}); $('.multirotorTuning').show();
$rthClimbFirst.change(); $('.multirotorTuningTitle').hide();
$('.notFixedWingTuning').show();
$rthClimbIgnoreEmergency.prop("checked", RTH_AND_LAND_CONFIG.rthClimbIgnoreEmergency); }
$rthClimbIgnoreEmergency.change(function () {
if ($(this).is(":checked")) {
RTH_AND_LAND_CONFIG.rthClimbIgnoreEmergency = 1;
} else {
RTH_AND_LAND_CONFIG.rthClimbIgnoreEmergency = 0;
}
});
$rthClimbIgnoreEmergency.change();
$rthTailFirst.prop("checked", RTH_AND_LAND_CONFIG.rthTailFirst);
$rthTailFirst.change(function () {
if ($(this).is(":checked")) {
RTH_AND_LAND_CONFIG.rthTailFirst = 1;
} else {
RTH_AND_LAND_CONFIG.rthTailFirst = 0;
}
});
$rthTailFirst.change();
GUI.fillSelect($rthAltControlMode, FC.getRthAltControlMode(), RTH_AND_LAND_CONFIG.rthAltControlMode);
$rthAltControlMode.val(RTH_AND_LAND_CONFIG.rthAltControlMode);
$rthAltControlMode.change(function () {
RTH_AND_LAND_CONFIG.rthAltControlMode = $rthAltControlMode.val();
});
GUI.fillSelect($rthAllowLanding, FC.getRthAllowLanding(), RTH_AND_LAND_CONFIG.rthAllowLanding);
$rthAllowLanding.val(RTH_AND_LAND_CONFIG.rthAllowLanding);
$rthAllowLanding.change(function () {
RTH_AND_LAND_CONFIG.rthAllowLanding = $rthAllowLanding.val();
});
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();
GUI.simpleBind(); GUI.simpleBind();
localize(); localize();
$('#advanced-tuning-save-button').click(function () {
saveChainer.execute();
});
$('a.save').click(function () { $('a.save').click(function () {
Settings.saveInputs().then(function () { Settings.saveInputs().then(function () {
...@@ -117,6 +47,7 @@ TABS.advanced_tuning.initialize = function (callback) { ...@@ -117,6 +47,7 @@ TABS.advanced_tuning.initialize = function (callback) {
setTimeout(function () { setTimeout(function () {
$(self).html(oldText); $(self).html(oldText);
}, 2000); }, 2000);
reboot();
}); });
}); });
GUI.content_ready(callback); GUI.content_ready(callback);
......
...@@ -35,17 +35,17 @@ TABS.auxiliary.initialize = function (callback) { ...@@ -35,17 +35,17 @@ TABS.auxiliary.initialize = function (callback) {
function sort_modes_for_display() { function sort_modes_for_display() {
// This array defines the order that the modes are displayed in the configurator modes page // This array defines the order that the modes are displayed in the configurator modes page
configuratorBoxOrder = [ configuratorBoxOrder = [
"ARM", "PREARM", // Arming "ARM", "PREARM", // Arming
"ANGLE", "HORIZON", "MANUAL", // Flight modes "ANGLE", "HORIZON", "MANUAL", // Flight modes
"NAV RTH", "NAV POSHOLD", "NAV COURSE HOLD", "NAV CRUISE", // Navigation mode "NAV RTH", "NAV POSHOLD", "NAV COURSE HOLD", // Navigation mode
"NAV ALTHOLD", "HEADING HOLD", "AIR MODE", // Flight mode modifiers "NAV ALTHOLD", "HEADING HOLD", "AIR MODE", // Flight mode modifiers
"NAV WP", "GCS NAV", "HOME RESET", // Navigation "NAV WP", "GCS NAV", "HOME RESET", // Navigation
"SERVO AUTOTRIM", "AUTO TUNE", "NAV LAUNCH", "LOITER CHANGE", "FLAPERON", // Fixed wing specific "SERVO AUTOTRIM", "AUTO TUNE", "NAV LAUNCH", "LOITER CHANGE", "FLAPERON", // Fixed wing specific
"FPV ANGLE MIX", "TURN ASSIST", "MC BRAKING", "SURFACE", "HEADFREE", "HEADADJ", // Multi-rotor specific "TURTLE", "FPV ANGLE MIX", "TURN ASSIST", "MC BRAKING", "SURFACE", "HEADFREE", "HEADADJ", // Multi-rotor specific
"BEEPER", "LEDLOW", "LIGHTS", // Feedback "BEEPER", "LEDS OFF", "LIGHTS", // Feedback
"OSD SW", "OSD ALT 1", "OSD ALT 2", "OSD ALT 3", // OSD "OSD OFF", "OSD ALT 1", "OSD ALT 2", "OSD ALT 3", // OSD
"CAMSTAB", "CAMERA CONTROL 1", "CAMERA CONTROL 2", "CAMERA CONTROL 3", // FPV Camera "CAMSTAB", "CAMERA CONTROL 1", "CAMERA CONTROL 2", "CAMERA CONTROL 3", // FPV Camera
"BLACKBOX", "FAILSAFE", "KILLSWITCH", "TELEMETRY", "MSP RC OVERRIDE", "USER1", "USER2" // Misc "BLACKBOX", "FAILSAFE", "KILLSWITCH", "TELEMETRY", "MSP RC OVERRIDE", "USER1", "USER2" // Misc
]; ];
// Sort the modes // Sort the modes
......
...@@ -963,6 +963,11 @@ OSD.constants = { ...@@ -963,6 +963,11 @@ OSD.constants = {
} }
return FONT.embed_dot('-0.5') + FONT.symbol(SYM.M_S); return FONT.embed_dot('-0.5') + FONT.symbol(SYM.M_S);
} }
},
{
name: 'OSD_RANGEFINDER',
id: 120,
preview: "2" + FONT.symbol(SYM.DIST_KM)
} }
] ]
}, },
......
...@@ -99,6 +99,12 @@ TABS.ports.initialize = function (callback) { ...@@ -99,6 +99,12 @@ TABS.ports.initialize = function (callback) {
maxPorts: 1 } maxPorts: 1 }
); );
functionRules.push({
name: 'IMU2',
groups: ['peripherals'],
maxPorts: 1 }
);
for (var i = 0; i < functionRules.length; i++) { for (var i = 0; i < functionRules.length; i++) {
functionRules[i].displayName = chrome.i18n.getMessage('portsFunction_' + functionRules[i].name); functionRules[i].displayName = chrome.i18n.getMessage('portsFunction_' + functionRules[i].name);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment