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()
|
||||
|
||||
# add a listener that verifies rangefinder innovations look good
|
||||
global alt
|
||||
alt = None
|
||||
|
||||
def verify_innov(mav, m):
|
||||
@ -2428,6 +2429,8 @@ class AutoTestCopter(AutoTest):
|
||||
return
|
||||
if m.get_type() != 'EKF_STATUS_REPORT':
|
||||
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
|
||||
zero_variance_wanted = False
|
||||
elif alt > 20:
|
||||
|
Loading…
Reference in New Issue
Block a user