AI Systems: Difference between revisions

Jump to navigation Jump to search
m
wikilinks added
m (wikilinks added)
Line 1: Line 1:
== ATC ==
== ATC ==
 
[[FlightGear]] has a simple [[ATC|Air Traffic Control]] system.
FlightGear has a simple Air Traffic Control system.


For airports with a tower frequency, if that frequency is tuned in to your radio, you may contact ATC.
For airports with a tower frequency, if that frequency is tuned in to your radio, you may contact ATC.


To obtain the tower frequencies for an airport within range of ATC, go to the ATC/AI menu, choose Frequencies to display the dialog. If there are any airports within 40nm range, a button with the airport designation will appear. Click see the frequencies. Tune the tower frequency in on the COM1 radio and then hit the single quote key to open the ATC window.
To obtain the tower frequencies for an airport within range of ATC, go to the ATC/AI menu, choose Frequencies to display the dialog. If there are any airports within 40nm range, a button with the airport designation will appear. Click see the frequencies. Tune the tower frequency in on the COM1 radio and then hit the single quote key to open the ATC window.


Points:
Points:
* Untowered airports are not supported in any way by ATC.
* Untowered airports are not supported in any way by ATC.
* You must be within 40 nautical miles of an ATC facility (towered airport with tower frequencies) to contact ATC.
* You must be within 40 nautical miles of an ATC facility (towered airport with tower frequencies) to contact ATC.


== AI Air Traffic ==
== AI Air Traffic ==
 
'''See:''' [[Interactive Traffic]]
Todo
 
Add a space in the wiki to mak a AI repository to cut and paste new AI sceneries.


== AI Models ==
== AI Models ==
 
Starting with FlightGear version 0.9.4 you can place AI objects in the "FlightGear world". In version 0.9.4 the AI objects can be defined in the preferences.xml file, or in an airplane's *-set.xml file. In later versions they are defined in a "scenario file" only. The types of AI objects you can have are airplanes, ships, thunderstorms, thermals/sinks, static and ballistic objects. AI objects have some things in common: The have a location in the "FlightGear world", they can have an associated exterior 3D model, and they can move according to an internal [[FDM]] (flight dynamics model). As of now, these objects are created at simulator start-up by adding some XML code to a scenario file. The scenario file must be in the data/AI directory. You select which scenario files you want to use by naming it in the preferences.xml file. The preferences.xml file has an entry that looks like this (FlightGear versions newer than 0.9.4, including CVS):  
Starting with FlightGear version 0.9.4 you can place AI objects in the "FlightGear world". In version 0.9.4 the AI objects can be defined in the preferences.xml file, or in an airplane's *-set.xml file. In later versions they are defined in a "scenario file" only. The types of AI objects you can have are airplanes, ships, thunderstorms, thermals/sinks, static and ballistic objects. AI objects have some things in common: The have a location in the "FlightGear world", they can have an associated exterior 3D model, and they can move according to an internal FDM (flight dynamics model). As of now, these objects are created at simulator start-up by adding some XML code to a scenario file. The scenario file must be in the data/AI directory. You select which scenario files you want to use by naming it in the preferences.xml file. The preferences.xml file has an entry that looks like this (FlightGear versions newer than 0.9.4, including CVS):  


  <AI>
  <AI>
Line 30: Line 22:


The above bit of XML enables the AI system and selects a scenario file called aircraft_demo.xml.
The above bit of XML enables the AI system and selects a scenario file called aircraft_demo.xml.


The scenario file contains one entry for each AI object. The entry specifies what kind of object to create, what its initial conditions will be, and optionally (for aircraft and ships) a flight plan. The entry for a sailboat could look like this:
The scenario file contains one entry for each AI object. The entry specifies what kind of object to create, what its initial conditions will be, and optionally (for aircraft and ships) a flight plan. The entry for a sailboat could look like this:
Line 59: Line 50:
   <BANK type="double">-15.0</BANK>
   <BANK type="double">-15.0</BANK>
  </ENTRY>
  </ENTRY>


It looks much the same as the ship AI code. There are two differences, the <CLASS> item and the <BANK> item. If the class is set to "tanker" the airplane will allow you to refuel if you can get close behind it.  The bank is of course similar to the ship's rudder. In the above example the A-4 will be orbiting to the left at 15 degrees of bank. You can also create a ship or airplane with a flight plan. In this case the object will follow the flight plan, and then delete itself when it reaches the end. The flight plans are kept in data/Data/AI/FlightPlans. To create an airplane with a flightplan do this:
It looks much the same as the ship AI code. There are two differences, the <CLASS> item and the <BANK> item. If the class is set to "tanker" the airplane will allow you to refuel if you can get close behind it.  The bank is of course similar to the ship's rudder. In the above example the A-4 will be orbiting to the left at 15 degrees of bank. You can also create a ship or airplane with a flight plan. In this case the object will follow the flight plan, and then delete itself when it reaches the end. The flight plans are kept in data/Data/AI/FlightPlans. To create an airplane with a flightplan do this:
Line 118: Line 107:


You can make your own AI scenario file, called say my_scenario.xml, and cut/paste entries from the other scenario files to build an AI scenario as complicated as you like.
You can make your own AI scenario file, called say my_scenario.xml, and cut/paste entries from the other scenario files to build an AI scenario as complicated as you like.


The following how-to shows you how to animate a tail-dragger airplane so that its pitch attitude looks proper for the AI aircraft's airpeed.  This is not needed for aircraft with tricycle landing gear.
The following how-to shows you how to animate a tail-dragger airplane so that its pitch attitude looks proper for the AI aircraft's airpeed.  This is not needed for aircraft with tricycle landing gear.


=== Using Interpolation Tables ===
=== Using Interpolation Tables ===
Interpolation tables are very handy for effecting animations that are non-linear in relation to the property they are referenced to.
Interpolation tables are very handy for effecting animations that are non-linear in relation to the property they are referenced to.


Line 172: Line 159:
| 45 KIAS
| 45 KIAS
|}
|}


'''Table IAS/flap extension'''
'''Table IAS/flap extension'''
Line 195: Line 180:
| 0
| 0
|}
|}


When the pilot extends the flaps "one notch" they will extend to "10°" etc. In the property tree, these 4 steps will typically be normalised to 0.00, 0.33, 0.66, 1.00.  This will differ from aircraft to aircraft. If the aircraft does not have equal extensions for each "notch" of flaps, the values observed may be; 0.00, 0.10, 0.30, 0.66, 1.00. Modeling this non-linear extension using "factor, offset, min/max" would be extremely difficult if not impossible. Modeling it using interpolation tables is very easy, as you shall see.
When the pilot extends the flaps "one notch" they will extend to "10°" etc. In the property tree, these 4 steps will typically be normalised to 0.00, 0.33, 0.66, 1.00.  This will differ from aircraft to aircraft. If the aircraft does not have equal extensions for each "notch" of flaps, the values observed may be; 0.00, 0.10, 0.30, 0.66, 1.00. Modeling this non-linear extension using "factor, offset, min/max" would be extremely difficult if not impossible. Modeling it using interpolation tables is very easy, as you shall see.
Line 269: Line 253:
| 0
| 0
|}
|}


this gives a stepped effect, where the movement is limited to 1knt of airspeed. That is the 3-D object will linearly move from 9° to 18° while the aircraft looses speed from 70 knots to 69 knots. This behaviour will make the need for an upper and lower limit of a stepped value obvious.
this gives a stepped effect, where the movement is limited to 1knt of airspeed. That is the 3-D object will linearly move from 9° to 18° while the aircraft looses speed from 70 knots to 69 knots. This behaviour will make the need for an upper and lower limit of a stepped value obvious.
Line 323: Line 304:


== Submodels ==
== Submodels ==
Submodels are AI ballistic objects that emanate from, fall from, or launch from the user aircraft.  They are presently used to model smoke, contrails, flares, tracers, bombs, drop tanks and flight path markers.  
Submodels are AI ballistic objects that emanate from, fall from, or launch from the user aircraft.  They are presently used to model smoke, contrails, flares, tracers, bombs, drop tanks and flight path markers.  


Submodels are controlled by the submodel manager.  The manager reads a submodel configuration file at the start of the sim session.  This configuration file is written by the aircraft author and defines all the submodels for that particular aircraft.
Submodels are controlled by the submodel manager.  The manager reads a submodel configuration file at the start of the sim session.  This configuration file is written by the aircraft author and defines all the submodels for that particular aircraft.


As an example examine the submodels file in the Aircraft/737-300 directory.  This file creates two submodels which will become the airplane's left and right engine contrails.  Each contrail needs its own submodel definition because the contrails begin at different locations.  Each contrail consists of a train of individual "puff" models that are released in rapid succession as long as the "trigger" property is true.  We ensure an unlimited supply of puffs by setting the "count" parameter to -1. The individual puffs, being AIBallistic objects, will follow their own ballistic paths once released.  In this case we have used the "bouyancy" parameter to negate gravity in the ballistic path.  The puffs have been given a life span of eight seconds.  At cruising speed the 737 will thus have about 400 puffs behind it at any moment.
As an example examine the submodels file in the Aircraft/737-300 directory.  This file creates two submodels which will become the airplane's left and right engine contrails.  Each contrail needs its own submodel definition because the contrails begin at different locations.  Each contrail consists of a train of individual "puff" models that are released in rapid succession as long as the "trigger" property is true.  We ensure an unlimited supply of puffs by setting the "count" parameter to -1. The individual puffs, being AIBallistic objects, will follow their own ballistic paths once released.  In this case we have used the "bouyancy" parameter to negate gravity in the ballistic path.  The puffs have been given a life span of eight seconds.  At cruising speed the [[Boeing 737|737]] will thus have about 400 puffs behind it at any moment.
 
==External links==
* [http://www.xs4all.nl/~dtalsma/flightgear.html The FlightGear AI aircraft download page]

Navigation menu