Example #1
0
    ser.open()

#状态机定义
STATE_NORMALLY_RUNNING=1
STATE_COLLECTING_POINTS=2
STATE_MANUAL_CTRL=3

#实例化各模块
Ship = Comm.UASattitude()
Route = Comm.Route()
ValidShip = Comm.UASattitude()
wirelessPort = Ctrl.WirelessUSART()
RingBuff = Comm.ringBuff(100,baudrate,wirelessPort,ser)
#创建多线程
tSynthesis = Comm.sysnthesisData(RingBuff,Ship,ValidShip,10,systemOnline)
tUART = Comm.USARTinData(RingBuff,systemOnline)
#创建线程池
THREADS = [tSynthesis,tUART]
try:
    for sub_thread in THREADS:
        sub_thread.start()
except:
    os.system('mplayer -really-quiet "/home/pi/RpiCentre/sound/subthreadserr.mp3"')

os.system('mplayer -really-quiet "/home/pi/RpiCentre/sound/SEQUENCESTART.mp3"')
time.sleep(0.5)

#启动主任务
try:
    startFromMinDistance = 0  #选择载具是从第一个点开始前进0还是就近开始前进1
    #读取路径轨迹