Exemplo n.º 1
0
            ConditionIsCompleted("Low Battery Level", uav, w4lowBatteryLevel))

        try:
            while True:
                p = wp[i]
                uav.GoTo(goal_x=p[0], goal_y=p[1], goal_z=1)
                uav.Wait(duration=1.0)
                if (i < 4):
                    i += 1
                else:
                    i = 0
        except TaskConditionException, e:
            if uav.isCompleted(w4landingBackOrder):
                rospy.loginfo(
                    "Mission suspended - UGV ordered a Landing Back !")
                uav.RequestLanding()
                uav.Wait(duration=2.0)
                uav.LandingBack()
                uav.WaitForTakeOffOrder()
                uav.RequestTakeOff()
                uav.Wait(duration=2.0)
                uav.TakeOff()

            if uav.isCompleted(w4lowBatteryLevel):
                rospy.loginfo(
                    "Mission suspended - Low battery level ! - starting a Landing Back"
                )
                uav.RequestLanding()
                uav.Wait(duration=2.0)
                uav.LandingBack()
                uav.WaitForChargedBattery()