From d0d15ad3ee690f4e2afa365ea7c9f453be85711b Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 29 May 2023 11:18:00 +1000 Subject: [PATCH] autotest: augment mount test to attempt as CMD_INT --- Tools/autotest/arducopter.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index e8f7015fc3..d93856e318 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -5154,6 +5154,32 @@ class AutoTestCopter(AutoTest): roi_alt, ) self.test_mount_pitch(-52, 5, mavutil.mavlink.MAV_MOUNT_MODE_GPS_POINT) + self.progress("Using MAV_CMD_DO_SET_ROI_LOCATION") + # start by pointing the gimbal elsewhere with a + # known-working command: + self.run_cmd( + mavutil.mavlink.MAV_CMD_DO_SET_ROI_LOCATION, + 0, + 0, + 0, + 0, + roi_lat + 1, + roi_lon + 1, + roi_alt, + ) + # now point it with command_int: + self.run_cmd_int( + mavutil.mavlink.MAV_CMD_DO_SET_ROI_LOCATION, + 0, + 0, + 0, + 0, + int(roi_lat * 1e7), + int(roi_lon * 1e7), + roi_alt, + frame=mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT, + ) + self.test_mount_pitch(-52, 5, mavutil.mavlink.MAV_MOUNT_MODE_GPS_POINT) self.progress("Using MAV_CMD_DO_SET_ROI_NONE") self.run_cmd(mavutil.mavlink.MAV_CMD_DO_SET_ROI_NONE,