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_())
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 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_())