From 2c1d77bf8f71ea08738f76700f5ac253f4ff0ad0 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 29 Jun 2020 20:36:00 +1000 Subject: [PATCH] autotest: test simulated ship takeoff --- Tools/autotest/arducopter.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index aff4c48de6..2028eecf97 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -4955,6 +4955,21 @@ class AutoTestCopter(AutoTest): self.fly_rangefinder_mavlink() + def fly_ship_takeoff(self): + # test ship takeoff + self.wait_groundspeed(0, 2) + self.set_parameter("SIM_SHIP_ENABLE", 1) + self.set_parameter("SIM_SHIP_SPEED", 10) + self.set_parameter("SIM_SHIP_DSIZE", 2) + self.wait_ready_to_arm() + # we should be moving with the ship + self.wait_groundspeed(9, 11) + self.takeoff(10) + # above ship our speed drops to 0 + self.wait_groundspeed(0, 2) + self.land_and_disarm() + # ship will have moved on, so we land on the water which isn't moving + self.wait_groundspeed(0, 2) def test_parameter_validation(self): self.progress("invalid; min must be less than max:") @@ -5155,6 +5170,10 @@ class AutoTestCopter(AutoTest): "Test Buttons", self.test_button), + ("ShipTakeoff", + "Fly Simulated Ship Takeoff", + self.fly_ship_takeoff), + ("RangeFinder", "Test RangeFinder Basic Functionality", self.test_rangefinder),