コード例 #1
0
ファイル: main.py プロジェクト: Capri2014/JdeRobot
#

import sys
from MyAlgorithm import MyAlgorithm
from sensors.sensor import Sensor
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__':
    sensor = Sensor();
    app = QtGui.QApplication(sys.argv)
    frame = MainWindow()
    frame.setSensor(sensor)
    frame.show()
    algorithm=MyAlgorithm(sensor)
    t1 = ThreadSensor(sensor,algorithm)  
    t1.daemon=True
    t1.start()

    t2 = ThreadGUI(frame)  
    t2.daemon=True
    t2.start()
    
    sys.exit(app.exec_()) 
コード例 #2
0
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_())
コード例 #3
0
    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_())