【发布时间】:2019-05-29 07:03:53
【问题描述】:
在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 事件:cur state=EXECUTING 预状态=EXECUTING 进度=总计数=2 目标索引=0 已达到= false state=INITIALIZING 错误=null
2019-05-29 12:03:28.443 12792-12834/? E/waypoint_reached: false
【问题讨论】: