mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
autotest: fix un-set variable problem in verify_innov
This commit is contained in:
parent
c68bab44a5
commit
d9564d973d
@ -2419,6 +2419,7 @@ class AutoTestCopter(AutoTest):
|
|||||||
self.reboot_sitl()
|
self.reboot_sitl()
|
||||||
|
|
||||||
# add a listener that verifies rangefinder innovations look good
|
# add a listener that verifies rangefinder innovations look good
|
||||||
|
global alt
|
||||||
alt = None
|
alt = None
|
||||||
|
|
||||||
def verify_innov(mav, m):
|
def verify_innov(mav, m):
|
||||||
@ -2428,6 +2429,8 @@ class AutoTestCopter(AutoTest):
|
|||||||
return
|
return
|
||||||
if m.get_type() != 'EKF_STATUS_REPORT':
|
if m.get_type() != 'EKF_STATUS_REPORT':
|
||||||
return
|
return
|
||||||
|
if alt is None:
|
||||||
|
return
|
||||||
if alt > 1 and alt < 8: # 8 is very low, but it takes a long time to start to use the rangefinder again
|
if alt > 1 and alt < 8: # 8 is very low, but it takes a long time to start to use the rangefinder again
|
||||||
zero_variance_wanted = False
|
zero_variance_wanted = False
|
||||||
elif alt > 20:
|
elif alt > 20:
|
||||||
|
Loading…
Reference in New Issue
Block a user