Skip to content

Commit

Permalink
mission_base: Run feasibility checker only after first global positio…
Browse files Browse the repository at this point in the history
…n has been published
  • Loading branch information
KonradRudin committed Mar 6, 2024
1 parent e3092a5 commit 1ed1ffd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/modules/navigator/mission_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 1ed1ffd

Please sign in to comment.