From 2436bff85310defb492c628cae363e6c0514a891 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 10 Nov 2011 22:34:54 +1100 Subject: [PATCH] autotest: ensure we have a VFR_HUD msgs before getting location --- Tools/autotest/arducopter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index 355c9e1075..c13d29e7ce 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -64,6 +64,9 @@ def get_bearing(loc1, loc2): def current_location(mav): '''return current location''' + # ensure we have a position + mav.recv_match(type='VFR_HUD', blocking=True) + mav.recv_match(type='GPS_RAW', blocking=True) return location(mav.messages['GPS_RAW'].lat, mav.messages['GPS_RAW'].lon, mav.messages['VFR_HUD'].alt)