From a7fa6e7c6147d5bbc0f542ecc8c50fab4f8286d2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 28 Nov 2012 11:10:18 +1100 Subject: [PATCH] autotest: fixed failsafe test for arducopter --- Tools/autotest/arducopter.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index 8597b554cf..9c0f587457 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -202,10 +202,18 @@ def fly_failsafe(mavproxy, mav, side=60, timeout=180): home_distance = get_distance(HOME, pos) print("Alt: %u HomeDistance: %.0f" % (m.alt, home_distance)) if m.alt <= 1 and home_distance < 10: + # switch modes to reset out of LAND + mavproxy.send('switch 2\n') + time.sleep(1) + mavproxy.send('switch 6\n') print("Reached failsafe home OK") mavproxy.send('rc 3 1100\n') return True print("Failed to land on failsafe RTL - timed out after %u seconds" % timeout) + # switch modes to reset out of LAND + mavproxy.send('switch 2\n') + time.sleep(1) + mavproxy.send('switch 6\n') return False