Jump to: navigation, search

High-Level Architecture

5,326 bytes added, 20:51, 13 January 2017
{{Official Core Development Effort}}
{{infobox subsystem
==Federate Object Model==
A key part of the design is writing the Federation Object Model (FOM), which defines the objects and updated updates that are published by the RTI. While it might at first glance seem a good idea to use the FOM to share the internal property tree across multiple federates, this is probably the wrong way to use HLA as the granularity is too low <ref></ref><ref></ref><ref></ref> and it's likely to lead to synchonization issues . Instead , we'll need to make explicit decisions about the data models to communicate.
The FOM is a set of XML files in [ fgdata/HLA/]
The orientation data in the FOM (SGOrientationWGS84) are Quaternions ([]), and those are the i,j,k values. From memory, the orientation is relative to a earth-centered-frame, and there are functions in SimGear to convert to heading/pitch/roll in combination with the object's position.
<ref> {{cite web
| url =
| title = <nowiki>Re: HLA </nowiki>
| author = <nowiki>stuart</nowiki>
| date = Mar 21st, 2016
| added = Mar 21st, 2016
| script_version = 0.25
}}</ref> <ref>{{cite web
| url =
| title = <nowiki>Re: [Flightgear-devel] HLA</nowiki>
| author = <nowiki>Stuart Buchanan</nowiki>
| date = Mar 24th, 2016
| added = Mar 24th, 2016
| script_version = 0.25
Richard's [[Emesary]] system would also probably work quite well with the HLA FOM to give us a way for models to communicate with other models.<ref> {{cite web
| url =
| title = <nowiki>[Flightgear-devel] Message passing interface for Nasal</nowiki>
| author = <nowiki>Richard Harrison</nowiki>
| date = Apr 1st, 2016
| added = Apr 1st, 2016
| script_version = 0.25
Federates can be written in most languages, but SimKit provides very good hooks for writing them in C++ and Python.
For some Subsystems split off from the existing FlightGear source, it's fairly easy to create an executable with its own property tree<ref></ref> and have shared C++ code to map FOM objects to property values. However, this is an implementation detail - the whole point of HLA and the FOM is that it makes no assumptions about what Federates do with the data.
Regarding weather, in a HLA/RTI context the way to do this would be to have a weather engine as an RTI Federate. This would run any required weather simulation, and pass (very) local weather conditions to each of the aircraft/tower/windsock in the simulation, plus publish position information on clouds for use by visualiation engines.<ref>{{cite web
|url =
|title = <nowiki> Re: [Flightgear-devel] Traffic 2020: Towards a new Development
Model for FlightGear AI Traffic </nowiki>
|author = <nowiki> Stuart Buchanan </nowiki>
|date = Jan 10th, 2017
|added = Jan 10th, 2017
|script_version = 0.40
==Current Status ==
Last updated: (1913/0201/20162017Stuart is cautiously optimistic that he may be able to provide the start of a HLA implementation quite soon, as one of the blocking factors may be resolved soon.<ref>{{cite web |url = |title = <nowiki> Re: [Flightgear-devel] Traffic 2020: Towards a new Development Model for FlightGear AI Traffic </nowiki> |author = <nowiki> Stuart Buchanan </nowiki> |date = Jan 10th, 2017 |added = Jan 10th, 2017 |script_version = 0.40 }}</ref> 
Currently, there is some very old HLA support in SimGear. This is very out of date and should be ignored.
Stuart has HLA Support support using the latest OpenRTI and SimKit working on a local build, but is waiting for Mathias to officially publish his SimKit before he pushes his changes. So all of the following is local-only, but included here for information.
The Flightgear core currently supports HLA as follows.
* SimKit integration, reading the SimKit FOM and connecting to an OpenRTI RTI.
* Instantiating MP AI objects so users can view objects published over the RTI by other Federates. This is currently somewhat unsatisfactory as it overloads the MP code, where really these objects are more basic.
* Pick up Environment Objects for this instance and use them to set the local METAR string for weather generation.
{{See also|FGTraffic}}
We currently have the following other Federates:
* '''fgogel ''' - An AI model written in python the publishes over to the RTI. Part of SimKit, but handy nevertheless!* '''fgtraffic ''' - to run an AI Scenario externally to the FG Core* '''fgmetar ''' - written in python that retrieves the closest METAR station for other published Federates and publishes the METAR for them to pick up. This could be expanded to provide [[FGPythonSys#Weather_Simulation|a general Weather Engine]]. Stuart now has the [[AI]] Manager working as an external binary, and publishing updates over the RTI which are displayed as MP Aircraft. Stuart has created a little python script that looks for objects with locations being published over the RTI and publishes the closest METAR to them, then modified FG to pick up the appropriate METAR string for this instance and use it as the real-time input for weather generation.
Separately, Erik has been doing some preparatory The python script could be fairly easily enhanced into a more substantial weather engine allowing a single coherent weather environment to be used across the simulation. Stuart also started work suitable for supporting HLA in JSBSim (modifying [[FGViewer]] so that it works with SimKit. This is a fairly big deal and quite a bit of fairly dull plumbing work but would allow us at least have a view of the simulation entirely separate from the running simulation. <ref> {{cite web | url = | title = <nowiki>[Flightgear-devel] HLA Status Update 23/2/2016</nowiki> | author = <nowiki>Stuart Buchanan</nowiki> | date = Feb 23rd, 2016 | added = Feb 23rd, 2016 | script_version = 0.25 }}</)ref>
Separately, Erik has been doing some preparatory work suitable for supporting HLA in JSBSim by adopting so called PropertyObjects to hopefully get rid of tied properties (
== Related ==
For additional information, please see:
* [[Technical_Reports#A_New_Architecture_for_FlightGear_Flight_Simulator]]
* [[Decoupling the AI Traffic System]] (currently work-in progress, highlights the limitations of the current AI system related to distributed/multi-instance and multiplayer usage)
* [[FlightGear HLA support (High Level Architecture)]] (outdated, documenting the original HLA infrastructure code)
* [[FlightGear CIGI Support (Common Image Generator Interface)]].
* [[Modularizing, parallelizing and distributing FlightGear]] (background info/discussions pre-dating HLA adoption in FlightGear)
* [[Distributed Interactive Simulation]] (DIS specific review of the FlightGear multiplayer system/protocol and its limitations, which can be addressed via HLA)
== External links ==

Navigation menu