From 3737c13784d0ea7d5a3db42c1c8d85308212265d Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 24 Jun 2020 13:16:09 +1000 Subject: [PATCH] autotest: allow message rates to be set by message name, not just ID Simply for convenience. --- Tools/autotest/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index 9f4221bbb5..fdc0c20c23 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -5130,6 +5130,8 @@ class AutoTest(ABC): def set_message_rate_hz(self, id, rate_hz): '''set a message rate in Hz; 0 for original, -1 to disable''' + if type(id) == str: + id = eval("mavutil.mavlink.MAVLINK_MSG_ID_%s" % id) if rate_hz == 0 or rate_hz == -1: set_interval = rate_hz else: