autotest: remove pointless try/except in PayloadPlaceMission

This commit is contained in:
Peter Barker 2024-06-26 16:55:06 +10:00 committed by Peter Barker
parent 2425023331
commit c388943f52

View File

@ -4951,49 +4951,39 @@ class AutoTestCopter(vehicle_test_suite.TestSuite):
"""Test payload placing in auto.""" """Test payload placing in auto."""
self.context_push() self.context_push()
ex = None self.set_analog_rangefinder_parameters()
try: self.set_servo_gripper_parameters()
self.set_analog_rangefinder_parameters() self.reboot_sitl()
self.set_servo_gripper_parameters()
self.reboot_sitl()
self.load_mission("copter_payload_place.txt") self.load_mission("copter_payload_place.txt")
if self.mavproxy is not None: if self.mavproxy is not None:
self.mavproxy.send('wp list\n') self.mavproxy.send('wp list\n')
self.set_parameter("AUTO_OPTIONS", 3) self.set_parameter("AUTO_OPTIONS", 3)
self.change_mode('AUTO') self.change_mode('AUTO')
self.wait_ready_to_arm() self.wait_ready_to_arm()
self.arm_vehicle() self.arm_vehicle()
self.wait_text("Gripper load releas", timeout=90) self.wait_text("Gripper load releas", timeout=90)
dist_limit = 1 dist_limit = 1
# this is a copy of the point in the mission file: # this is a copy of the point in the mission file:
target_loc = mavutil.location(-35.363106, target_loc = mavutil.location(-35.363106,
149.165436, 149.165436,
0, 0,
0) 0)
dist = self.get_distance(target_loc, self.mav.location()) dist = self.get_distance(target_loc, self.mav.location())
self.progress("dist=%f" % (dist,)) self.progress("dist=%f" % (dist,))
if dist > dist_limit: if dist > dist_limit:
raise NotAchievedException("Did not honour target lat/lng (dist=%f want <%f" % raise NotAchievedException("Did not honour target lat/lng (dist=%f want <%f" %
(dist, dist_limit)) (dist, dist_limit))
self.wait_disarmed() self.wait_disarmed()
except Exception as e:
self.print_exception_caught(e)
self.disarm_vehicle(force=True)
ex = e
self.context_pop() self.context_pop()
self.reboot_sitl() self.reboot_sitl()
self.progress("All done") self.progress("All done")
if ex is not None:
raise ex
def Weathervane(self): def Weathervane(self):
'''Test copter weathervaning''' '''Test copter weathervaning'''
# We test nose into wind code paths and yaw direction here and test side into wind # We test nose into wind code paths and yaw direction here and test side into wind