Data Distribution Services Support

From FlightGear wiki
Jump to navigation Jump to search
This article is a stub. You can help the wiki by expanding it.

In 03/2021, Erik added a first stab at supporting CycloneDDS Data Distribution Service This is a link to a Wikipedia article} support in next (FlightGear commit 5786d402725328d7c9913d361632854b5afb1124):

Data Distribution Services are used in Internet of things This is a link to a Wikipedia article applications and have a number of advantages over normal socket support:

  • Auto configuring within a LAN.
  • Auto connecting and disconnecting.
  • Platform and computer language agnostic:
  • Instead to a one-on-one connection you get a one-to-many connection.

One thing which is important to keep in mind: DDS works on fixed structures so it is not possible to access individual property-nodes within FlightGear (which can be done when using the telnet/props or generic protocols). Future versions could adopt Google Protocol Buffers for dynamically allocating structures from IDL configurations.

For now, Erik implemented net_fdm, net_ctrls and net_gui equivalents for DDS so if the data you want isn't in any of them then it's probably best to keep using the telnet interface.

If there is data missing in any of those net_* structs then it could be an option to add another structure to fill the gap.[1]

What does this mean ?

You now can connect to FlightGear from Java and Python and get the same data as in C and C++

  • Use your Raspberry Pi to display some cockpit instruments.
  • Controlling the main system from a cell-phone

If you set up a system with multiple PC's driving multiple displays you can add, and remove, display stations on the fly.

How to run it

Just like using sockets but without the need to specify an IP-adress or port number:

fgfs --native-fdm=dds,out,60
fgfs --native-ctrls=dds,in,10

See for more information (needs to be updated for DDS support): Property Tree/Sockets

It is in its early stages right now but Erik included a small command line utility to log some FDM values like:

  • latitude
  • longitude
  • altitude from a

DDS connection as an example. [2]

For details, take a look at flightgear/flightgear/next//examples/dds

or flightgear/flightgear/next//src/Network/DDS/fg_dds_log.cpp