From 8abf9a82f377ea5e50b66619ba1afb055efbe02d Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 30 Dec 2020 18:28:29 +1100 Subject: [PATCH] autotest: reliability improvements for EKF failover tests --- Tools/autotest/arducopter.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index 5708b2d45f..0918b87eb6 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -1640,38 +1640,43 @@ class AutoTestCopter(AutoTest): self.takeoff(10, mode="LOITER") - self.mavproxy.send('mode CIRCLE\n') - self.wait_mode('CIRCLE') + self.change_mode('CIRCLE') self.delay_sim_time(20) + self.context_collect("STATUSTEXT") + self.progress("Failing first compass") self.set_parameter("SIM_MAG1_FAIL", 1) # we want for the message twice, one for EK2 and again for EK3 - self.wait_statustext("IMU0 switching to compass 1") - self.wait_statustext("IMU0 switching to compass 1") + self.wait_statustext("EKF2 IMU0 switching to compass 1", check_context=True) + self.wait_statustext("EKF3 IMU0 switching to compass 1", check_context=True) self.progress("compass switch 1 OK") self.delay_sim_time(2) + self.context_clear_collection("STATUSTEXT") + self.progress("Failing 2nd compass") self.set_parameter("SIM_MAG2_FAIL", 1) - self.wait_statustext("IMU0 switching to compass 2") - self.wait_statustext("IMU0 switching to compass 2") + self.wait_statustext("EKF2 IMU0 switching to compass 2", check_context=True) + self.wait_statustext("EKF3 IMU0 switching to compass 2", check_context=True) self.progress("compass switch 2 OK") self.delay_sim_time(2) + self.context_clear_collection("STATUSTEXT") + self.progress("Failing 3rd compass") self.set_parameter("SIM_MAG3_FAIL", 1) self.delay_sim_time(2) self.set_parameter("SIM_MAG1_FAIL", 0) - self.wait_statustext("IMU0 switching to compass 0") - self.wait_statustext("IMU0 switching to compass 0") + self.wait_statustext("EKF2 IMU0 switching to compass 0", check_context=True) + self.wait_statustext("EKF3 IMU0 switching to compass 0", check_context=True) self.progress("compass switch 0 OK") self.do_RTL()