if __name__ == "__main__": cfg = config.load(sys.argv[1]) # starting comm jdrc = comm.init(cfg, 'Stop') cameraC = jdrc.getCameraClient("Stop.CameraC") cameraL = jdrc.getCameraClient("Stop.CameraL") cameraR = jdrc.getCameraClient("Stop.CameraR") motors = jdrc.getMotorsClient("Stop.Motors") pose3d = jdrc.getPose3dClient("Stop.Pose3D") algorithm = MyAlgorithm(pose3d, cameraC, cameraL, cameraR, motors) app = QApplication(sys.argv) myGUI = MainWindow() myGUI.setMotors(motors) myGUI.setCameraC(cameraC) myGUI.setCameraL(cameraL) myGUI.setCameraR(cameraR) myGUI.setPose3D(pose3d) myGUI.setAlgorithm(algorithm) myGUI.show() t2 = ThreadGUI(myGUI) t2.daemon = True t2.start() sys.exit(app.exec_())
from PyQt4 import QtCore, QtGui from gui.GUI import MainWindow from gui.threadGUI import ThreadGUI from sensors.sensor import Sensor from sensors.threadSensor import ThreadSensor from MyAlgorithm import MyAlgorithm if __name__ == "__main__": sensor = Sensor() algorithm=MyAlgorithm(sensor) app = QtGui.QApplication(sys.argv) myGUI = MainWindow() myGUI.setSensor(sensor) myGUI.setAlgorithm(algorithm) myGUI.show() t1 = ThreadSensor(sensor,algorithm) t1.daemon=True t1.start() t2 = ThreadGUI(myGUI) t2.daemon=True t2.start() sys.exit(app.exec_())
from sensors.camera import Camera from actuators.motors import Motors from sensors.threadSensor import ThreadSensor from gui.threadGUI import ThreadGUI from gui.GUI import MainWindow from PyQt4 import QtGui import signal signal.signal(signal.SIGINT, signal.SIG_DFL) if __name__ == '__main__': camera = Camera() motors = Motors() app = QtGui.QApplication(sys.argv) frame = MainWindow() frame.setMotors(motors) frame.setCamera(camera) frame.show() t1 = ThreadSensor(camera) t1.daemon = True t1.start() t2 = ThreadGUI(frame) t2.daemon = True t2.start() sys.exit(app.exec_())
from gui.GUI import MainWindow from PyQt5.QtWidgets import QApplication from drone import Drone import signal signal.signal(signal.SIGINT, signal.SIG_DFL) if __name__ == '__main__': drone = Drone("mavros/cmd/arming", "mavros/cmd/land","mavros/set_mode", "/mavros/setpoint_velocity/cmd_vel","/IntrorobROS/Pose3D", "/IntrorobROS/image_raw") algorithm=MyAlgorithm(drone) app = QApplication(sys.argv) frame = MainWindow() frame.setDrone(drone) frame.setAlgorithm(algorithm) frame.show() t2 = ThreadGUI(frame) t2.daemon=True t2.start() sys.exit(app.exec_())
def run(): app = QApplication(sys.argv) main = MainWindow() main.show() sys.exit(app.exec_())