AP_Mission: allow clearing mission in AUTO when disarmed

This commit is contained in:
Henry Wurzburg 2023-03-23 19:01:47 -05:00 committed by Andrew Tridgell
parent e57a9cacb6
commit 67f19c6ddb
1 changed files with 3 additions and 3 deletions

View File

@ -267,8 +267,8 @@ void AP_Mission::reset()
/// returns true if mission was running so it could not be cleared /// returns true if mission was running so it could not be cleared
bool AP_Mission::clear() bool AP_Mission::clear()
{ {
// do not allow clearing the mission while it is running // do not allow clearing the mission while it is running unless disarmed
if (_flags.state == MISSION_RUNNING) { if (hal.util->get_soft_armed() && _flags.state == MISSION_RUNNING) {
return false; return false;
} }
@ -280,7 +280,7 @@ bool AP_Mission::clear()
_do_cmd.index = AP_MISSION_CMD_INDEX_NONE; _do_cmd.index = AP_MISSION_CMD_INDEX_NONE;
_flags.nav_cmd_loaded = false; _flags.nav_cmd_loaded = false;
_flags.do_cmd_loaded = false; _flags.do_cmd_loaded = false;
_flags.state = MISSION_STOPPED;
// return success // return success
return true; return true;
} }