From 3d51dd0d90fd7a13da29623d69b73ec19d2ee564 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 3 Sep 2024 07:37:50 +1000 Subject: [PATCH] autotest: added GliderPullup test --- .../GliderPullup/glider-pullup-mission.txt | 3 ++ Tools/autotest/arduplane.py | 38 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 Tools/autotest/ArduPlane_Tests/GliderPullup/glider-pullup-mission.txt diff --git a/Tools/autotest/ArduPlane_Tests/GliderPullup/glider-pullup-mission.txt b/Tools/autotest/ArduPlane_Tests/GliderPullup/glider-pullup-mission.txt new file mode 100644 index 00000000000000..52c5718544123f --- /dev/null +++ b/Tools/autotest/ArduPlane_Tests/GliderPullup/glider-pullup-mission.txt @@ -0,0 +1,3 @@ +QGC WPL 110 +0 0 0 16 0.000000 0.000000 0.000000 0.000000 -35.363262 149.165237 584.000000 1 +1 0 0 83 2000.000000 10.000000 30.000000 0.000000 0.000000 0.000000 0.000000 1 diff --git a/Tools/autotest/arduplane.py b/Tools/autotest/arduplane.py index 9ef6eba1aae967..a9d7096db660a4 100644 --- a/Tools/autotest/arduplane.py +++ b/Tools/autotest/arduplane.py @@ -6089,6 +6089,43 @@ def MAV_CMD_EXTERNAL_WIND_ESTIMATE(self): self._MAV_CMD_EXTERNAL_WIND_ESTIMATE(self.run_cmd) self._MAV_CMD_EXTERNAL_WIND_ESTIMATE(self.run_cmd_int) + def GliderPullup(self): + '''test pullup of glider after ALTITUDE_WAIT''' + self.start_subtest("test glider pullup") + + self.customise_SITL_commandline( + [], + model="glider", + defaults_filepath="Tools/autotest/default_params/glider.parm", + wipe=True) + + self.set_parameters({ + "PUP_ENABLE": 1, + "SERVO6_FUNCTION": 0, # balloon lift + "SERVO10_FUNCTION": 156, # lift release + "EK3_IMU_MASK": 1, # lane switches just make log harder to read + }) + + self.set_servo(6, 1000) + + self.load_mission("glider-pullup-mission.txt") + self.change_mode("AUTO") + self.wait_ready_to_arm() + self.arm_vehicle() + self.context_collect('STATUSTEXT') + + self.progress("Start balloon lift") + self.set_servo(6, 2000) + + self.wait_text("Reached altitude", check_context=True, timeout=300) + self.wait_text("Start pullup airspeed", check_context=True) + self.wait_text("Pullup airspeed", check_context=True) + self.wait_text("Pullup pitch", check_context=True) + self.wait_text("Pullup level", check_context=True) + self.wait_text("Mission complete, changing mode to RTL", check_context=True) + + self.fly_home_land_and_disarm(timeout=400) + def tests(self): '''return list of all tests''' ret = super(AutoTestPlane, self).tests() @@ -6221,6 +6258,7 @@ def tests(self): self.SetHomeAltChange, self.ForceArm, self.MAV_CMD_EXTERNAL_WIND_ESTIMATE, + self.GliderPullup, ]) return ret