From 1530dbde3d328b249ca142174486d093d5b8a81e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 15 Feb 2023 12:11:32 +1100 Subject: [PATCH] autotest: added test of BRD_SD_MISSION check that we can create and compare 4368 WPs --- Tools/autotest/arduplane.py | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/Tools/autotest/arduplane.py b/Tools/autotest/arduplane.py index de53afd95c..253a0872d1 100644 --- a/Tools/autotest/arduplane.py +++ b/Tools/autotest/arduplane.py @@ -4156,6 +4156,54 @@ class AutoTestPlane(AutoTest): else: raise NotAchievedException("Missing trick %s" % t) + def SDCardWPTest(self): + '''test BRD_SD_MISSION support''' + spiral_script = "mission_spiral.lua" + + self.context_push() + self.install_example_script(spiral_script) + self.context_collect('STATUSTEXT') + self.set_parameters({ + "BRD_SD_MISSION" : 64, + "SCR_ENABLE" : 1, + "SCR_VM_I_COUNT" : 1000000 + }) + + self.wait_ready_to_arm() + self.reboot_sitl() + + self.wait_text("Loaded spiral mission creator", check_context=True) + self.set_parameters({ + "SCR_USER2": 19, # radius + "SCR_USER3": -35.36322, # lat + "SCR_USER4": 149.16525, # lon + "SCR_USER5": 684.13, # alt + }) + + count = (65536 // 15) - 1 + + self.progress("Creating spiral mission of size %s" % count) + self.set_parameter("SCR_USER1", count) + + self.wait_text("Created spiral of size %u" % count) + + self.progress("Checking spiral before reboot") + self.set_parameter("SCR_USER6", count) + self.wait_text("Compared spiral of size %u OK" % count) + self.set_parameter("SCR_USER6", 0) + + self.wait_ready_to_arm() + self.reboot_sitl() + self.progress("Checking spiral after reboot") + self.set_parameter("SCR_USER6", count) + self.wait_text("Compared spiral of size %u OK" % count) + + self.remove_installed_script(spiral_script) + + self.context_pop() + self.wait_ready_to_arm() + self.reboot_sitl() + def MANUAL_CONTROL(self): '''test MANUAL_CONTROL mavlink message''' self.set_parameter("SYSID_MYGCS", self.mav.source_system) @@ -4522,6 +4570,7 @@ class AutoTestPlane(AutoTest): self.AirspeedCal, self.MissionJumpTags, self.GCSFailsafe, + self.SDCardWPTest, ]) return ret