在onExecutionUpdate
中,我正在检查isWaypointReached
的状态。如果状态为false,则执行会停止,并且之后不会从onExecutionUpdate
回调中进行任何更新。
@Override
public void onExecutionUpdate(final WaypointMissionExecutionEvent executionEvent) {
int waypoint_size = executionEvent.getProgress().totalWaypointCount;
int target_waypoint_index = executionEvent.getProgress().targetWaypointIndex;
if (waypoint_size - 1 == target_waypoint_index) {
if (executionEvent.getProgress().isWaypointReached == true) {
if (executionEvent.getProgress().executeState.toString().equals("FINISHED_ACTION")) {
setResultToToast("Aircraft reached at waypoint location");
stopWaypointMission();
}
}
} else {
if (executionEvent.getProgress().isWaypointReached == true) {
if (executionEvent.getProgress().executeState.toString().equals("BEGIN_ACTION")) {
setResultToToast("aircraft reached at location " + "" + target_waypoint_index);
pauseWaypointMission();
}
}
}
}
2019-05-29 12:03:28.442 12792-12834 /? E / exe事件:当前状态=执行中 状态=执行进度=总计数= 2目标索引= 0 = 假状态=初始化错误=空
2019-05-29 12:03:28.443 12792-12834 /? E / waypoint_reached:错误