Tools: added test for MSP GPS

This commit is contained in:
Andrew Tridgell 2023-07-31 11:40:48 +10:00
parent 217f073165
commit c6a4c2ae87
1 changed files with 9 additions and 7 deletions

View File

@ -12996,23 +12996,25 @@ switch value'''
# if gps_type is None we auto-detect
sim_gps = [
# (0, "NONE"),
(1, "UBLOX", None, "u-blox"),
(5, "NMEA", 5, "NMEA"),
(6, "SBP", None, "SBP"),
# (7, "SBP2", 9, "SBP2"), # broken, "waiting for config data"
(8, "NOVA", 15, "NOVA"), # no attempt to auto-detect this in AP_GPS
(1, "UBLOX", None, "u-blox", 5, 'detected'),
(5, "NMEA", 5, "NMEA", 5, 'detected'),
(6, "SBP", None, "SBP", 5, 'detected'),
# (7, "SBP2", 9, "SBP2", 5), # broken, "waiting for config data"
(8, "NOVA", 15, "NOVA", 5, 'detected'), # no attempt to auto-detect this in AP_GPS
(19, "MSP", 19, "MSP", 32, 'specified'), # no attempt to auto-detect this in AP_GPS
# (9, "FILE"),
]
self.context_collect("STATUSTEXT")
for (sim_gps_type, name, gps_type, detect_name) in sim_gps:
for (sim_gps_type, name, gps_type, detect_name, serial_protocol, detect_prefix) in sim_gps:
self.start_subtest("Checking GPS type %s" % name)
self.set_parameter("SIM_GPS_TYPE", sim_gps_type)
self.set_parameter("SERIAL3_PROTOCOL", serial_protocol)
if gps_type is None:
gps_type = 1 # auto-detect
self.set_parameter("GPS_TYPE", gps_type)
self.context_clear_collection('STATUSTEXT')
self.reboot_sitl()
self.wait_statustext("detected as %s" % detect_name, check_context=True)
self.wait_statustext("%s as %s" % (detect_prefix, detect_name), check_context=True)
n = self.poll_home_position(timeout=120)
distance = self.get_distance_int(orig, n)
if distance > 1: