autotest: correct check of frsky home-relative altitude

GLOBAL_POSITION_INT.relative_alt is in mm
This commit is contained in:
Peter Barker 2020-07-19 11:51:37 +10:00 committed by Peter Barker
parent ac827cf45b
commit 4acb66cd13

View File

@ -6246,9 +6246,9 @@ switch value'''
)
if gpi is None:
raise NotAchievedException("Did not get GLOBAL_POSITION_INT message")
gpi_relative_alt = gpi.relative_alt
self.progress("GLOBAL_POSITION_INT rel_alt==%f frsky==%f" % (gpi_relative_alt, home_alt_m))
if abs(gpi_relative_alt - home_alt_m) < 1:
gpi_relative_alt_m = gpi.relative_alt/1000.0
self.progress("GLOBAL_POSITION_INT rel_alt==%fm frsky_home_alt==%fm" % (gpi_relative_alt_m, home_alt_m))
if abs(gpi_relative_alt_m - home_alt_m) < 1:
return True
# FIXME: need to check other values as well
return False