Tools: sub set-position-target-global-int sends target once

This commit is contained in:
Randy Mackay 2020-11-25 10:28:36 +09:00
parent d63fe1eb6c
commit bce3c551e7
1 changed files with 20 additions and 19 deletions

View File

@ -290,10 +290,6 @@ class AutoTestSub(AutoTest):
lon = 5
alt = -10
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
@ -313,6 +309,11 @@ class AutoTestSub(AutoTest):
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")
pos = self.mav.recv_match(type='GLOBAL_POSITION_INT',
blocking=True)
delta = self.get_distance_int(startpos, pos)