HLA Timeline

From FlightGear wiki
Jump to navigation Jump to search

2015

Cquote1.png Hi All, I've started looking at the HLA integration for FG, after some very useful discussion with Mathias Froehlich. This is just a note to say what I'm looking at and how I'm thinking of developing it. Any comments/advice is welcome - this is a new area for me. As background, we currently have a partial HLA implementation in SimGear which has a dependency on OpenRTI. As the name suggests, OpenRTI is an open-source RTI, which is developed by Mathias himself. This is all very well, but the HLA world has moved on since this code was written, and the code doesn't support some of the modern constructs. Mathias has been working on a toolkit that provides a lot of the "plumbing" required for a HLA client, in a much nicer package. This toolkit doesn't yet have a name, but would allow us to ditch most/all of the SimGear HLA code. (Note that like the current HLA dependency, this is completely optional and only required if one is compiling with the ENABLE_RTI boolean cmake option.) As a first use-case I expect to start looking at a very basic AI integration so other aircraft in the federation are displayed within FG. That doesn't really leverage the power of HLA, but should at least allow me to get to grips with the problems and architecture before moving onto more ambitious plans, including the Holy Grail of separating the viewer from the FDM. A lot of the challenge is likely to be in designing the data to be shared across the RTI, which I think will require a lot more thought than one might naively assume.
— Stuart Buchanan (Nov 6th, 2015). [Flightgear-devel] HLA developments.
(powered by Instant-Cquotes)
Cquote2.png
Screenshot showing HLA prototype at LOWI


Cquote1.png Here's an early update on where I've got to, and a request for help. I've successfully replaced the HLA implemented in SimGear with SimKit (the name of Mathias' abstracting layer). This has allowed me to replace ~ 17000 lines of code in simgear/flightgear with 500 in flightgear alone. I'll need some help with the cmake plumbing before it can be checked in. I've also successfully joined an OpenRTI HLA federation, and received updates from an external source, which are displayed as an MP aircraft in the property tree. Unfortunately, while I can see the /ai/multiplayer object being updated in the property tree, and indeed moving on the in-sim map, the model itself isn't being loaded for some reason. I've included the code snippet below which should be adding the object. I suspect I've got something subtly wrong, but haven't managed to work out what. Any help would be greatly appreciated.
— Stuart Buchanan (Nov 16th, 2015). Re: [Flightgear-devel] HLA developments.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png I managed to work out what I'd done wrong - I needed to pass the position information in as an external data structure (ExternalMotionInfo) rather than writing the properties directly. I may have also disabled AI models by mistake (thank to Hooray for reminding me to check that!). So, I've now got an external HLA Federate being displayed in FlightGear. The implementation right now is very basic - I have a KC-135 circling above LOWI at 10kts and 500ft AGL - but it's enough to build on. The next steps I'm planning are as follows: - Flesh out the Viewer Federate implementation, possibly to include mapping of HLA data to properties (not sure exactly how to do this yet). - Publish the FlightGear aircraft instance position to the RTI so it can be picked up by other viewers. - Create a Multiplayer Proxy as a Federate that proxies between the MP network and the RTI. This will run in a separate thread or as a separate executable. - Split out the traffic Manager in a similar way. This is obviously focussing on the viewer aspect, and doesn't address splitting out the FDM or control elements. If anyone has any comments or suggestions, I'd be very happy to receive them - this is very much an exploration for me and I'm only just working out the questions to ask, let alone the answers. Still, it's lots of fun :).
— Stuart Buchanan (Nov 17th, 2015). Re: [Flightgear-devel] HLA developments.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png I thought you might be interested in where I've managed to get with my HLA work. I now have FlightGear reading other aircraft in the RTI Federation (RTI speak for a simulation environment) and publishing it's own position information for other clients (in RTI known as Federates) to read. There's a screenshot showing it all here: http://www.nanjika.co.uk/flightgear/hla1.png There are a number of different components in play here: 1) A python script Federate which represents the KC-135 tanker. It publishes position updates a bit like we have for MP aircraft. 2) FlightGear itself as a Federate. It too is publishing position updates, but is also subscribing to updates and displaying them if appropriate. In this case it is displaying the KC-135 Federate. 3) A python script simulating a radar screen. This is receiving updates from both the KC-135 Federate and the FlightGear Federate and displaying them. The python scripts and all the clever stuff are courtesy of Mathias. The actual flightgear code changes amount to only 1.2kloc so far. I hope to be able to push some changes to flightgear soon.
— Stuart Buchanan (Dec 14th, 2015). [Flightgear-devel] HLA Update.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png I thought I should provide an update on where I've got to in HLA integration. I've managed to split the AI Manager out as a separate Federate and executable. So AI scenarios can now be run outside of FlightGear itself, and viewed within the FG instance. This took a little longer than expected, as I had to work out iteratively the minimal set of FG components required to successfully run the AI Manager. (James - when you get the chance we'll need the capability to to have two clients access the NavDB concurrently - I've hit lots of errors trying to do this) I expect that it will be fairly straightforward to extend this and run the TrafficManager as part of this Federate as well. My next step will be to spend some time fleshing out the data model (FOM) to provide equivalent function to a locally running AI Manager - so for example it is possible to launch from a carrier being run in a separate Federate. I also need to get the build changes sorted so this can be checked in, which has some external dependencies.
— Stuart Buchanan (Dec 29th, 2015). [Flightgear-devel] HLA Update.
(powered by Instant-Cquotes)
Cquote2.png