航线管理

2025-02-17
暂无评分

Event

返航信息

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: return_home_info

Data:

ColumnNameTypeconstraintDescription
planned_path_points规划的轨迹点列表array{"size": -, "item_type": struct}
»latitude轨迹点纬度(角度值)double{"max":90,"min":-90}轨迹点纬度,角度值,南纬是负,北纬是正,精度到小数点后6位
»longitude轨迹点经度(角度值)double{"max":180,"min":-180}轨迹点经度,角度值,东经是正,西经是负,精度到小数点后6位
»height轨迹点高度float{"max":"","min":"","step":0.1,"unit_name":"米 / m"}轨迹点高度,椭球高
last_point_type返航路径最后一个点的类型enum_int{"0":"轨迹最后一个点在返航点的上空","1":"轨迹最后一个点不在返航点上空"}
flight_id任务 IDtext{"length":""}
home_dock_snhome点机场sntext{"length":""}蛙跳任务中当前选择的机场home点SN,普通任务无该字段
multi_dock_home_info蛙跳任务机场返航信息array{"size": 2, "item_type": struct}普通任务无该字段
»sn机场SNtext{"length":""}
»plan_status路径规划状态enum_int{"0":"规划失败或正在规划中","1":"规划路径不可达","2":"规划路径因电量不可达","3":"目标可达"}
»estimated_battery_consumption预估电量消耗int{"max":"100","min":"0","step":"1","unit_name":null}
»home_distancehome点距离float{"max":"","min":"","step":"","unit_name":"米 / m"}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"flight_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
		"home_dock_sn": "6QCDL870020164",
		"last_point_type": 0,
		"multi_dock_home_info": [
			{
				"estimated_battery_consumption": 30,
				"home_distance": 298.3277282714844,
				"plan_status": 3,
				"sn": "6QCDL870020164"
			},
			{
				"estimated_battery_consumption": 30,
				"home_distance": 298.289794921875,
				"plan_status": 3,
				"sn": "6QCDL820020041"
			}
		],
		"planned_path_points": [
			{
				"height": 60.285194396972656,
				"latitude": 22.755022128112614,
				"longitude": 114.89828051067889
			},
			{
				"height": 88.22719192504883,
				"latitude": 22.755022128112614,
				"longitude": 114.89828051067889
			},
			{
				"height": 88.22719192504883,
				"latitude": 22.75721542071551,
				"longitude": 114.89853624254465
			},
			{
				"height": 88.22719192504883,
				"latitude": 22.757445462048054,
				"longitude": 114.89860304631293
			},
			{
				"height": 78.30619430541992,
				"latitude": 22.757531544193625,
				"longitude": 114.89862810820341
			}
		]
	},
	"gateway": "6QCDL820020041",
	"method": "return_home_info",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1720000266772
}

任务就绪通知

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: flighttask_ready

Data:

ColumnNameTypeconstraintDescription
flight_ids计划 IDarray{"size": -, "item_type": text}当前满足任务就绪条件的任务 ID 集合

Example:

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

上报航线任务进度

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: flighttask_progress

Data:

ColumnNameTypeconstraintDescription
ext扩展内容struct
»current_waypoint_index当前执行到的航点数int
»wayline_mission_state航线任务状态enum_int{"0":"断连","1":"不支持该航点","2":"航线准备状态,可上传文件,可执行已有文件","3":"航线文件上传中","4":"触发开始命令,飞行器触发读航线等逻辑,还未开始任务,处于准备状态","5":"进入航线,到第一个航点","6":"航线执行","7":"航线中断,触发条件:1.用户主动暂停 2.飞控异常","8":"航线恢复","9":"航线结束"}
»media_count本次航线任务执行产生的媒体文件数量int
»track_id航迹 IDtext
»flight_id任务 IDtext
»break_point航线断点信息struct可选字段,用于告知云端本次航线任务断点信息
»»index断点序号int{"max":"","min":"","step":"","unit_name":null}
»»state断点状态enum_int{"0":"在航段上","1":"在航点上"}
»»progress当前航段进度float{"max":"1.0","min":"0","step":"","unit_name":null}
»»wayline_id航线 IDint{"max":"","min":"","step":"","unit_name":null}
»»break_reason中断原因enum_int{"0":"无异常","1":"Mission ID 不存在,该航线任务未执行","2":"不常见错误,建议联系技术支持","4":"请求开始/恢复航线任务时,航线文件加载出错,请重新尝试上传文件开始或联系技术支持","5":"请求查询断点信息时,查询断点文件失败。请求恢复航线任务时,解析断点类型失败","6":"请求开始/结束航线任务时,cmd参数有误,协议请求的指令有误。请求恢复航线任务时,解析断点类型失败","7":"请求开始/恢复航线任务时,解析 wpmz 文件超时,请重试","257":"航线已经开始,不能再次开始","258":"此状态下无法中断航线,只允许在航线执行状态时暂停航线","259":"航线未开始,不能结束航线","261":"飞行任务冲突,无法获取飞行器控制权,不允许在降落和返航中开始航线","262":"该状态下无法恢复航线,只允许在航线暂停状态时恢复航线","513":"飞行器超过限高高度","514":"飞行器超过限远距离","516":"飞行器触发限低","517":"飞行器触发避障","518":"RTK 信号差","519":"接近禁飞区边界","521":"超过机场限飞区限高","522":"航线请求起飞失败","523":"起飞任务执行失败","524":"请求航线任务失败","526":"请求航线 RTK 收敛任务失败","527":"航线 RTK 收敛任务运行失败","769":"GPS 信号弱","770":"遥控器档位不在 N 档","771":"返航点未刷新","772":"当前电量过低无法开始任务","773":"低电量返航导致航线中断","775":"遥控器与飞行器失联","778":"飞行器在地面起桨,不允许开始航线","779":"实时仿地过程中,相机状态异常(如过亮,过暗,两侧亮度不一致)","780":"实时仿地用户设置的仿地高度不合法(大于 200 m 或者小于 30 m)","781":"实时仿地过程中全局地图计算出错","784":"大风返航导致航线中断","1281":"用户退出","1282":"用户中断","1283":"用户触发返航","1539":"开始信息(航点 index 或者 progress)错误","1540":"使用不支持的坐标系","1541":"使用不支持的高度模式","1542":"使用不支持的过渡航线模式","1543":"使用不支持的 yaw 模式","1544":"使用不支持的 yaw 方向调转模式","1545":"使用不支持的航点类型","1546":"首尾点不能使用协调转弯类型","1547":"航线全局速度超过合理范围","1548":"航点数量异常","1549":"经纬度数据异常","1550":"转弯截距异常","1551":"航段最大速度超过合理范围","1552":"航段目标速度超过合理范围","1553":"航点 yaw 角度超过合理范围","1555":"断点续飞的 mission_id 输入错误","1556":"断点续飞的 progress 信息输入错误","1557":"断点续飞的任务状态异常","1558":"断点续飞的航点 index 信息输入错误","1559":"断点续飞的经纬度信息输入错误","1560":"断点续飞的航点 yaw 输入错误","1561":"断点续飞的标志位设置错误","1563":"航线生成失败","1564":"航线运行失败","1565":"航线避障紧急刹停","1588":"无法识别的动作类型","1595":"动作 ID 不能重复","1598":"动作 ID 值不能为 65535","1602":"动作组数量超过合理范围","1603":"动作组生效范围错误","1606":"断点续飞中动作 index 超过合理范围","1608":"断点信息中触发器运行结果异常","1609":"断点续飞中动作组 ID 信息不能重复","1610":"断点续飞中动作组位置不能重复","1611":"断点续飞中动作组位置超过合理范围","1612":"续飞中动作 ID 不在断点信息中","1613":"断点续飞中不能修改动作状态为中断","1614":"断点信息错误导致续飞失败","1634":"无法识别的动作类型","1649":"无法识别的触发器类型","65534":"未知内部错误","65535":"未知内部错误"}
»»latitude断点纬度float{"max":"90","min":"-90","step":"","unit_name":"度 / °"}
»»longitude断点经度float{"max":"180","min":"-180","step":"","unit_name":"度 / °"}
»»height断点相对地球椭球面高度float{"max":"","min":"","step":"","unit_name":"米 / m"}
»»attitude_head断点偏航轴角度float{"max":"","min":"","step":"","unit_name":null}
»wayline_id当前在作业的航线 IDint包括进入航线的过渡阶段,例如0代表飞行器正在进入或者已经在执行第一条航线
status任务状态enum_string{"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":"等待飞行系统准备就绪,推送连接建立","10":"等待 RTK 源监听有值上报","11":"检查 RTK 源是否是机场源,如果不是要重新设置","12":"等待飞行控制权通知","13":"机场无控制权,抢夺飞行器控制权","14":"自定义飞行区一致性检查","15":"离线地图一致性检查","16":"获取最新 KMZ URL","17":"下载 KMZ","18":"KMZ 上传中","19":"染色配置","20":"飞行器起飞参数设置,备降点设置,起飞高度设置,染色设置","21":"飞行器 flyto 起飞参数设置","22":"起飞机场检查降落机场准备状态","23":"Home 点设置","24":"触发执行航线","25":"航线执行中","26":"进入返航的检查准备工作","27":"飞行器降落机场","28":"降落以后的关盖","29":"机场退出工作模式","30":"机场异常恢复","31":"机场上传飞行系统日志","32":"相机录像状态检查","33":"获取媒体文件数量","34":"机场起飞开盖的异常恢复","35":"通知任务结果","36":"日志列表拉取 - 飞行器列表","37":"日志列表拉取 - 拉取机场列表","38":"日志列表拉取 - 上传日志列表结果","39":"日志拉取-拉取飞行器日志","40":"日志拉取-拉取机场日志","41":"日志拉取-压缩飞行器日志","42":"日志拉取-压缩机场日志","43":"日志拉取-上传飞行器日志","44":"日志拉取-上传机场日志","45":"日志拉取-通知结果","46":"自定义飞行区文件更新准备中","47":"自定义飞行区更新中","48":"离线地图更新准备中","49":"离线地图更新中","65533":"结束后等待服务回包","65534":"无具体状态","65535":"UNKNOWN"}
»percent进度值int{"max":"100","min":"0","step":"1"}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"output": {
			"ext": {
				"break_point": {
					"attitude_head": 30,
					"break_reason": 1,
					"height": 100.23,
					"index": 1,
					"latitude": 23.4,
					"longitude": 113.99,
					"progress": 0.34,
					"state": 0,
					"wayline_id": 0
				},
				"current_waypoint_index": 3,
				"flight_id": "flight_id",
				"media_count": 6,
				"track_id": "track_id",
				"wayline_id": 0,
				"wayline_mission_state": 9
			},
			"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}/events

Direction: up

Method: device_exit_homing_notify

Data:

ColumnNameTypeconstraintDescription
sn机场 SNtext{}
action退出返航通知消息类型enum_int{"0":"退出”返航退出状态“","1":"进入”返航退出状态“"}进入“返航退出状态”,指当机场处于返航模式时,由于 reason 字段中展示的原因,退出了返航过程。相似的,退出“返航退出状态”,指机场停止了退出返航这一过程。
reason退出返航原因enum_int{"0":"操纵杆油门添加","1":"操纵杆间距添加","2":"行为树初始化失败","3":"被障碍物包围","4":"触发限飞限制","5":"障碍物距离太近","6":"无 GPS 信号","7":"GPS 和 VIO 位置输出标志为 false","8":"GPS 和 VIO 融合位置误差太大","9":"短距离回溯","10":"近距离触发返航"}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"action": 1,
		"reason": "0",
		"sn": "机场 SN"
	},
	"need_reply": 1,
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"method": "device_exit_homing_notify"
}

Service

执行任务

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: flighttask_execute

Data:

ColumnNameTypeconstraintDescription
flight_id计划 IDtext{"length":""}
multi_dock_task蛙跳任务参数struct
»wireless_link_topo图传连接拓扑struct
»»secret_code加密编码array{"size": 28, "item_type": int}从飞行器的设备属性中获取
»»center_node飞行器对频信息struct从飞行器的设备属性中获取
»»»sdr_id扰码信息int{"max":"","min":"","step":"","unit_name":null}
»»»sn设备sntext{"length":""}
»»leaf_nodes机场或遥控器对频信息array{"size": -, "item_type": struct}
»»»sdr_id扰码信息int{"max":"","min":"","step":"","unit_name":null}
»»»sn设备sntext{"length":""}
»»»control_source_index控制源序号int{"max":"1","min":"0","step":"1","unit_name":"无 / "}
»dock_infos机场信息array{"size": 2, "item_type": struct}执行本次蛙跳任务的机场信息,除了dock_type需要指定外,其他字段均可从设备属性上报中直接获取
»»dock_type机场在蛙跳任务中的角色enum_string{"landing":"降落","takeoff":"起飞机场"}
»»latitude纬度double{"max":"90","min":"-90","step":"0.01"}机场纬度,可从机场设备属性中获取
»»longitude经度double{"max":"180","min":"-180","step":"0.01"}机场经度,可从机场设备属性中获取
»»height椭球高度double{"unit_name":"米 / m"}机场高度,可从机场设备属性中获取
»»heading机场朝向角double{"max":"180","min":"-180","step":"","unit_name":"度 / °"}机场朝向角,可从机场设备属性中获取
»»home_position_is_valid机场home点有效性enum_int{"0":"无效","1":"有效"}可从机场设备属性中获取
»»index机场任务唯一性标识int{"max":"31","min":"1"}给机场分配的序号,单次任务中保持唯一且最好长期固定使用
»»sn机场SNtext{"length":""}
»»rtcm_info机场RTK标定源struct
»»»mount_point网络RTK挂载点信息text{"length":""}
»»»port网络端口信息text{"length":""}
»»»host网络host信息text{"length":""}
»»»rtcm_device_type设备类型enum_int{"1":"机场"}
»»»source_type标定类型enum_int{"0":"未标定","1":"自收敛标定","2":"手动标定","3":"网络RTK标定"}
»»alternate_land_point备降点struct
»»»longitude经度float{}
»»»latitude纬度float{}
»»»safe_land_height安全高度(备降转移高)float{}
»»»is_configured是否设置备降点enum_int{"0":"未设置","1":"已设置"}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"flight_id": "aee739dc-f1cc-47d5-beaa-64d327f2d797",
		"multi_dock_task": {
			"dock_infos": [
				{
					"alternate_land_point": {
						"height": 0,
						"is_configured": 1,
						"latitude": 37.348792490321514,
						"longitude": 116.52867090782102,
						"safe_land_height": 30
					},
					"dock_type": "takeoff",
					"heading": -78.7066650390625,
					"height": 30.81130027770996,
					"home_position_is_valid": 1,
					"index": 1,
					"latitude": 37.3487657248638,
					"longitude": 116.52893686422743,
					"rtcm_info": {
						"host": "120.253.226.97",
						"mount_point": "RTCM33_GRCEJ",
						"port": "8002",
						"rtcm_device_type": 1,
						"source_type": 3
					},
					"sn": "7CTDM5900B3X1B"
				},
				{
					"alternate_land_point": {
						"height": 0,
						"is_configured": 1,
						"latitude": 37.336024417709915,
						"longitude": 116.554075635852,
						"safe_land_height": 30
					},
					"dock_type": "landing",
					"heading": -69.79183197021484,
					"height": 32.31420135498047,
					"home_position_is_valid": 1,
					"index": 2,
					"latitude": 37.33605462094235,
					"longitude": 116.55416413516038,
					"rtcm_info": {
						"host": "120.253.226.97",
						"mount_point": "RTCM33_GRCEJ",
						"port": "8002",
						"rtcm_device_type": 1,
						"source_type": 3
					},
					"sn": "7CTDM5900BK07M"
				}
			],
			"wireless_link_topo": {
				"center_node": {
					"sdr_id": 933765657,
					"sn": "1581F6Q8D245P00EKS87"
				},
				"leaf_nodes": [
					{
						"control_source_index": 1,
						"sdr_id": 920128532,
						"sn": "7CTDM5900B3X1B"
					},
					{
						"control_source_index": 2,
						"sdr_id": 911741468,
						"sn": "7CTDM5900BK07M"
					}
				],
				"secret_code": [
					0,
					0,
					0,
					0,
					1,
					0,
					0,
					0,
					123,
					114,
					19,
					203,
					192,
					100,
					244,
					160,
					146,
					228,
					196,
					213,
					105,
					220,
					176,
					147,
					87,
					182,
					90,
					210
				]
			}
		}
	},
	"method": "flighttask_execute",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1720095314016
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: flighttask_execute

Data:

ColumnNameTypeconstraintDescription
result返回码int{"max":"","min":"","step":"","unit_name":null}非 0 代表错误

Example:

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

指定home点的返航

蛙跳任务中,需要指定一个机场作为返航目的地时使用

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: return_specific_home

Data:

ColumnNameTypeconstraintDescription
home_dock_sn返航的目的机场SNtext{"length":""}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"home_dock_sn": "xxxxxxxx"
	},
	"method": "return_specific_home",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1234567890123
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: return_specific_home

Data:

ColumnNameTypeconstraintDescription
result返回码int{"max":"","min":"","step":"","unit_name":null}非 0 代表错误

Example:

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

任务终止

蛙跳任务中,当一个机场上报任务结束后,需要下发此指令到另一机场结束任务

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: flighttask_stop

Data:

ColumnNameTypeconstraintDescription
flight_id任务idtext{"length":""}
reason结束原因enum_int{"0":"正常结束","1":"另一机场状态机异常"}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"flight_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
		"reason": 0
	},
	"method": "flighttask_stop",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1234567890123
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: flighttask_stop

Data:

ColumnNameTypeconstraintDescription
result返回码int{"max":"","min":"","step":"","unit_name":null}非 0 代表错误

Example:

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

取消返航

返航后,飞行器会退出航线模式,此时取消返航,飞行器会悬停

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: return_home_cancel

Data: null

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "return_home_cancel"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: return_home_cancel

Data:

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

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"need_reply": 1,
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "return_home_cancel"
}

一键返航

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_recovery

Data: null

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "flighttask_recovery"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: flighttask_recovery

Data:

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

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"need_reply": 1,
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "flighttask_recovery"
}

航线暂停

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: flighttask_pause

Data: null

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "flighttask_pause"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: flighttask_pause

Data:

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

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"need_reply": 1,
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "flighttask_pause"
}

取消任务

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"
}

下发任务

若用户的云服务无法访问外网,需实现 配置更新 功能,下发可被云服务访问的 NTP 服务的 URL,以实现时钟同步,否则航线任务将无法正常执行。

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: flighttask_prepare

Data:

ColumnNameTypeconstraintDescription
flight_id计划 IDtext{"length":""}
execute_time开始执行时间int{"max":"","min":"","step":"","unit_name":null}任务开始执行时间毫秒时间戳。可选字段。当 task_type 为 0 或 1 时必填,为 2 时非必填。
task_type任务类型enum_int{"0":"立即任务","1":"定时任务","2":"条件任务"}立即任务和定时任务均由execute_time指定执行时间;条件任务支持ready_conditions字段指定任务就绪条件,设备可在指定时间段内满足就绪条件后即可执行;立即任务媒体上传优先级最高,定时任务和条件任务媒体上传优先级相同
file航线文件对象struct
»url文件 URLtext
»fingerprint文件签名text文件内容 MD5 签名
ready_conditions任务就绪条件struct可选字段。条件任务(即 task_type 为2)时必填,其他类型任务会忽略该字段。下发条件任务后,设备会定频检查 ready_conditions 是否全部满足,若全部满足则会有 flighttask_ready 事件通知。且设备端接收 flighttask_execute 指令时,也会检查任务的 ready_conditions 是否已全部满足。
»battery_capacity电池容量int可执行任务的飞行器电池电量百分比阈值,任务开始执行时的飞行器电量必须大于 battery_capacity
»begin_time任务可执行时段的开始时间int{"length":13}任务可执行时段起始时间毫秒时间戳,任务开始执行的时间必须大于 begin_time
»end_time任务可执行时段的结束时间int{"length":13}任务可执行时段截止时间毫秒时间戳,任务开始执行的时间必须小于 end_time
executable_conditions任务执行条件struct可选字段,用于在设备端增加任务执行的前置检查条件,存在任一条件不满足时会执行失败
»storage_capacity存储容量int可执行任务的机场或飞行器最低存储容量,机场或飞行器存储容量不满足 storage_capacity 时,任务执行失败。
break_point航线断点信息struct可选字段,用于断点续飞,若指定该字段,航线任务会从字段指定的断点位置开始执行。
»index断点序号int
»state断点状态enum_int{"0":"在航段上","1":"在航点上"}
»progress当前航段进度float{"max":"1.0","min":"0"}
»wayline_id航线 IDint
rth_altitude返航高度int{"max":1500,"min":20,"step":"","unit_name":"米 / m"}
rth_mode返航高度模式enum_int{"0":"智能高度","1":"设定高度"}智能返航模式下,飞行器将自动规划最佳返航高度。大疆机场当前不支持设置返航高度模式,只能选择'设定高度'模式。当环境,光线不满足视觉系统要求时(譬如傍晚阳光直射、夜间弱光无光),飞行器将使用您设定的返航高度进行直线返航
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 任务"}高精度 RTK 任务:飞行器起飞后会在空中等待 RTK 收敛后再执行任务,等待 RTK 收敛的过程中无法暂停任务。默认场景建议使用该模式。GPS 任务:飞行器无需等待 RTK 收敛便可以直接开始执行。精度要求不高的任务或对起飞时效性要求较高的任务建议使用该模式。
simulate_mission是否在模拟器中执行任务struct可选字段,用于在室内进行模拟任务调试。
»is_enable是否开启模拟器任务enum_int{"0":"不开启","1":"开启"}当次任务打开或关闭模拟器
»latitude纬度double{"max":"90.0","min":"-90.0"}
»longitude经度double{"max":"180.0","min":"-180.0"}
flight_safety_advance_check飞行安全预检查bool{"0":"关闭","1":"开启"}设置一键起飞和航线任务中的飞行安全是否预先检查。此字段为可选,默认为0,值为0表示关闭,1表示开启。飞行安全预先检查表示: 飞行器执行任务前,检查自身作业区文件是否与云端一致,如果不一致则拉取文件更新,如果一致则不处理

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"break_point": {
			"index": 1,
			"progress": 0.34,
			"state": 0,
			"wayline_id": 0
		},
		"executable_conditions": {
			"storage_capacity": 1000
		},
		"execute_time": 1234567890123,
		"exit_wayline_when_rc_lost": 0,
		"file": {
			"fingerprint": "xxxx",
			"url": "https://xxx.com/xxxx"
		},
		"flight_id": "xxxxxxx",
		"flight_safety_advance_check": 1,
		"out_of_control_action": 0,
		"ready_conditions": {
			"battery_capacity": 90,
			"begin_time": 1234567890123,
			"end_time": 1234567890123
		},
		"rth_altitude": 100,
		"simulate_mission": {
			"is_enable": 1,
			"latitude": 22.1223,
			"longitude": 113.2222
		},
		"task_type": 2,
		"wayline_precision_type": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1234567890123,
	"method": "flighttask_prepare"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: flighttask_prepare

Data:

ColumnNameTypeconstraintDescription
result返回码int{"max":"","min":"","step":"","unit_name":null}非 0 代表错误

Example:

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

创建航线任务(废弃)

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: flighttask_create

Data:

ColumnNameTypeconstraintDescription
flight_id计划 IDtext
type任务类型text
file航线文件对象struct
»url文件 URLtext
»signMD5 签名text

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"file": {
			"sign": "xxxx",
			"url": "https://xxx.com/xxxx"
		},
		"flight_id": "xxxxxxx",
		"type": "wayline"
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"method": "flighttask_create"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: flighttask_create

Data:

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

Example:

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

Requests

机场任务状态获取

蛙跳任务中,机场需要请求另一机场的任务执行状态

Topic: thing/product/{gateway_sn}/requests

Direction: up

Method: flighttask_progress_get

Data:

ColumnNameTypeconstraintDescription
sn目标设备sntext{"length":""}

Topic: thing/product/{gateway_sn}/requests_reply

Direction: down

Method: flighttask_progress_get

Data:

ColumnNameTypeconstraintDescription
result返回码int{"max":"","min":"","step":"","unit_name":null}非 0 代表错误
output输出struct
»flight_id设备最新当前任务idtext{"length":""}
»progress任务进度struct字段枚举值同上报航线任务进度flighttask_progress中progress字段
»»current_step执行步骤int{"max":"","min":"","step":"","unit_name":null}
»»percent执行进度int{"max":"100","min":"0","step":"","unit_name":null}
»status任务状态text{"length":""}字段枚举值同上报航线任务进度flighttask_progress中status字段

任务资源获取

Topic: thing/product/{gateway_sn}/requests

Direction: up

Method: flighttask_resource_get

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_resource_get"
}

Topic: thing/product/{gateway_sn}/requests_reply

Direction: down

Method: flighttask_resource_get

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误
output输出struct
»file航线文件对象struct
»»url文件 URLtext
»»fingerprint文件签名text文件 MD5 签名

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"output": {
			"file": {
				"fingerprint": "signxxxx",
				"url": "https://xx.oss-cn-hangzhou.aliyuncs.com/xx.kmz?Expires=xx&OSSAccessKeyId=xxx&Signature=xxx"
			}
		},
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1234567890123,
	"method": "flighttask_resource_get"
}
若您对文档有意见或疑惑,点击可快速反馈,我们会与您联系。