Board index FlightGear Support Interfacing

How can I activate all aircraft effects during simulation?

Connecting two computers, using generic protocol, connecting with Matlab?

How can I activate all aircraft effects during simulation?

Postby g_don.24 » Wed Jun 02, 2021 10:33 am

Hi to everyone!
I'm running some simulations by launching them from Simulink. So, the aircraft is frozen in a specific position in the scene and then, I press "play" button in simulink to start the simulation.
Is it possible to "activate" all the aircraft effects as the nozzles, the cockipt indicators, the sounds and so on in order to make the simulation more realistic?

I use FG 2020.3 and the Mig-29 downloaded inside the program from the default hangar.

Image

Image

EDIT: I've downloaded a customized aircraft version that seems to be very detailed:

Image

Image

Image

Here my settings in the .bat file:
Code: Select all
D:
cd D:\Programmi HDD\FlightGear 2020.3

SET FG_ROOT=D:\Programmi HDD\FlightGear 2020.3\data
.\\bin\fgfs --fg-aircraft=D:\FlightGear\Downloads\Aircraft_downloaded --aircraft=MiG-29_9-12 --fdm=null  --native-fdm=socket,in,30,localhost,5502,udp --enable-auto-coordination --fog-disable --enable-clouds3d --enable-specular-highlight --enable-sound --turbulence=0.0 --enable-random-objects --start-date-lat=2021:06:10:15:00:00  --in-air --enable-freeze --enable-terrasync --fg-scenery=D:\FlightGear\Downloads\TerraSync --terrasync-dir=D:\FlightGear\Downloads\TerraSync --lat=40.768304 --lon=14.351368 --units-meters --altitude=800 --heading=-30 --offset-distance=0 --prop:/sim/rendering/shaders/quality-level=8 --prop:/engines/engine0/running=true


Here the warnings that i get from the command window:
Image
Last edited by g_don.24 on Wed Jun 02, 2021 6:02 pm, edited 2 times in total.
g_don.24
 
Posts: 12
Joined: Sat May 15, 2021 12:57 pm

Re: How can I activate all aircraft effects during simulatio

Postby Johan G » Wed Jun 02, 2021 12:25 pm

g_don.24 wrote in Wed Jun 02, 2021 10:33 am:Is it possible to "activate" all the aircraft effects as the nozzles, the cockipt indicators, the sounds and so on in order to make the simulation more realistic?

It absolutely should be. How much work that would be depends on how much is animated on the model, and also on how Simulink and FlightGear communicate. Very likely you will have to extend the amount of information that is transferred by editing XML configuration files.

To get an idea of what key-value pair properties that are available in the property tree (in essence the backbone of FlightGear), press "/" to open the property browser dialog. Most of these you should be able to drive from Simulink (though use what you need, there are literally thousands).

Unfortunately I have no experience with Simulink so I do not know how it communicates with FlightGear.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6634
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: How can I activate all aircraft effects during simulatio

Postby g_don.24 » Wed Jun 02, 2021 2:26 pm

Thanks for your answer. To connect FG and simulink I use the following scheme in Simulink (it's a piece of my simulink project):

Image

Then I modify the .bat file to customize the FG simulation.
g_don.24
 
Posts: 12
Joined: Sat May 15, 2021 12:57 pm

Re: How can I activate all aircraft effects during simulatio

Postby Johan G » Thu Jun 03, 2021 12:11 pm

In the .bat file, is FlightGear given a "--generic" option? If so, it would also have a path to an XML file with the definition of the protocol used for communication. There could be other ways Simulink communicate with FlightGear though.

In any case there would most likely be a need to add the additional properties needed to drive the external model and instrument animations etc. that you mentioned earlier ("the aircraft effects") to both the Simulink and FlightGear configuration.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6634
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: How can I activate all aircraft effects during simulatio

Postby Hooray » Thu Jun 03, 2021 8:35 pm

that will require some tinkering: you will probably want to run the aircraft without simulink first, then see what's supported in terms of effects/animations and possibly create a replay/fgtape file - that way you can easily look up the corresponding properties.

The BAT file you have posted is disabling the internal FDM and using the native FDM mechanism, so it's pretty likely that the aircraft itself (its system) isn't fully aware what's going on - the people who developed it originally almost certainly didn't have access to simulink and may have never used the native-fdm mechanism, let alone tested your specific use-case.

running the aircraft in standalone mode, possibly in conjunction with multiplayer or replay, should give you a list of relevant properties that need to be monitored/sync'ed to also show the corresponding effects.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: How can I activate all aircraft effects during simulatio

Postby g_don.24 » Thu Jun 03, 2021 11:02 pm

Thanks very much guys! Forgive me but I'm a neophyte into the wonderful FG world. I managed to record a short FG run and this is the replay file:
https://ufile.io/6imt73sa

How can I exploit it to repoduce "aircraft effects" during a Simulink/FG simulation?
g_don.24
 
Posts: 12
Joined: Sat May 15, 2021 12:57 pm

Re: How can I activate all aircraft effects during simulatio

Postby Hooray » Fri Jun 04, 2021 5:02 am

The point was that if the replay contains animations that you want, those must be part of its configuration file.
In other words, multiplayer/replay also need to be explicitly configured for stuff like custom animations/effects to be properly sampled.

For details, check the wiki "fgtape" and $FG_ROOT/Docs/README.flightrecorder or the multiplayer docs.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: How can I activate all aircraft effects during simulatio

Postby g_don.24 » Wed Jun 09, 2021 1:45 pm

Hi guys, I cannot solve this problem. I tried to load the aircraft configuration file .xml that is contained in the aircraft installation folder:

Image

by using this command in the .bat file:
Code: Select all
 --generic=D:\FlightGear\Downloads\Aircraft_downloaded\MiG-29_9-12\MiG-29_9-12-set.xml


But the effects are not loaded into FG simulation launched via simulink.
g_don.24
 
Posts: 12
Joined: Sat May 15, 2021 12:57 pm

Re: How can I activate all aircraft effects during simulatio

Postby Johan G » Wed Jun 09, 2021 7:04 pm

g_don.24 wrote in Wed Jun 09, 2021 1:45 pm:I tried to load the aircraft configuration file .xml that is contained in the aircraft installation folder:
[...]
by using this command in the .bat file:
Code: Select all
 --generic=D:\FlightGear\Downloads\Aircraft_downloaded\MiG-29_9-12\MiG-29_9-12-set.xml

The --generic option is for the path to an XML file defining a generic protocol. The aircraft should go to --aircraft=MiG-29_9-12, in essence the <aircraft> part of the <aircraft>-set.xml file name.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6634
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: How can I activate all aircraft effects during simulatio

Postby g_don.24 » Wed Jun 09, 2021 11:09 pm

I've already loaded the aircraft (as shown in the first post of this discussion). My goal is to load also its features during the simulation, for example the nozzles "flames".
Image
P.s. I've obtained this image by running a simulation from FG, but I wish to obtain this by using my simulink project.
g_don.24
 
Posts: 12
Joined: Sat May 15, 2021 12:57 pm

Re: How can I activate all aircraft effects during simulatio

Postby AndersG » Thu Jun 10, 2021 7:51 am

Then you probably need to contact authors of that particular aircraft and hope to get some help. You will need to read and partly understand most of the XML and Nasal files in that aircraft.
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2527
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: How can I activate all aircraft effects during simulatio

Postby shausc » Mon Jan 16, 2023 3:18 pm

Hi,,

A complete newbie to Flight Gear and beginning to understand how it works. As a similar question to the original post, I call Flight Gear from the SIMULINK block "Flight Gear Preconfigured 6DoF Animation". This has 6 fixed inputs for Long, Lat, Href and the 3 Euler angles.

1. The simulation runs ok (except I'm missing sound). Can't see why it's not calling the *.wav files because the paths and conditions all appear to be satisfied in the *.xml files and paths. There is an error in calling the Nasal directory and permissions when I run the *.bat file. Could this be a reason ?

2. As a second question. Is there anyway of exporting more SIMULINK parameters into the Flight Gear simulation ? Specifically, I'm thinking of when I extend Landing Gear, Flaps or move control surface/inceptor - is there anyway of visualising the flap motion etc in Flight Gear from the event in SIMULINK given that there's only the 6 pre-defined inputs into the "Flight Gear Preconfigured 6DoF Animation" block ? As it stands any change in the state of these signals isnt reflected visually on the aircraft as their positions aren't inputs to the SIMULINK block

Any advice would be much appreciated. Cheers
shausc
 
Posts: 3
Joined: Sat Jan 14, 2023 12:21 am


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 2 guests