mirror of https://github.com/ArduPilot/ardupilot
Rover: allow clearing mission in AUTO when disarmed
This commit is contained in:
parent
67f19c6ddb
commit
09331259bf
|
@ -200,6 +200,9 @@ bool AP_Arming_Rover::mode_checks(bool report)
|
|||
if (!rover.control_mode->allows_arming()) {
|
||||
check_failed(report, "Mode not armable");
|
||||
return false;
|
||||
} else if (rover.control_mode == &rover.mode_auto && rover.mode_auto.mission.num_commands() <= 1) {
|
||||
check_failed(report, "AUTO requires mission");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -44,6 +44,12 @@ void ModeAuto::_exit()
|
|||
|
||||
void ModeAuto::update()
|
||||
{
|
||||
// check if mission exists (due to being cleared while disarmed in AUTO,
|
||||
// if no mission, then stop...needs mode change out of AUTO, mission load,
|
||||
// and change back to AUTO to run a mission at this point
|
||||
if (!hal.util->get_soft_armed() && mission.num_commands() <= 1) {
|
||||
start_stop();
|
||||
}
|
||||
// start or update mission
|
||||
if (waiting_to_start) {
|
||||
// don't start the mission until we have an origin
|
||||
|
|
Loading…
Reference in New Issue