import sys from gui.GUI import MainWindow from gui.threadGUI import ThreadGUI from MyAlgorithm import MyAlgorithm from PyQt5.QtWidgets import QApplication from interfaces.camera import ListenerCamera from interfaces.pose3d import ListenerPose3d from interfaces.motors import PublisherMotors if __name__ == "__main__": camera = ListenerCamera("/F1ROS/cameraL/image_raw") motors = PublisherMotors("/F1ROS/cmd_vel", 4, 0.3) pose3d = ListenerPose3d("/F1ROS/odom") pose3dphantom = ListenerPose3d("/F1ROS_phantom/odom") algorithm = MyAlgorithm(camera, motors, pose3d) app = QApplication(sys.argv) myGUI = MainWindow() myGUI.setCamera(camera) myGUI.setMotors(motors) myGUI.setPose3D(pose3d, pose3dphantom) 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_())
cfg = config.load(sys.argv[1]) #jdrc= comm.init(cfg, 'FollowLineTurtlebot') robot = cfg.getProperty("FollowLineTurtlebot.Robot") if (robot == "simkobuki"): cam_path = cfg.getProperty("FollowLineTurtlebot.SimCameraPath") mot_path = cfg.getProperty("FollowLineTurtlebot.SimMotorsPath") else: # realkobuki cam_path = cfg.getProperty("FollowLineTurtlebot.RealCameraPath") mot_path = cfg.getProperty("FollowLineTurtlebot.RealMotorsPath") camera = ListenerCamera(cam_path) motors = PublisherMotors(mot_path, 4, 0.3) algorithm=MyAlgorithm(camera, motors) app = QApplication(sys.argv) myGUI = MainWindow() myGUI.setCamera(camera) myGUI.setMotors(motors) myGUI.setAlgorithm(algorithm) myGUI.show() t2 = ThreadGUI(myGUI) t2.daemon=True t2.start() sys.exit(app.exec_())
from PyQt5.QtWidgets import QApplication from interfaces.camera import ListenerCamera from interfaces.motors import PublisherMotors from interfaces.point import ListenerPoint, PublisherPoint if __name__ == "__main__": cameraL = ListenerCamera("/TurtlebotROS/cameraL/image_raw") cameraR = ListenerCamera("/TurtlebotROS/cameraR/image_raw") #motors = PublisherMotors("/TurtlebotROS/cmd_vel", 4, 0.3) pointTopic = "/TurtlebotROS/point" publishPoint = PublisherPoint(pointTopic) listenPoint = ListenerPoint(pointTopic) algorithm = MyAlgorithm(cameraL, cameraR, publishPoint) app = QApplication(sys.argv) myGUI = MainWindow() myGUI.setCamera(cameraL, 'left') myGUI.setCamera(cameraR, 'right') myGUI.setPlot(listenPoint) myGUI.setAlgorithm(algorithm) myGUI.show() t2 = ThreadGUI(myGUI) t2.daemon = True t2.start() sys.exit(app.exec_())
import signal signal.signal(signal.SIGINT, signal.SIG_DFL) if __name__ == '__main__': cfg = config.load(sys.argv[1]) #starting comm jdrc= comm.init(cfg, 'mbotSuite_py') camera = jdrc.getCameraClient("mbotSuite_py.PiCamera") irl = jdrc.getCameraClient("mbotSuite_py.IRLeft") irr = jdrc.getCameraClient("mbotSuite_py.IRRight") sonar = jdrc.getSonarClient("mbotSuite_py.Sonar") motors = jdrc.getMotorsClient("mbotSuite_py.Motors") app = QApplication(sys.argv) frame = MainWindow() frame.setMotors(motors) frame.setCamera(camera, irl, irr) frame.setSonar(sonar) frame.show() t2 = ThreadGUI(frame) t2.daemon = True t2.start() sys.exit(app.exec_())