AI Traffic: Difference between revisions

Jump to navigation Jump to search
143 bytes added ,  19 January 2009
Updated part of the documentation to reflect FlightGear 1.9.0
(Updated part of the documentation to reflect FlightGear 1.9.0)
Line 229: Line 229:


== Putting it all together: Including a traffic file ==
== Putting it all together: Including a traffic file ==
After creating a traffic file, all we need to do is make sure FlightGear knows how to use this. In the next few sections, I will explain how to do this.  
After creating a traffic file, all we need to do is make sure FlightGear knows how to use this. In earlier versions of FlightGear, this used to involve quite a bit of editing, because every file had to be referenced in a master traffic file, named fgtraffic.xml.


== fgtraffic.xml ==
Those days are gone, however, since FlightGear 1.0.0, when a directory scanning mechanism was put in place. Both flightgear 1.0.0., and 1.9.0 and beyond use this directory scanning mechanims, however, in order to separate between the traffic manager 1 format used by flightgear 1.0.0, and the traffic manager II format used by later versions, these files are located in two different locations. In flightgear 1.0.0, traffic files should be located in a subdirectory of the data/AI/Aircraft directory. For example, traffic for a Boeing 737 could be located in in an xml file in data/AI/Aircraft/737, and traffic for a 747 should be located in data/AI/Aircraft/747.
If you use a current version of FlightGear cvs HEAD/ OpenSceneGraph, activating traffic is easy: Just copy the traffic file into the same directory as where the AI aircraft file resides (for example: data/AI/Aircraft/737). If you use an older version, or if you use the PLIB based version of FlightGear, traffic can be activated according to the following instructions.


At startup, FlightGear (older versions, or CVS PLIB) reads a file called '''fgtraffic.xml'''. In order to let FlightGear use our newly built traffic file, all we need to do is add a reference to the new file. Suppose we saved our file as PH-KCA.xml, all that would be required would be to add the following line:
Since traffic files for FlightGear 1.9.0 are stricktly speaking no longer tied to one particular aircraft, or aircraft type, the traffic files were moved to a different directory, namely data/AI/Traffic. Again, the actual traffic files should be stored in a subdirectory one level below /AI/Traffic. In the demo that is provided with FlightGear 1.9.0, all traffic is organized by airline, and stored in a single letter directory. For example, KLM traffic can be found in data/AI/Traffic/K/KLM.xml, and United Airlines traffic is stored in data/AI/Traffic/U/UAL.xml. Although currently no formal definition exists for military or general aviation traffic, a similar scheme could be adapted. For instance, military traffic could be placed in data/AI/Traffic/mil/USAF.xml


<traffic include="<path>/PH-KCA.xml",  
== Tools ==
One major motivation for introducing the traffic manager II file format is to make it easier for FlightGear users to contribute to the traffic database. To further motivate this, some tools are currently in development that aim to make user interaction even easier. Although most of these tools are not ready for public use yet, it is probably worth mentioning some of these developments. First of all, the custrom scenery project is working on extending their scene model database to store traffic. A web based front end will allow users to enter their favorite flight, and thus collect an extensive amount of traffic data. Users will be able to download the collected results and place the downloaded files in their traffic directory.


where '''<path>''' is the directory where the file is located, relative to the main '''Traffic''' directory. For example, fgtraffic could look like this:
Secondly, the author of the traffic manager code has written some scripts, mainly for private usethat will allow one to input the flight data into a simple text format and then convert the resulting text file to xml. These scrips are not available yet, because they haven't been tested well enough for general use, but that is likely to change in the not too distant future.  
 
  <?xml version="1.0"?>
<trafficlist>
    <traffic include="KLM/KLM.xml"/>
    <traffic include="UAL/UAL.xml"/>
    <traffic include="general/KSFO/c172.xml"/>
</trafficlist>
 
== Organizing by airline ==
Although the example above works and is perfectly legal, I would prefer to see the individual files grouped together by airline and aircraft type. One way to do this is to organize files by airline and within each airline by aircraft type. For example, we could group all KLM flights together. Then we bundle these into a file called \verb|KLM.xml|, which would look like the following:
 
<?xml version="1.0"?>
<trafficlist>
    <airline include="KLM/MD11/MD11.xml"/>
</trafficlist>
 
This file currently contains only one line, which includes the '''MD11.xml''' group, but more could be added easily.
 
== Organizing by aircraft type ==
Finally, the '''MD11.xml''' file could look like this.
 
<trafficlist>
  <traffic include="KLM/MD11/PH-KCA.xml"/>
  <traffic include="KLM/MD11/PH-KCB.xml"/>
  <traffic include="KLM/MD11/PH-KCC.xml"/>
  <traffic include="KLM/MD11/PH-KCD.xml"/>
  <traffic include="KLM/MD11/PH-KCE.xml"/>
  <traffic include="KLM/MD11/PH-KCF.xml"/>
  <traffic include="KLM/MD11/PH-KCG.xml"/>
</trafficlist>
 
One final note on the organization of the schedules is that I'm consisdering changing the organization. In order to make the whole system more ''plug-and-play'' compatible, I'd like to add in the ability to drop traffic files right in a dedicated AI directory that FLightGear would automatically scan for new traffic files. Until those ideas are finally fleshed out, the current organisation is probably likely to stay in place.


'''Documentation updated until here.'''
== Ground networks: A technical perspective ==
== Ground networks: A technical perspective ==
AI aircraft pickup taxiway information from an xml file that resides in  
AI aircraft pickup taxiway information from an xml file that resides in  
117

edits

Navigation menu