autotest: switch to looking for barometer update string for passthrough test

MAVProxy can fetch parameters using FTP rather than normal param
mechanism.  Currently this does not emit any of our statustext
information - like the text we're looking for in this test
This commit is contained in:
Peter Barker 2020-05-03 10:52:12 +10:00 committed by Peter Barker
parent d197fd4acf
commit ebc781ba3a

View File

@ -5165,15 +5165,29 @@ switch value'''
self.wait_ready_to_arm() self.wait_ready_to_arm()
# test we get statustext strings. This relies on ArduPilot # test we get statustext strings. This relies on ArduPilot
# emitting statustext strings when we fetch parameters. # emitting statustext strings when we fetch parameters. (or,
self.mavproxy.send("param fetch\n") # now, an updating-barometer statustext)
tstart = self.get_sim_time_cached() tstart = self.get_sim_time_cached()
old_data = None old_data = None
text = "" text = ""
sent_request = False
while True: while True:
now = self.get_sim_time() now = self.get_sim_time()
if now - tstart > 60: # it can take a *long* time to get these messages down! if now - tstart > 60: # it can take a *long* time to get these messages down!
raise NotAchievedException("Did not get statustext in time") raise NotAchievedException("Did not get statustext in time")
if now - tstart > 30 and not sent_request:
# have to wait this long or our message gets squelched....
sent_request = True
# self.mavproxy.send("param fetch\n")
self.run_cmd(mavutil.mavlink.MAV_CMD_PREFLIGHT_CALIBRATION,
0, #p1
0, #p2
1, #p3, baro
0, #p4
0, #p5
0, #p6
0, #p7
)
frsky.update() frsky.update()
data = frsky.get_data(0x5000) # no timestamping on this data, so we can't catch legitimate repeats. data = frsky.get_data(0x5000) # no timestamping on this data, so we can't catch legitimate repeats.
if data is None: if data is None:
@ -5195,7 +5209,9 @@ switch value'''
if (x & 0x7f) == 0x00: if (x & 0x7f) == 0x00:
last = True last = True
if last: if last:
m = re.match("Ardu(Plane|Copter|Rover|Tracker|Sub) V[345]", text) # we used to do a 'param fetch' and expect this back, but the params-via-ftp thing broke it.
# m = re.match("Ardu(Plane|Copter|Rover|Tracker|Sub) V[345]", text)
m = re.match("Updating barometer calibration", text)
if m is not None: if m is not None:
want_sev = mavutil.mavlink.MAV_SEVERITY_INFO want_sev = mavutil.mavlink.MAV_SEVERITY_INFO
if severity != want_sev: if severity != want_sev: