Board index FlightGear Development

Send data to the FGMS without running FGFS

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

Send data to the FGMS without running FGFS

Postby Swiber » Tue Nov 29, 2016 10:12 am

Hello everyone,

I am wondering if it is possible to send data directly to the fmgs server without running a FlightGear instance. I have a code in C++ that can send several aircraft data (position, orientation,... ) to a specified IP address. So, can I just use the multiplayer protocol to send multiplayer messages to the server? Any ideas of how to do that?

Thank you!!
Swiber
 
Posts: 8
Joined: Tue Nov 08, 2016 12:50 am

Re: Send data to the FGMS without running FGFS

Postby PINTO » Tue Nov 29, 2016 11:10 am

Sure. Openradar and ATC-pie both do that. Here's the info on the packets: http://fgms.freeflightsim.org/developers_guide.html
Actively developing the MiG-21bis (github repo) (forum thread) (dev discord) (fg wiki)

http://opredflag.com is an active flightgear dogfighting community (using a system that isn’t bombable)
User avatar
PINTO
 
Posts: 966
Joined: Wed Oct 21, 2015 7:28 pm
Callsign: pinto
Version: stable
OS: Win10

Re: Send data to the FGMS without running FGFS

Postby Hooray » Tue Nov 29, 2016 8:22 pm

Subject: FGTraffic 2020: Road map for a new AI traffic system design

Hooray wrote:https://sourceforge.net/p/flightgear/mailman/message/35486799/
Durk wrote:I've just added a little module called fgtraffic, which doesn't do anything
except print "Hello World". But, it's an important first step to get some
experience with cmake and helps me to organize my thoughts about how to set
up a modular AI system.


Just briefly, I suggest to check out F-JJTH's original FGAIS code: http://wiki.flightgear.org/FGAIS
That code can already "inject" arbitrary traffic into fgms using the MP protocol, using a tiny subset of the whole protocol.

In addition, if your intention is to maintain compatibility with existing data files, you will sooner or later realize that you will inevitably also need access to certain FG subsystems - IcecodeGL ended up implementing a SimGear based SGApplication framework for his FGRadar client: http://wiki.flightgear.org/FGRadar

This whole thing works by setting up a single SGSubsystemMgr, so that you can directly reuse existing FG Subsystems (think properties, autopilot) without causing additional work.

Ultimately, this approach would mean that even things like tanker.nas or the Bombable addon (both of which are using your AI system) could be running in a standalone fashion if people really wanted to (in fact, SGApplication contains a stripped-down Nasal interpreter, too).

In the light of Mathias' and Stuart's ongoing HLA work, it would make sense to come up with an abstract base class/interface to encapsulate protocol specifics, i.e. something like "MPTransport" so that any new code does not contain hard-coded assumptions about the MP protocol being the only transport mechanism: http://wiki.flightgear.org/High-Level_A ... ent_Status
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: Send data to the FGMS without running FGFS

Postby Swiber » Thu Dec 01, 2016 11:57 pm

Cool, thanks! I will dig more into it and see if I can manage to work it out.
Swiber
 
Posts: 8
Joined: Tue Nov 08, 2016 12:50 am

Re: Send data to the FGMS without running FGFS

Postby Hooray » Sat Dec 03, 2016 11:41 am

Do a search for "mpdummy" - it's a standalone C++ program feeding traffic to fgms: https://gitlab.com/fgms/fgms-1-x/blob/m ... pdummy.cxx
http://wiki.flightgear.org/Multiplayer_protocol
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: Send data to the FGMS without running FGFS

Postby Swiber » Wed Jan 04, 2017 2:45 pm

Sorry, but I don't manage to make it work. How am I supposed to execute this mpdummy C++ program to send position data to the fgms? This is the only thing I need, a program that can be used to send position messages to the fgms. Could it be done only with this C++ code or do I need something else?
Swiber
 
Posts: 8
Joined: Tue Nov 08, 2016 12:50 am

Re: Send data to the FGMS without running FGFS

Postby Hooray » Wed Jan 04, 2017 8:01 pm

if I remember correctly, the mpdummy stuff should be self-contained, I think it's a part of the fgms code base (?)
If in doubt get in touch with the fgms folks, who are much more familiar with the fgms architecture.

Note that there are overlapping efforts, doing similar things - including a similar program written by Stuart using HLA to do pretty much the same thing via Python.
See the wiki's HLA article for details
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


Return to Development

Who is online

Users browsing this forum: No registered users and 6 guests