From 3be1b9efa6163e702995b536fcc1addebe8d1980 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 7 Mar 2024 14:34:24 +1100 Subject: [PATCH] autotest: add set_home function --- Tools/autotest/vehicle_test_suite.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Tools/autotest/vehicle_test_suite.py b/Tools/autotest/vehicle_test_suite.py index d223290addb1e4..e752171665112f 100644 --- a/Tools/autotest/vehicle_test_suite.py +++ b/Tools/autotest/vehicle_test_suite.py @@ -8993,6 +8993,15 @@ def monitor_groundspeed(self, want, tolerance=0.5, timeout=5): self.progress("GroundSpeed OK (got=%f) (want=%f)" % (m.groundspeed, want)) + def set_home(self, loc): + '''set home to supplied loc''' + self.run_cmd_int( + mavutil.mavlink.MAV_CMD_DO_SET_HOME, + p5=int(loc.lat*1e7), + p6=int(loc.lng*1e7), + p7=loc.alt, + ) + def SetHome(self): '''Setting and fetching of home''' if self.is_tracker():