|
From: David C. <dco...@ma...> - 2021-09-02 14:06:40
|
Hi James, Thanks for the response! You are correct the FDM would be in Simulink, so we would primarily be using flight gear as a visualization platform. I think the main use case would be that Simulink has the position and rotation, velocity, etc. of N aircraft at time t, and we just want send that position and rotation data to FlightGear to update the visuals. Having finer-grained visuals like gear deployment and control surface deflection for all N aircraft might be a nice to have, but not really necessary. The AI traffic idea is a great one! I did not realize the AI traffic was being received through a socket. Because Simulink would be handling all of the dynamics modeling, I think this path forward would be viable as we wouldn't need fine-grained switching of automated to manual control. Just to send packets of N aircraft to the fgfs. Is there some reference material of the packet information for the AI aircraft / what it would take to inject packets from Simulink to FlightGear AI models? I'm experienced with the main aircraft net_fdm packeting, but not with the AI aircraft. Best, David From: James Turner <ja...@fl...> Sent: Wednesday, September 1, 2021 5:36 AM To: FG Developers List <fli...@li...> Subject: Re: [Flightgear-devel] FlightGear Headless Mode On 31 Aug 2021, at 13:23, David Coventry <dco...@ma...<mailto:dco...@ma...>> wrote: I'm a developer for the Aerospace Toolbox and Blockset at Mathworks, and one of my tasks is extending the current FlightGear interface including the Aero.FlightGearAnimation object and the network FDM Simulink blocks. Hi David, and thanks for getting in touch with us. One of the features I would like to take advantage of is the multiplayer capability where a user might have N number of aircraft simulating or playing back simultaneously, such as a quadcopter swarm or chaser aircraft. For R2022a I have some hidden multiplayer support for the GenerateRunScript functionality, but the RAM usage of spawning N full flight gear instances on a single machine is definitely a limiting factor. I found this wiki article<https://wiki.flightgear.org/FlightGear_Headless> on enabling a headless mode which would definitely be helpful on this front, but I was curious if there was any additional information about this -headless parameter such as how to enable it and what its current status is for public release. I couldn't find any references to it in my searches through the flightgear src. Or if there is a person / mailing list more suited to this feature please let me know! And if there are any additional feature requests for MATLAB+Simulink and FlightGear I would love to hear them! Headless mode can do what you want, but you still pay the cost of rendering. It's more intended to disable blocking GUI, but still keep rendering output working. (It should maybe be called 'kiosk mode') What people have done is configure the system to then output to a tiny (1px square) window, so that rendering is very fast, but we have some coupling between scenery loading and the FDM (especially for collision detection) which means a pure headless mode needs some real hacking. (The problem is loading of scenery tiles is triggered by rendering, usually : to have collision queries trigger tile loading, in the absence of the render frame loop, is theoretically possible but needs a little bit of plumbing between the ground-cache and the tile loader I think). However, in your particular setup, the FDM is inside Simulink, I think: so this raises the possibility of using a single FlightGear instance, and having your simulated aircraft appear as 'AI' aircraft (which is what traffic and multiplayer use). This system of course already supports hundreds of aircraft models, receiving position/velocity updates from a socket, so in principle it could be a good fit, depending on what use cases you have in mind. If it's primarily using FlightGear as a visualisation platform, it should work well. But if you want to for example switch between manual control of differnet simulated aircraft, that would be much harder. (Since FG has a rather fixed notion of the primary aircraft compared to AI-defined ones) Kind regards, James |