Skip to content

Commit 59dc368

Browse files
author
Mikael Ferland
committed
base_mode is now optional to success on unit tests
1 parent 8a5191a commit 59dc368

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dronekit/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ def listener(self, name, m):
11771177
self.notify_attribute_listeners('armed', self.armed, cache=True)
11781178
self._autopilot_type = m.autopilot
11791179
self._vehicle_type = m.type
1180-
if self._is_mode_available(m.base_mode,m.custom_mode) == False:
1180+
if self._is_mode_available(m.custom_mode, m.base_mode) == False:
11811181
raise APIException("mode %s not available on mavlink definition" % m.custom_mode)
11821182
if self._autopilot_type == mavutil.mavlink.MAV_AUTOPILOT_PX4:
11831183
self._flightmode = mavutil.interpret_px4_mode(m.base_mode, m.custom_mode)
@@ -1528,7 +1528,7 @@ def _mode_mapping(self):
15281528
def _mode_mapping_bynumber(self):
15291529
return mavutil.mode_mapping_bynumber(self._vehicle_type)
15301530

1531-
def _is_mode_available(self,basemode_code, custommode_code):
1531+
def _is_mode_available(self, custommode_code, basemode_code=0):
15321532
try:
15331533
if self._autopilot_type == mavutil.mavlink.MAV_AUTOPILOT_PX4:
15341534
mode = mavutil.interpret_px4_mode(basemode_code, custommode_code)

0 commit comments

Comments
 (0)