Skip to content

Commit

Permalink
Merge pull request #1960 from Scavanger/Autoland-7.0.1
Browse files Browse the repository at this point in the history
Fixed Wing Autoland
  • Loading branch information
DzikuVx authored Feb 15, 2024
2 parents 5579bc2 + 2a9a366 commit 111307e
Show file tree
Hide file tree
Showing 15 changed files with 3,480 additions and 1,213 deletions.
119 changes: 118 additions & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3371,6 +3371,54 @@
"fixedWingNavigationConfiguration": {
"message": "Fixed Wing Navigation Settings"
},
"fixedWingLandingConfiguration": {
"message": "Fixed Wing Landing Settings"
},
"MissionPlannerOnlyOneLandWp": {
"message": "You can set only one LAND Waypoint per mission."
},
"fwLandApproachLength" : {
"message": "Final approach length"
},
"fwLandApproachLengthHelp": {
"message": "Length of the final approach, also includes the glide and intercept phase. This is the length from the safe home point to the final turn point."
},
"fwLandFinalApproachPitch2throttle": {
"message": "Modifier for pitch to throttle ratio at final approach"
},
"fwLandFinalApproachPitch2throttleHelp": {
"message": "This value is multiplied by the \"pitch to throttle ratio\" value during the final approach. Allows the velocity to be reduced."
},
"fwLandGlideAlt" : {
"message": "Initial altitude of the glide phase"
},
"fwLandGlideAltHelp" : {
"message": "At this altitude (measured from the altitude of the landing point) the engine is switched off and the aircraft glides from here."
},
"fwLandFlareAlt" : {
"message": "Initial altitude of the flare phase"
},
"fwLandFlareAltHelp" : {
"message": "At this altitude (measured from the altitude of the landing point) the last phase of landing is executed."
},
"fwLandGlidePitch" : {
"message": "Pitch value for glide phase"
},
"fwLandGlidePitchHelp" : {
"message": "This pitch angle is held during the glide phase."
},
"fwLandFlarePitch" : {
"message": "Pitch value for flare phase"
},
"fwLandFlarePitchHelp" : {
"message": "This pitch angle is held during the flare phase."
},
"fwLandMaxTailwind": {
"message": "Max. tailwind"
},
"fwLandMaxTailwindHelp": {
"message": "This value is used when no headwind landing is possible and wind speeds below this value are ignored (inaccuracies in INAV wind measurement)."
},
"osd_unsupported_msg1": {
"message": "Your flight controller isn't responding to OSD commands. This probably means that it does not have an integrated OSD."
},
Expand Down Expand Up @@ -4319,6 +4367,12 @@
"SafehomeSafeRadius": {
"message": "Safe Radius (m):"
},
"SafehomeFwAppraoch": {
"message": "FW Approach:"
},
"safehomeEdit": {
"message": "Edit Safehome"
},
"missionTitleHide": {
"message": "Hide"
},
Expand Down Expand Up @@ -4349,6 +4403,9 @@
"missionTitleSaveEepromMission": {
"message": "Save Eeprom mission"
},
"missionTitleDelete": {
"message": "Delete"
},
"missionTitleRemoveAll": {
"message": "Remove all"
},
Expand All @@ -4360,7 +4417,7 @@
},
"missionTitleAdd": {
"message": "Add"
},
},
"missionTitleMoveToCenterView": {
"message": "move to center view"
},
Expand All @@ -4373,6 +4430,60 @@
"missionTitlEditMission": {
"message": "Edit Mission"
},
"MissionPlannerFwLAndingAltitudeChangeReset": {
"message": "Altitude below min land altitude. Change ignored"
},
"missionWpType": {
"message": "Type:"
},
"missionWpLat": {
"message": "Lat:"
},
"missionWpLon": {
"message": "Lon:"
},
"missionSeaLevelRef": {
"message": "Sea level Ref: "
},
"missionElevation": {
"message": "Elevation (m):"
},
"missionNA": {
"message": "N/A"
},
"missionGroundDist": {
"message": "Grd Dist (m):"
},
"missionParameter1": {
"message": "Parameter 1:"
},
"missionParameter2": {
"message": "Parameter 2:"
},
"missionUserActions": {
"message": "User Actions:"
},
"missionFwLandingSettings": {
"message": "Fixed Wing landing settings:"
},
"missionFwApproachAlt": {
"message": "Approach Alt: (cm):"
},
"missionFwLandAlt": {
"message": "Land Alt: (cm):"
},
"missionFwApproachDir": {
"message": "Approach direction:"
},
"missionFwLandHeading1": {
"message": "Heading 1: (deg):"
},
"missionFwLandHeading2": {
"message": "Heading 2: (deg):"
},
"missionExclusive": {
"message": "Excl."
},
"missionRTHsettingsTitle": {
"message": "RTH settings"
},
Expand All @@ -4388,6 +4499,12 @@
"missionSafehomeHead": {
"message": "Safe Home manager"
},
"missionSafehomeAvailableSafehomes" : {
"message": "Available Safehomes:"
},
"missionSafehomeMaxSafehomesReached": {
"message": "Maximum number of safehomes reached."
},
"missionMultiMissionHead": {
"message": "Multi Missions"
},
Expand Down
4 changes: 3 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ sources.js = [
'./js/libraries/plotly-latest.min.js',
'./js/sitl.js',
'./js/CliAutoComplete.js',
'./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js'
'./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js',
'./js/fwApproach.js',
'./js/fwApproachCollection.js'
];

sources.receiverCss = [
Expand Down
12 changes: 9 additions & 3 deletions js/fc.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ var CONFIG,
CURRENT_METER_CONFIG,
FEATURES,
RATE_DYNAMICS,
OSD_CUSTOM_ELEMENTS
;
FW_APPROACH,
OSD_CUSTOM_ELEMENTS;


var FC = {
restartRequired: false,
Expand Down Expand Up @@ -567,10 +568,14 @@ var FC = {
expo: null
};


FW_APPROACH = new FwApproachCollection();

OSD_CUSTOM_ELEMENTS = {
settings: {customElementsCount: 0, customElementTextSize: 0},
items: [],
};

},
getOutputUsages: function() {
return {
Expand Down Expand Up @@ -1307,7 +1312,8 @@ var FC = {
37: "Rangefinder [cm]",
38: "Active MixerProfile",
39: "MixerTransition Active",
40: "Yaw [deg]"
40: "Yaw [deg]",
41: "FW Land State"
}
},
3: {
Expand Down
107 changes: 107 additions & 0 deletions js/fwApproach.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/*global $*/
'use strict';

const ApproachDirection = Object.freeze({
LEFT: 0,
RIGHT: 1,
})

let FwApproach = function (number, approachAltAsl = 0, landAltAsl = 0, approachDirection = 0, landHeading1 = 0, landHeading2 = 0, isSeaLevelRef = 0, elevation = 0) {

var self = {};

self.getNumber = function () {
return number;
};

self.setNumber = function (data) {
number = data;
};

self.getApproachAltAsl = function () {
return approachAltAsl;
}

self.setApproachAltAsl = function (data) {
approachAltAsl = data;
}

self.getLandAltAsl = function () {
return landAltAsl;
}

self.setLandAltAsl = function (data) {
landAltAsl = data;
}

self.getApproachDirection = function () {
return approachDirection;
}

self.setApproachDirection = function (data) {
approachDirection = data;
}

self.getLandHeading1 = function () {
return landHeading1;
}

self.setLandHeading1 = function (data) {
landHeading1 = data;
}

self.getLandHeading2 = function () {
return landHeading2;
}

self.setLandHeading2 = function (data) {
landHeading2 = data;
}

self.getIsSeaLevelRef = function () {
return isSeaLevelRef;
}

self.setIsSeaLevelRef = function (data) {
isSeaLevelRef = data;
}

self.getElevation = function() {
return elevation;
}

self.setElevation = function (data) {
elevation = data;
}

self.cleanup = function () {
approachAltAsl = 0;
landAltAsl = 0;
approachDirection = 0;
landHeading1 = 0;
landHeading2 = 0;
isSeaLevelRef = 0;
elevation = 0
};

self.getElevationFromServer = async function (lon, lat, globalSettings) {
let elevation = "N/A";
if (globalSettings.mapProviderType == 'bing') {
let elevationEarthModel = $('#elevationEarthModel').prop("checked") ? "sealevel" : "ellipsoid";

const response = await fetch('http://dev.virtualearth.net/REST/v1/Elevation/List?points='+lat+','+lon+'&heights='+elevationEarthModel+'&key='+globalSettings.mapApiKey);
const myJson = await response.json();
elevation = myJson.resourceSets[0].resources[0].elevations[0];
}
else {
const response = await fetch('https://api.opentopodata.org/v1/aster30m?locations='+lat+','+lon);
const myJson = await response.json();
if (myJson.status == "OK" && myJson.results[0].elevation != null) {
elevation = myJson.results[0].elevation;
}
}
return elevation;
}

return self;
};
Loading

0 comments on commit 111307e

Please sign in to comment.