Board index FlightGear Support Interfacing

Fast communication

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

Fast communication

Postby kamikaze » Mon Nov 06, 2017 4:40 pm

Is there a way to communicate with FlightGear in a fast way? (real-time I would say) Current telnet interface is not very responsive. Is there a way to bind Python to FlightGear or something?
kamikaze
 
Posts: 7
Joined: Wed Mar 08, 2017 3:44 pm

Re: Fast communication

Postby CaptB » Mon Nov 06, 2017 6:46 pm

HLA probably.
Ongoing projects(3D modelling): A320, MD-11, A350, B767
FG767: https://fg767.wordpress.com/
CaptB
 
Posts: 685
Joined: Thu May 23, 2013 7:36 pm
Callsign: EKCH_AP
IRC name: CaptB
Version: next
OS: Xubuntu

Re: Fast communication

Postby curt » Mon Nov 06, 2017 7:00 pm

There is also built in udp packet communication. Look for the --generic option which allows you to specify the expected contents of the in/out packets using an xml config file. There should be several examples in the fgdata repository. Of course the code you write to pair up with FlightGear will need to agree on the exact packet contents and engineering units. It works really well once you get the details worked out. I use this mechanism for an external autopilot that can remotely pilot a flightgear airplane. (The remote program receives all the sensor data, and sends back control surface commands.)

There is also HLA, but I don't know as much about that. Definitely ask Stuart if HLA is something you know enough about to want to use.

Curt.
Aerospace Engineering and Mechanics
University of Minnesota
curt
Administrator
 
Posts: 1168
Joined: Thu Jan 01, 1970 1:00 am
Location: Minneapolis, MN

Re: Fast communication

Postby wkitty42 » Mon Nov 06, 2017 7:31 pm

IIUC, python is already integrated... i don't know to what extent but these pages may be of interest to you...


in either case, why not switch to a different protocol? the MP stuff uses UDP... there may also be the possibility of using TCP... i don't know (yet)... there are various methods of talking directly to FGFS...

i have a python script i wrote that queries (GET) the built-in web server for certain (AI related) properties and their branches (in JSON format)... i haven't tried POSTing anything back to the server to make changes to any properties, though... that's next on the learning curve...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Fast communication

Postby stuart » Tue Nov 07, 2017 12:01 am

Hi kamikaze,

If you're happy compiling from source and want to use Python, then the link wkitty has provided are a good starting point.

For UDP and other types of connection, have a look at the README.IO and README.protocol files in the Docs/ sub-directory of your FlightGear installation. They provide lots of information on the formatting options etc.

-Stuart
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1629
Joined: Wed Nov 29, 2006 10:56 am
Location: Edinburgh
Callsign: G-MWLX


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 3 guests