flightgear_python.fg_if.FDMConnection

class flightgear_python.fg_if.FDMConnection(fdm_version)

Bases: FGConnection

FlightGear Flight Dynamics Model Connection

Parameters

fdm_version (int) – Net FDM version (24 or 25)

__init__(fdm_version)
Parameters

fdm_version (int) –

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_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,,5501,udp)

  • rx_cb (Callable[[Container, EventPipe], Optional[construct.lib.containers.Container]]) – 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,,,5502,udp)

fg_net_struct: Optional[Struct] = None
start()

Start the RX/TX loop with FlightGear

stop()

Stop the RX/TX loop