Comments

2 comments

  • DJI Developer Support
    可以设置航点任务监听 WaypointMissionOperatorListener,其中提供了 onExecutionUpdate() 接口方法监听执行过程中的数据。获取到 WaypointExecutionProgress 对象后,其中提供了 targetWaypointIndex 属性,代表了正在执行的航点索引,从0开始。
    0
    Comment actions Permalink
  • 虞青

    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的数字么?

    0
    Comment actions Permalink

Please sign in to leave a comment.