flightgear_python.fg_if.FDMConnection

class flightgear_python.fg_if.FDMConnection(fdm_version=None, rx_timeout_s=2.0)

Bases: FGConnection

FlightGear Flight Dynamics Model Connection

Parameters:
  • fdm_version (int | None) – Net FDM version (24, 25, or None for auto-detection)

  • rx_timeout_s (float) – Optional timeout value in seconds when receiving data

__init__(fdm_version=None, rx_timeout_s=2.0)
Parameters:
  • fdm_version (int | None) –

  • rx_timeout_s (float) –

Methods

connect_rx(fg_host, fg_port, rx_cb)

Connect to a UDP output of FlightGear

connect_tx(fg_host, fg_port)

Connect to a UDP input of FlightGear

start()

Start the RX/TX loop with FlightGear

stop()

Stop the RX/TX loop

Attributes

fg_auto_partial_parse

fg_net_struct

connect_rx(fg_host, fg_port, rx_cb)

Connect to a UDP output of FlightGear

Parameters:
  • fg_host (str) – IP address of FG (usually localhost)

  • fg_port (int) – Port of the output socket (i.e. the 5501 from --native-fdm=socket,out,30,localhost,5501,udp)

  • rx_cb (Callable[[Container, EventPipe], Container | None]) – Callback function, called whenever we receive data from FG. Function signature should follow rx_callback_type

Returns:

EventPipe so that data can be passed from the parent process to the callback process

Return type:

EventPipe

connect_tx(fg_host, fg_port)

Connect to a UDP input of FlightGear

Parameters:
  • fg_host (str) – IP address of FG (usually localhost)

  • fg_port (int) – Port of the input socket (i.e. the 5502 from --native-fdm=socket,in,30,localhost,5502,udp)

fg_auto_partial_parse: PartialParseSwitchStruct | None = None
fg_net_struct: Struct | None = None
start()

Start the RX/TX loop with FlightGear

stop()

Stop the RX/TX loop