From 12ac5174d7b69ea38a6fcc5e9bafb1f7b4a2a7f9 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 16 Aug 2021 20:45:23 +1000 Subject: [PATCH] autotest: check battery_status.charge_state is critical on failsafe --- Tools/autotest/arducopter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index 8a48d0c1c1..cf9064c3d2 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -940,6 +940,9 @@ class AutoTestCopter(AutoTest): self.wait_mode("ALT_HOLD") self.set_parameter('SIM_BATT_VOLTAGE', 10.0) self.wait_statustext("Battery 1 is critical", timeout=60) + m = self.mav.recv_match(type='BATTERY_STATUS', blocking=True, timeout=1) + if m.charge_state != mavutil.mavlink.MAV_BATTERY_CHARGE_STATE_CRITICAL: + raise NotAchievedException("Execpted state critical") self.delay_sim_time(5) self.wait_mode("ALT_HOLD") self.change_mode("RTL")