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