From bce3c551e71f0fe5f2210f05aeddedc821ca725a Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Wed, 25 Nov 2020 10:28:36 +0900 Subject: [PATCH] Tools: sub set-position-target-global-int sends target once --- Tools/autotest/ardusub.py | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/Tools/autotest/ardusub.py b/Tools/autotest/ardusub.py index 6c0d5cba71..1d5252907c 100644 --- a/Tools/autotest/ardusub.py +++ b/Tools/autotest/ardusub.py @@ -290,29 +290,30 @@ class AutoTestSub(AutoTest): lon = 5 alt = -10 + # send a position-control command + self.mav.mav.set_position_target_global_int_send( + 0, # timestamp + 1, # target system_id + 1, # target component id + mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, + 0b1111111111111000, # mask specifying use-only-lat-lon-alt + lat, # lat + lon, # lon + alt, # alt + 0, # vx + 0, # vy + 0, # vz + 0, # afx + 0, # afy + 0, # afz + 0, # yaw + 0, # yawrate + ) + tstart = self.get_sim_time() while True: if self.get_sim_time_cached() - tstart > 200: raise NotAchievedException("Did not move far enough") - # send a position-control command - self.mav.mav.set_position_target_global_int_send( - 0, # timestamp - 1, # target system_id - 1, # target component id - mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, - 0b1111111111111000, # mask specifying use-only-lat-lon-alt - lat, # lat - lon, # lon - alt, # alt - 0, # vx - 0, # vy - 0, # vz - 0, # afx - 0, # afy - 0, # afz - 0, # yaw - 0, # yawrate - ) pos = self.mav.recv_match(type='GLOBAL_POSITION_INT', blocking=True) delta = self.get_distance_int(startpos, pos)