Tools: autotest: correct wait_servo_channel_value error path

Also make flaps test a little more verbose
This commit is contained in:
Peter Barker 2018-11-29 09:48:31 +11:00
parent 42b89e7427
commit dd88e6e85c
2 changed files with 5 additions and 3 deletions

View File

@ -562,10 +562,10 @@ class AutoTestPlane(AutoTest):
self.set_parameter("SERVO%u_MAX" % servo_ch, servo_ch_max)
self.set_parameter("SERVO%u_TRIM" % servo_ch, servo_ch_trim)
# check flaps are not deployed:
self.progress("check flaps are not deployed")
self.set_rc(flaps_ch, flaps_ch_min)
self.wait_servo_channel_value(servo_ch, servo_ch_min)
# deploy the flaps:
self.progress("deploy the flaps")
self.set_rc(flaps_ch, flaps_ch_max)
tstart = self.get_sim_time()
self.wait_servo_channel_value(servo_ch, servo_ch_max)
@ -576,7 +576,7 @@ class AutoTestPlane(AutoTest):
if delta_time < delta_time_min or delta_time > delta_time_max:
raise NotAchievedException((
"Flaps Slew not working (%f seconds)" % (delta_time,)))
# undeploy flaps:
self.progress("undeploy flaps")
self.set_rc(flaps_ch, flaps_ch_min)
self.wait_servo_channel_value(servo_ch, servo_ch_min)

View File

@ -1163,6 +1163,8 @@ class AutoTest(ABC):
m = self.mav.recv_match(type='SERVO_OUTPUT_RAW',
blocking=True,
timeout=remaining)
if m is None:
continue
m_value = getattr(m, channel_field, None)
self.progress("SERVO_OUTPUT_RAW.%s=%u want=%u" %
(channel_field, m_value, value))