MSDK,执行航线航点任务,如何实时获取执行到第几个航点
已完成MSDK,执行航线航点任务,如何实时获取执行到第几个航点
-
wpMissionOperator?.addListener(object : WaypointMissionOperatorListener {
override fun onDownloadUpdate(p0: WaypointMissionDownloadEvent) {
}
override fun onUploadUpdate(p0: WaypointMissionUploadEvent) {
}
override fun onExecutionUpdate(p0: WaypointMissionExecutionEvent) {
MyApplication.targetPointIndex = p0.progress?.targetWaypointIndex?:-1
}
override fun onExecutionStart() {
lifecycleScope.launch(Dispatchers.Main) {
viewModel.updateTask(taskId ?: 0, 64)
}
}
override fun onExecutionFinish(p0: DJIError?) {
MyApplication.targetPointIndex = 0
lifecycleScope.launch(Dispatchers.Main) {
viewModel.updateTask(taskId ?: 0, 48)
}
}
})按照这个写的,targetWaypointIndex取出来怎么是72,71,70,不应该是下标,小于10的数字么?
请先登录再写评论。
评论
2 条评论