示例#1
0
                              mPR, mPS)
                gpsData = GPS.readGPS()
                Motor.motor(mPL, mPR, 0.1, 1)
            Motor.motor(0, 0, 1)
            print("Running Phase Finished")
            IM920.Send("P7F")

        # ------------------- GoalDetection Phase ------------------- #
        if (phaseChk <= 8):
            Other.saveLog(phaseLog, "8", "GoalDetection Phase Started",
                          time.time() - t_start)
            print("Goal Detection Phase Started")
            IM920.Send("P8S")
            while goalFlug != 0 or goalBuf != 0:
                gpsdata = GPS.readGPS()
                goalFlug, goalArea, goalGAP, photoName = Goal.Togoal(
                    photopath, H_min, H_max, S_thd, mp_min, mp_max, mp_adj)
                goalBuf = goalFlug
                print("goal is", goalFlug)
                Other.saveLog(goalDetectionLog,
                              time.time() - t_start, gpsData, goalFlug,
                              goalArea, goalGAP, photoName)
                Other.saveLog(captureLog, time.time() - t_start, photoName)
            print("Goal Detection Phase Finished")
            IM920.Send("P8F")

        print("Program Finished")
        IM920.Send("P10")
        Other.saveLog(phaseLog, "10", "Program Finished",
                      time.time() - t_start)
        close()
    except KeyboardInterrupt:
                              mPR, mPS)
                gpsData = GPS.readGPS()
                Motor.motor(mPL, mPR, 0.1, 1)
            print("Running Phase Finished")
            IM920.Send("P7F")

# ------------------- GoalDetection Phase ------------------- #
        if (phaseChk <= 8):
            Other.saveLog(phaseLog, "8", "GoalDetection Phase Started",
                          time.time() - t_start)
            print("Goal Detection Phase Started")
            IM920.Send("P8S")
            H_min = 200
            H_max = 10
            S_thd = 120
            goal = Goal.Togoal(photopath, H_min, H_max, S_thd)
            while goal[0] != 0:
                gpsdata = GPS.readGPS()
                goal = Goal.Togoal(photopath, H_min, H_max, S_thd)
                print("goal is", goal)
                Other.saveLog(goalDetectionLog,
                              time.time() - t_start, gpsData, goal)
                Other.saveLog(captureLog, time.time() - t_start, goal)
            print("Goal Detection Phase Finished")
            IM920.Send("P8F")

        print("Program Finished")
        IM920.Send("P10")
        Other.saveLog(phaseLog, "10", "Program Finished",
                      time.time() - t_start)
        close()