cfg = readConfig() configurator = NetworkConfigurator(cfg) network = configurator.create_network() camera = ListenerCamera("/F1ROS/cameraL/image_raw") motors = PublisherMotors("/F1ROS/cmd_vel", 4, 0.3, 0, 0) network.setCamera(camera) t_network = ThreadNetwork(network) t_network.start() algorithm = MyAlgorithm(camera, motors, network) autopilot = AutoPilot(camera, motors) # algorithm = MyAlgorithm(None, None, None) app = QApplication(sys.argv) myGUI = MainWindow() myGUI.setCamera(camera) myGUI.setMotors(motors) myGUI.setAlgorithm(algorithm) myGUI.setAutopilot(autopilot) myGUI.setThreadConnector(t_network) myGUI.show() t2 = ThreadGUI(myGUI) t2.daemon = True t2.start() sys.exit(app.exec_())