autotest: check battery_status.charge_state is critical on failsafe

This commit is contained in:
Peter Barker 2021-08-16 20:45:23 +10:00 committed by Peter Barker
parent baf2b4a3d8
commit 12ac5174d7

View File

@ -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")