跳到主要内容

航线管理

Event

上报航线任务进度

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: flighttask_progress

Data:

ColumnNameTypeconstraintDescription
output内容struct
»ext扩展内容struct
»»current_waypoint_index当前执行到的航点数int
»»media_count本次航线任务执行产生的媒体文件数量int
»»flight_id任务 IDtext
»status任务状态enum_string{”pending“:"开始执行","canceled":"取消或终止","failed":"失败","in_progress":"执行中","ok":"执行成功","partially_done":"部分完成","paused":"暂停","rejected":"拒绝","sent":"已下发","timeout":"超时"}
»progress进度struct
»»current_step执行步骤enum_int{"0":"初始状态","1":"启动前检查,无人机是否在执行航线中","2":"启动前检查,机场是否退出工作模式","3":"启动前检查,航线执行中","4":"启动前检查,返航中","5":"航线执行进入准备状态,开始等待任务下发","6":"机场进入工作状态","7":"进入开机检查准备工作和开盖准备工作","8":"等待飞行系统准备就绪,推送连接建立","9":"等待 RTK 源监听有值上报","10":"检查 RTK 是否就绪“,"14":"下载 任务文件","15":"任务文件上传中";,"17":"无人机起飞参数设置,备降点设置,起飞高度设置"18":"无人机 flyto 起飞参数设置","19":"Home 点设置","20":"触发执行航线","21":"航线执行中","22":"返航","23":"无人机降落机场","24":"降落以后的关盖","29":"获取媒体文件数量","46":"上传图片",,"47":"任务完成","0xFFFD":"结束后等待服务回包","0xFFFE":"无具体状态","0xFFFFF":"UNKNOWN"}
»»percent进度值int{"max":"100","min":"0",}
result结果int返回0成功,非零失败(失败原因见错误码)

Example:

{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"output": {
"ext": {
"current_waypoint_index": 3,
"flight_id": "flight_id",
"media_count": 6,
},
"progress": {
"current_step": 19,
"percent": 100
},
"status": "ok"
},
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "flighttask_progress"
}

下发任务

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: flighttask_prepare

Data:

ColumnNameTypeconstraintDescription
flight_id计划 IDtext
execute_time开始执行时间int{"length":13}任务开始执行时间毫秒时间戳。可选字段。当 task_type 为 0 或 1 时必填,为 2 时非必填。
task_type任务类型enum_int{"0":"立即任务","1":"定时任务",}立即任务和定时任务均由 execute_time 指定执行时间。条件任务支持 ready_conditions 字段指定任务就绪条件。任务可在指定时间段内满足一定条件后即可执行。立即任务媒体上传优先级最高,定时任务和条件任务媒体上传优先级相同。
wayline_type航线类型enum_int{"0":"普通航点航线"}
file航线文件对象struct
»url文件 URLtext
»fingerprint文件 MD5 签名text
rth_altitude返航高度int{"max":1500,"min":20,"unit_name":"米 / m"}
out_of_control_action遥控器失控动作enum_int{"0":"返航","1":"悬停","2":"降落"}失控动作,当前固定传的值是 0,即返航。注意该枚举值定义跟飞控跟机场定义的不一致,机场端会进行转换。
exit_wayline_when_rc_lost航线失控动作enum_int{"0":"继续执行航线任务","1":"退出航线任务,执行遥控器失控动作"}保持跟 KMZ 文件一致
wayline_precision_type航线精度类型enum_int{0:"GPS 任务", 1: "高精度RTK任务"}
barrier_switch_state避障开关enum_int{0:打开避障, 1, 关闭避障}
takeoff_altitude起飞高度int
first_waypoint_speed去首航点的速度int
return_speed去首航点的速度int
media_upload_method媒体文件上传方式enum_int{0:落地上传, 1:变飞边传}
alternate_land_point备降点struct
longitude经度double
latitude纬度double
safe_land_height安全高度float
is_configured是否设置备降点enum_int{0:未设置,1:已设置}

Example:

{
"timestamp" : "1715693761421",
"data" : {
"flight_id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"execute_time" : "1715693761357",
"task_type" : 0,
"wayline_type" : 0,
"file" : {
"url" : "http://139.9.78.181:9000/autel-store/20240514/7dc350b0-33dc-4795-aac6-b0b9c88384b8-181153706728624128.aut",
"fingerprint" : "ebf5f3c1ee5228edd96943ade9dda33d"
},
"rth_altitude" : 100,
"exit_wayline_when_rc_lost" : 0,
"alternate_land_point" : {
"longitude" : 114.2304316,
"latitude" : 23.0358027,
"safe_land_height" : 10,
"is_configured" : 1
},
"wayline_precision_type" : 1,
"takeoff_altitude" : 100,
"first_waypoint_speed" : 10,
"return_speed" : 10,
"media_upload_method" : 0
},
"method" : "flighttask_prepare",
"tid" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"bid" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"gateway" : "NM1923371013"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: flighttask_prepare

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误

Example:

{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"gateway": "NM1923371013",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1715693761468,
"method": "flighttask_prepare"
}

执行任务

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: flighttask_execute

Data:

ColumnNameTypeconstraintDescription
flight_id计划 IDtext

Example:

{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_id": "xxxxxxx"
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "flighttask_execute"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: flighttask_execute

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误

Example:

{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "flighttask_execute"
}

一键返航

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: return_home

Data: null

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: return_home

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误
output输出struct
»status任务状态enum_string{"canceled":"取消或终止","failed":"失败","in_progress":"执行中","ok":"执行成功","paused":"暂停","rejected":"拒绝","sent":"已下发","timeout":"超时"}

航线暂停

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: flighttask_pause

Data: null

Example:

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: flighttask_pause

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误

航线恢复

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: flighttask_recovery

Data: null

Example:

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: flighttask_recovery

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误

取消任务

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: flighttask_undo

Data:

ColumnNameTypeconstraintDescription
flight_ids计划 IDarray{"size": -, "item_type": text}

Example:

{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_ids": [
"aaaaaaa",
"bbbbbbb"
]
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "flighttask_undo"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: flighttask_undo

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误

Example:

{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "flighttask_undo"
}

取消返航

返航后,无人机会退出航线模式,此时取消返航,无人机会悬停

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: return_home_cancel

Data: null

Example:

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: return_home_cancel

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误