diff --git a/Tools/autotest/rover.py b/Tools/autotest/rover.py index 3ecbc871cc..fb10d75c03 100644 --- a/Tools/autotest/rover.py +++ b/Tools/autotest/rover.py @@ -5125,7 +5125,61 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) if ex is not None: raise ex + def test_scripting_print_home_and_origin(self): + self.start_subtest("Scripting print home and origin") + + self.context_push() + + ex = None + example_script = "ahrs-print-home-and-origin.lua" + try: + self.set_parameter("SCR_ENABLE", 1) + self.install_example_script(example_script) + self.reboot_sitl() + self.wait_ready_to_arm() + self.wait_statustext("Home - ") + self.wait_statustext("Origin - ") + except Exception as e: + self.print_exception_caught(e) + ex = e + + self.remove_example_script(example_script) + + self.context_pop() + + self.reboot_sitl() + + if ex is not None: + raise ex + + def test_scripting_set_home_to_vehicle_location(self): + self.start_subtest("Scripting set home to vehicle location") + + self.context_push() + + ex = None + example_script = "ahrs-set-home-to-vehicle-location.lua" + try: + self.set_parameter("SCR_ENABLE", 1) + self.install_example_script(example_script) + self.reboot_sitl() + self.wait_statustext("Home position reset") + except Exception as e: + self.print_exception_caught(e) + ex = e + + self.remove_example_script(example_script) + + self.context_pop() + + self.reboot_sitl() + + if ex is not None: + raise ex + def test_scripting(self): + self.test_scripting_set_home_to_vehicle_location() + self.test_scripting_print_home_and_origin() self.test_scripting_hello_world() self.test_scripting_simple_loop() self.test_scripting_internal_test()