Skip to content

Commit 35a02bc

Browse files
committed
autotest: Copter: test an ROI is not part of the return path track
1 parent 78e64af commit 35a02bc

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

‎Tools/autotest/arducopter.py‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21957,6 +21957,22 @@ def fly_return_path_from(north, east, track_north_max=None, no_backtrack=False,
2195721957
fly_return_path_from(600, 200, 450)
2195821958
self.wait_current_waypoint(4)
2195921959

21960+
# a located command that is not navigated to, such as an ROI,
21961+
# is not part of the track. Leave AUTO so the upload does not
21962+
# restart the running mission
21963+
self.change_mode('GUIDED')
21964+
self.upload_simple_relhome_mission([
21965+
(mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 1000, 0, alt), # 1
21966+
self.create_MISSION_ITEM_INT(cmd_return_path_start), # 2
21967+
(mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 800, 0, alt), # 3
21968+
(mavutil.mavlink.MAV_CMD_DO_SET_ROI_LOCATION, 400, 400, alt), # 4
21969+
(mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 50, 0, alt), # 5
21970+
self.create_MISSION_ITEM_INT(mavutil.mavlink.MAV_CMD_DO_LAND_START), # 6
21971+
(mavutil.mavlink.MAV_CMD_NAV_LAND, 50, 0, 0), # 7
21972+
])
21973+
fly_return_path_from(400, 300, 350)
21974+
self.wait_current_waypoint(5)
21975+
2196021976
# a repeated waypoint starts the next leg, so the vehicle does not
2196121977
# fly back up the path to it after the rejoin point
2196221978
self.change_mode('GUIDED')
@@ -22030,6 +22046,18 @@ def return_path_mission(leg_start_north):
2203022046
self.change_mode('AUTO')
2203122047
self.wait_current_waypoint(1, timeout=10)
2203222048

22049+
# a return path with only a located DO_LAND_START still joins at it
22050+
self.change_mode('GUIDED')
22051+
self.upload_simple_relhome_mission([
22052+
(mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 1000, 0, alt), # 1
22053+
self.create_MISSION_ITEM_INT(cmd_return_path_start), # 2
22054+
(mavutil.mavlink.MAV_CMD_DO_LAND_START, 50, 0, 0), # 3
22055+
(mavutil.mavlink.MAV_CMD_NAV_LAND, 50, 0, 0), # 4
22056+
])
22057+
self.run_cmd(cmd_return_path_start)
22058+
self.assert_mode_is('AUTO_RTL')
22059+
self.wait_current_waypoint(4, timeout=10)
22060+
2203322061
# a leg into a landing is flown at the current altitude, so the
2203422062
# rejoin altitude is not interpolated down towards the landing
2203522063
self.change_mode('GUIDED')

0 commit comments

Comments
 (0)