Skip to content

Commit

Permalink
Tools: added test for MSP GPS
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Jul 31, 2023
1 parent 7254e04 commit d11f6ed
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Tools/autotest/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -12996,23 +12996,25 @@ def GPSTypes(self):
# 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:
Expand Down

0 comments on commit d11f6ed

Please sign in to comment.