Control: Add reworked Generic Autopilot
Rework of the generic autopilot https://sourceforge.net/p/flightgear/fgdata/merge-requests/284/ Control: Improve FPA engagement smoothness Control: Generic autopilot logical improvement
This commit is contained in:
parent
7cbc34b355
commit
25c46a69bc
4 changed files with 1438 additions and 671 deletions
|
@ -1,4 +1,5 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
|
<!-- No longer required by generic-autopilot.xml, left in for compatibility reasons -->
|
||||||
<!--
|
<!--
|
||||||
These are the autopilot helpers, currently implemented
|
These are the autopilot helpers, currently implemented
|
||||||
in the c++ code of xmlauto.cxx.
|
in the c++ code of xmlauto.cxx.
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,15 +1,17 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
<PropertyList>
|
<PropertyList>
|
||||||
|
|
||||||
<!-- heading -->
|
<!-- Roll -->
|
||||||
|
<label>
|
||||||
<label>
|
|
||||||
<width>60</width>
|
<width>60</width>
|
||||||
<height>10</height>
|
<height>10</height>
|
||||||
<box>true</box>
|
<box>true</box>
|
||||||
<format>ROLL</format>
|
<format>ROLL %3.1f</format>
|
||||||
<halign>left</halign>
|
<halign>center</halign>
|
||||||
|
<input>
|
||||||
|
<property>/autopilot/settings/target-roll-deg</property>
|
||||||
|
</input>
|
||||||
<condition>
|
<condition>
|
||||||
<equals>
|
<equals>
|
||||||
<property>/autopilot/locks/heading</property>
|
<property>/autopilot/locks/heading</property>
|
||||||
|
@ -17,14 +19,13 @@
|
||||||
</equals>
|
</equals>
|
||||||
</condition>
|
</condition>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<width>60</width>
|
<width>60</width>
|
||||||
<height>10</height>
|
<height>10</height>
|
||||||
<box>true</box>
|
<box>true</box>
|
||||||
<format>HDG %03d</format>
|
<format>HDG %03d</format>
|
||||||
<halign>left</halign>
|
<halign>center</halign>
|
||||||
<input>
|
<input>
|
||||||
<property>/autopilot/settings/heading-bug-deg</property>
|
<property>/autopilot/settings/heading-bug-deg</property>
|
||||||
</input>
|
</input>
|
||||||
|
@ -35,13 +36,13 @@
|
||||||
</equals>
|
</equals>
|
||||||
</condition>
|
</condition>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<width>60</width>
|
<width>60</width>
|
||||||
<height>10</height>
|
<height>10</height>
|
||||||
<box>true</box>
|
<box>true</box>
|
||||||
<format>HDG %03d</format>
|
<format>HDG %03d</format>
|
||||||
<halign>left</halign>
|
<halign>center</halign>
|
||||||
<input>
|
<input>
|
||||||
<property>/autopilot/settings/true-heading-deg</property>
|
<property>/autopilot/settings/true-heading-deg</property>
|
||||||
</input>
|
</input>
|
||||||
|
@ -52,87 +53,176 @@
|
||||||
</equals>
|
</equals>
|
||||||
</condition>
|
</condition>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
<!-- altitude -->
|
<width>60</width>
|
||||||
|
<height>10</height>
|
||||||
|
<box>true</box>
|
||||||
|
<format>NAV1 CDI</format>
|
||||||
|
<halign>center</halign>
|
||||||
|
<condition>
|
||||||
|
<equals>
|
||||||
|
<property>/autopilot/locks/heading</property>
|
||||||
|
<value>nav1-hold</value>
|
||||||
|
</equals>
|
||||||
|
</condition>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<!-- Pitch -->
|
||||||
<label>
|
<label>
|
||||||
<x>60</x>
|
|
||||||
<width>60</width>
|
|
||||||
<height>10</height>
|
|
||||||
<box>true</box>
|
|
||||||
<format>ALT %04d</format>
|
|
||||||
<halign>left</halign>
|
|
||||||
<input>
|
|
||||||
<property>/autopilot/settings/target-altitude-ft</property>
|
|
||||||
</input>
|
|
||||||
<condition>
|
|
||||||
<equals>
|
|
||||||
<property>/autopilot/locks/altitude</property>
|
|
||||||
<value>altitude-hold</value>
|
|
||||||
</equals>
|
|
||||||
</condition>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label>
|
|
||||||
<x>60</x>
|
|
||||||
<width>60</width>
|
|
||||||
<height>10</height>
|
|
||||||
<box>true</box>
|
|
||||||
<format>PTCH</format>
|
|
||||||
<halign>left</halign>
|
|
||||||
<condition>
|
|
||||||
<equals>
|
|
||||||
<property>/autopilot/locks/altitude</property>
|
|
||||||
<value>pitch-hold</value>
|
|
||||||
</equals>
|
|
||||||
</condition>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
|
|
||||||
<label>
|
|
||||||
<x>60</x>
|
<x>60</x>
|
||||||
<width>60</width>
|
<width>60</width>
|
||||||
<height>10</height>
|
<height>10</height>
|
||||||
<box>true</box>
|
<box>true</box>
|
||||||
<format>V/S %d</format>
|
<format>V/S %d</format>
|
||||||
<halign>left</halign>
|
<halign>center</halign>
|
||||||
<input>
|
<input>
|
||||||
<property>/autopilot/settings/vertical-speed-fpm</property>
|
<property>/autopilot/settings/vertical-speed-fpm</property>
|
||||||
</input>
|
</input>
|
||||||
<condition>
|
<condition>
|
||||||
|
<not><property>/autopilot/internal/speed-on-pitch-active</property></not>
|
||||||
<equals>
|
<equals>
|
||||||
<property>/autopilot/locks/altitude</property>
|
<property>/autopilot/locks/altitude</property>
|
||||||
<value>vertical-speed-hold</value>
|
<value>vertical-speed-hold</value>
|
||||||
</equals>
|
</equals>
|
||||||
</condition>
|
</condition>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<x>60</x>
|
<x>60</x>
|
||||||
<width>60</width>
|
<width>60</width>
|
||||||
<height>10</height>
|
<height>10</height>
|
||||||
<format>AGL %04d</format>
|
<box>true</box>
|
||||||
<halign>left</halign>
|
<format>PITCH %3.1f</format>
|
||||||
|
<halign>center</halign>
|
||||||
|
<input>
|
||||||
|
<property>/autopilot/settings/target-pitch-deg</property>
|
||||||
|
</input>
|
||||||
|
<condition>
|
||||||
|
<not><property>/autopilot/internal/speed-on-pitch-active</property></not>
|
||||||
|
<equals>
|
||||||
|
<property>/autopilot/locks/altitude</property>
|
||||||
|
<value>pitch-hold</value>
|
||||||
|
</equals>
|
||||||
|
</condition>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<x>60</x>
|
||||||
|
<width>60</width>
|
||||||
|
<height>10</height>
|
||||||
|
<box>true</box>
|
||||||
|
<format>FPA %3.1f</format>
|
||||||
|
<halign>center</halign>
|
||||||
|
<input>
|
||||||
|
<property>/autopilot/settings/target-fpa-deg</property>
|
||||||
|
</input>
|
||||||
|
<condition>
|
||||||
|
<not><property>/autopilot/internal/speed-on-pitch-active</property></not>
|
||||||
|
<equals>
|
||||||
|
<property>/autopilot/locks/altitude</property>
|
||||||
|
<value>fpa-hold</value>
|
||||||
|
</equals>
|
||||||
|
</condition>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<x>60</x>
|
||||||
|
<width>60</width>
|
||||||
|
<height>10</height>
|
||||||
|
<box>true</box>
|
||||||
|
<format>ALT %03d</format>
|
||||||
|
<halign>center</halign>
|
||||||
|
<input>
|
||||||
|
<property>/autopilot/settings/target-altitude-ft</property>
|
||||||
|
</input>
|
||||||
|
<condition>
|
||||||
|
<not><property>/autopilot/internal/speed-on-pitch-active</property></not>
|
||||||
|
<equals>
|
||||||
|
<property>/autopilot/locks/altitude</property>
|
||||||
|
<value>altitude-hold</value>
|
||||||
|
</equals>
|
||||||
|
</condition>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<x>60</x>
|
||||||
|
<width>60</width>
|
||||||
|
<height>10</height>
|
||||||
|
<format>AGL %03d</format>
|
||||||
|
<halign>center</halign>
|
||||||
<box>true</box>
|
<box>true</box>
|
||||||
<input>
|
<input>
|
||||||
<property>/autopilot/settings/target-agl-ft</property>
|
<property>/autopilot/settings/target-agl-ft</property>
|
||||||
</input>
|
</input>
|
||||||
<condition>
|
<condition>
|
||||||
|
<not><property>/autopilot/internal/speed-on-pitch-active</property></not>
|
||||||
<equals>
|
<equals>
|
||||||
<property>/autopilot/locks/altitude</property>
|
<property>/autopilot/locks/altitude</property>
|
||||||
<value>agl-hold</value>
|
<value>agl-hold</value>
|
||||||
</equals>
|
</equals>
|
||||||
</condition>
|
</condition>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<!-- speed -->
|
<label>
|
||||||
<label>
|
<x>60</x>
|
||||||
|
<width>60</width>
|
||||||
|
<height>10</height>
|
||||||
|
<format>NAV1 G/S</format>
|
||||||
|
<halign>center</halign>
|
||||||
|
<box>true</box>
|
||||||
|
<condition>
|
||||||
|
<not><property>/autopilot/internal/speed-on-pitch-active</property></not>
|
||||||
|
<equals>
|
||||||
|
<property>/autopilot/locks/altitude</property>
|
||||||
|
<value>gs1-hold</value>
|
||||||
|
</equals>
|
||||||
|
</condition>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<x>60</x>
|
||||||
|
<width>60</width>
|
||||||
|
<height>10</height>
|
||||||
|
<format>IAS %3d</format>
|
||||||
|
<halign>center</halign>
|
||||||
|
<box>true</box>
|
||||||
|
<input>
|
||||||
|
<property>/autopilot/settings/target-speed-kt</property>
|
||||||
|
</input>
|
||||||
|
<condition>
|
||||||
|
<equals>
|
||||||
|
<property>/autopilot/locks/speed</property>
|
||||||
|
<value>speed-with-pitch-trim</value>
|
||||||
|
</equals>
|
||||||
|
</condition>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<x>60</x>
|
||||||
|
<width>60</width>
|
||||||
|
<height>10</height>
|
||||||
|
<format>MACH %4.3f</format>
|
||||||
|
<halign>center</halign>
|
||||||
|
<box>true</box>
|
||||||
|
<input>
|
||||||
|
<property>/autopilot/settings/target-speed-mach</property>
|
||||||
|
</input>
|
||||||
|
<condition>
|
||||||
|
<equals>
|
||||||
|
<property>/autopilot/locks/speed</property>
|
||||||
|
<value>mach-with-pitch-trim</value>
|
||||||
|
</equals>
|
||||||
|
</condition>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<!-- Speed -->
|
||||||
|
<label>
|
||||||
<x>120</x>
|
<x>120</x>
|
||||||
<width>60</width>
|
<width>60</width>
|
||||||
<height>10</height>
|
<height>10</height>
|
||||||
<format>IAS %3dkt</format>
|
<format>IAS %3d</format>
|
||||||
<halign>left</halign>
|
<halign>center</halign>
|
||||||
<box>true</box>
|
<box>true</box>
|
||||||
<input>
|
<input>
|
||||||
<property>/autopilot/settings/target-speed-kt</property>
|
<property>/autopilot/settings/target-speed-kt</property>
|
||||||
|
@ -149,8 +239,8 @@
|
||||||
<x>120</x>
|
<x>120</x>
|
||||||
<width>60</width>
|
<width>60</width>
|
||||||
<height>10</height>
|
<height>10</height>
|
||||||
<format>MACH %1.2f</format>
|
<format>MACH %4.3f</format>
|
||||||
<halign>left</halign>
|
<halign>center</halign>
|
||||||
<box>true</box>
|
<box>true</box>
|
||||||
<input>
|
<input>
|
||||||
<property>/autopilot/settings/target-speed-mach</property>
|
<property>/autopilot/settings/target-speed-mach</property>
|
||||||
|
@ -167,18 +257,21 @@
|
||||||
<x>120</x>
|
<x>120</x>
|
||||||
<width>60</width>
|
<width>60</width>
|
||||||
<height>10</height>
|
<height>10</height>
|
||||||
<format>PITCH %3dkt</format>
|
<format>UNLOCKED</format>
|
||||||
<halign>left</halign>
|
<halign>center</halign>
|
||||||
<box>true</box>
|
<box>true</box>
|
||||||
<input>
|
|
||||||
<property>/autopilot/settings/target-speed-mach</property>
|
|
||||||
</input>
|
|
||||||
<condition>
|
<condition>
|
||||||
<equals>
|
<or>
|
||||||
<property>/autopilot/locks/speed</property>
|
<equals>
|
||||||
<value>speed-with-pitch-trim</value>
|
<property>/autopilot/locks/speed</property>
|
||||||
</equals>
|
<value>speed-with-pitch-trim</value>
|
||||||
|
</equals>
|
||||||
|
<equals>
|
||||||
|
<property>/autopilot/locks/speed</property>
|
||||||
|
<value>mach-with-pitch-trim</value>
|
||||||
|
</equals>
|
||||||
|
</or>
|
||||||
</condition>
|
</condition>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
</PropertyList>
|
</PropertyList>
|
||||||
|
|
|
@ -6,13 +6,14 @@
|
||||||
/autopilot/locks/altitude
|
/autopilot/locks/altitude
|
||||||
/autopilot/locks/heading
|
/autopilot/locks/heading
|
||||||
/autopilot/locks/speed
|
/autopilot/locks/speed
|
||||||
/autopilot/locks/passive-mode
|
|
||||||
/autopilot/settings/heading-bug-deg
|
/autopilot/settings/heading-bug-deg
|
||||||
|
/autopilot/settings/target-roll-deg
|
||||||
/autopilot/settings/target-agl-ft
|
/autopilot/settings/target-agl-ft
|
||||||
/autopilot/settings/target-altitude-ft
|
/autopilot/settings/target-altitude-ft
|
||||||
/autopilot/settings/target-aoa-deg
|
/autopilot/settings/target-fpa-deg
|
||||||
/autopilot/settings/target-pitch-deg
|
/autopilot/settings/target-pitch-deg
|
||||||
/autopilot/settings/target-speed-kt
|
/autopilot/settings/target-speed-kt
|
||||||
|
/autopilot/settings/target-speed-mach
|
||||||
/autopilot/settings/true-heading-deg
|
/autopilot/settings/true-heading-deg
|
||||||
/autopilot/settings/vertical-speed-fpm
|
/autopilot/settings/vertical-speed-fpm
|
||||||
-->
|
-->
|
||||||
|
@ -117,9 +118,9 @@
|
||||||
## create and initialize input field properties if necessary
|
## create and initialize input field properties if necessary
|
||||||
#
|
#
|
||||||
var apset = props.globals.getNode("/autopilot/settings", 1);
|
var apset = props.globals.getNode("/autopilot/settings", 1);
|
||||||
foreach (var p; ["heading-bug-deg", "true-heading-deg", "vertical-speed-fpm",
|
foreach (var p; ["heading-bug-deg", "target-roll-deg", "true-heading-deg", "vertical-speed-fpm",
|
||||||
"target-pitch-deg", "target-aoa-deg", "target-altitude-ft",
|
"target-pitch-deg", "target-fpa-deg", "target-altitude-ft",
|
||||||
"target-agl-ft", "target-speed-kt"]) {
|
"target-agl-ft", "target-speed-kt", "target-speed-mach"]) {
|
||||||
|
|
||||||
if ((var n = apset.getNode(p)) == nil or n.getType() == "NONE") {
|
if ((var n = apset.getNode(p)) == nil or n.getType() == "NONE") {
|
||||||
apset.getNode(p, 1).setDoubleValue(0);
|
apset.getNode(p, 1).setDoubleValue(0);
|
||||||
|
@ -136,9 +137,9 @@
|
||||||
var hdg = Group.new("heading", ["dg-heading-hold", "wing-leveler", "true-heading-hold", "nav1-hold"]);
|
var hdg = Group.new("heading", ["dg-heading-hold", "wing-leveler", "true-heading-hold", "nav1-hold"]);
|
||||||
var vel = Group.new("speed", ["speed-with-throttle", "speed-with-pitch-trim"]);
|
var vel = Group.new("speed", ["speed-with-throttle", "speed-with-pitch-trim"]);
|
||||||
var alt = Group.new("altitude", ["altitude-hold", "vertical-speed-hold", "pitch-hold",
|
var alt = Group.new("altitude", ["altitude-hold", "vertical-speed-hold", "pitch-hold",
|
||||||
"aoa-hold", "agl-hold", "gs1-hold"]);
|
"fpa-hold", "agl-hold", "gs1-hold"]);
|
||||||
</open>
|
</open>
|
||||||
<close>
|
<close>
|
||||||
hdg.del();
|
hdg.del();
|
||||||
vel.del();
|
vel.del();
|
||||||
alt.del();
|
alt.del();
|
||||||
|
@ -421,7 +422,7 @@
|
||||||
</binding>
|
</binding>
|
||||||
</input>
|
</input>
|
||||||
<text>
|
<text>
|
||||||
<label>AoA Hold</label>
|
<label>FPA Hold</label>
|
||||||
<halign>right</halign>
|
<halign>right</halign>
|
||||||
<row>2</row>
|
<row>2</row>
|
||||||
<col>0</col>
|
<col>0</col>
|
||||||
|
@ -429,17 +430,17 @@
|
||||||
<radio>
|
<radio>
|
||||||
<row>2</row>
|
<row>2</row>
|
||||||
<col>1</col>
|
<col>1</col>
|
||||||
<property>/sim/gui/dialogs/autopilot/aoa-hold</property>
|
<property>/sim/gui/dialogs/autopilot/fpa-hold</property>
|
||||||
<live>true</live>
|
<live>true</live>
|
||||||
<binding>
|
<binding>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>alt.set("aoa-hold")</script>
|
<script>alt.set("fpa-hold")</script>
|
||||||
</binding>
|
</binding>
|
||||||
</radio>
|
</radio>
|
||||||
<input>
|
<input>
|
||||||
<row>2</row>
|
<row>2</row>
|
||||||
<col>2</col>
|
<col>2</col>
|
||||||
<property>/autopilot/settings/target-aoa-deg</property>
|
<property>/autopilot/settings/target-fpa-deg</property>
|
||||||
<live>true</live>
|
<live>true</live>
|
||||||
<binding>
|
<binding>
|
||||||
<command>dialog-apply</command>
|
<command>dialog-apply</command>
|
||||||
|
@ -518,23 +519,6 @@
|
||||||
</group>
|
</group>
|
||||||
<!-- End of Pitch/Altitude VBox -->
|
<!-- End of Pitch/Altitude VBox -->
|
||||||
</group>
|
</group>
|
||||||
<hrule/>
|
|
||||||
<group>
|
|
||||||
<!-- Passive Mode Toggle -->
|
|
||||||
<layout>hbox</layout>
|
|
||||||
<checkbox>
|
|
||||||
<label>FlightDirector Mode</label>
|
|
||||||
<halign>center</halign>
|
|
||||||
<property>/autopilot/locks/passive-mode</property>
|
|
||||||
<live>true</live>
|
|
||||||
<binding>
|
|
||||||
<command>dialog-apply</command>
|
|
||||||
</binding>
|
|
||||||
<binding>
|
|
||||||
<command>property-toggle</command>
|
|
||||||
</binding>
|
|
||||||
</checkbox>
|
|
||||||
</group>
|
|
||||||
|
|
||||||
<hrule/>
|
<hrule/>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue