From 8fd5df33d5ad4741a20c84bc29cfb1b8f67bca2d Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 11 Aug 2022 11:32:28 +1000 Subject: [PATCH] autotest: add test for stick-mixing in auto mode --- Tools/autotest/rover.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Tools/autotest/rover.py b/Tools/autotest/rover.py index a3def514c1..df77211cc7 100644 --- a/Tools/autotest/rover.py +++ b/Tools/autotest/rover.py @@ -5922,6 +5922,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.delay_sim_time(10) self.assert_prearm_failure("Motors Emergency Stopped") self.context_pop() + self.reboot_sitl() def assert_mode(self, mode): if not self.mode_is(mode): @@ -5934,6 +5935,25 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.change_mode(x) self.assert_mode(want) + def StickMixingAuto(self): + items = [] + self.set_parameter('STICK_MIXING', 1) + # home + items.append((mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 0, 0, 0),) + # 1 waypoint a long way away + items.append((mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 2000, 0, 0),) + self.upload_simple_relhome_mission(items) + if self.mavproxy is not None: + # handy for getting pretty pictures + self.mavproxy.send("wp list\n") + self.change_mode('AUTO') + self.wait_ready_to_arm() + self.arm_vehicle() + self.set_rc(1, 1150) + self.wait_heading(45) + self.wait_heading(90) + self.disarm_vehicle() + def tests(self): '''return list of all tests''' ret = super(AutoTestRover, self).tests() @@ -6184,6 +6204,10 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) "Ensure EStop prevents arming when asserted at boot time", self.EStopAtBoot), + ("StickMixingAuto", + "Ensure Stick Mixing works in auto", + self.StickMixingAuto), + ]) return ret