Howto:Implement pushback: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (Properties still need to be set to 0...)
(Systems/pushback.xml: simpler and declared required property)
Line 7: Line 7:
Create the following directory, if not present <tt>[[$FG_ROOT]]/Aircraft/.../Systems</tt> and create a file named pushback.xml with the following content:
Create the following directory, if not present <tt>[[$FG_ROOT]]/Aircraft/.../Systems</tt> and create a file named pushback.xml with the following content:


<?xml version='1.0' encoding='UTF-8' ?>
  <system name="pushback">
  <system name="pushback">
  <property>/sim/model/pushback/magnitude</property>
   <channel name="Pushback">
   <channel name="Pushback">
    <switch name="systems/pushback/force">
  <switch name="systems/pushback/linked">
      <default value="0"/>
    <default value="0"/>
      <test value="/sim/model/pushback/magnitude">
    <test logic="AND" value="1">
        /sim/model/pushback/position-norm gt 0.95
      /sim/model/pushback/position-norm == 1
        /gear/gear/wow == 1
      /gear/gear/wow == 1
        gear/unit[0]/wheel-speed-fps lt 500
    </test>
      </test>
  </switch>
      <output>external_reactions/pushback/magnitude</output>
    </switch>
  <switch name="systems/pushback/force">
    <default value="0"/>
    <test  logic="AND" value="/sim/model/pushback/magnitude">
      systems/pushback/linked == 1
      gear/unit[0]/wheel-speed-fps lt 500
    </test>
    <output>external_reactions/pushback/magnitude</output>
  </switch>
   </channel>
   </channel>
  </system>
  </system>

Revision as of 20:16, 5 May 2009

A KLM Boeing 747-400 ready for pushback at EHAM. This is the Goldhofert truck.

Currently, pushback is only used on JSBSim planes. It should be possible with YASim aswell, but it has never be done yet.

Please note: this system does not work over a multiplay network.

Systems/pushback.xml

Create the following directory, if not present $FG_ROOT/Aircraft/.../Systems and create a file named pushback.xml with the following content:

<?xml version='1.0' encoding='UTF-8' ?>
<system name="pushback">
 <property>/sim/model/pushback/magnitude</property>
 <channel name="Pushback">
   <switch name="systems/pushback/force">
     <default value="0"/>
     <test value="/sim/model/pushback/magnitude">
       /sim/model/pushback/position-norm gt 0.95
       /gear/gear/wow == 1
       gear/unit[0]/wheel-speed-fps lt 500
     </test>
     <output>external_reactions/pushback/magnitude</output>
   </switch>
 </channel>
</system>

.xml (FDM)

After the </propulsion> tag we add a reference to the pushback system:

 <system file="pushback"/>

And at the end of the FDM, the following is needed to attach the forces of the pushback to the aircraft. The location should be somewhere near the nose wheel of the aircraft (where the pushback truck is connected).

<external_reactions>

 <force name="pushback" frame="BODY">
  <location unit="IN">
   <x>  -139 </x>
   <y>    0.0 </y>
   <z>  -71.0 </z>
  </location>
  <direction>
   <x>1</x>
   <y>0</y>
   <z>0</z>
  </direction>
 </force>

</external_reactions>

-set.xml

Between the <model> tags in the -set.xml file we set three properties to false (0). Note: if the model tags are already there, you do no need to add them again. Just place the stuff between them. If you want the truck to be connected on startup, set linked and position-norm to 1. Note: if the model tags are already there, you do no need to add them again. Just place the stuff between them.

<model>

 <pushback>
  <magnitude>0</magnitude>
  <linked>0</linked>
  <position-norm>0</position-norm>
 </pushback>

</model>

Below the </sim> tag, we add our menu dialog. A generic one is available at $FG_ROOT/gui/Dialogs/pushback.xml. Add the following lines to include it in the Equipment menu of the aircraft. Note: if the menubar and default tags are already there, you do no need to add them again. Just place the stuff between them.

<menubar>
 <default>
    
  <menu n="5">
   <item n="10">
    <label>Pushback</label>
    <name>pushback</name>
    <binding>
     <command>dialog-show</command>
     <dialog-name>pushback</dialog-name>
    </binding>
   </item>
  </menu>

 </default>
</menubar>

Models/ .xml

In your planes model file, we add a reference to one of the generic pushback models, or a custom made truck, shipped with your plane. Edit the offsets to fit your plane; the z offset should be at ground level, while the x offset is at the nosewheel(center).

<model>
 <name>Pushback</name>
 <path>Models\Airport\Pushback\Goldhofert.xml</path>
 <offsets>
  <x-m>-25.0</x-m>
  <y-m>0</y-m>
  <z-m>-4.0</z-m>
 </offsets>
</model>