From 726f54e37f099982795229a0a73c43a04b3b55d1 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 12 Feb 2021 09:45:48 +1100 Subject: [PATCH] autotest: flake8 compliance for rover.py --- Tools/autotest/rover.py | 651 ++++++++++++++++++++++++---------------- 1 file changed, 393 insertions(+), 258 deletions(-) diff --git a/Tools/autotest/rover.py b/Tools/autotest/rover.py index 0534d03415..09bb7a831b 100644 --- a/Tools/autotest/rover.py +++ b/Tools/autotest/rover.py @@ -1,6 +1,12 @@ #!/usr/bin/env python -# Drive Rover in SITL +''' +Drive Rover in SITL + +AP_FLAKE8_CLEAN + +''' + from __future__ import print_function import copy @@ -13,7 +19,6 @@ import time from common import AutoTest from pysim import util -from pysim import vehicleinfo from common import AutoTestTimeoutException from common import MsgRcvTimeoutException @@ -57,7 +62,7 @@ class AutoTestRover(AutoTest): return "Rover" def test_filepath(self): - return os.path.realpath(__file__) + return os.path.realpath(__file__) def set_current_test_name(self, name): self.current_test_name_directory = "ArduRover_Tests/" + name + "/" @@ -320,8 +325,8 @@ class AutoTestRover(AutoTest): 0, # p4 0, # p5 0, # p6 - 0, # p7 - ); + 0) # p7 + self.progress("Testing speed-ramping") self.set_rc(3, 1700) # start driving forward self.wait_servo_channel_value(pump_ch, 1690, timeout=60, comparator=operator.gt) @@ -333,8 +338,7 @@ class AutoTestRover(AutoTest): 0, # p4 0, # p5 0, # p6 - 0, # p7 - ); + 0) # p7 self.wait_servo_channel_value(pump_ch, pump_ch_min) self.set_rc(3, 1000) # start driving forward @@ -531,7 +535,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) if m.seq == 3: break - self.drain_mav(); + self.drain_mav() m = self.mav.recv_match(type='NAV_CONTROLLER_OUTPUT', blocking=True, @@ -567,7 +571,6 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.disarm_vehicle() self.progress("RTL Mission OK (%fm)" % home_distance) - def drive_fence_ac_avoidance(self): self.context_push() ex = None @@ -680,7 +683,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) ex = None try: # from mavproxy_rc.py - mapping = [ 0, 1165, 1295, 1425, 1555, 1685, 1815 ] + mapping = [0, 1165, 1295, 1425, 1555, 1685, 1815] self.set_parameter("MODE1", 1) # acro self.set_rc(8, mapping[1]) self.wait_mode('ACRO') @@ -957,10 +960,9 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) channel_field = "chan%u_raw" % ch m_value = getattr(m, channel_field) if m_value != ch_override_value: - raise NotAchievedException("Value reverted after %f seconds when it should not have (got=%u) (want=%u)" % (delta, m_value, ch_override_value)) + raise NotAchievedException("Value reverted after %f seconds when it should not have (got=%u) (want=%u)" % (delta, m_value, ch_override_value)) # noqa self.set_parameter("RC_OVERRIDE_TIME", old) - self.delay_sim_time(10) self.start_subtest("Checking higher-channel semantics") @@ -992,7 +994,6 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) ) self.wait_rc_channel_value(ch, rc_value, timeout=10) - channels[ch-1] = ch_override_value self.progress("Sending override message ch%u=%u" % (ch, ch_override_value)) self.mav.mav.rc_channels_override_send( @@ -1026,7 +1027,6 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.end_subtest("Checking higher-channel semantics") - except Exception as e: self.progress("Exception caught: %s" % self.get_exception_stacktrace(e)) @@ -1083,7 +1083,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) if m.groundspeed < want_speed and m.throttle == expected_throttle: break - self.progress("now override to stop - but set the switch on the RC transmitter to deny overrides; this should send the speed back up to 5 metres/second") + self.progress("now override to stop - but set the switch on the RC transmitter to deny overrides; this should send the speed back up to 5 metres/second") # noqa self.set_rc(12, 1000) throttle_override_normalized = 500 @@ -1282,9 +1282,14 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) return True if (f1 == pair[1] and f2 == pair[0]): return True - return f1 == f2; + return f1 == f2 - def check_mission_items_same(self, check_atts, want, got, epsilon=None,skip_first_item=False): + def check_mission_items_same(self, + check_atts, + want, + got, + epsilon=None, + skip_first_item=False): self.progress("Checking mission items same") if epsilon is None: epsilon = 1 @@ -1338,7 +1343,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) downloaded_items = self.download_using_mission_protocol(mission_type) self.progress("Downloaded items: (%s)" % str(downloaded_items)) if len(items) != len(downloaded_items): - raise NotAchievedException("Did not download same number of items as uploaded want=%u got=%u" % (len(items), len(downloaded_items))) + raise NotAchievedException("Did not download same number of items as uploaded want=%u got=%u" % + (len(items), len(downloaded_items))) if mission_type == mavutil.mavlink.MAV_MISSION_TYPE_FENCE: self.check_fence_items_same(items, downloaded_items) elif mission_type == mavutil.mavlink.MAV_MISSION_TYPE_MISSION: @@ -1372,8 +1378,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0017 *1e7), # latitude - int(1.0017 *1e7), # longitude + int(1.0017 * 1e7), # latitude + int(1.0017 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), ] @@ -1392,8 +1398,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0017 *1e7), # latitude - int(1.0017 *1e7), # longitude + int(1.0017 * 1e7), # latitude + int(1.0017 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), ] @@ -1412,8 +1418,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0017 *1e7), # latitude - int(1.0017 *1e7), # longitude + int(1.0017 * 1e7), # latitude + int(1.0017 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), ] @@ -1432,8 +1438,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0017 *1e7), # latitude - int(1.0017 *1e7), # longitude + int(1.0017 * 1e7), # latitude + int(1.0017 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), self.mav.mav.mission_item_int_encode( @@ -1448,8 +1454,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0017 *1e7), # latitude - int(1.0017 *1e7), # longitude + int(1.0017 * 1e7), # latitude + int(1.0017 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), ] @@ -1469,7 +1475,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p3 0, # p4 int(100 * 1e7), # bad latitude. bad. - int(1.0017 *1e7), # longitude + int(1.0017 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), ] @@ -1489,7 +1495,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p3 0, # p4 int(1.0 * 1e7), # latitude - int(1.0017 *1e7), # longitude + int(1.0017 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), self.mav.mav.mission_item_int_encode( @@ -1505,7 +1511,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p3 0, # p4 int(2.0 * 1e7), # latitude - int(2.0017 *1e7), # longitude + int(2.0017 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), ] @@ -1526,22 +1532,38 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p3 0, # p4 int(1.0 * 1e7), # latitude - int(1.0017 *1e7), # longitude + int(1.0017 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), ) return ret def fences_which_should_not_upload(self, target_system=1, target_component=1): - return [ ("Bad Frame", self.fence_with_bad_frame(target_system=target_system, target_component=target_component)), - ("Zero Vertex Count", self.fence_with_zero_vertex_count(target_system=target_system, target_component=target_component)), - ("Wrong Vertex Count", self.fence_with_wrong_vertex_count(target_system=target_system, target_component=target_component)), - ("Multiple return points", self.fence_with_multiple_return_points(target_system=target_system, target_component=target_component)), - ("Invalid lat/lon", self.fence_with_invalid_latlon(target_system=target_system, target_component=target_component)), - ("Multiple Return points with bad sequence numbers", self.fence_with_multiple_return_points_with_bad_sequence_numbers(target_system=target_system, target_component=target_component)), - ("Fence which exceeds storage space", self.fence_which_exceeds_storage_space(target_system=target_system, target_component=target_component)), - ] - + return [ + ("Bad Frame", self.fence_with_bad_frame( + target_system=target_system, + target_component=target_component)), + ("Zero Vertex Count", self.fence_with_zero_vertex_count( + target_system=target_system, + target_component=target_component)), + ("Wrong Vertex Count", self.fence_with_wrong_vertex_count( + target_system=target_system, + target_component=target_component)), + ("Multiple return points", self.fence_with_multiple_return_points( + target_system=target_system, + target_component=target_component)), + ("Invalid lat/lon", self.fence_with_invalid_latlon( + target_system=target_system, + target_component=target_component)), + ("Multiple Return points with bad sequence numbers", + self.fence_with_multiple_return_points_with_bad_sequence_numbers( # noqa + target_system=target_system, + target_component=target_component)), + ("Fence which exceeds storage space", + self.fence_which_exceeds_storage_space( + target_system=target_system, + target_component=target_component)), + ] def fence_with_single_return_point(self, target_system=1, target_component=1): return [ @@ -1557,12 +1579,15 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0017 *1e7), # latitude - int(1.0017 *1e7), # longitude + int(1.0017 * 1e7), # latitude + int(1.0017 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), ] - def fence_with_single_return_point_and_5_vertex_inclusion(self, target_system=1, target_component=1): + + def fence_with_single_return_point_and_5_vertex_inclusion(self, + target_system=1, + target_component=1): return [ self.mav.mav.mission_item_int_encode( target_system, @@ -1576,8 +1601,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0017 *1e7), # latitude - int(1.0017 *1e7), # longitude + int(1.0017 * 1e7), # latitude + int(1.0017 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), self.mav.mav.mission_item_int_encode( @@ -1592,8 +1617,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0000 *1e7), # latitude - int(1.0000 *1e7), # longitude + int(1.0000 * 1e7), # latitude + int(1.0000 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), self.mav.mav.mission_item_int_encode( @@ -1608,8 +1633,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0001 *1e7), # latitude - int(1.0000 *1e7), # longitude + int(1.0001 * 1e7), # latitude + int(1.0000 * 1e7), # longitude 32.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), self.mav.mav.mission_item_int_encode( @@ -1624,8 +1649,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0001 *1e7), # latitude - int(1.0001 *1e7), # longitude + int(1.0001 * 1e7), # latitude + int(1.0001 * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), self.mav.mav.mission_item_int_encode( @@ -1640,8 +1665,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0002 *1e7), # latitude - int(1.0002 *1e7), # longitude + int(1.0002 * 1e7), # latitude + int(1.0002 * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), self.mav.mav.mission_item_int_encode( @@ -1656,8 +1681,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0002 *1e7), # latitude - int(1.0003 *1e7), # longitude + int(1.0002 * 1e7), # latitude + int(1.0003 * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), ] @@ -1679,8 +1704,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(lat_deg *1e7), # latitude - int(lng_deg *1e7), # longitude + int(lat_deg * 1e7), # latitude + int(lng_deg * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE) ret.append(item) @@ -1689,7 +1714,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) def fence_with_many_exclusion_polyfences(self, target_system=1, target_component=1): ret = [] seq = 0 - for fencenum in range(0,4): + for fencenum in range(0, 4): pointcount = fencenum + 6 for p in range(0, pointcount): lat_deg = 1.0003 + p/10 + fencenum/100 @@ -1706,8 +1731,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(lat_deg *1e7), # latitude - int(lng_deg *1e7), # longitude + int(lat_deg * 1e7), # latitude + int(lng_deg * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE) ret.append(item) @@ -1716,13 +1741,24 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) def fences_which_should_upload(self, target_system=1, target_component=1): return [ - ("Single Return Point", self.fence_with_single_return_point(target_system=target_system, target_component=target_component)), - ( "Return and 5-vertex-inclusion", self.fence_with_single_return_point_and_5_vertex_inclusion(target_system=target_system, target_component=target_component) ), - ( "Many exclusion circles", self.fence_with_many_exclusion_circles(target_system=target_system, target_component=target_component) ), - ( "Many exclusion polyfences", self.fence_with_many_exclusion_polyfences(target_system=target_system, target_component=target_component) ), - ( "Empty fence", [] ), - ] - + ("Single Return Point", + self.fence_with_single_return_point( + target_system=target_system, + target_component=target_component)), + ("Return and 5-vertex-inclusion", + self.fence_with_single_return_point_and_5_vertex_inclusion( + target_system=target_system, + target_component=target_component)), + ("Many exclusion circles", + self.fence_with_many_exclusion_circles( + target_system=target_system, + target_component=target_component)), + ("Many exclusion polyfences", + self.fence_with_many_exclusion_polyfences( + target_system=target_system, + target_component=target_component)), + ("Empty fence", []), + ] def assert_fence_does_not_upload(self, fence, target_system=1, target_component=1): self.clear_mission(mavutil.mavlink.MAV_MISSION_TYPE_FENCE, @@ -1740,7 +1776,15 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) raise NotAchievedException("Uploaded fence when should not be possible") self.progress("Fence rightfully bounced") - def send_fencepoint_expect_statustext(self, offset, count, lat, lng, statustext_fragment, target_system=1, target_component=1, timeout=10): + def send_fencepoint_expect_statustext(self, + offset, + count, + lat, + lng, + statustext_fragment, + target_system=1, + target_component=1, + timeout=10): self.mav.mav.fence_point_send(target_system, target_component, offset, @@ -1775,7 +1819,6 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) if abs(centroid.lng - want_lng) > 0.000001: raise NotAchievedException("Centroid lng not as expected (want=%f got=%f)" % (want_lng, centroid.lng)) - def test_gcs_fence_update_fencepoint(self, target_system=1, target_component=1): self.start_subtest("Ensuring we can move a fencepoint") items = self.test_gcs_fence_boring_triangle( @@ -1783,7 +1826,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) target_component=target_component) self.upload_using_mission_protocol(mavutil.mavlink.MAV_MISSION_TYPE_FENCE, items) - downloaded_items = self.download_using_mission_protocol(mavutil.mavlink.MAV_MISSION_TYPE_FENCE) +# downloaded_items = self.download_using_mission_protocol(mavutil.mavlink.MAV_MISSION_TYPE_FENCE) item_seq = 2 item = items[item_seq] print("item is (%s)" % str(item)) @@ -1822,8 +1865,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0000 *1e7), # latitude - int(1.0000 *1e7), # longitude + int(1.0000 * 1e7), # latitude + int(1.0000 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), self.mav.mav.mission_item_int_encode( @@ -1838,8 +1881,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0001 *1e7), # latitude - int(1.0000 *1e7), # longitude + int(1.0001 * 1e7), # latitude + int(1.0000 * 1e7), # longitude 32.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), self.mav.mav.mission_item_int_encode( @@ -1854,8 +1897,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0001 *1e7), # latitude - int(1.0001 *1e7), # longitude + int(1.0001 * 1e7), # latitude + int(1.0001 * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), self.mav.mav.mission_item_int_encode( @@ -1870,8 +1913,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.00015 *1e7), # latitude - int(1.00015 *1e7), # longitude + int(1.00015 * 1e7), # latitude + int(1.00015 * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), ]) @@ -1890,8 +1933,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0000 *1e7), # latitude - int(1.0000 *1e7), # longitude + int(1.0000 * 1e7), # latitude + int(1.0000 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), self.mav.mav.mission_item_int_encode( @@ -1906,8 +1949,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0002 *1e7), # latitude - int(1.0000 *1e7), # longitude + int(1.0002 * 1e7), # latitude + int(1.0000 * 1e7), # longitude 32.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), self.mav.mav.mission_item_int_encode( @@ -1922,8 +1965,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0002 *1e7), # latitude - int(1.0001 *1e7), # longitude + int(1.0002 * 1e7), # latitude + int(1.0001 * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), self.mav.mav.mission_item_int_encode( @@ -1938,8 +1981,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0000 *1e7), # latitude - int(1.0001 *1e7), # longitude + int(1.0000 * 1e7), # latitude + int(1.0001 * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), ]) @@ -1967,8 +2010,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0017 *1e7), # latitude - int(1.0017 *1e7), # longitude + int(1.0017 * 1e7), # latitude + int(1.0017 * 1e7), # longitude 0.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE) print("item is (%s)" % str(item)) @@ -1992,8 +2035,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0017 *1e7), # latitude - int(1.0017 *1e7), # longitude + int(1.0017 * 1e7), # latitude + int(1.0017 * 1e7), # longitude 0.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE) self.click_location_from_item(item2) @@ -2012,14 +2055,16 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.delay_sim_time(5) downloaded_items = self.download_using_mission_protocol(mavutil.mavlink.MAV_MISSION_TYPE_FENCE) if len(downloaded_items) != pointcount: - raise NotAchievedException("Did not get expected number of points returned (want=%u got=%u)" % (pointcount, len(downloaded_items))) + raise NotAchievedException("Did not get expected number of points returned (want=%u got=%u)" % + (pointcount, len(downloaded_items))) self.end_subsubtest("fence addpoly") self.start_subsubtest("fence movepolypoint") self.mavproxy.send("fence clear\n") self.delay_sim_time(1) - triangle = self.test_gcs_fence_boring_triangle(target_system=target_system, - target_component=target_component) + triangle = self.test_gcs_fence_boring_triangle( + target_system=target_system, + target_component=target_component) self.upload_using_mission_protocol(mavutil.mavlink.MAV_MISSION_TYPE_FENCE, triangle) self.mavproxy.send("fence list\n") @@ -2040,7 +2085,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.mavproxy.expect("fence disabled") self.end_subsubtest("fence enable and disable") -# MANUAL> usage: fence +# MANUAL> usage: fence # noqa def test_gcs_fence(self): target_system = 1 @@ -2049,13 +2094,13 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.progress("Testing FENCE_POINT protocol") self.start_subtest("FENCE_TOTAL manipulation") - self.clear_mission(mavutil.mavlink.MAV_MISSION_TYPE_FENCE); + self.clear_mission(mavutil.mavlink.MAV_MISSION_TYPE_FENCE) self.assert_parameter_value("FENCE_TOTAL", 0) self.set_parameter("FENCE_TOTAL", 5) self.assert_parameter_value("FENCE_TOTAL", 5) - self.clear_mission(mavutil.mavlink.MAV_MISSION_TYPE_FENCE); + self.clear_mission(mavutil.mavlink.MAV_MISSION_TYPE_FENCE) self.assert_parameter_value("FENCE_TOTAL", 0) self.progress("sending out-of-range fencepoint") @@ -2098,11 +2143,21 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) raise NotAchievedException("Unexpected lat/lon in fencepoint") self.progress("Storing a return point") - self.roundtrip_fencepoint_protocol(0, 5, 1.2345, 5.4321, target_system=target_system, target_component=target_component) + self.roundtrip_fencepoint_protocol(0, + 5, + 1.2345, + 5.4321, + target_system=target_system, + target_component=target_component) lat = 2.345 lng = 4.321 - self.roundtrip_fencepoint_protocol(0, 5, lat, lng, target_system=target_system, target_component=target_component) + self.roundtrip_fencepoint_protocol(0, + 5, + lat, + lng, + target_system=target_system, + target_component=target_component) if not self.mavproxy_can_do_mision_item_protocols(): self.progress("MAVProxy too old to do fence point protocols") @@ -2113,11 +2168,15 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) if len(items) != 1: raise NotAchievedException("Unexpected fencepoint count (want=%u got=%u)" % (1, len(items))) if items[0].command != mavutil.mavlink.MAV_CMD_NAV_FENCE_RETURN_POINT: - raise NotAchievedException("Fence return point not of correct type expected (%u) got %u" % (items[0].command, mavutil.mavlink.MAV_CMD_NAV_FENCE_RETURN_POINT)) + raise NotAchievedException( + "Fence return point not of correct type expected (%u) got %u" % + (items[0].command, + mavutil.mavlink.MAV_CMD_NAV_FENCE_RETURN_POINT)) if items[0].frame != mavutil.mavlink.MAV_FRAME_GLOBAL: - raise NotAchievedException("Unexpected frame want=%s got=%s," % - (self.string_for_frame(mavutil.mavlink.MAV_FRAME_GLOBAL), - self.string_for_frame(items[0].frame))) + raise NotAchievedException( + "Unexpected frame want=%s got=%s," % + (self.string_for_frame(mavutil.mavlink.MAV_FRAME_GLOBAL), + self.string_for_frame(items[0].frame))) got_lat = items[0].x want_lat = lat * 1e7 if abs(got_lat - want_lat) > 1: @@ -2140,7 +2199,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) if len(downloaded_items) != len(items): raise NotAchievedException("Did not download expected number of items (wanted=%u got=%u)" % (len(items), len(downloaded_items))) - self.assert_parameter_value("FENCE_TOTAL", len(items) +1) # +1 for closing + self.assert_parameter_value("FENCE_TOTAL", len(items) + 1) # +1 for closing self.progress("Ensuring fence items match what we sent up") self.check_fence_items_same(items, downloaded_items) @@ -2157,8 +2216,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) target_component=target_component) self.progress("Checking count post-nuke") self.clear_mission(mavutil.mavlink.MAV_MISSION_TYPE_FENCE, - target_system=target_system, - target_component=target_component) + target_system=target_system, + target_component=target_component) self.assert_mission_count_on_link(self.mav, 0, target_system, @@ -2336,14 +2395,17 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) raise NotAchievedException("Unexpected target system %u want=%u" % (m.target_system, mav.mav.srcSystem)) if m.seq != item: - raise NotAchievedException("Incorrect sequence number on received item got=%u want=%u" % - (m.seq, item)) + raise NotAchievedException( + "Incorrect sequence number on received item got=%u want=%u" % + (m.seq, item)) if m.mission_type != mission_type: - raise NotAchievedException("Mission type incorrect on received item (want=%u got=%u)" % - (mission_type, m.mission_type)) + raise NotAchievedException( + "Mission type incorrect on received item (want=%u got=%u)" % + (mission_type, m.mission_type)) if m.target_component != mav.mav.srcComponent: - raise NotAchievedException("Unexpected target component %u want=%u" % - (m.target_component, mav.mav.srcComponent)) + raise NotAchievedException( + "Unexpected target component %u want=%u" % + (m.target_component, mav.mav.srcComponent)) return m def get_mission_item_on_link(self, item, mav, target_system, target_component, mission_type): @@ -2362,7 +2424,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) (m.target_system, mav.mav.srcSystem)) if m.seq != item: raise NotAchievedException("Incorrect sequence number on received item_int got=%u want=%u" % - (m.seq, item)) + (m.seq, item)) if m.mission_type != mission_type: raise NotAchievedException("Mission type incorrect on received item_int (want=%u got=%u)" % (mission_type, m.mission_type)) @@ -2423,7 +2485,6 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) def mavproxy_can_do_mision_item_protocols(self): return False - mavproxy_version = self.mavproxy_version() if not self.mavproxy_version_gt(1, 8, 12): self.progress("MAVProxy is too old; skipping tests") return False @@ -2476,12 +2537,12 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) if len(downloaded_items) != 1: raise NotAchievedException("Unexpected count (got=%u want=1)" % (len(downloaded_items), )) - if (downloaded_items[0].x - int(lat *1e7)) > 1: + if (downloaded_items[0].x - int(lat * 1e7)) > 1: raise NotAchievedException("Bad rally lat. Want=%d got=%d" % - (int(lat*1e7), downloaded_items[0].x)) - if (downloaded_items[0].y - int(lng *1e7)) > 1: + (int(lat * 1e7), downloaded_items[0].x)) + if (downloaded_items[0].y - int(lng * 1e7)) > 1: raise NotAchievedException("Bad rally lng. Want=%d got=%d" % - (int(lng*1e7), downloaded_items[0].y)) + (int(lng * 1e7), downloaded_items[0].y)) if (downloaded_items[0].z - int(90)) > 1: raise NotAchievedException("Bad rally alt. Want=90 got=%d" % (downloaded_items[0].y)) @@ -2490,7 +2551,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.start_subsubtest("rally list") util.pexpect_drain(self.mavproxy) self.mavproxy.send('rally list\n') - self.mavproxy.expect("Saved 1 rally items to ([^\s]*)\s") + self.mavproxy.expect(r"Saved 1 rally items to ([^\s]*)\s") filename = self.mavproxy.match.group(1) self.assert_rally_filepath_content(filename, '''QGC WPL 110 0 0 3 5100 0.000000 0.000000 0.000000 0.000000 -5.678900 98.234100 90.000000 0 @@ -2501,7 +2562,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) util.pexpect_drain(self.mavproxy) save_tmppath = self.buildlogs_path("rally-testing-tmp.txt") self.mavproxy.send('rally save %s\n' % save_tmppath) - self.mavproxy.expect("Saved 1 rally items to ([^\s]*)\s") + self.mavproxy.expect(r"Saved 1 rally items to ([^\s]*)\s") filename = self.mavproxy.match.group(1) if filename != save_tmppath: raise NotAchievedException("Bad save filepath; want=%s got=%s" % (save_tmppath, filename)) @@ -2510,7 +2571,6 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) ''') self.end_subsubtest("rally save") - self.start_subsubtest("rally savecsv") util.pexpect_drain(self.mavproxy) csvpath = self.buildlogs_path("rally-testing-tmp.csv") @@ -2540,15 +2600,17 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) # warning: uses file saved from previous test self.start_subtest("Check rally load from filepath") self.mavproxy.send('rally load %s\n' % save_tmppath) - self.mavproxy.expect("Loaded 1 rally items from ([^\s]*)\s") + self.mavproxy.expect(r"Loaded 1 rally items from ([^\s]*)\s") self.mavproxy.expect("Sent all .* rally items") # notional race condition here downloaded_items = self.download_using_mission_protocol(mavutil.mavlink.MAV_MISSION_TYPE_RALLY) if len(downloaded_items) != 1: raise NotAchievedException("Unexpected item count (%u)" % len(downloaded_items)) - if abs(int(downloaded_items[0].x) - int(lat*1e7)) > 3: - raise NotAchievedException("Expected lat=%d got=%d" % (lat*1e7, downloaded_items[0].x)) - if abs(int(downloaded_items[0].y) - int(lng*1e7)) > 10: - raise NotAchievedException("Expected lng=%d got=%d" % (lng*1e7, downloaded_items[0].y)) + if abs(int(downloaded_items[0].x) - int(lat * 1e7)) > 3: + raise NotAchievedException("Expected lat=%d got=%d" % + (lat * 1e7, downloaded_items[0].x)) + if abs(int(downloaded_items[0].y) - int(lng * 1e7)) > 10: + raise NotAchievedException("Expected lng=%d got=%d" % + (lng * 1e7, downloaded_items[0].y)) self.end_subsubtest("rally load") self.start_subsubtest("rally changealt") @@ -2579,19 +2641,19 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) downloaded_items = self.download_using_mission_protocol(mavutil.mavlink.MAV_MISSION_TYPE_RALLY) if len(downloaded_items) != 2: raise NotAchievedException("Unexpected item count (%u)" % len(downloaded_items)) - if abs(int(downloaded_items[0].x) - int(1*1e7)) > 3: - raise NotAchievedException("Expected lat=%d got=%d" % (1*1e7, downloaded_items[0].x)) - if abs(int(downloaded_items[0].y) - int(1*1e7)) > 10: - raise NotAchievedException("Expected lng=%d got=%d" % (1*1e7, downloaded_items[0].y)) + if abs(int(downloaded_items[0].x) - int(1 * 1e7)) > 3: + raise NotAchievedException("Expected lat=%d got=%d" % (1 * 1e7, downloaded_items[0].x)) + if abs(int(downloaded_items[0].y) - int(1 * 1e7)) > 10: + raise NotAchievedException("Expected lng=%d got=%d" % (1 * 1e7, downloaded_items[0].y)) # at some stage ArduPilot will stop rounding altitude. This # will break then. if abs(int(downloaded_items[0].z) - int(17.6)) > 0.0001: raise NotAchievedException("Expected alt=%f got=%f" % (17.6, downloaded_items[0].z)) - if abs(int(downloaded_items[1].x) - int(2*1e7)) > 3: - raise NotAchievedException("Expected lat=%d got=%d" % (2*1e7, downloaded_items[0].x)) - if abs(int(downloaded_items[1].y) - int(2*1e7)) > 10: - raise NotAchievedException("Expected lng=%d got=%d" % (2*1e7, downloaded_items[0].y)) + if abs(int(downloaded_items[1].x) - int(2 * 1e7)) > 3: + raise NotAchievedException("Expected lat=%d got=%d" % (2 * 1e7, downloaded_items[0].x)) + if abs(int(downloaded_items[1].y) - int(2 * 1e7)) > 10: + raise NotAchievedException("Expected lng=%d got=%d" % (2 * 1e7, downloaded_items[0].y)) # at some stage ArduPilot will stop rounding altitude. This # will break then. if abs(int(downloaded_items[1].z) - int(19.1)) > 0.0001: @@ -2606,19 +2668,19 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) if len(downloaded_items) != 2: raise NotAchievedException("Unexpected item count (%u)" % len(downloaded_items)) - if abs(int(downloaded_items[0].x) - int(1*1e7)) > 3: - raise NotAchievedException("Expected lat=%d got=%d" % (1*1e7, downloaded_items[0].x)) - if abs(int(downloaded_items[0].y) - int(1*1e7)) > 10: - raise NotAchievedException("Expected lng=%d got=%d" % (1*1e7, downloaded_items[0].y)) + if abs(int(downloaded_items[0].x) - int(1 * 1e7)) > 3: + raise NotAchievedException("Expected lat=%d got=%d" % (1 * 1e7, downloaded_items[0].x)) + if abs(int(downloaded_items[0].y) - int(1 * 1e7)) > 10: + raise NotAchievedException("Expected lng=%d got=%d" % (1 * 1e7, downloaded_items[0].y)) # at some stage ArduPilot will stop rounding altitude. This # will break then. if abs(int(downloaded_items[0].z) - int(17.3)) > 0.0001: raise NotAchievedException("Expected alt=%f got=%f" % (17.3, downloaded_items[0].z)) - if abs(int(downloaded_items[1].x) - int(2*1e7)) > 3: - raise NotAchievedException("Expected lat=%d got=%d" % (2*1e7, downloaded_items[0].x)) - if abs(int(downloaded_items[1].y) - int(2*1e7)) > 10: - raise NotAchievedException("Expected lng=%d got=%d" % (2*1e7, downloaded_items[0].y)) + if abs(int(downloaded_items[1].x) - int(2 * 1e7)) > 3: + raise NotAchievedException("Expected lat=%d got=%d" % (2 * 1e7, downloaded_items[0].x)) + if abs(int(downloaded_items[1].y) - int(2 * 1e7)) > 10: + raise NotAchievedException("Expected lng=%d got=%d" % (2 * 1e7, downloaded_items[0].y)) # at some stage ArduPilot will stop rounding altitude. This # will break then. if abs(int(downloaded_items[1].z) - int(17.3)) > 0.0001: @@ -2851,7 +2913,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.start_subsubtest("rally update") self.click_three_in(target_system=target_system, target_component=target_component) pure_items = self.download_using_mission_protocol(mavutil.mavlink.MAV_MISSION_TYPE_RALLY) - rally_update_tmpfilepath= self.buildlogs_path("rally-tmp-update.txt") + rally_update_tmpfilepath = self.buildlogs_path("rally-tmp-update.txt") self.mavproxy.send("rally save %s\n" % rally_update_tmpfilepath) self.delay_sim_time(5) self.progress("Moving waypoint") @@ -2882,7 +2944,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.end_subsubtest("rally update") -# MANUAL> usage: rally +# MANUAL> usage: rally # noqa def test_gcs_rally(self): target_system = 1 @@ -2905,7 +2967,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.mavproxy.expect("Unloaded module wp") self.drain_mav() try: - item1_lat = int(2.0000 *1e7) + item1_lat = int(2.0000 * 1e7) items = [ self.mav.mav.mission_item_int_encode( target_system, @@ -2919,8 +2981,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0000 *1e7), # latitude - int(1.0000 *1e7), # longitude + int(1.0000 * 1e7), # latitude + int(1.0000 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_RALLY), self.mav.mav.mission_item_int_encode( @@ -2936,7 +2998,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p3 0, # p4 item1_lat, # latitude - int(2.0000 *1e7), # longitude + int(2.0000 * 1e7), # longitude 32.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_RALLY), self.mav.mav.mission_item_int_encode( @@ -2951,8 +3013,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(3.0000 *1e7), # latitude - int(3.0000 *1e7), # longitude + int(3.0000 * 1e7), # latitude + int(3.0000 * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_RALLY), ] @@ -2961,36 +3023,45 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) downloaded = self.download_using_mission_protocol(mavutil.mavlink.MAV_MISSION_TYPE_RALLY) print("Got items (%s)" % str(items)) if len(downloaded) != len(items): - raise NotAchievedException("Did not download correct number of items want=%u got=%u" % (len(downloaded), len(items))) + raise NotAchievedException( + "Did not download correct number of items want=%u got=%u" % + (len(downloaded), len(items))) rally_total = self.get_parameter("RALLY_TOTAL") if rally_total != len(downloaded): - raise NotAchievedException("Unexpected rally point count: want=%u got=%u" % (len(items), rally_total)) + raise NotAchievedException( + "Unexpected rally point count: want=%u got=%u" % + (len(items), rally_total)) self.progress("Pruning count by setting parameter (urgh)") self.set_parameter("RALLY_TOTAL", 2) downloaded = self.download_using_mission_protocol(mavutil.mavlink.MAV_MISSION_TYPE_RALLY) if len(downloaded) != 2: - raise NotAchievedException("Failed to prune rally points by setting parameter. want=%u got=%u" % (2, len(downloaded))) + raise NotAchievedException( + "Failed to prune rally points by setting parameter. want=%u got=%u" % + (2, len(downloaded))) self.progress("Uploading a third item using old protocol") - new_item2_lat = int(6.0 *1e7) + new_item2_lat = int(6.0 * 1e7) self.set_parameter("RALLY_TOTAL", 3) self.mav.mav.rally_point_send(target_system, target_component, 2, # sequence number 3, # total count new_item2_lat, - int(7.0 *1e7), + int(7.0 * 1e7), 15, 0, # "break" alt?! 0, # "land dir" 0) # flags downloaded = self.download_using_mission_protocol(mavutil.mavlink.MAV_MISSION_TYPE_RALLY) if len(downloaded) != 3: - raise NotAchievedException("resetting rally point count didn't change items returned") + raise NotAchievedException( + "resetting rally point count didn't change items returned") if downloaded[2].x != new_item2_lat: - raise NotAchievedException("Bad lattitude in downloaded item: want=%u got=%u" % (new_item2_lat, downloaded[2].x)) + raise NotAchievedException( + "Bad lattitude in downloaded item: want=%u got=%u" % + (new_item2_lat, downloaded[2].x)) self.progress("Grabbing original item 1 using original protocol") self.mav.mav.rally_fetch_point_send(target_system, @@ -2998,7 +3069,9 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 1) m = self.mav.recv_match(type="RALLY_POINT", blocking=True, timeout=1) if m.target_system != self.mav.source_system: - raise NotAchievedException("Bad target_system on received rally point (want=%u got=%u)" % (255, m.target_system)) + raise NotAchievedException( + "Bad target_system on received rally point (want=%u got=%u)" % + (255, m.target_system)) if m.target_component != self.mav.source_component: # autotest's component ID raise NotAchievedException("Bad target_component on received rally point") if m.lat != item1_lat: @@ -3041,7 +3114,9 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) break if self.get_sim_time_cached() - tstart > 100: raise NotAchievedException("Did not get both ack and statustext") - m = self.mav.recv_match(type=['STATUSTEXT','MISSION_ACK'], blocking=True, timeout=1) + m = self.mav.recv_match(type=['STATUSTEXT', 'MISSION_ACK'], + blocking=True, + timeout=1) if m is None: continue self.progress("Got (%s)" % str(m)) @@ -3078,7 +3153,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.reboot_sitl() mav2 = mavutil.mavlink_connection("tcp:localhost:5763", robust_parsing=True, - source_system = 7, + source_system=7, source_component=7) mav2.mav.mission_request_list_send(target_system, target_component, @@ -3094,13 +3169,33 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.set_parameter("SERIAL2_PROTOCOL", 2) expected_count = 3 self.progress("Assert mission count on new link") - self.assert_mission_count_on_link(mav2, expected_count, target_system, target_component, mavutil.mavlink.MAV_MISSION_TYPE_RALLY) + self.assert_mission_count_on_link( + mav2, + expected_count, + target_system, + target_component, + mavutil.mavlink.MAV_MISSION_TYPE_RALLY) self.progress("Assert mission count on original link") - self.assert_mission_count_on_link(self.mav, expected_count, target_system, target_component, mavutil.mavlink.MAV_MISSION_TYPE_RALLY) + self.assert_mission_count_on_link( + self.mav, + expected_count, + target_system, + target_component, + mavutil.mavlink.MAV_MISSION_TYPE_RALLY) self.progress("Get first item on new link") - m2 = self.get_mission_item_int_on_link(2, mav2, target_system, target_component, mavutil.mavlink.MAV_MISSION_TYPE_RALLY) + m2 = self.get_mission_item_int_on_link( + 2, + mav2, + target_system, + target_component, + mavutil.mavlink.MAV_MISSION_TYPE_RALLY) self.progress("Get first item on original link") - m = self.get_mission_item_int_on_link(2, self.mav, target_system, target_component, mavutil.mavlink.MAV_MISSION_TYPE_RALLY) + m = self.get_mission_item_int_on_link( + 2, + self.mav, + target_system, + target_component, + mavutil.mavlink.MAV_MISSION_TYPE_RALLY) if m2.x != m.x: raise NotAchievedException("mission items do not match (%d vs %d)" % (m2.x, m.x)) self.get_mission_item_on_link(2, self.mav, target_system, target_component, mavutil.mavlink.MAV_MISSION_TYPE_RALLY) @@ -3217,8 +3312,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.1000 *1e7), # latitude - int(1.2000 *1e7), # longitude + int(1.1000 * 1e7), # latitude + int(1.2000 * 1e7), # longitude 321.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_MISSION), self.assert_receive_mission_item_request(mavutil.mavlink.MAV_MISSION_TYPE_MISSION, 1) @@ -3257,8 +3352,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.1000 *1e7), # latitude - int(1.2000 *1e7), # longitude + int(1.1000 * 1e7), # latitude + int(1.2000 * 1e7), # longitude 321.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_MISSION), self.assert_receive_mission_item_request(mavutil.mavlink.MAV_MISSION_TYPE_MISSION, 2) @@ -3277,8 +3372,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.1000 *1e7), # latitude - int(1.2000 *1e7), # longitude + int(1.1000 * 1e7), # latitude + int(1.2000 * 1e7), # longitude 321.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_MISSION), self.assert_receive_mission_ack(mavutil.mavlink.MAV_MISSION_TYPE_MISSION) @@ -3335,8 +3430,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.1000 *1e7), # latitude - int(1.2000 *1e7), # longitude + int(1.1000 * 1e7), # latitude + int(1.2000 * 1e7), # longitude 321.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_RALLY), self.assert_receive_mission_ack(mavutil.mavlink.MAV_MISSION_TYPE_RALLY, @@ -3356,15 +3451,15 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.1000 *1e7), # latitude - int(1.2000 *1e7), # longitude + int(1.1000 * 1e7), # latitude + int(1.2000 * 1e7), # longitude 321.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_RALLY), self.assert_receive_mission_ack(mavutil.mavlink.MAV_MISSION_TYPE_RALLY, want_type=mavutil.mavlink.MAV_MISSION_INVALID_SEQUENCE) self.progress("Now provide correct item") - item1_latitude = int(1.2345*1e7) + item1_latitude = int(1.2345 * 1e7) self.drain_mav(unparsed=True) self.mav.mav.mission_item_int_send( target_system, @@ -3379,7 +3474,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p3 0, # p4 item1_latitude, # latitude - int(1.2000 *1e7), # longitude + int(1.2000 * 1e7), # longitude 321.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_RALLY), self.assert_receive_mission_item_request(mavutil.mavlink.MAV_MISSION_TYPE_RALLY, 2) @@ -3391,18 +3486,48 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.progress("TODO: ensure partial mission write was good") self.start_subtest("clear mission types") - self.assert_mission_count_on_link(self.mav, 3, target_system, target_component, mavutil.mavlink.MAV_MISSION_TYPE_RALLY) - self.assert_mission_count_on_link(self.mav, 3, target_system, target_component, mavutil.mavlink.MAV_MISSION_TYPE_MISSION) + self.assert_mission_count_on_link( + self.mav, + 3, + target_system, + target_component, + mavutil.mavlink.MAV_MISSION_TYPE_RALLY) + self.assert_mission_count_on_link( + self.mav, + 3, + target_system, + target_component, + mavutil.mavlink.MAV_MISSION_TYPE_MISSION) self.drain_mav(unparsed=True) self.mav.mav.mission_clear_all_send(target_system, target_component, mavutil.mavlink.MAV_MISSION_TYPE_RALLY) self.assert_receive_mission_ack(mavutil.mavlink.MAV_MISSION_TYPE_RALLY) - self.assert_mission_count_on_link(self.mav, 0, target_system, target_component, mavutil.mavlink.MAV_MISSION_TYPE_RALLY) - self.assert_mission_count_on_link(self.mav, 3, target_system, target_component, mavutil.mavlink.MAV_MISSION_TYPE_MISSION) + self.assert_mission_count_on_link( + self.mav, + 0, + target_system, + target_component, + mavutil.mavlink.MAV_MISSION_TYPE_RALLY) + self.assert_mission_count_on_link( + self.mav, + 3, + target_system, + target_component, + mavutil.mavlink.MAV_MISSION_TYPE_MISSION) self.drain_mav(unparsed=True) self.mav.mav.mission_clear_all_send(target_system, target_component, mavutil.mavlink.MAV_MISSION_TYPE_MISSION) self.assert_receive_mission_ack(mavutil.mavlink.MAV_MISSION_TYPE_MISSION) - self.assert_mission_count_on_link(self.mav, 0, target_system, target_component, mavutil.mavlink.MAV_MISSION_TYPE_RALLY) - self.assert_mission_count_on_link(self.mav, 0, target_system, target_component, mavutil.mavlink.MAV_MISSION_TYPE_MISSION) + self.assert_mission_count_on_link( + self.mav, + 0, + target_system, + target_component, + mavutil.mavlink.MAV_MISSION_TYPE_RALLY) + self.assert_mission_count_on_link( + self.mav, + 0, + target_system, + target_component, + mavutil.mavlink.MAV_MISSION_TYPE_MISSION) self.start_subtest("try sending out-of-range counts") self.drain_mav(unparsed=True) @@ -3457,12 +3582,12 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.start_subsubtest("wp changealt") downloaded_items = self.download_using_mission_protocol(mavutil.mavlink.MAV_MISSION_TYPE_MISSION) changealt_item = 1 - oldalt = downloaded_items[changealt_item].z +# oldalt = downloaded_items[changealt_item].z want_newalt = 37.2 self.mavproxy.send('wp changealt %u %f\n' % (changealt_item, want_newalt)) self.delay_sim_time(5) downloaded_items = self.download_using_mission_protocol(mavutil.mavlink.MAV_MISSION_TYPE_MISSION) - if abs(downloaded_items[changealt_item].z - want_newalt) > 0.0001: + if abs(downloaded_items[changealt_item].z - want_newalt) > 0.0001: raise NotAchievedException( "changealt didn't (want=%f got=%f)" % (want_newalt, downloaded_items[changealt_item].z)) @@ -3511,8 +3636,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0 *1e7), # latitude - int(1.0 *1e7), # longitude + int(1.0 * 1e7), # latitude + int(1.0 * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_MISSION), self.mav.mav.mission_item_int_encode( @@ -3527,8 +3652,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(2.0 *1e7), # latitude - int(2.0 *1e7), # longitude + int(2.0 * 1e7), # latitude + int(2.0 * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_MISSION), ] @@ -3560,8 +3685,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.5 *1e7), # latitude - int(1.5 *1e7), # longitude + int(1.5 * 1e7), # latitude + int(1.5 * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_MISSION), items[2], @@ -3570,7 +3695,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.check_mission_waypoint_items_same(items_with_split_in, downloaded_items) - # MANUAL> usage: wp + # MANUAL> usage: wp # noqa def wait_location_sending_target(self, loc, target_system=1, target_component=1, timeout=60, max_delta=2): tstart = self.get_sim_time() @@ -3599,8 +3724,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) target_component, mavutil.mavlink.MAV_FRAME_GLOBAL_INT, type_mask, - int(loc.lat*1.0e7), - int(loc.lng*1.0e7), + int(loc.lat * 1.0e7), + int(loc.lng * 1.0e7), 0, # alt 0, # x-ve 0, # y-vel @@ -3620,8 +3745,9 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.progress("Target: (%s)" % str(m), send_statustext=False) elif t == "GLOBAL_POSITION_INT": self.progress("Position: (%s)" % str(m), send_statustext=False) - delta = self.get_distance(mavutil.location(m.lat*1e-7, m.lon*1e-7, 0, 0), - loc) + delta = self.get_distance( + mavutil.location(m.lat * 1e-7, m.lon * 1e-7, 0, 0), + loc) self.progress("delta: %s" % str(delta), send_statustext=False) if delta < max_delta: self.progress("Reached destination") @@ -3653,8 +3779,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) target_component, mavutil.mavlink.MAV_FRAME_GLOBAL_INT, type_mask, - int(loc.lat*1.0e7), - int(loc.lng*1.0e7), + int(loc.lat * 1.0e7), + int(loc.lng * 1.0e7), 0, # alt 0, # x-ve 0, # y-vel @@ -3694,7 +3820,6 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) timeout=120): tstart = self.get_sim_time() last_sent = 0 - seen_fence_breach = False type_mask = (mavutil.mavlink.POSITION_TARGET_TYPEMASK_VX_IGNORE + mavutil.mavlink.POSITION_TARGET_TYPEMASK_VY_IGNORE + @@ -3719,8 +3844,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) target_component, mavutil.mavlink.MAV_FRAME_GLOBAL_INT, type_mask, - int(loc.lat*1.0e7), - int(loc.lng*1.0e7), + int(loc.lat * 1.0e7), + int(loc.lng * 1.0e7), 0, # alt 0, # x-ve 0, # y-vel @@ -3740,8 +3865,12 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) print("Target: (%s)" % str(m)) elif t == "GLOBAL_POSITION_INT": print("Position: (%s)" % str(m)) - delta = self.get_distance(mavutil.location(m.lat*1e-7, m.lon*1e-7, 0, 0), - mavutil.location(expected_stopping_point.lat, expected_stopping_point.lng, 0, 0)) + delta = self.get_distance( + mavutil.location(m.lat * 1e-7, m.lon * 1e-7, 0, 0), + mavutil.location(expected_stopping_point.lat, + expected_stopping_point.lng, + 0, + 0)) print("delta: %s want_delta<%f" % (str(delta), expected_distance_epsilon)) at_stopping_point = delta < expected_distance_epsilon elif t == "VFR_HUD": @@ -3816,8 +3945,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(here.lat*1e7), # latitude - int(here.lng*1e7), # longitude + int(here.lat * 1e7), # latitude + int(here.lng * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), self.mav.mav.mission_item_int_encode( @@ -3832,8 +3961,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(self.offset_location_ne(here, 100, 100).lat*1e7), # latitude - int(here.lng*1e7), # longitude + int(self.offset_location_ne(here, 100, 100).lat * 1e7), # latitude + int(here.lng * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), ] @@ -3868,8 +3997,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(here.lat*1e7), # latitude - int(here.lng*1e7), # longitude + int(here.lat * 1e7), # latitude + int(here.lng * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), self.mav.mav.mission_item_int_encode( @@ -3884,11 +4013,11 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(self.offset_location_ne(here, 100, 100).lat*1e7), # latitude - int(here.lng*1e7), # longitude + int(self.offset_location_ne(here, 100, 100).lat * 1e7), # latitude + int(here.lng * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE), - ]; + ] self.upload_using_mission_protocol(mavutil.mavlink.MAV_MISSION_TYPE_FENCE, items) self.delay_sim_time(5) # ArduPilot only checks for breaches @1Hz @@ -4050,7 +4179,6 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) if m.target_component != self.mav.mav.srcComponent: raise NotAchievedException("Incorrect target component in MISSION_REQUEST") - def test_fence_upload_timeouts_2(self, target_system=1, target_component=1): self.start_subtest("fence upload timeouts 2") self.progress("Telling victim there will be two items coming") @@ -4078,8 +4206,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.1 *1e7), # latitude - int(1.2 *1e7), # longitude + int(1.1 * 1e7), # latitude + int(1.2 * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE) self.expect_request_for_item(item) @@ -4099,8 +4227,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.1 *1e7), # latitude - int(1.2 *1e7), # longitude + int(1.1 * 1e7), # latitude + int(1.2 * 1e7), # longitude 33.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_FENCE) @@ -4252,7 +4380,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.offset_location_ne(here, 50, 40), # tr self.offset_location_ne(here, -50, 40), # tl, self.offset_location_ne(here, -50, 20), # closing point - ]) + ]) self.roundtrip_fence_using_fencepoint_protocol( [ self.offset_location_ne(here, 0, 0), # bl // return point @@ -4260,7 +4388,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.offset_location_ne(here, 50, 20), # br self.offset_location_ne(here, -50, 40), # tl, self.offset_location_ne(here, -50, 20), # closing point - ]) + ]) self.roundtrip_fence_using_fencepoint_protocol( [ self.offset_location_ne(here, 0, 0), # bl // return point @@ -4269,7 +4397,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.offset_location_ne(here, 50, 40), # tr self.offset_location_ne(here, -50, 40), # tl, self.offset_location_ne(here, -50, 20), # closing point - ]) + ]) def test_poly_fence_reboot_survivability(self): here = self.mav.location() @@ -4326,7 +4454,6 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.test_poly_fence_reboot_survivability() - def test_poly_fence_inclusion_overlapping_inclusion_circles(self, here, target_system=1, target_component=1): self.start_subtest("Overlapping circular inclusion") self.upload_fences_from_locations( @@ -4361,7 +4488,10 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) def test_poly_fence_inclusion(self, here, target_system=1, target_component=1): self.progress("Circle and Polygon inclusion") - self.test_poly_fence_inclusion_overlapping_inclusion_circles(here, target_system=target_system, target_component=target_component) + self.test_poly_fence_inclusion_overlapping_inclusion_circles( + here, + target_system=target_system, + target_component=target_component) self.upload_fences_from_locations( mavutil.mavlink.MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION, @@ -4476,7 +4606,6 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) target_system=target_system, target_component=target_component) - def drive_smartrtl(self): self.change_mode("STEERING") self.wait_ready_to_arm() @@ -4511,14 +4640,15 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) def test_motor_test(self): '''AKA run-rover-run''' magic_throttle_value = 1812 - self.run_cmd(mavutil.mavlink.MAV_CMD_DO_MOTOR_TEST, - 1, # p1 - motor instance - mavutil.mavlink.MOTOR_TEST_THROTTLE_PWM, # p2 - throttle type - magic_throttle_value, # p3 - throttle - 5, # p4 - timeout - 1, # p5 - motor count - 0, # p6 - test order (see MOTOR_TEST_ORDER) - 0, # p7 + self.run_cmd( + mavutil.mavlink.MAV_CMD_DO_MOTOR_TEST, + 1, # p1 - motor instance + mavutil.mavlink.MOTOR_TEST_THROTTLE_PWM, # p2 - throttle type + magic_throttle_value, # p3 - throttle + 5, # p4 - timeout + 1, # p5 - motor count + 0, # p6 - test order (see MOTOR_TEST_ORDER) + 0, # p7 ) self.wait_armed() self.progress("Waiting for magic throttle value") @@ -4570,7 +4700,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) raise ex def send_guided_mission_item(self, loc, target_system=1, target_component=1): - self.mav.mav.mission_item_send ( + self.mav.mav.mission_item_send( target_system, target_component, 0, @@ -4795,8 +4925,10 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) def test_poly_fence_object_avoidance_bendy_ruler_easier(self, target_system=1, target_component=1): if not self.mavproxy_can_do_mision_item_protocols(): return - self.test_poly_fence_object_avoidance_auto_bendy_ruler_easier(target_system=target_system, target_component=target_component) - self.test_poly_fence_object_avoidance_guided_bendy_ruler_easier(target_system=target_system, target_component=target_component) + self.test_poly_fence_object_avoidance_auto_bendy_ruler_easier( + target_system=target_system, target_component=target_component) + self.test_poly_fence_object_avoidance_guided_bendy_ruler_easier( + target_system=target_system, target_component=target_component) def test_poly_fence_object_avoidance_guided_bendy_ruler_easier(self, target_system=1, target_component=1): '''finish-line issue means we can't complete the harder one. This @@ -4936,6 +5068,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) ex = None example_script = "simple_loop.lua" messages = [] + def my_message_hook(mav, message): if message.get_type() != 'STATUSTEXT': return @@ -4970,10 +5103,11 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) def test_scripting_internal_test(self): self.start_subtest("Scripting internal test") ex = None - test_scripts = ["scripting_test.lua","math.lua","strings.lua"] - success_text = ["Internal tests passed","Math tests passed","String tests passed"] + test_scripts = ["scripting_test.lua", "math.lua", "strings.lua"] + success_text = ["Internal tests passed", "Math tests passed", "String tests passed"] messages = [] + def my_message_hook(mav, message): if message.get_type() != 'STATUSTEXT': return @@ -5010,7 +5144,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) script_success = True success = script_success and success self.progress("Success") - if not success : + if not success: raise NotAchievedException("Scripting internal test failed") def test_scripting_hello_world(self): @@ -5094,8 +5228,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0000 *1e7), # latitude - int(1.0000 *1e7), # longitude + int(1.0000 * 1e7), # latitude + int(1.0000 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_MISSION), self.mav.mav.mission_item_int_encode( @@ -5110,8 +5244,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) 0, # p2 0, # p3 0, # p4 - int(1.0000 *1e7), # latitude - int(1.0000 *1e7), # longitude + int(1.0000 * 1e7), # latitude + int(1.0000 * 1e7), # longitude 31.0000, # altitude mavutil.mavlink.MAV_MISSION_TYPE_MISSION), ] @@ -5154,7 +5288,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) increment_f, data["angle_offset"], mavutil.mavlink.MAV_FRAME_BODY_FRD - ); + ) def send_obstacle_distances_expect_distance_sensor_messages(self, obstacle_distances_in, expect_distance_sensor_messages): self.delay_sim_time(11) # allow obstacles to time out @@ -5185,7 +5319,9 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.progress("Marking message as found") expected_distance_sensor_message["__found__"] = True if (m.current_distance - expected_distance_sensor_message["distance"] > 1): - raise NotAchievedException("Bad distance for orient=%u want=%u got=%u" % (orientation, expected_distance_sensor_message["distance"], m.current_distance)) + raise NotAchievedException( + "Bad distance for orient=%u want=%u got=%u" % + (orientation, expected_distance_sensor_message["distance"], m.current_distance)) break if not found: raise NotAchievedException("Got unexpected DISTANCE_SENSOR message") @@ -5211,32 +5347,31 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) # 1 laser pointing straight forward: self.send_obstacle_distances_expect_distance_sensor_messages( { - "distances": [ 234 ], + "distances": [234], "increment_f": 10, "angle_offset": 0.0, "min_distance": 0, "max_distance": 1000, # cm }, [ - { "orientation": 0, "distance": 234 }, - ]) - + {"orientation": 0, "distance": 234}, + ]) # 5 lasers at front of vehicle, spread over 40 degrees: self.send_obstacle_distances_expect_distance_sensor_messages( { - "distances": [ 111, 222, 333, 444, 555 ], + "distances": [111, 222, 333, 444, 555], "increment_f": 10, "angle_offset": -20.0, "min_distance": 0, "max_distance": 1000, # cm }, [ - { "orientation": 0, "distance": 111 }, - ]) + {"orientation": 0, "distance": 111}, + ]) # lots of dense readings (e.g. vision camera: distances = [0] * 72 for i in range(0, 72): - distances[i] = 1000 + 10*abs(36-i); + distances[i] = 1000 + 10*abs(36-i) self.send_obstacle_distances_expect_distance_sensor_messages( { @@ -5246,10 +5381,10 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) "min_distance": 0, "max_distance": 2000, # cm }, [ - { "orientation": 0, "distance": 1000 }, - { "orientation": 1, "distance": 1190 }, - { "orientation": 7, "distance": 1190 }, - ]) + {"orientation": 0, "distance": 1000}, + {"orientation": 1, "distance": 1190}, + {"orientation": 7, "distance": 1190}, + ]) except Exception as e: self.progress("Caught exception: %s" % @@ -5306,7 +5441,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.customise_SITL_commandline([], model=model, - defaults_filepath=self.model_defaults_filepath("Rover",model)) + defaults_filepath=self.model_defaults_filepath("Rover", model)) self.change_mode("MANUAL") self.wait_ready_to_arm() @@ -5601,7 +5736,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.test_do_set_mode_via_command_long), ("MAVProxy_DO_SET_MODE", - "Set mode via MAV_COMMAND_DO_SET_MODE with MAVProxy", + "Set mode via MAV_COMMAND_DO_SET_MODE with MAVProxy", self.test_mavproxy_do_set_mode_via_command_long), ("ServoRelayEvents", @@ -5752,7 +5887,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) ("AHRSTrim", "Accelerometer trim testing", self.ahrstrim), - + ("AP_Proximity_MAV", "Test MAV proximity backend", self.ap_proximity_mav), @@ -5764,7 +5899,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) ("LogUpload", "Upload logs", self.log_upload), - ]) + ]) return ret def disabled_tests(self):