From 98adeafad96389ffb4cb973c5cf1d7651e025fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Mon, 27 Jan 2020 18:03:23 -0300 Subject: [PATCH] Tools: autotest: Add sub test for MOT_THST_HOVER parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- Tools/autotest/ardusub.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Tools/autotest/ardusub.py b/Tools/autotest/ardusub.py index f2b52994ef..5409756931 100644 --- a/Tools/autotest/ardusub.py +++ b/Tools/autotest/ardusub.py @@ -141,6 +141,21 @@ class AutoTestSub(AutoTest): self.disarm_vehicle() + def test_mot_thst_hover_ignore(self): + """Test if we are ignoring MOT_THST_HOVER parameter + """ + + # Test default parameter value + mot_thst_hover_value = self.get_parameter("MOT_THST_HOVER") + if mot_thst_hover_value != 0.5: + raise NotAchievedException("Unexpected default MOT_THST_HOVER parameter value {}".format(mot_thst_hover_value)) + + # Test if parameter is being ignored + for value in [0.25, 0.75]: + self.set_parameter("MOT_THST_HOVER", value) + self.test_alt_hold() + + def dive_manual(self): self.wait_ready_to_arm() self.arm_vehicle() @@ -287,6 +302,8 @@ class AutoTestSub(AutoTest): "Test gripper mission items", self.test_gripper_mission), + ("MotorThrustHoverParameterIgnore", "Test if we are ignoring MOT_THST_HOVER", self.test_mot_thst_hover_ignore), + ("SET_POSITION_TARGET_GLOBAL_INT", "Move vehicle using SET_POSITION_TARGET_GLOBAL_INT", self.dive_set_position_target),