Flightplan XML formats: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Created page with "FlightGear can use '''flightplans''' stored in property-list xml files. == Property-list format == <syntaxhighlight lang="xml"> <?xml version="1.0"?> <PropertyList> <flight...")
 
(→‎Source code: Apparently flightlgear/Navaids/FlightPlan.cxx is not specific to AI flightplans)
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
FlightGear can use '''flightplans''' stored in property-list xml files.
FlightGear use a few different '''flightplan XML formats''' stored in property-list xml files.  Due to different needs the flightplans used in the route manager and AI scenarios and have different formats.


== Property-list format ==
== AI flightplans ==
{{see also|AI Scenarios#Flightplans and Their Waypoints|AI groundvehicles#The flightplan}}
 
These flightplans contain only waypoints.  By tying an AI flightplan to an AI model in a scenario xml file, an AI scenario will be created.
 
=== Waypoint tags ===
Each waypoint can contain the following tags:
{| class="wikitable"
! Tag !! Type !! Use !! Remarks
|-
| <code>&lt;name&gt;</code> || string || Waypoint name || The last waypoint use <code>EOF</code>, or if the AI model is to be deleted <code>END</code>.
|-
| <code>&lt;lat&gt;</code> || double || Latitude, decimal degrees ||
|-
| <code>&lt;lon&gt;</code> || double || Longitude, decimal degrees ||
|-
| <code>&lt;alt&gt;</code> || double || Altitude above mean sea level, feet ||
|-
| <code>&lt;crossat&gt;</code> || double || Crossing altitude, feet ||
|-
| <code>&lt;ktas&gt;</code> || double || True air speed, knots ||
|-
| <code>&lt;on-ground&gt;</code> || bool || Set to <code>true</code> or <code>1</code> if on ground
 
Set to <code>false</code> or <code>0</code> if in air or in a tunnel
|
|-
| <code>&lt;gear-down&gt;</code> || double || <code>true</code> for gear down
 
<code>false</code> for gear up
| Or any number between 0 and 1
|-
| <code>&lt;flaps-down&gt;</code> || double || <code>true</code> for flaps down
 
<code>false</code> for flaps up
| Or any number between 0 and 1
|}
 
=== Example ===
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<?xml version="1.0"?>
<?xml version="1.0"?>
<PropertyList>
<PropertyList>
   <flightplan>
   <flightplan>
    <wpt>
      <name>First!</name>
      <lat>53.6762</lat>
      <lon>-1.39984</lon>
      <alt>1000</alt>
      <ktas>120</ktas>
      <on-ground>false</on-ground>
      <gear-down>1</gear-down>
      <flaps-down>0.25</flaps-down>
    </wpt>
     ...
     ...
    <wpt>
      <name>END</name>
    </wpt>
   </flightplan>
   </flightplan>
</PropertyList>
</PropertyList>
</syntaxhighlight>
</syntaxhighlight>


=== AI Flightplans ===
== Route manager flightplans ==
Each waypoint can contain the following tags:
:''See also [[Route manager#Defining a Route]].''
* <tt>'''<name>'''</tt> - Waypoint name, if END AI model is deleted
 
* <tt>'''<lat>'''</tt> - Latitude, decimal degrees
Route manager waypoints are a bit more complex, for starters they contain departure and destination information and not just one type of waypoint.
* <tt>'''<lon>'''</tt> - Longitude, decimal degrees
 
* <tt>'''<alt>'''</tt> - Altitude above mean sea level, feet
Note that the first and last waypoint are the departure and destination airports.
* <tt>'''<crossat>'''</tt> - Crossing altitude, feet
 
* <tt>'''<ktas>'''</tt> - Knots true air speed
There is also support for Level-D 767 SID:s and STAR:s in FlightGear.
* <tt>'''<on-ground>'''</tt> - True if on ground, if in air or in a tunnel set to false
 
* <tt>'''<gear-down>'''</tt> - True for gear down, false for gear up
=== Departure and destination tags ===
* <tt>'''<flaps-down>'''</tt> - True for flaps down, false for flaps up
{| class="wikitable"
! Tag !! Type !! Use !! Remarks
|-
| <code>&lt;airport&gt;</code> || string || The ICAO identifier of the airport ||
|-
| <code>&lt;sid&gt;</code> || string || Any available SID ||
|-
| <code>&lt;star&gt;</code> || string || Any available STAR ||
|-
| <code>&lt;transition&gt;</code> || string ||  ||
|-
| <code>&lt;runway&gt;</code> || string || Departure or destination runway ||
|}


<syntaxhighlight lang="xml">
=== Waypoint types and tags ===
    <wpt>
{| class="wikitable"
      <name>1</name>
! Tag !! Type !! Use !! Remarks
      <lat>53.6762</lat>
|-
      <lon>-1.39984</lon>
| <code>&lt;type&gt;</code> || string || Type of waypoint. Either <code>runway</code>, <code>navaid</code> or <code>offset-navaid</code> ||
      <alt>51.9773</alt>
|-
      <ktas>10</ktas>
| <code>&lt;alt-restrict&gt;</code> || string ||  ||
      <on-ground>true</on-ground>
|-
    </wpt>
| <code>&lt;altitude-ft&gt;</code> || double || Altitude in feet ||
</syntaxhighlight>
|-
| <code>&lt;ident&gt;</code> || string || If <code>&lt;type&gt;</code> is
: <code>runway</code>:  The departure or destination airport's runway number. Accompanied in the waypoint by the <code>&lt;icao&gt;</code> tag.
: <code>navaid</code>:  Any significant point along the route. Both airports, navaids and fixes.
: <code>offset-navaid</code>:  An point offset from a navaid by a bearing and distance. Note that true bearings are used here.
|
|-
| <code>&lt;icao&gt;</code> || string || ICAO code of an airport || Used only if <code>&lt;type&gt;</code> is <code>runway</code>
|-
| <code>&lt;lon&gt;</code> || double || Longitude of the waypoint in decimal degrees ||
|-
| <code>&lt;lat&gt;</code> || double || Latitude of the waypoint in decimal degrees ||
|-
| <code>&lt;radial-deg&gt;</code> || double || True bearing from a navaid, fix or airport || {{inote|Radials on charts are magnetic!}}
|-
| <code>&lt;distance-nm&gt;</code> || double || Distance from a navaid, fix or airport ||
|}


=== Example ===
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
    <wpt>
<?xml version="1.0"?>
      <name>2</name>
      <lat>53.6761</lat>
      <lon>-1.40056</lon>
      <alt>52.199</alt>
      <ktas>20</ktas>
      <on-ground>false</on-ground>
    </wpt>
</syntaxhighlight>


<syntaxhighlight lang="xml">
<PropertyList>
     <wpt>
  <version type="int">2</version>
       <name>END</name>
  <departure>
     </wpt>
    <airport type="string">KOAK</airport>
    <sid type="string">(none)</sid>
    <runway type="string">29</runway>
  </departure>
  <destination>
    <airport type="string">KSJC</airport>
    <star type="string">(none)</star>
    <transition type="string"></transition>
    <runway type="string">11</runway>
  </destination>
  <route>
    <wp>
      <type type="string">runway</type>
      <departure type="bool">true</departure>
      <generated type="bool">true</generated>
      <ident type="string">29</ident>
      <icao type="string">KOAK</icao>
    </wp>
    <wp n="1">
      <type type="string">offset-navaid</type>
      <alt-restrict type="string">at</alt-restrict>
      <altitude-ft type="double">7500</altitude-ft>
      <ident type="string">SFO</ident>
      <lon type="double">-122.3738889</lon>
      <lat type="double">37.61947222</lat>
      <radial-deg type="double">88.22972768</radial-deg>
      <distance-nm type="double">16</distance-nm>
    </wp>
     <wp n="2">
      <type type="string">navaid</type>
       <alt-restrict type="string">at</alt-restrict>
      <altitude-ft type="double">10000</altitude-ft>
      <ident type="string">MISON</ident>
      <lon type="double">-121.890306</lon>
      <lat type="double">37.496806</lat>
    </wp>
    <wp n="3">
      <type type="string">runway</type>
      <arrival type="bool">true</arrival>
      <generated type="bool">true</generated>
      <ident type="string">11</ident>
      <icao type="string">KSJC</icao>
     </wp>
  </route>
</PropertyList>
</syntaxhighlight>
</syntaxhighlight>


== Using the flightplans in FlightGear ==
== Using the flightplans in FlightGear ==
=== Through the route manager ===
=== Through the route manager ===
{{main article|Route manager}}


=== For AI models ===
=== For AI models ===
{{main article|AI Systems#AI Models}}
{{main article|AI Systems#AI Models}}


== Related pages ==
== Related content ==
=== Wiki articles ===
* [[Howto:Add procedures to the route manager]]
* [[AI Systems]]
* [[AI Systems]]
* [[UFO from the 'White Project' of the UNESCO]]
* [[Howto:Create a flightplan]] – Contains no information whatsoever on using flightplans in FlightGear though.
* [[AI Traffic#An example of a traffic file]] – Not flightplans per see as they only cover cruise altitude and departure and destination airport.
* [[List of Nasal extension functions#flightplan()]]
* [[List of Nasal extension functions#flightplan()]]
* [[Nasal Flightplan]]
* [[Nasal Flightplan]]
* [[PropertyList XML File]]
* [[PropertyList XML File]]
* [[Howto:Create a flightplan]], contains no information whatsoever on using flightplans in FlightGear though.
* [[UFO from the 'White Project' of the UNESCO]]
 
=== Source code ===
* {{flightgear source|src/Navaids/FlightPlan.hxx}}
* {{flightgear source|src/Navaids/FlightPlan.cxx}}
 
==== AI flightplans ====
* {{flightgear source|src/AIModel/AIFlightPlan.hxx}}
* {{flightgear source|src/AIModel/AIFlightPlan.cxx}}
 
==== Route manager flightplans ====
* {{flightgear source|src/Autopilot/route_mgr.hxx}}
* {{flightgear source|src/Autopilot/route_mgr.cxx}}
 
[[Category:XML]]
[[Category:AI Traffic]]
[[Category:Autoflight]]

Latest revision as of 18:22, 9 March 2024

FlightGear use a few different flightplan XML formats stored in property-list xml files. Due to different needs the flightplans used in the route manager and AI scenarios and have different formats.

AI flightplans

These flightplans contain only waypoints. By tying an AI flightplan to an AI model in a scenario xml file, an AI scenario will be created.

Waypoint tags

Each waypoint can contain the following tags:

Tag Type Use Remarks
<name> string Waypoint name The last waypoint use EOF, or if the AI model is to be deleted END.
<lat> double Latitude, decimal degrees
<lon> double Longitude, decimal degrees
<alt> double Altitude above mean sea level, feet
<crossat> double Crossing altitude, feet
<ktas> double True air speed, knots
<on-ground> bool Set to true or 1 if on ground

Set to false or 0 if in air or in a tunnel

<gear-down> double true for gear down

false for gear up

Or any number between 0 and 1
<flaps-down> double true for flaps down

false for flaps up

Or any number between 0 and 1

Example

<?xml version="1.0"?>
<PropertyList>
  <flightplan>
    <wpt>
      <name>First!</name>
      <lat>53.6762</lat>
      <lon>-1.39984</lon>
      <alt>1000</alt>
      <ktas>120</ktas>
      <on-ground>false</on-ground>
      <gear-down>1</gear-down>
      <flaps-down>0.25</flaps-down>
    </wpt>
    ...
    <wpt>
      <name>END</name>
    </wpt>
  </flightplan>
</PropertyList>

Route manager flightplans

See also Route manager#Defining a Route.

Route manager waypoints are a bit more complex, for starters they contain departure and destination information and not just one type of waypoint.

Note that the first and last waypoint are the departure and destination airports.

There is also support for Level-D 767 SID:s and STAR:s in FlightGear.

Departure and destination tags

Tag Type Use Remarks
<airport> string The ICAO identifier of the airport
<sid> string Any available SID
<star> string Any available STAR
<transition> string
<runway> string Departure or destination runway

Waypoint types and tags

Tag Type Use Remarks
<type> string Type of waypoint. Either runway, navaid or offset-navaid
<alt-restrict> string
<altitude-ft> double Altitude in feet
<ident> string If <type> is
runway: The departure or destination airport's runway number. Accompanied in the waypoint by the <icao> tag.
navaid: Any significant point along the route. Both airports, navaids and fixes.
offset-navaid: An point offset from a navaid by a bearing and distance. Note that true bearings are used here.
<icao> string ICAO code of an airport Used only if <type> is runway
<lon> double Longitude of the waypoint in decimal degrees
<lat> double Latitude of the waypoint in decimal degrees
<radial-deg> double True bearing from a navaid, fix or airport Note Radials on charts are magnetic!
<distance-nm> double Distance from a navaid, fix or airport

Example

<?xml version="1.0"?>

<PropertyList>
  <version type="int">2</version>
  <departure>
    <airport type="string">KOAK</airport>
    <sid type="string">(none)</sid>
    <runway type="string">29</runway>
  </departure>
  <destination>
    <airport type="string">KSJC</airport>
    <star type="string">(none)</star>
    <transition type="string"></transition>
    <runway type="string">11</runway>
  </destination>
  <route>
    <wp>
      <type type="string">runway</type>
      <departure type="bool">true</departure>
      <generated type="bool">true</generated>
      <ident type="string">29</ident>
      <icao type="string">KOAK</icao>
    </wp>
    <wp n="1">
      <type type="string">offset-navaid</type>
      <alt-restrict type="string">at</alt-restrict>
      <altitude-ft type="double">7500</altitude-ft>
      <ident type="string">SFO</ident>
      <lon type="double">-122.3738889</lon>
      <lat type="double">37.61947222</lat>
      <radial-deg type="double">88.22972768</radial-deg>
      <distance-nm type="double">16</distance-nm>
    </wp>
    <wp n="2">
      <type type="string">navaid</type>
      <alt-restrict type="string">at</alt-restrict>
      <altitude-ft type="double">10000</altitude-ft>
      <ident type="string">MISON</ident>
      <lon type="double">-121.890306</lon>
      <lat type="double">37.496806</lat>
    </wp>
    <wp n="3">
      <type type="string">runway</type>
      <arrival type="bool">true</arrival>
      <generated type="bool">true</generated>
      <ident type="string">11</ident>
      <icao type="string">KSJC</icao>
    </wp>
  </route>
</PropertyList>

Using the flightplans in FlightGear

Through the route manager

1rightarrow.png See Route manager for the main article about this subject.

For AI models

1rightarrow.png See AI Systems#AI Models for the main article about this subject.

Related content

Wiki articles

Source code

AI flightplans

Route manager flightplans