mission: The mission check on activation should only be performed for a mission, not RTL.

We need to make sure that when the RTL is triggered, it should not reevaluate it, as when it was valid but evaluated to false on activation, it can't do a RTL.
This commit is contained in:
Konrad 2024-03-11 14:56:50 +01:00 committed by Silvan Fuhrer
parent cb8520427c
commit c5fde63440
3 changed files with 8 additions and 8 deletions

View File

@ -86,6 +86,8 @@ Mission::on_activation()
{
_need_mission_save = true;
check_mission_valid(true);
MissionBase::on_activation();
}

View File

@ -207,8 +207,6 @@ MissionBase::on_activation()
_mission_has_been_activated = true;
_system_disarmed_while_inactive = false;
check_mission_valid(true);
update_mission();
// reset the cache and fill it with the items up to the previous item. The cache contains

View File

@ -215,6 +215,12 @@ protected:
*/
bool isMissionValid() const;
/**
* @brief Check whether a mission is ready to go
* @param[in] forced flag if the check has to be run irregardles of any updates.
*/
void check_mission_valid(bool forced = false);
/**
* On mission update
* Change behaviour after external mission update.
@ -344,12 +350,6 @@ private:
*/
void updateMavlinkMission();
/**
* @brief Check whether a mission is ready to go
* @param[in] forced flag if the check has to be run irregardles of any updates.
*/
void check_mission_valid(bool forced = false);
/**
* Reset mission
*/