任务管理器
interface IMissionManager
描述: 航点任务管理接口,提供航线任务上传(MissionInfoJNI/KMZ/路径)、启动、暂停、恢复、退出、断点恢复、任务下载等功能。通过 IAutelDroneDevice.getWayPointMissionManager() 获取。适用于 MSDK 3.0。
包路径: com.autel.drone.sdk.vmodelx.interfaces.IMissionManager
method uploadMissionFile
fun uploadMissionFile(
missionInfo: MissionInfoJNI,
listener: CommonCallbacks.CompletionCallbackWithProgressAndParam
)
描述: 上传航线任务执行文件
输入参数:
| 参数 | 类型 | 说明 |
|---|---|---|
| missionInfo | MissionInfoJNI | 航线任务文件模型 |
| listener | CompletionCallbackWithProgressAndParam | 上传进度与结果回调,进度类型为 Long |
method uploadKmzMissionFile
fun uploadKmzMissionFile(
kmzPath: String,
callback: CommonCallbacks.CompletionCallbackWithProgressAndParam
)
描述: 上传 KMZ 航线执行文件
输入参数:
| 参数 | 类型 | 说明 |
|---|---|---|
| kmzPath | String | KMZ 文件路径 |
| callback | CompletionCallbackWithProgressAndParam | 上传进度与结果回调 |
method uploadKmzMissionFile (指定 GUID)
fun uploadKmzMissionFile(
kmzPath: String,
guid: Int,
listener: CommonCallbacks.CompletionCallbackWithProgressAndParam
)
描述: 上传 KMZ 航线执行文件并指定任务 GUID。适用于多机场景需要相同 GUID 的情况。
method uploadMissionByPath
fun uploadMissionByPath(
autelMissionPath: String,
guid: Long,
listener: CommonCallbacks.CompletionCallbackWithProgressAndParam
)
描述: 通过文件路径上传 Autel 格式任务文件。
| 参数 | 类型 | 说明 |
|---|---|---|
| autelMissionPath | String | 任务文件路径 |
| guid | Long | 任务 ID |
| listener | CompletionCallbackWithProgressAndParam | 上传进度与结果回调 |
method cancelUploadMission
fun cancelUploadMission()
描述: 取消本次任务上传。
method startMission
fun startMission(
guidBean: IMissionWaypointBean,
callback: CommonCallbacks.CompletionCallbackWithParam
)
描述: 任务文件上传后启动任务执行。
| 参数 | 类型 | 说明 |
|---|---|---|
| guidBean | IMissionWaypointBean | 任务信息(含 GUID),通过 IMissionWaypointBean 实现不同任务文件类型 |
| callback | CompletionCallbackWithParam | 完成回调 |
method enterAndResumeMission
fun enterAndResumeMission(
param: IMissionWaypointBean,
callback: CommonCallbacks.CompletionCallbackWithParam
)
描述: 进入并恢复任务执行(适用于中断后直接恢复的场景)。
method pauseMission
fun pauseMission(
callback: CommonCallbacks.CompletionCallbackWithParam,
isKml: Boolean? = false
)
描述: 暂停执行航线任务。
| 参数 | 类型 | 说明 |
|---|---|---|
| callback | CompletionCallbackWithParam | 完成回调 |
| isKml | Boolean? | 是否为 KMZ 任务,默认 false |
method resumeMission
fun resumeMission(
guidBean: IMissionWaypointBean,
callback: CommonCallbacks.CompletionCallbackWithParam
)
描述: 从暂停处恢复执行航线任务。
method exitMission
fun exitMission(
callback: CommonCallbacks.CompletionCallbackWithParam,
isKml: Boolean? = false
)
描述: 退出航点任务模式。
method addWaypointMissionExecuteStateListener
fun addWaypointMissionExecuteStateListener(
listener: CommonCallbacks.KeyListener
)
描述: 设置航线任务执行状态的监听器。可以用来监听航线任务的执行状态,比如:任务文件上传中、进入航线任务飞行、任务完成、任务进度等。
method removeWaypointMissionExecuteStateListener
fun removeWaypointMissionExecuteStateListener(
listener: CommonCallbacks.KeyListener
)
描述: 移除航线任务执行状态的监听器。
method queryMissionBreakpointInfo
fun queryMissionBreakpointInfo(
param: IMissionWaypointBean,
callback: CommonCallbacks.CompletionCallbackWithParam
)
描述: 查询任务断点信息。
| 参数 | 类型 | 说明 |
|---|---|---|
| param | IMissionWaypointBean | 任务信息(含 GUID) |
| callback | CompletionCallbackWithParam | 返回 MissionWaypointBreakRspBean |
method resumeBreakpointMission
fun resumeBreakpointMission(
guid: IMissionWaypointBean,
listener: CommonCallbacks.CompletionCallbackWithParam
)
描述: 恢复断点任务。需先调用进入任务,再调用恢复任务。
method downloadMissionFile
fun downloadMissionFile(
sourcePath: String,
desPath: String,
callback: CommonCallbacks.CompletionCallbackWithProgress
)
描述: 下载航线任务执行文件。
| 参数 | 类型 | 说明 |
|---|---|---|
| sourcePath | String | 飞行器上的任务文件路径 |
| desPath | String | 下载到本地的文件路径 |
| callback | CompletionCallbackWithProgress | 下载进度回调 |
class MissionWaypointStatusReportNtfyBean
描述: 任务执行状态上报数据
data class MissionWaypointStatusReportNtfyBean(
/**
* 系统时间戳; uint: ms
*/
var timestamp: Long = 0L,
/**
* 任务ID
*/
var missionId: Int = 0,
/**
* 航点序号
*/
var wpSeq: Int = 0,
/**
* 剩余距离
*/
var remainDistance: Int = 0,
/**
* 参考 MISSION_TYPE
*/
var missionType: MissionTypeEnum = MissionTypeEnum.UNKNOWN,
/**
* 当前拍照张数
*/
var photoNum: Int = 0,
/**
* 剩余时间; uint:s
*/
var remainTime: Int = 0,
/**
* 当前任务状态,参考 MISSION_CURRENT_STATUS
*/
var status: MissionCurrentStateEnum = MissionCurrentStateEnum.UNKNOWN,
/**
* 任务guid
*/
var guid: Int = 0,
/**
* 当前动作序号
*/
var actionSeq: Int = 0,
/**
* 航点抵达状态; 0 - arrived; 1 - Not arrived
*/
var arrived: Int = 0,
/**
* 任务进度百分比
*/
var percent: Int = 0,
/**
* 当前的任务阶段
*/
var taskStageIndex: Int = 4
) {
fun isKmzMission(): Boolean
}