From 1a7284ca73dc06ab6a311f86c7922e21769d1ef4 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 10 Sep 2019 14:52:56 +1000 Subject: [PATCH] Tools: autotest: add test for spline-as-last-waypoint --- Tools/autotest/arducopter.py | 27 ++++++++++++++++++- .../autotest/copter-spline-last-waypoint.txt | 4 +++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 Tools/autotest/copter-spline-last-waypoint.txt diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index 83fbc74c9d..d4d36cc0ea 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -2615,6 +2615,28 @@ class AutoTestCopter(AutoTest): if ex is not None: raise ex + def test_spline_last_waypoint(self): + self.context_push() + ex = None + try: + self.load_mission("copter-spline-last-waypoint.txt") + self.mavproxy.send('mode loiter\n') + self.wait_ready_to_arm() + self.arm_vehicle() + self.mavproxy.send('mode auto\n') + self.wait_mode('AUTO') + self.set_rc(3, 1500) + self.wait_altitude(10, 3000, relative=True) + except Exception as e: + self.progress("Exception caught: %s" % ( + self.get_exception_stacktrace(e))) + ex = e + self.context_pop() + self.do_RTL() + self.mav.motors_disarmed_wait() + if ex is not None: + raise ex + def fly_manual_throttle_mode_change(self): self.set_parameter("FS_GCS_ENABLE", 0) # avoid GUIDED instant disarm self.change_mode("STABILIZE") @@ -3673,7 +3695,10 @@ class AutoTestCopter(AutoTest): "Fly copter mission", self.fly_auto_test), - # Gripper test + ("SplineLastWaypoint", + "Test Spline as last waypoint", + self.test_spline_last_waypoint), + ("Gripper", "Test gripper", self.test_gripper), diff --git a/Tools/autotest/copter-spline-last-waypoint.txt b/Tools/autotest/copter-spline-last-waypoint.txt new file mode 100644 index 0000000000..42ef839685 --- /dev/null +++ b/Tools/autotest/copter-spline-last-waypoint.txt @@ -0,0 +1,4 @@ +QGC WPL 110 +0 0 0 16 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1 +1 0 3 22 0.000000 0.000000 0.000000 0.000000 -35.362297 149.164734 10.000000 1 +2 0 3 82 0.000000 0.000000 0.000000 0.000000 -35.362072 149.165909 100.000000 1