From b450355ff62a6be000ede0c64fb7691f1dbdf2a2 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 11 Mar 2019 13:58:26 +1100 Subject: [PATCH] Tools: autotest: remove needless wrappers, initialisation etc around guided-submode test Also disable disarm delay due to autotest mavlink traffic issues --- Tools/autotest/arducopter.py | 54 ++++++++++++------------------------ 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index e85ec57eb4..1239f889ff 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -2318,47 +2318,29 @@ class AutoTestCopter(AutoTest): def fly_guided_change_submode(self): """"Ensure we can move around in guided after a takeoff command.""" - self.context_push() - - ex = None - try: - '''start by disabling GCS failsafe, otherwise we immediately disarm - due to (apparently) not receiving traffic from the GCS for - too long. This is probably a function of --speedup''' - self.set_parameter("FS_GCS_ENABLE", 0) - self.mavproxy.send('mode guided\n') # stabilize mode - self.wait_mode('GUIDED') - self.wait_ready_to_arm() - self.arm_vehicle() - - self.user_takeoff(alt_min=10) - - """yaw through absolute angles using MAV_CMD_CONDITION_YAW""" - self.guided_achieve_heading(45) - self.guided_achieve_heading(135) - - """move the vehicle using set_position_target_global_int""" - self.fly_guided_move_relative(5, 5, 10) + '''start by disabling GCS failsafe, otherwise we immediately disarm + due to (apparently) not receiving traffic from the GCS for + too long. This is probably a function of --speedup''' + self.set_parameter("FS_GCS_ENABLE", 0) + self.set_parameter("DISARM_DELAY", 0) # until traffic problems are fixed + self.change_mode("GUIDED") + self.wait_ready_to_arm() + self.arm_vehicle() - """move the vehicle using MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED""" - self.fly_guided_stop() - self.fly_guided_move_local(5, 5, 10) + self.user_takeoff(alt_min=10) - self.progress("Landing") - self.mavproxy.send('switch 2\n') # land mode - self.wait_mode('LAND') - self.mav.motors_disarmed_wait() + """yaw through absolute angles using MAV_CMD_CONDITION_YAW""" + self.guided_achieve_heading(45) + self.guided_achieve_heading(135) - except Exception as e: - self.progress("Exception caught") - ex = e + """move the vehicle using set_position_target_global_int""" + self.fly_guided_move_relative(5, 5, 10) - self.context_pop() - self.zero_throttle() - self.reboot_sitl() + """move the vehicle using MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED""" + self.fly_guided_stop() + self.fly_guided_move_local(5, 5, 10) - if ex is not None: - raise ex + self.do_RTL() def test_gripper_mission(self): self.context_push()