flightgear_python.fg_if.CtrlsConnection

class flightgear_python.fg_if.CtrlsConnection(ctrls_version)

Bases: FGConnection

FlightGear Controls Connection

Parameters

ctrls_version (int) – Net Ctrls version (27)

__init__(ctrls_version)
Parameters

ctrls_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