Control: Add and enumerate proper second input sidestick
This commit is contained in:
parent
1861a5f659
commit
bfeb003c41
5 changed files with 84 additions and 15 deletions
|
@ -936,9 +936,12 @@
|
|||
<test-btn-2 type="bool">0</test-btn-2>
|
||||
</fire>
|
||||
<flight>
|
||||
<aileron n="1" type="double">0</aileron>
|
||||
<aileron-drives-tiller type="bool">0</aileron-drives-tiller>
|
||||
<aileron-input type="double">0</aileron-input>
|
||||
<elevator n="1" type="double">0</elevator>
|
||||
<elevator-input type="double">0</elevator-input>
|
||||
<rudder n="1" type="double">0</rudder>
|
||||
<speedbrake-arm type="bool">0</speedbrake-arm>
|
||||
<slats type="double">0</slats>
|
||||
</flight>
|
||||
|
@ -4654,7 +4657,6 @@
|
|||
<file>Aircraft/A320-family/Nasal/Libraries/libraries.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Libraries/buttons.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Libraries/controls-override.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Libraries/custom-views.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Libraries/shake.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Libraries/sounds.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Libraries/view-controller.nas</file>
|
||||
|
|
|
@ -91,6 +91,9 @@ var FBW = {
|
|||
overspeedRoll: props.globals.getNode("/it-fbw/protections/overspeed-roll-back"),
|
||||
overspeed: props.globals.getNode("/it-fbw/protections/overspeed"),
|
||||
},
|
||||
Sidestick: {
|
||||
active: [props.globals.getNode("/fdm/jsbsim/fbw/sidestick/active[0]"), props.globals.getNode("/fdm/jsbsim/fbw/sidestick/active[1]")],
|
||||
},
|
||||
Switches: {
|
||||
elac1Sw: props.globals.getNode("/controls/fctl/switches/elac1"),
|
||||
elac2Sw: props.globals.getNode("/controls/fctl/switches/elac2"),
|
||||
|
@ -124,6 +127,8 @@ var FBW = {
|
|||
me.Computers.sec3.setBoolValue(0);
|
||||
me.Computers.fac1.setBoolValue(0);
|
||||
me.Computers.fac2.setBoolValue(0);
|
||||
me.Sidestick.active[0].setBoolValue(1); # Change to reset stick priority?
|
||||
me.Sidestick.active[1].setBoolValue(1); # Change to reset stick priority?
|
||||
me.degradeLaw.setValue(0);
|
||||
me.activeLaw.setValue(0);
|
||||
me.override.setValue(0);
|
||||
|
|
|
@ -6,8 +6,11 @@
|
|||
# Sim
|
||||
var Controls = {
|
||||
aileron: props.globals.getNode("/controls/flight/aileron", 1),
|
||||
aileron2: props.globals.getNode("/controls/flight/aileron[1]", 1),
|
||||
elevator: props.globals.getNode("/controls/flight/elevator", 1),
|
||||
elevator2: props.globals.getNode("/controls/flight/elevator[1]", 1),
|
||||
rudder: props.globals.getNode("/controls/flight/rudder", 1),
|
||||
rudder2: props.globals.getNode("/controls/flight/rudder[1]", 1),
|
||||
};
|
||||
|
||||
var FPLN = {
|
||||
|
@ -348,7 +351,7 @@ var ITAF = {
|
|||
|
||||
# Misc
|
||||
if (Output.ap1Temp == 1 or Output.ap2Temp == 1) { # Trip AP off
|
||||
if (abs(Controls.aileron.getValue()) >= 0.2 or abs(Controls.elevator.getValue()) >= 0.2 or abs(Controls.rudder.getValue()) >= 0.2) {
|
||||
if (abs(Controls.aileron.getValue()) >= 0.2 or abs(Controls.elevator.getValue()) >= 0.2 or abs(Controls.rudder.getValue()) >= 0.2 or abs(Controls.aileron2.getValue()) >= 0.2 or abs(Controls.elevator2.getValue()) >= 0.2 or abs(Controls.rudder2.getValue()) >= 0.2) {
|
||||
fcu.apOff("hard", 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,10 @@
|
|||
<property value="0">fbw/pitch/g-pi</property>
|
||||
<property value="0">fbw/pitch/pid</property>
|
||||
<property value="0">fbw/yaw/tc-pd</property>
|
||||
<property value="0">fbw/spoiler-output</property>
|
||||
<property value="1">fbw/mixer/sidestick-gain-feedback</property>
|
||||
<property value="1">fbw/sidestick/active[0]</property>
|
||||
<property value="1">fbw/sidestick/active[1]</property>
|
||||
<property value="0">fbw/spoiler-output</property>
|
||||
|
||||
<!-- Default gains for tuning -->
|
||||
<property value="0">fbw/roll/p-gain</property>
|
||||
|
@ -238,6 +240,63 @@
|
|||
</table>
|
||||
</function>
|
||||
</fcs_function>
|
||||
|
||||
<fcs_function name="fbw/sidestick/roll-input">
|
||||
<function>
|
||||
<sum>
|
||||
<product>
|
||||
<property>/controls/flight/aileron[0]</property>
|
||||
<property>fbw/sidestick/active[0]</property>
|
||||
</product>
|
||||
<product>
|
||||
<property>/controls/flight/aileron[1]</property>
|
||||
<property>fbw/sidestick/active[1]</property>
|
||||
</product>
|
||||
</sum>
|
||||
</function>
|
||||
<clipto>
|
||||
<min>-1.0</min>
|
||||
<max>1.0</max>
|
||||
</clipto>
|
||||
</fcs_function>
|
||||
|
||||
<fcs_function name="fbw/sidestick/pitch-input">
|
||||
<function>
|
||||
<sum>
|
||||
<product>
|
||||
<property>/controls/flight/elevator[0]</property>
|
||||
<property>fbw/sidestick/active[0]</property>
|
||||
</product>
|
||||
<product>
|
||||
<property>/controls/flight/elevator[1]</property>
|
||||
<property>fbw/sidestick/active[1]</property>
|
||||
</product>
|
||||
</sum>
|
||||
</function>
|
||||
<clipto>
|
||||
<min>-1.0</min>
|
||||
<max>1.0</max>
|
||||
</clipto>
|
||||
</fcs_function>
|
||||
|
||||
<fcs_function name="fbw/sidestick/yaw-input">
|
||||
<function>
|
||||
<sum>
|
||||
<product>
|
||||
<property>/controls/flight/rudder[0]</property>
|
||||
<property>fbw/sidestick/active[0]</property>
|
||||
</product>
|
||||
<product>
|
||||
<property>/controls/flight/rudder[1]</property>
|
||||
<property>fbw/sidestick/active[1]</property>
|
||||
</product>
|
||||
</sum>
|
||||
</function>
|
||||
<clipto>
|
||||
<min>-1.0</min>
|
||||
<max>1.0</max>
|
||||
</clipto>
|
||||
</fcs_function>
|
||||
|
||||
</channel>
|
||||
|
||||
|
@ -472,7 +531,7 @@
|
|||
<channel name="FBW: Roll">
|
||||
|
||||
<switch name="fbw/roll/a-i-f">
|
||||
<default value="/controls/flight/aileron"/>
|
||||
<default value="fbw/sidestick/roll-input"/>
|
||||
<test value="0">
|
||||
fbw/fmgc/enabled eq 1
|
||||
</test>
|
||||
|
@ -496,7 +555,7 @@
|
|||
<fcs_function name="fbw/roll/aileron-nul">
|
||||
<function>
|
||||
<table>
|
||||
<independentVar lookup="row">/controls/flight/aileron</independentVar>
|
||||
<independentVar lookup="row">fbw/sidestick/roll-input</independentVar>
|
||||
<tableData>
|
||||
-1.00 -1
|
||||
-0.04 0
|
||||
|
@ -862,7 +921,7 @@
|
|||
</switch>
|
||||
|
||||
<lag_filter name="fbw/aileron-sidestick">
|
||||
<input>/controls/flight/aileron</input>
|
||||
<input>fbw/sidestick/roll-input</input>
|
||||
<c1>20</c1>
|
||||
</lag_filter>
|
||||
|
||||
|
@ -879,7 +938,7 @@
|
|||
</switch>
|
||||
|
||||
<switch name="fbw/pitch/e-i-f">
|
||||
<default value="/controls/flight/elevator"/>
|
||||
<default value="fbw/sidestick/pitch-input"/>
|
||||
<test value="0">
|
||||
fbw/fmgc/enabled eq 1
|
||||
</test>
|
||||
|
@ -907,7 +966,7 @@
|
|||
<fcs_function name="fbw/pitch/elevator-nul">
|
||||
<function>
|
||||
<table>
|
||||
<independentVar lookup="row">/controls/flight/elevator</independentVar>
|
||||
<independentVar lookup="row">fbw/sidestick/pitch-input</independentVar>
|
||||
<tableData>
|
||||
-1.00 -1
|
||||
-0.04 0
|
||||
|
@ -1304,7 +1363,7 @@
|
|||
</switch>
|
||||
|
||||
<lag_filter name="fbw/elevator-sidestick">
|
||||
<input>/controls/flight/elevator</input>
|
||||
<input>fbw/sidestick/pitch-input</input>
|
||||
<c1>20</c1>
|
||||
</lag_filter>
|
||||
|
||||
|
@ -1527,7 +1586,7 @@
|
|||
<fcs_function name="fbw/yaw/rudder-nul">
|
||||
<function>
|
||||
<table>
|
||||
<independentVar lookup="row">/controls/flight/rudder</independentVar>
|
||||
<independentVar lookup="row">fbw/sidestick/yaw-input</independentVar>
|
||||
<independentVar lookup="column">fbw/fmgc/enabled</independentVar>
|
||||
<tableData>
|
||||
0 1
|
||||
|
@ -1647,7 +1706,7 @@
|
|||
</switch>
|
||||
|
||||
<lag_filter name="fbw/rudder-pedal">
|
||||
<input>/controls/flight/rudder</input>
|
||||
<input>fbw/sidestick/yaw-input</input>
|
||||
<c1>20</c1>
|
||||
</lag_filter>
|
||||
|
||||
|
|
|
@ -942,14 +942,14 @@
|
|||
<channel name="Tiller">
|
||||
|
||||
<switch name="/controls/gear/steering-switched">
|
||||
<default value="/controls/flight/rudder"/>
|
||||
<default value="fbw/sidestick/yaw-input"/>
|
||||
<test value="0">
|
||||
/gear/gear[0]/wow ne 1
|
||||
</test>
|
||||
<test value="/controls/gear/steering">
|
||||
/systems/acconfig/options/seperate-tiller-axis eq 1
|
||||
</test>
|
||||
<test value="/controls/flight/aileron">
|
||||
<test value="fbw/sidestick/roll-input">
|
||||
/controls/flight/aileron-drives-tiller eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
@ -1003,8 +1003,8 @@
|
|||
</scheduled_gain>
|
||||
|
||||
<switch name="hydraulics/tiller/rudder-cmd-input">
|
||||
<default value="/controls/flight/rudder"/>
|
||||
<test value="/controls/flight/aileron">
|
||||
<default value="fbw/sidestick/yaw-input"/>
|
||||
<test value="fbw/sidestick/roll-input">
|
||||
/controls/flight/aileron-drives-tiller eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
|
Loading…
Add table
Reference in a new issue