From 504713b771e716760c0165d2cbde3eee3863d6aa Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Dec 2017 11:28:19 -0500 Subject: [PATCH] MODES: Add new ArduPilot flight modes to pymavlink Several new modes have been introduced to the various vehicles supported by ArduPilot since the solo was created. This patch adds all those new flight modes to the enumerations in this older version of pymavlink. For ArduCopter, this adds support for the following modes: - Throw mode - ADS-B Avoid (not a user mode) - Guided with no GPS - Smart RTL --- pymavlink/mavutil.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pymavlink/mavutil.py b/pymavlink/mavutil.py index f040105..6ffdeeb 100644 --- a/pymavlink/mavutil.py +++ b/pymavlink/mavutil.py @@ -1282,8 +1282,14 @@ def mode_string_v09(msg): 12 : 'LOITER', 14 : 'LAND', 15 : 'GUIDED', - 16 : 'INITIALISING' + 16 : 'INITIALISING', + 17 : 'QSTABILIZE', + 18 : 'QHOVER', + 19 : 'QLOITER', + 20 : 'QLAND', + 21 : 'QRTL' } + mode_mapping_acm = { 0 : 'STABILIZE', 1 : 'ACRO', @@ -1301,8 +1307,13 @@ def mode_string_v09(msg): 14 : 'FLIP', 15 : 'AUTOTUNE', 16 : 'POSHOLD', - 17 : 'BRAKE' + 17 : 'BRAKE', + 18 : 'THROW', + 19 : 'AVOID_ADSB', + 20 : 'GUIDED_NOGPS', + 21 : 'SMART_RTL' } + mode_mapping_rover = { 0 : 'MANUAL', 2 : 'LEARNING', @@ -1310,6 +1321,7 @@ def mode_string_v09(msg): 4 : 'HOLD', 10 : 'AUTO', 11 : 'RTL', + 12 : 'SMART_RTL', 15 : 'GUIDED', 16 : 'INITIALISING' } @@ -1329,7 +1341,6 @@ def mode_string_v09(msg): 3 : 'AUTO' } - def mode_mapping_byname(mav_type): '''return dictionary mapping mode names to numbers, or None if unknown''' map = None