Skip to content

Commit 0118d30

Browse files
committed
autotest: add test for getting MAV_STATE_BOOTCOUNT heartbeats
1 parent b89df7c commit 0118d30

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Tools/autotest/arducopter.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11521,6 +11521,20 @@ def Clamp(self):
1152111521

1152211522
self.reboot_sitl() # because we set home
1152311523

11524+
def MAV_STATE_BOOT(self):
11525+
'''check mav state is boot during init'''
11526+
self.context_push()
11527+
self.context_collect('HEARTBEAT')
11528+
self.set_parameter("BRD_BOOT_DELAY", 30)
11529+
self.reboot_sitl()
11530+
heartbeats = self.context_collection('HEARTBEAT')
11531+
count = len(list(filter(lambda hb : hb.system_status == mavutil.mavlink.MAV_STATE_BOOT, heartbeats)))
11532+
self.progress(f"Saw {count} MAV_STATE_BOOT heartbeats")
11533+
if count == 0:
11534+
raise NotAchievedException('Never saw heartbeat with MAV_STATE_BOOT')
11535+
self.context_pop()
11536+
self.reboot_sitl()
11537+
1152411538
def tests2b(self): # this block currently around 9.5mins here
1152511539
'''return list of all tests'''
1152611540
ret = ([
@@ -11611,6 +11625,7 @@ def tests2b(self): # this block currently around 9.5mins here
1161111625
self.GuidedForceArm,
1161211626
self.GuidedWeatherVane,
1161311627
self.Clamp,
11628+
self.MAV_STATE_BOOT,
1161411629
])
1161511630
return ret
1161611631

0 commit comments

Comments
 (0)