Skip to content

Commit

Permalink
autotest: add test for Battery InternalUseOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Aug 7, 2024
1 parent 127e634 commit f9fde66
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Tools/autotest/arducopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11704,6 +11704,31 @@ def MissionRTLYawBehaviour(self):
if abs(new_heading - original_heading) > 5:
raise NotAchievedException(f"Should return to original heading want={original_heading} got={new_heading}")

def BatteryInternalUseOnly(self):
'''batteries marked as internal use only should not appear over mavlink'''
self.set_parameters({
"BATT_MONITOR": 4, # 4 is analog volt+curr
"BATT2_MONITOR": 4,
})
self.reboot_sitl()
self.wait_message_field_values('BATTERY_STATUS', {
"id": 0,
})
self.wait_message_field_values('BATTERY_STATUS', {
"id": 1,
})
self.progress("Making battery private")
self.set_parameters({
"BATT_OPTIONS": 256,
})
self.wait_message_field_values('BATTERY_STATUS', {
"id": 1,
})
for i in range(10):
self.assert_received_message_field_values('BATTERY_STATUS', {
"id": 1
})

def tests2b(self): # this block currently around 9.5mins here
'''return list of all tests'''
ret = ([
Expand Down Expand Up @@ -11802,6 +11827,7 @@ def tests2b(self): # this block currently around 9.5mins here
self.REQUIRE_POSITION_FOR_ARMING,
self.LoggingFormat,
self.MissionRTLYawBehaviour,
self.BatteryInternalUseOnly,
])
return ret

Expand Down

0 comments on commit f9fde66

Please sign in to comment.