mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 17:38:32 -04:00
Tools: autotest: accept home position before or after ack
autopilot may be out of space or time to send home position packet after we have requested it
This commit is contained in:
parent
6fd687e861
commit
6fc4086726
@ -1689,6 +1689,7 @@ class AutoTest(ABC):
|
|||||||
while True:
|
while True:
|
||||||
if self.get_sim_time() - tstart > 30:
|
if self.get_sim_time() - tstart > 30:
|
||||||
raise NotAchievedException("Failed to poll home position")
|
raise NotAchievedException("Failed to poll home position")
|
||||||
|
self.progress("Sending MAV_CMD_GET_HOME_POSITION")
|
||||||
try:
|
try:
|
||||||
self.run_cmd(
|
self.run_cmd(
|
||||||
mavutil.mavlink.MAV_CMD_GET_HOME_POSITION,
|
mavutil.mavlink.MAV_CMD_GET_HOME_POSITION,
|
||||||
@ -1701,10 +1702,13 @@ class AutoTest(ABC):
|
|||||||
0)
|
0)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
continue
|
continue
|
||||||
break
|
|
||||||
m = self.mav.messages.get("HOME_POSITION", None)
|
m = self.mav.messages.get("HOME_POSITION", None)
|
||||||
if old is not None and m._timestamp == old._timestamp:
|
if m is None:
|
||||||
raise NotAchievedException("home position not updated")
|
continue
|
||||||
|
if old is None:
|
||||||
|
break
|
||||||
|
if m._timestamp != old._timestamp:
|
||||||
|
break
|
||||||
return m
|
return m
|
||||||
|
|
||||||
def distance_to_home(self):
|
def distance_to_home(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user