ControlUAV

Control UAV operations

Usage: Used in 14 task(s)

Lua Implementation

-- Control UAV
function execute(params)
    local uav = params.uav
    local command = params.command

    if uav and uav:isValid() then
        if command == "goto" then
            uav:addTask("DtGoto", {location = params.location})
        elseif command == "orbit" then
            uav:addTask("DtOrbit", {location = params.location, radius = params.radius})
        elseif command == "rtb" then
            uav:addTask("DtReturnToBase", {})
        end
        return true
    end
    return false
end