flightgear_python.fg_if.FDMConnection
- class flightgear_python.fg_if.FDMConnection(fdm_version=None, rx_timeout_s=2.0)
Bases:
FGConnectionFlightGear Flight Dynamics Model Connection
- Parameters:
- __init__(fdm_version=None, rx_timeout_s=2.0)
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
- 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
5501from--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:
EventPipeso that data can be passed from the parent process to the callback process- Return type:
- 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