mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-21 16:18:29 -04:00
autotest: correct setting mode by number
This commit is contained in:
parent
a672c7df97
commit
2ca68da77a
@ -5351,6 +5351,8 @@ class AutoTest(ABC):
|
||||
|
||||
def get_mode_from_mode_mapping(self, mode):
|
||||
"""Validate and return the mode number from a string or int."""
|
||||
if isinstance(mode, int):
|
||||
return mode
|
||||
mode_map = self.mav.mode_mapping()
|
||||
if mode_map is None:
|
||||
mav_type = self.mav.messages['HEARTBEAT'].type
|
||||
|
Loading…
Reference in New Issue
Block a user