mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 00:41:35 +08:00
mission_base: Run feasibility checker only after first global position has been published
This commit is contained in:
@@ -1369,8 +1369,9 @@ bool MissionBase::checkMissionDataChanged(mission_s new_mission)
|
|||||||
|
|
||||||
bool MissionBase::canRunMissionFeasibility()
|
bool MissionBase::canRunMissionFeasibility()
|
||||||
{
|
{
|
||||||
return _navigator->home_global_position_valid() &&
|
return _navigator->home_global_position_valid() && // Need to have a home position checked
|
||||||
(_geofence_status_sub.get().timestamp > 0) &&
|
_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().geofence_id == _mission.geofence_id) &&
|
||||||
(_geofence_status_sub.get().status == geofence_status_s::GF_STATUS_READY);
|
(_geofence_status_sub.get().status == geofence_status_s::GF_STATUS_READY);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user