FlightGear Simulator & FlightGear Interface



FlightGear Interface

FlightGear Interface is a small UDP listener written in C# that provides functionality to receive datagrams sent from the FlightGear through an UDP socket. To get this interface working, you have to:

  1. Extend basic UDPListener class and override ProcessFrame method
  2. Create an instance of your listener and bind it to a port
  3. Create an XML protocol definition file and specify variables for FlightGear to send through the UDP socket (list of all variables Property Tree/Reference) Show
    <?xml version="1.0"?>
  4. Run the FlightGear with a -generic argument like this:
    fgfs.exe –fg-root=”..\..\data” –generic=socket,out,10,localhost,1234,udp,myprotocol
    • 10 specifies how many times per second will FlightGear send the datagrams
    • localhost is the hostname to send the datagrams to
    • 1234 is your port number that you binded your listener to
    • myprotocol is the name of XML definition file without .xml extension

FlightGear Simulator

FlightGear Simulator is a stantalone application which uses the process described above to receive and process the datagrams from FlightGear and display it to the user via the instruments pane (simulates basic aircraft controls) and the map view (shows the location of an aircraft using GPS data from FlightGear). The processing of the incoming datagrams takes place in an external plugin (a Dll file which gets loaded when the simulation begins). The default plugin supplied with FG Simulator expects a Lua file to be present in the working directory so that when a new datagram is received, a Lua function is called and processes the input data and optionally sets the output data (flaps, engine throttles, breaks, gear and lights).