Board index FlightGear Support Multiplayer

Visualize a Swarm of Quadcopters

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.

Visualize a Swarm of Quadcopters

Postby VM101 » Tue Jun 12, 2018 1:31 pm

I want to visualize a swarm of quadcopters using data generated in MATLAB/Simulink. The mp protocol allows to show only two planes at the same time, and is prone to jitter problem as discribed in this post: viewtopic.php?f=27&t=32246&hilit=simulink+flightgear+multiplayer&start=15.

It is possible in Simulink to send a single airplane data via UDP to fg (with the aerospace toolbox), but what I want is to send the position data of multiple airplanes to a single instance of fg. That could be done with the "mp protocol paquets" mentioned in the link above.

I need help on how to implement that, I have few knowledge on how to send data to fg and how the software interpret them.
Posts: 2
Joined: Mon Jun 11, 2018 10:25 am

Re: Visualize a Swarm of Quadcopters

Postby Johan G » Tue Jun 12, 2018 8:18 pm

I think these FlightGear wiki articles could be a good starting point (though I would guess some of them could be a bit old):
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)
Johan G
Posts: 6202
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: Visualize a Swarm of Quadcopters

Postby jano » Sun Oct 14, 2018 11:21 pm

hi VM101, and maybe a bit late ( i do a fg break between each winter and just started recently to see what i missed in the fg world :) )

to avoid the jitter problem and the need for one fg session for each copter, plus a mp server to set up, the best solution is to have the quadcopters as mpplanes in one single fg session, the difficulty is in the way to do it.

i see 3 ways:

-one is to have simulink send the copters position as mp paquet, the wiki page seems quite acurate for this and you can try to contact Richard who worked on the recent mp protocol code for pointers.
the minimum to send are:
a different callsign for each copter
other mandatory fields can be zeroed

- or you can make a piece of code who read the net_fdm udp paquets sent by simukink and convert them to mp protocol, and run it between simulink and fg.

- last, make fg read net_fdm paqets, and create mp plane with this. i don't know if a call sign is included in the net_fdm protocol, or if each copter need a different port ?

if the timestamps are in sync between the differents copters, there's a way to display them in sync in a fg session ( a git fg personnal branch WIP not ready for a real mp world, but the current code should be fine displaying the copters in sync, based on the timestamps provided. we did some try with zero lag last winter and that was good ! )

the velocity, rotationnal velocity and accelerations are only mandatory if you need a realtime display in FG, where they are used to predict the plane position a bit ahead of time, but if it's just to display the result, we don't need them as we interpolate between latest received positions.

maybe other can come up with different solutions?
Posts: 199
Joined: Thu Nov 29, 2007 11:32 pm
Location: france
Callsign: jano
Version: git
OS: debian SID

Return to Multiplayer

Who is online

Users browsing this forum: No registered users and 2 guests