Tools: autotest: ensure we get get saved-gains message in qautotune

This commit is contained in:
Peter Barker 2019-04-01 08:42:06 +11:00 committed by Andrew Tridgell
parent 3fe63d5bc0
commit 156f0ff496

View File

@ -7,10 +7,13 @@ import pexpect
from pymavlink import mavutil from pymavlink import mavutil
from common import AutoTest from common import AutoTest
from common import AutoTestTimeoutException
from pysim import util from pysim import util
from pysim import vehicleinfo from pysim import vehicleinfo
import operator import operator
# get location of scripts # get location of scripts
testdir = os.path.dirname(os.path.realpath(__file__)) testdir = os.path.dirname(os.path.realpath(__file__))
SITL_START_LOCATION = mavutil.location(-27.274439, 151.290064, 343, 8.7) SITL_START_LOCATION = mavutil.location(-27.274439, 151.290064, 343, 8.7)
@ -133,12 +136,17 @@ class AutoTestQuadPlane(AutoTest):
continue continue
self.progress("STATUSTEXT (%u<%u): %s" % (now, deadline, m.text)) self.progress("STATUSTEXT (%u<%u): %s" % (now, deadline, m.text))
if "AutoTune: Success" in m.text: if "AutoTune: Success" in m.text:
self.progress("AUTOTUNE OK (%u seconds)" % (now - tstart)) break
# near enough for now: self.progress("AUTOTUNE OK (%u seconds)" % (now - tstart))
self.change_mode("QLAND") self.set_rc(3, 1200)
self.mavproxy.expect("AutoTune: Saved gains for Roll Pitch Yaw") self.wait_altitude(-5, 1, relative=True, timeout=30)
self.mav.motors_disarmed_wait() while self.get_sim_time_cached() < deadline:
return self.mavproxy.send('disarm\n')
try:
self.wait_text("AutoTune: Saved gains for Roll Pitch Yaw", timeout=0.5)
except AutoTestTimeoutException as e:
continue
break
self.mav.motors_disarmed_wait() self.mav.motors_disarmed_wait()
def test_pid_tuning(self): def test_pid_tuning(self):