。MQTT消息用于控制
,事件上報等
。GB28181用于視頻相關流媒體傳輸
。
用戶可以對照著大疆的MQTT Topic協(xié)議文檔
https://developer.dji.com/doc/cloud-api-tutorial/cn/api-reference/pilot-to-cloud/mqtt/topic-definition.html
MQTT Topic 定義
Topic Name |
發(fā)送者 -> 訂閱者 |
Message |
說明 |
thing/product/{device_sn}/osd |
設備 > 云平臺 |
|
盒子定頻向云平臺推送的設備屬性 |
thing/product/{device_sn}/state |
設備 > 云平臺 |
|
盒子按需上報向云平臺推送的設備屬性 |
thing/product/{gateway_sn}/services |
云平臺 -> 設備 |
|
云平臺向盒子請求的服務 |
thing/product/{gateway_sn}/services_reply |
設備 > 云平臺 |
|
設備對 service 的回復、處理結果 |
thing/product/{gateway_sn}/events |
設備 > 云平臺 |
|
設備端向云平臺發(fā)送的事件 |
thing/product/{gateway_sn}/requests |
設備 > 云平臺 |
|
設備端向云平臺發(fā)送請求 ,為了獲取一些信息,比如上傳的臨時憑證 |
thing/product/{gateway_sn}/requests_reply |
云平臺 -> 設備 |
|
云平臺對設備請求的回復 |
sys/product/{gateway_sn}/status |
設備 > 云平臺 |
|
設備上下線 |
thing/product/{gateway_sn}/drc/up |
設備 > 云平臺 |
|
DRC 協(xié)議上行 |
thing/product/{gateway_sn}/drc/down |
云平臺 > 設備 |
|
DRC 協(xié)議下行 |
公共字段:
Column |
Name |
Type |
Description |
tid |
事務uuid |
text |
事務(Transaction)的 UUID:表征一次簡單的消息通信 |
bid |
業(yè)務uuid |
text |
業(yè)務(Business)的 UUID |
timestamp |
毫秒時間戳 |
int |
消息的發(fā)送時間 |
gateway |
網(wǎng)關設備的序列號 |
text |
發(fā)送該消息的網(wǎng)關設備的序列號 |
data |
消息內(nèi)容 |
object |
消息內(nèi)容 |
開始直播
topic: thing/product/{gateway_sn}/services
Direction: down
Method: live_start_push
字段:
Column |
Name |
Type |
Description |
url_type |
直播協(xié)議類型 |
enum |
"3" //GB28181 |
url |
直播參數(shù) |
text |
"serverIP=192.168.1.1&serverPort=8080&serverID=34000000000000000000&agentID=300000000010000000000&agentPassword=0000000&localPort=7060&channel=340000000000000000000&agentID1=300000000010000000001&agentPassword1=0000000&localPort1=7061&channel1=340000000000000000001" |
video_id |
直播視頻流的ID編號 |
text |
1ZNDH1D0010098/39-0-7/normal-0 |
video_quality |
直播質量 |
enum |
{"0":"自適應","1":"流暢","2":"標清","3":"高清","4":"超清"} |
示例: |
|
|
|
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"url_type": "3",
"url": "serverIP=192.168.1.1&serverPort=8080&serverID=34000000000000000000&agentID=300000000010000000000&agentPassword=0000000&localPort=7060&channel=340000000000000000000&agentID1=300000000010000000001&agentPassword1=0000000&localPort1=7061&channel1=340000000000000000001",
"video_id": "1ZNDH1D0010098/39-0-7/normal-0",
"video_quality": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_start_push"
}
停止直播
topic: thing/product/{gateway_sn}/services
Direction: down
Method: live_stop_push
字段:
Column |
Name |
Type |
Description |
video_id |
直播視頻流的ID編號 |
text |
1ZNDH1D0010098/39-0-7/normal-0 |
示例: |
|
|
|
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp:": 1654070968655,
"method": "live_stop_push",
"data": {
"video_id": "1ZNDH1D0010098/42-0-0/zoom-0"
}
}
盒子Osd
topic: thing/product/{device_sn}/osd
說明:此消息1hz定時上報
字段:
Column |
Name |
Type |
Description |
height |
絕對高度 |
float |
|
latitude |
當前位置緯度 |
float |
|
longitude |
當前位置經(jīng)度 |
float |
|
authority_change |
|
bool |
控制權變化 |
flight_authority_type |
|
int |
|
flight_authority_user |
|
string |
|
live_status |
|
int |
|
live_quality |
|
int |
|
live_video_type |
|
string |
|
available_network |
|
int |
|
real_use_network |
|
int |
|
wireless_status_list |
無線信號質量 |
array |
|
wireliess_status_list字段
Column |
Name |
Type |
Description |
module_name |
|
string |
|
module_installed |
|
bool |
|
module_connected |
|
bool |
|
in_use |
|
bool |
|
sim_card_status |
|
enum_int |
// 0: no sim card, 1: not ready, 2: sim card ready, 3: pin code required, 4: puk code required, 5: network personalization, 6: bad |
ue_state |
|
string |
|
network_type |
|
string |
|
cell_id |
|
string |
|
rsrp |
|
int |
|
sinr |
|
int |
|
sdr_quality |
|
int |
|
示例:
{
"bid":"00000000-0000-0000-0000-000000000000",
"tid":"00000000-0000-0000-0000-000000000000",
"timestamp":1727505066666,
"gateway":"1ZMBJBF0030041",
"data": {
wireless_status_list: [
{
"module_name" : "5G_A",
"module_installed" : true,
"sim_card_status" : 0,
"ue_state": "NOCONN",
"network_type" : "NR",
"cell_id" : 0,
"rsrp" : -70,
"sinr" : -20,
},
{
"module_name" : "5G_B",
"module_installed" : true,
"sim_card_status" : 0,
"ue_state": "NOCONN",
"network_type" : "NR",
"cell_id" : 0,
"rsrp" : -70,
"sinr" : -20,
},
{
"module_name" : "1.4G",
"module_installed" : true,
"sim_card_status" : 0,
"ue_state": "NOCONN",
"network_type" : "LTE",
"cell_id" : 0,
"rsrp" : -70,
"sinr" : -20,
},
]
},
}
飛機Osd
topic: thing/product/{device_sn}/osd
說明:此消息1hz定時上報
字段:
Column |
Name |
Type |
Description |
attitude_head |
偏航軸角度 |
float |
偏航軸角度與真北角(經(jīng)線)的角度,0到6點鐘方向為正值,6到12點鐘方向為負值 |
attitude_pitch |
俯仰軸角度 |
float |
|
attitude_roll |
橫滾軸角度 |
float |
|
battery |
飛行器電池信息 |
struct |
|
distance_limit_status |
|
struct |
|
elevation |
相對起飛點高度 |
float |
|
firmware_version |
固件版本 |
string |
{"length":"64"} |
gear |
檔位 |
enum |
{"0":"A","1":"P","2":"NAV","3":"FPV","4":"FARM","5":"S","6":"F","7":"M","8":"G","9":"T"} |
height |
絕對高度 |
float |
相對地球橢球面高度, 計算:相對起飛點的高度 + 起飛點的橢球高 |
height_limit |
飛行器限高 |
int |
{"max":"1500","min":"20","step":"1","unit_name":"米 / m"} |
home_distance |
距離 Home 點的距離 |
float |
|
horizontal_speed |
水平速度 |
float |
|
latitude |
當前位置緯度 |
float |
{"max":"3.4028235E38","min":"-1.4E-45","step":"0.1"} |
longitude |
當前位置經(jīng)度 |
float |
{"max":"3.4028235E38","min":"-1.4E-45","step":"0.1"} |
mode_code |
飛行器狀態(tài) |
enum |
{"0":"待機","1":"起飛準備","2":"起飛準備完畢","3":"手動飛行","4":"自動起飛","5":"航線飛行","6":"全景拍照","7":"智能跟隨","8":"ADS-B 躲避","9":"自動返航","10":"自動降落","11":"強制降落","12":"三槳葉降落","13":"升級中","14":"未連接","15":"APAS","16":"虛擬搖桿狀態(tài)","17":"指令飛行","18":"空中 RTK 收斂模式"} |
payload |
負載 |
Struct |
|
position_state |
搜星狀態(tài) |
struct |
|
storage |
存儲容量 |
Struct |
|
total_flight_distance |
飛行器累計飛行總里程 |
Float |
{"unit_name":"米 / m"} |
total_flight_time |
飛行器累計飛行航時 |
Int |
{"unit_name":"秒 / s"} |
track_id |
航跡 ID |
string |
{"length":"64"} |
vertical_speed |
垂直速度 |
float |
{"unit_name":"米每秒 / m/s"} |
wind_direction |
當前風向 |
Enum |
{"1":"正北","2":"東北","3":"東","4":"東南","5":"南","6":"西南","7":"西","8":"西北"} |
wind_speed |
風速 |
float |
風速估計,該風速是通過飛行器姿態(tài)推測出的 ,有一定的誤差 ,僅供參考 ,不能作為氣象數(shù)據(jù)使用 |
Position state字段
Column |
Name |
Type |
Description |
gps_number |
GPS 搜星數(shù)量 |
int |
|
is_fixed |
是否收斂 |
Enum |
{"0":"未開始","1":"收斂中","2":"收斂成功","3":"收斂失敗"} |
quality |
搜星檔位 |
enum |
{"1":"1檔","2":"2檔","3":"3檔","4":"4檔","5":"5檔"} |
rtk_number |
RTK 搜星數(shù)量 |
int |
|
drone battery字段
Column |
Name |
Type |
Description |
batteries |
電池詳細信息 |
array |
|
capacity_percent |
電池的總剩余電量 |
int |
{"max":100,"min":0} |
landing_power |
強制降落電量百分比 |
int |
{"max":100,"min":0} |
remain_flight_time |
剩余飛行時間 |
int |
{"unit_name":"秒 / s"} |
return_home_power |
返航所需電量百分比 |
int |
{"max":100,"min":0} |
battery字段
Column |
Name |
Type |
Description |
capacity_percent |
電池剩余電量 |
int |
{"max":100,"min":0} |
firmware_version |
固件版本 |
string |
|
high_voltage_storage_days |
高電壓存儲天數(shù) |
int |
{"unit_name":"日 / day"} |
index |
電池序號 |
int |
left: 0 right: 1 |
loop_times |
電池循環(huán)次數(shù) |
int |
|
sn |
電池序列號(SN) |
string |
|
sub_type |
電池子類型 |
enum_int |
|
temperature |
溫度 |
float |
{"unit_name":"攝氏度 / °C"} 保留小數(shù)點后一位 |
type |
電池類型 |
enum_int |
|
voltage |
電壓 |
int |
{"unit_name":"毫伏 / mV"} |
storage字段
Column |
Name |
Type |
Description |
total |
總容量 |
int |
{"unit_name":"千字節(jié) / KB"} |
used |
已使用容量 |
int |
{"unit_name":"千字節(jié) / KB"} |
示例:
盒子上下線
topic: sys/product/{gateway_sn}/status
字段:
Column |
Name |
Type |
Description |
device_secret |
網(wǎng)關設備的密鑰 |
|
|
domain |
網(wǎng)關設備的命名空間 |
|
|
nonce |
nonce |
|
|
sub_devices |
子設備列表 |
|
|
sub_type |
網(wǎng)關子設備的產(chǎn)品子類型 |
|
|
thing_version |
網(wǎng)關設備的物模型版本 |
|
|
type |
網(wǎng)關設備的產(chǎn)品類型 |
|
|
sub_device字段
Column |
Name |
Type |
Description |
device_secret |
子設備的密鑰 |
|
|
domain |
|
|
|
index |
|
|
|
nonce |
nonce |
|
|
sn |
子設備序列號(SN) |
|
|
sub_type |
|
|
|
thing_version |
|
|
|
type |
|
|
|
示例:
{
"tid": "tid001",
"bid": "bid001",
"method": "update_topo",
"timestamp": 1234567890123,
"gateway": "gw123456",
"from": "gw123456",
"data": {
"type": 98,
"sub_type": 0,
"device_secret": "secret",
"nonce": "nonce",
"version": 1,
"sub_devices": [
{
"sn": "drone001",
"type": 116,
"sub_type": 0,
"index": "A",
"device_secret": "secret",
"nonce": "nonce",
"version": 1
}
]
}
}
獲取飛行控制權
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: flight_authority_grab
Data: null
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "flight_authority_grab"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: flight_authority_grab
Data:
Column |
Name |
Type |
constraint |
Description |
result |
返回碼 |
int |
|
非 0 代表錯誤 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "flight_authority_grab"
}
一鍵起飛
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: takeoff_to_point
Data:
Column |
Name |
Type |
Description |
commander_flight_height |
【必填】指點飛行高度 |
float |
{"max":3000,"min":2,"step":0.1,"unit_name":"米 / m"} 相對(機場)起飛點的高度,相對高 ALT |
commander_flight_mode |
【必填】指點飛行模式設置值 |
enum_int |
{"0":"智能高度飛行","1":"設定高度飛行"} |
commander_mode_lost_action |
【必填】指點飛行失控動作 |
enum_int |
{"0":"繼續(xù)執(zhí)行指點飛行任務","1":"退出指點飛行任務,執(zhí)行普通失控行為"} |
flight_id |
一鍵起飛任務 UUID |
string |
任務 UUID,全局唯一,用于染色 ,云端區(qū)分該值是普通計劃任務還是一鍵起飛任務 |
max_speed |
一鍵起飛的飛行過程中能達到的最大速度 |
int |
{"max":15,"min":1,"unit_name":"米每秒 / m/s"} |
rth_altitude |
返航高度 |
int |
{"max":1500,"min":2,"step":1,"unit_name":"米 / m"}相對(機場)起飛點的高度,相對高 ALT |
rc_lost_action |
遙控器失控動作 |
enum_int |
{"0":"懸停","1":"著陸(降落)","2":"返航"}遙控器失控動作 |
rth_mode |
【必填】返航模式設置值 |
enum_int |
{"0":"智能高度","1":"設定高度"}智能返航模式下,飛行器將自動規(guī)劃最佳返航高度。大疆機場當前不支持設置返航高度模式 ,只能選擇'設定高度'模式。當環(huán)境,光線不滿足視覺系統(tǒng)要求時(譬如傍晚陽光直射 、夜間弱光無光),飛行器將使用您設定的返航高度進行直線返航 |
security_takeoff_height |
安全起飛高度 |
float |
{"max":1500,"min":20,"step":0.1,"unit_name":"米 / m"}相對(機場)起飛點的高度(ALT) |
target_height |
目標點高度 |
float |
{"max":1500,"min":2,"step":0.1,"unit_name":"米 / m"}目標點高度(橢球高) ,使用 WGS84 模型,飛行器到點后默認行為:懸停 |
target_latitude |
目標點緯度 |
double |
{"max":90,"min":-90} 目標點緯度,角度值,南緯是負,北緯是正,精度到小數(shù)點后6位 |
target_longitude |
目標點經(jīng)度 |
double |
{"max":180,"min":-180} 目標點經(jīng)度,角度值,東經(jīng)是正 ,西經(jīng)是負,精度到小數(shù)點后6位 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"commander_flight_height": 80,
"commander_mode_lost_action": 1,
"flight_id": "ABDEAC21DCADDA",
"max_speed": 12,
"rc_lost_action": 0,
"rth_altitude": 100,
"security_takeoff_height": 100,
"target_height": 100,
"target_latitude": 12.23,
"target_longitude": 12.32
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "takeoff_to_point"
}
盒子響應
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: takeoff_to_point
Data:
Column |
Name |
Type |
constraint |
Description |
result |
返回碼 |
int |
|
非 0 代表錯誤 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "takeoff_to_point"
}
一鍵起飛結果上報
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: takeoff_to_point_progress
Data:
Column |
Name |
Type |
Description |
flight_id |
一鍵起飛任務 UUID |
text |
|
planned_path_points |
規(guī)劃的軌跡點列表 |
array |
指點飛行為什么不要這個字段 |
remaining_distance |
剩余任務距離 |
float |
{"step":0.1,"unit_name":"米 / m"} |
remaining_time |
剩余任務時間 |
float |
{"step":0.1,"unit_name":"秒 / s"} |
result |
返回碼 |
int |
非 0 代表錯誤 |
status |
任務狀態(tài) |
enum_string |
{"task_finish":"一鍵起飛任務完成","task_ready":"準備起飛","wayline_cancel":"取消飛向目標點","wayline_failed":"執(zhí)行失敗","wayline_ok":"執(zhí)行成功,已飛向目標點","wayline_progress":"執(zhí)行中"} |
track_id |
航跡 ID |
text |
|
way_point_index |
當前執(zhí)行到第幾個航點 |
int |
指點飛行為什么不要這個字段 |
planned_path_points字段:
Column |
Name |
Type |
Description |
height |
目標點高度 |
float |
{"max":10000,"min":2,"step":0.1,"unit_name":"米 / m"} 目標點高度(橢球高),使用 WGS84 模型 |
latitude |
目標點緯度 |
float |
{"max":90,"min":-90} 目標點緯度,角度值,南緯是負,北緯是正,精度到小數(shù)點后6位 |
longitude |
目標點經(jīng)度 |
float |
{"max":180,"min":-180} 目標點經(jīng)度,角度值,東經(jīng)是正,西經(jīng)是負,精度到小數(shù)點后6位 |
示例:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"planned_path_points": [
{
"height": 123.234,
"latitude": 13.23,
"longitude": 123.234
}
],
"remaining_distance": 0,
"remaining_time": 0,
"result": 0,
"status": "wayline_ok",
"track_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"way_point_index": 1
},
"need_reply": 1,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 16540709686556,
"method": "takeoff_to_point_progress"
}
指點飛行
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: fly_to_point
Data:
Column |
Name |
Type |
Description |
fly_to_id |
飛向目標點 ID |
text |
|
max_speed |
flyto 的飛行過程中能達到的最大速度 |
int |
{"max":15,"min":0,"unit_name":"米每秒 / m/s"} |
points |
flyto 目標點列表 |
array |
僅支持 1 個目標點 |
points字段:
Column |
Name |
Type |
Description |
height |
目標點高度 |
float |
{"max":10000,"min":2,"step":0.1,"unit_name":"米 / m"} 目標點高度(橢球高),使用 WGS84 模型 |
latitude |
目標點緯度 |
float |
{"max":90,"min":-90} 目標點緯度,角度值,南緯是負,北緯是正 ,精度到小數(shù)點后6位 |
longitude |
目標點經(jīng)度 |
float |
{"max":180,"min":-180} 目標點經(jīng)度,角度值,東經(jīng)是正 ,西經(jīng)是負 ,精度到小數(shù)點后6位 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"fly_to_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"max_speed": 12,
"points": [
{
"height": 100,
"latitude": 12.23,
"longitude": 12.23
}
]
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "fly_to_point"
}
盒子響應消息
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: fly_to_point
Data:
Column |
Name |
Type |
constraint |
Description |
result |
返回碼 |
int |
|
非 0 代表錯誤 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "fly_to_point"
}
指點飛行執(zhí)行結果通知
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: fly_to_point_progress
Data:
Column |
Name |
Type |
Description |
fly_to_id |
飛向目標點 ID |
text |
|
remaining_distance |
剩余任務距離 |
float |
{"step":0.1,"unit_name":"米 / m"} |
remaining_time |
剩余任務時間 |
float |
{"step":0.1,"unit_name":"秒 / s"} |
planned_path_points |
規(guī)劃的軌跡點列表 |
array |
{"size": -, "item_type": struct} |
result |
返回碼 |
int |
非 0 代表錯誤 |
status |
狀態(tài) |
enum_string |
{"wayline_cancel":"取消飛向目標點","wayline_failed":"執(zhí)行失敗","wayline_ok":"執(zhí)行成功,已飛向目標點","wayline_progress":"執(zhí)行中"} |
way_point_index |
當前執(zhí)行到第幾個航點 |
int |
|
planned_path_points字段:
Column |
Name |
Type |
Description |
height |
目標點高度 |
float |
{"max":10000,"min":2,"step":0.1,"unit_name":"米 / m"} 目標點高度(橢球高),使用 WGS84 模型 |
latitude |
目標點緯度 |
float |
{"max":90,"min":-90} 目標點緯度,角度值,南緯是負,北緯是正,精度到小數(shù)點后6位 |
longitude |
目標點經(jīng)度 |
float |
{"max":180,"min":-180} 目標點經(jīng)度,角度值,東經(jīng)是正 ,西經(jīng)是負 ,精度到小數(shù)點后6位 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"fly_to_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"planned_path_points": [
{
"height": 123.234,
"latitude": 13.23,
"longitude": 123.234
}
],
"remaining_distance": 0,
"remaining_time": 0,
"result": 0,
"status": "wayline_progress",
"way_point_index": 0
},
"need_reply": 1,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 16540709686556,
"method": "fly_to_point_progress"
}
結束指點飛行
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: fly_to_point_stop
Data: null
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "fly_to_point_stop"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: fly_to_point_stop
Data:
Column |
Name |
Type |
constraint |
Description |
result |
返回碼 |
int |
|
非 0 代表錯誤 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "fly_to_point_stop"
}
更新指點飛行目標點
說明:「一鍵起飛」或「flyto 飛向目標點」的過程中,可以通過該命令快速更新目標點
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: fly_to_point_update
Data:
Column |
Name |
Type |
constraint |
Description |
max_speed |
指令飛行過程中能達到的最大速度 |
int |
{"max":15,"min":1,"unit_name":"米每秒 / m/s"} |
|
points |
更新的目標點列表 |
array |
{"size": -, "item_type": struct} |
僅支持 1 個目標點 |
?latitude |
目標點緯度 |
double |
{"max":90,"min":-90} |
目標點緯度 |
?longitude |
目標點經(jīng)度 |
double |
{"max":180,"min":-180} |
目標點經(jīng)度,角度值 ,東經(jīng)是正,西經(jīng)是負,精度到小數(shù)點后6位 |
?height |
目標點高度 |
float |
{"max":10000,"min":2,"step":0.1,"unit_name":"米 / m"} |
目標點高度(橢球高) ,使用 WGS84 模型 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"max_speed": 12,
"points": [
{
"height": 100,
"latitude": 12.23,
"longitude": 12.23
}
]
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "fly_to_point_update"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: fly_to_point_update
Data:
Column |
Name |
Type |
constraint |
Description |
result |
返回碼 |
int |
|
非 0 代表錯誤 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "fly_to_point_update"
}
執(zhí)行航線任務
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: flighttask_execute
Data:
Column |
Name |
Type |
constraint |
Description |
flight_id |
計劃 ID |
text |
|
|
file |
航線文件對象 |
struct |
|
|
?url |
文件 URL |
text |
|
|
?fingerprint |
文件簽名 |
text |
|
文件內(nèi)容 MD5 簽名 |
示例:
{
"bid": "00000000-0000-0000-0000-000000000000",
"data": {
"file": {
"url": "https://cloud.3g.com.cn/kmz/waypoint_v3_test_file.kmz",
"fingerprint": "MD5"
},
"flight_id": "12345678"
},
"tid": "00000000-0000-0000-0000-000000000000",
"timestamp": 1654070968655,
"method": "flighttask_execute"
}
航線暫停
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:
Column |
Name |
Type |
constraint |
Description |
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_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:
Column |
Name |
Type |
constraint |
Description |
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_stop
Data:
Column |
Name |
Type |
constraint |
Description |
flight_id |
任務id |
text |
|
|
reason |
結束原因 |
enum_int |
{"0":"正常結束","1":"另一機場狀態(tài)機異常"} |
|
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:
Column |
Name |
Type |
constraint |
Description |
result |
返回碼 |
int |
|
非 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}/events
Direction: up
Method: flighttask_progress
Data:
Column |
Name |
Type |
constraint |
Description |
flight_id |
任務 ID |
text |
|
|
state |
斷點狀態(tài) |
enum_int |
{"0":"在航段上","1":"在航點上"} |
|
way_point_index |
航線 ID |
int |
|
|
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"way_point_index": 3,
"flight_id": "flight_id",
"state": 1,
},
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "flighttask_progress"
}
一鍵返航
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: return_home
Data: null
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "return_home"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: return_home
Data:
Column |
Name |
Type |
constraint |
Description |
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"
}
取消一鍵返航
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
Data:
Column |
Name |
Type |
constraint |
Description |
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: landing_smart
Data: null
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "landing_smart"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: return_home
Data:
Column |
Name |
Type |
constraint |
Description |
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": "landing_smart"
}
緊急停止
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: emergency_stop
Data: null
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "emergency_stop"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: emergency_stop
Data:
Column |
Name |
Type |
constraint |
Description |
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": "emergency_stop"
}
進入DRC模式
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: drc_mode_enter
Data::
Column |
Name |
Type |
Description |
hsi_frequency |
HSI 頻率 |
int |
{"max":30,"min":1,"step":"","unit_name":"赫茲 / Hz"} 設置 HSI 上報頻率 |
mqtt_broker |
Broker 連接信息 |
struct |
獲取 MQTT 中繼服務的地址與認證信息 |
osd_frequency |
OSD 頻率 |
int |
{"max":30,"min":1,"step":"","unit_name":"赫茲 / Hz"} 設置 OSD 上報頻率 |
mqtt_broker字段:
Column |
Name |
Type |
Description |
address |
|
|
|
client_id |
|
|
|
enable_tls |
|
|
|
expire_time |
|
|
|
password |
|
|
|
username |
|
|
|
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"hsi_frequency": 1,
"mqtt_broker": {
"address": "mqtt.dji.com:8883",
"client_id": "sn_a",
"enable_tls": true,
"expire_time": 1672744922,
"password": "jwt_token",
"username": "sn_a_username"
},
"osd_frequency": 10
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "drc_mode_enter"
}
設備端-reply:
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: drc_mode_enter
Data:
Column |
Name |
Type |
constraint |
Description |
result |
返回碼 |
int |
|
非 0 代表錯誤 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "drc_mode_enter"
}
web端發(fā)送控制指令
進入指令飛行模式后允許通過該指令控制飛行器航行方向與速度
,發(fā)送的頻率需要保持在
5-10hz以內(nèi)讓設備能夠比較精準的控制速度變化與方向。
Topic: thing/product/{gateway_sn}/drc/down
Direction: down
Method: drone_control
Data:
Column |
Name |
Type |
Description |
h |
上下方向的速度 |
double |
{"max":5,"min":-4,"unit_name":"米每秒 / m/s"} 向上向下移動的最大速度 ,負值表示向下移動 |
seq |
命令序號 |
int |
遞增的序號,保證指令順序執(zhí)行 。若 x、y 、h 、w 參數(shù)發(fā)生變化,seq 需要從 0 開始增長 。 |
w |
機身角速度 |
double |
{"max":90,"min":-90,"unit_name":"弧度每秒 / rad/s"} 順時針與逆時針的最大角速度 ,負值表示逆時針轉動 |
x |
前進后退方向的速度 |
double |
{"max":17,"min":-17,"unit_name":"米每秒 / m/s"} 前進后退的最大速度,負值表示向后移動 |
y |
左右方向的速度 |
double |
{"max":17,"min":-17,"unit_name":"米每秒 / m/s"} 左右移動的最大速度,負值表示向左移動 |
Example:
{
"data": {
"h": 2.76,
"seq": 1,
"w": 2.86,
"x": 2.34,
"y": -2.45
},
"method": "drone_control"
}
DRC避障信息
Topic: thing/product/{gateway_sn}/drc/up
Direction: up
Method: hsi_info_push
Data:
Column |
Name |
Type |
Description |
around_distances |
周邊的障礙物距離 |
array |
水平方向觀察點,分布在[0,360)的角度區(qū)間 ,0對應機頭方向正前方,順時針分布 ,例如0度為機頭正前方 ,90度為飛行器正右方 。每個數(shù)值表示該角度上障礙物與飛行器距離 ,60000 表示該角度沒有障礙物 。若上報空數(shù)組 ,意味任意角度都無障礙物。若上報 4 個數(shù)據(jù)的數(shù)組 ,意味該數(shù)據(jù)為 TOF 避障數(shù)據(jù) |
back_enable |
后視避障開關狀態(tài) |
bool |
|
back_work |
后視避障工作狀態(tài) |
bool |
|
down_distance |
下方的障礙物距離 |
int |
{"unit_name":"毫米 / mm"} |
down_enable |
下視避障開關狀態(tài) |
bool |
|
down_work |
下視避障工作狀態(tài) |
bool |
|
front_enable |
前視避障開關狀態(tài) |
bool |
|
front_work |
前視避障工作狀態(tài) |
bool |
|
horizontal_enable |
水平避障開關狀態(tài) |
bool |
|
horizontal_work |
水平避障工作狀態(tài) |
bool |
|
left_enable |
左視避障開關狀態(tài) |
bool |
|
left_work |
左視避障工作狀態(tài) |
bool |
|
right_enable |
右視避障開關狀態(tài) |
bool |
|
right_work |
右視避障工作狀態(tài) |
bool |
|
up_distance |
上方的障礙物距離 |
int |
{"unit_name":"毫米 / mm"} |
up_enable |
上視避障開關狀態(tài) |
bool |
|
up_work |
上視避障工作狀態(tài) |
bool |
|
vertical_enable |
垂直避障開關狀態(tài) |
bool |
|
vertical_work |
垂直避障工作狀態(tài) |
bool |
|
Example:
{
"method": "hsi_info_push",
"timestamp": 1670415891013,
"data": {
"up_distance": 10,
"down_distance": 10,
"around_distance": [
10,
8,
9,
16,
2
],
"up_enable": true,
"up_work": true,
"down_enable": true,
"down_work": true,
"left_enable": true,
"left_work": true,
"right_enable": true,
"right_work": true,
"front_enable": true,
"front_work": true,
"back_enable": true,
"back_work": true,
"vertical_enable": true,
"vertical_work": true,
"horizontal_enable": true,
"horizontal_work": true
}
}
DRC osd信息
Topic: thing/product/{gateway_sn}/drc/up
Direction: up
Method: osd_info_push
Data:
Column |
Name |
Type |
Description |
attitude_head |
飛行器姿態(tài) head 角 |
float |
{"unit_name":"度 / °"} 飛行器姿態(tài) head 角 |
gimbal_pitch |
云臺 pitch 角 |
float |
{"unit_name":"度 / °"} |
gimbal_roll |
云臺 roll 角 |
float |
{"unit_name":"度 / °"} |
gimbal_yaw |
云臺 yaw 角 |
float |
{"unit_name":"度 / °"} |
height |
飛行器高度 |
float |
{"unit_name":"度 / °"} 飛行器海拔高度 |
latitude |
飛行器緯度 |
float |
{"unit_name":"度 / °"} |
longitude |
飛行器經(jīng)度 |
float |
{"unit_name":"度 / °"} |
speed_x |
當前飛行器 x 坐標方向的速度 |
float |
{"unit_name":"米每秒 / m/s"} |
speed_y |
當前飛行器 y 坐標方向的速度 |
float |
{"unit_name":"米每秒 / m/s"} |
speed_z |
當前飛行器 z 坐標方向的速度 |
float |
{"unit_name":"米每秒 / m/s"} |
Example:
{
"data": {
"attitude_head": 60,
"gimbal_pitch": 60,
"gimbal_roll": 60,
"gimbal_yaw": 60,
"height": 10,
"latitude": 10,
"longitude": 10,
"speed_x": 10,
"speed_y": 10,
"speed_z": 10
},
"timestamp": 1670415891013
}
DRC飛行器急停
Topic: thing/product/{gateway_sn}/drc/down
Direction: down
Method: drone_emergency_stop
Data: null
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "drone_emergency_stop"
}
DRC心跳
Topic: thing/product/{gateway_sn}/drc/down
Direction: down
Method: heart_beat
Data:
Column |
Name |
Type |
Description |
seq |
命令序號 |
int |
遞增的序號,保證指令順序執(zhí)行 |
timestamp |
心跳發(fā)送時間戳 |
int |
{"unit_name":"毫秒 / ms"} 若超過 1 分鐘未收到業(yè)務方發(fā)送心跳協(xié)議,設備將會認為 DRC 鏈路處于空閑退出 DRC 鏈路。 |
Example:
{
"data": {
"seq": 10,
"timestamp": 1670415891013
},
"method": "heart_beat",
"seq": 1
}
退出DRC模式
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: drc_mode_exit
Data::
Example:**
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "drc_mode_exit"
}
設備端-reply:
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: drc_mode_exit
Data:
Column |
Name |
Type |
constraint |
Description |
result |
返回碼 |
int |
|
非 0 代表錯誤 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "drc_mode_exit"
}
參數(shù)設定
Topic: thing/product/{gateway_sn}/property/set
Direction: down
Method: param_set
Data:
Column |
Name |
Type |
Description |
obstacle_avoidance_horizon_enable |
水平避障 |
int |
|
obstacle_avoidance_downside_enable |
下避障 |
int |
|
obstacle_avoidance_upside_enable |
上避障 |
int |
|
rc_lost_action |
|
|
|
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"obstacle_avoidance_horizon_enable": 0,
"obstacle_avoidance_downside_enable": 0,
"obstacle_avoidance_upside_enable": 0,
"rc_lost_action": 0,
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "param_set"
}
HMS
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: has
Data:
Column |
Name |
Type |
constraint |
Description |
list |
hms信息列表 |
list |
|
|
list字段:
Column |
Name |
Type |
constraint |
Description |
args |
產(chǎn)生hms的組件信息 |
Struct |
|
|
code |
hms編碼 |
string |
|
|
device_type |
設備編碼 |
string |
|
|
imminent |
是否緊急 |
bool |
|
|
in_the_sky |
是否在空中 |
bool |
|
|
level |
等級 |
int |
|
|
module |
模塊 |
|
|
|
Example:
{
"bid":"7785a02f-b630-4d1d-be12-36d91520ab7f",
"data":{
"list":[
{
"args":{"component_index":0,"sensor_index":0},
"code":"0x1B080003",
"device_type":"0-89-0",
"imminent":true,
"in_the_sky":false,
"level":2,
"module":3
}
]
},
"tid":"f1e89554-a96e-43a9-926f-b1fe3859675b",
"timestamp":1729504021399,
"from":"1581F6GKB24790040093",
"gateway":"4LGZM7300A01VV",
"method":"hms",
"need_reply":false
}