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 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_())
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_())
removeMapFromArgs() cfg = config.load(sys.argv[1]) #starting comm jdrc = comm.init(cfg, 'TeleTaxi') motors = jdrc.getMotorsClient("TeleTaxi.Motors") pose = jdrc.getPose3dClient("TeleTaxi.Pose3D") vel = Velocity(0, 0, motors.getMaxV(), motors.getMaxW()) frame.setVelocity(vel) sensor = Sensor(grid, pose, True) sensor.setGetPathSignal(frame.getPathSig) frame.setGrid(grid) frame.setSensor(sensor) algorithm = MyAlgorithm(grid, sensor, vel) frame.setAlgorithm(algorithm) frame.show() t1 = ThreadMotors(motors, vel) t1.daemon = True t1.start() t2 = ThreadGUI(frame) t2.daemon = True t2.start() sys.exit(app.exec_())