大疆API中,当规划航点并飞行时候,怎样确定飞到哪个航点了,
已完成还有就是,为什么在航点状态更新方法里边,会执行两次
int currentIndex = executionEvent.getProgress().targetWaypointIndex;
executionEvent.getProgress().isWaypointReached) {
if (executionEvent.getProgress() != null) {
boolean isWaypointReached = executionEvent.getProgress().isWaypointReached; //获取到当前无人机是否以及抵达目标航点
// 只有当到达一个新的航点时才执行操作
if (isWaypointReached) {
// 当前无人机已到达航点
lastIndexNum = currentIndex;
setResultToToast("无人机到达航点: " + executionEvent.getProgress().targetWaypointIndex+"!!"+"全部航点: " +waypointList.size());
turnOffAllLEDs();
}}
boolean isWaypointReached = executionEvent.getProgress().isWaypointReached;也就导致会执行两次到达航点方法
int currentIndex = executionEvent.getProgress().targetWaypointIndex;
executionEvent.getProgress().isWaypointReached) {
if (executionEvent.getProgress() != null) {
boolean isWaypointReached = executionEvent.getProgress().isWaypointReached; //获取到当前无人机是否以及抵达目标航点
// 只有当到达一个新的航点时才执行操作
if (isWaypointReached) {
// 当前无人机已到达航点
lastIndexNum = currentIndex;
setResultToToast("无人机到达航点: " + executionEvent.getProgress().targetWaypointIndex+"!!"+"全部航点: " +waypointList.size());
turnOffAllLEDs();
}}
请先登录再写评论。
评论
1 条评论