File tree 1 file changed +10
-11
lines changed
1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -402,19 +402,18 @@ def QAUTOTUNE(self):
402
402
self .takeoff (15 , mode = 'GUIDED' )
403
403
self .set_rc (3 , 1500 )
404
404
self .change_mode ("QLOITER" )
405
- self .change_mode ("QAUTOTUNE" )
406
405
tstart = self .get_sim_time ()
407
406
self .context_collect ('STATUSTEXT' )
408
- while True :
409
- now = self .get_sim_time_cached ()
410
- if now - tstart > 5000 :
411
- raise NotAchievedException ( "Did not get success message" )
412
- try :
413
- self . wait_text ( "AutoTune: Success" , timeout = 1 , check_context = True )
414
- except AutoTestTimeoutException :
415
- continue
416
- # got success message
417
- break
407
+ self . change_mode ( "QAUTOTUNE" )
408
+ self .wait_text (
409
+ "AutoTune: (Success|Failed to level).*" ,
410
+ timeout = 5000 ,
411
+ check_context = True ,
412
+ regex = True ,
413
+ )
414
+ if self . re_match . group ( 1 ) != "Success" :
415
+ raise NotAchievedException ( "autotune did not succeed" )
416
+ now = self . get_sim_time ()
418
417
self .progress ("AUTOTUNE OK (%u seconds)" % (now - tstart ))
419
418
self .context_clear_collection ('STATUSTEXT' )
420
419
You can’t perform that action at this time.
0 commit comments