Board index FlightGear Support Multiplayer

Simulink, FlightGear, and Formation Flight  Topic is solved

Trouble getting online, setting up a server?
Forum rules
In order to help you, we need to know a lot of information. Make sure to include answers to at least the following questions in your initial post.

- what OS (Windows Xp/Vista, Mac etc.) are you running?
- what FlightGear version do you use?
- copy&paste your commandline.

Please, also see Requesting Technical Help.

Note: If you did not get a reponse, even after 7 days, you may want to check out the FlightGear mailing lists to ask your question there.

Re: Simulink, FlightGear, and Formation Flight

Postby Tomas » Sun Jun 11, 2017 9:50 am

After switching to another computer which has a independent video card, the quality of the output video is much better. The delay is within 40ms and the framerate is around 60Hz. And the lag setting for multiplay mode is used.

Here are two clips:
https://youtu.be/_df-Loo8QnA
https://youtu.be/B0nuUdXnkRI

For now, it's good enough. Thank you all the guys for you help.
Tomas
 
Posts: 9
Joined: Wed May 24, 2017 8:14 am

Re: Simulink, FlightGear, and Formation Flight

Postby jano » Wed Feb 14, 2018 3:35 pm

I'm surely a bit late :) , but the case you report was reported somes years ago, now i remember :)

from my understanding, it's basicaly because the way FG deal with the external input is a kind of successive "frozen" state, each being a received position, and it's not a plane having a linear velocity and a smooth sailing as in a "normal" FG session.

if you look at the ground from the plane view, you'll see a saccaded movement, ie the position doesn't change during a bunch of FG frame .

the solution is:
- to use the external input, and compute the plane's position each FG frame, from last received position and velocity,the same way it's done in aimp code, so a bit of c++ work is needed :)
- you need to cheat the mp protocol, to send packets with the same fdm states as received in input (optionnal).

an other way is to have simulink send directly the two planes positions as mp protocol paquets, and then you just have to do a run with the obs and follow the 2 planes, if you only need FG as a external visualisation tool.

or you can mix both, having two fg session receiving from simulink, the sending with mp protocol to a 3rd fg used to visualise, in this case you need to be sure the mp protocol use the fdm states provided by simulink (position, orientation, velocity and timestamp at minimum) to have coherent time-space relations.

The first part is in my long term todo list, but with my coding speed, there can be years before a fg integration :)

jano
jano
 
Posts: 221
Joined: Fri Nov 30, 2007 12:32 am
Location: france
Callsign: jano
Version: git
OS: debian SID

Re: Simulink, FlightGear, and Formation Flight

Postby Tomas » Tue Feb 27, 2018 11:52 am

jano wrote in Wed Feb 14, 2018 3:35 pm:I'm surely a bit late :) , but the case you report was reported somes years ago, now i remember :)

from my understanding, it's basicaly because the way FG deal with the external input is a kind of successive "frozen" state, each being a received position, and it's not a plane having a linear velocity and a smooth sailing as in a "normal" FG session.

if you look at the ground from the plane view, you'll see a saccaded movement, ie the position doesn't change during a bunch of FG frame .

the solution is:
- to use the external input, and compute the plane's position each FG frame, from last received position and velocity,the same way it's done in aimp code, so a bit of c++ work is needed :)
- you need to cheat the mp protocol, to send packets with the same fdm states as received in input (optionnal).

an other way is to have simulink send directly the two planes positions as mp protocol paquets, and then you just have to do a run with the obs and follow the 2 planes, if you only need FG as a external visualisation tool.

or you can mix both, having two fg session receiving from simulink, the sending with mp protocol to a 3rd fg used to visualise, in this case you need to be sure the mp protocol use the fdm states provided by simulink (position, orientation, velocity and timestamp at minimum) to have coherent time-space relations.

The first part is in my long term todo list, but with my coding speed, there can be years before a fg integration :)

jano


Thank you for your reply, Jano!

It took me a while to recall what I did and to figure out what your post means. Your explanation of the 'jitter' problem seems reasonable. And I believe your solutions will work.

Currently I am busy preparing my Ph.D. dissertation and don't have time to have another trial. Perhaps someone will bump into this issue in the future and this post will be helpful. :D
Tomas
 
Posts: 9
Joined: Wed May 24, 2017 8:14 am

Re: Simulink, FlightGear, and Formation Flight

Postby VM101 » Tue Jun 12, 2018 2:37 pm

hello jano, I am interested in the second method you mentioned about sending multiple airplane data to a single instance of fg (mp protocol packet) and visualize it as an external observer. Can you give me some hints on how to implement that?

I have poster an independent topic here: viewtopic.php?f=27&t=34378#p333226

Thanks
VM101
 
Posts: 2
Joined: Mon Jun 11, 2018 11:25 am

Previous

Return to Multiplayer

Who is online

Users browsing this forum: No registered users and 2 guests