Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow Plane to run MAV_CMD_MISSION_START as long and int #25181

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ArduPlane/GCS_Mavlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,10 @@ MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_packet(const mavlink_command_in
}
return MAV_RESULT_FAILED;

case MAV_CMD_MISSION_START:
plane.set_mode(plane.mode_auto, ModeReason::GCS_COMMAND);
return MAV_RESULT_ACCEPTED;

default:
return GCS_MAVLINK::handle_command_int_packet(packet, msg);
}
Expand Down Expand Up @@ -1057,10 +1061,6 @@ MAV_RESULT GCS_MAVLINK_Plane::handle_command_long_packet(const mavlink_command_l
}
#endif // HAL_QUADPLANE_ENABLED

case MAV_CMD_MISSION_START:
plane.set_mode(plane.mode_auto, ModeReason::GCS_COMMAND);
return MAV_RESULT_ACCEPTED;

default:
return GCS_MAVLINK::handle_command_long_packet(packet, msg);
}
Expand Down
11 changes: 11 additions & 0 deletions Tools/autotest/arduplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -5015,6 +5015,16 @@ def InteractTest(self):

self.mavproxy.interact()

def MAV_CMD_MISSION_START(self):
'''test MAV_CMD_MISSION_START starts AUTO'''
self.upload_simple_relhome_mission([
(mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 800, 0, 0),
])
for run_cmd in self.run_cmd, self.run_cmd_int:
self.change_mode('LOITER')
run_cmd(mavutil.mavlink.MAV_CMD_MISSION_START)
self.wait_mode('AUTO')

def tests(self):
'''return list of all tests'''
ret = super(AutoTestPlane, self).tests()
Expand Down Expand Up @@ -5114,6 +5124,7 @@ def tests(self):
self.MAV_CMD_DO_FLIGHTTERMINATION,
self.MAV_CMD_DO_LAND_START,
self.InteractTest,
self.MAV_CMD_MISSION_START,
])
return ret

Expand Down