mission_base: Run feasibility checker only after first global position has been published

This commit is contained in:
Konrad 2024-03-06 13:28:47 +01:00 committed by Silvan Fuhrer
parent 6c6142ba79
commit acd750e033
1 changed files with 3 additions and 2 deletions

View File

@ -1369,8 +1369,9 @@ bool MissionBase::checkMissionDataChanged(mission_s new_mission)
bool MissionBase::canRunMissionFeasibility()
{
return _navigator->home_global_position_valid() &&
(_geofence_status_sub.get().timestamp > 0) &&
return _navigator->home_global_position_valid() && // Need to have a home position checked
_navigator->get_global_position()->timestamp > 0 && // Need to have a position, for first waypoint check
(_geofence_status_sub.get().timestamp > 0) && // Geofence data must be loaded
(_geofence_status_sub.get().geofence_id == _mission.geofence_id) &&
(_geofence_status_sub.get().status == geofence_status_s::GF_STATUS_READY);
}