大疆无人机 MQTT消息定义

公共字段解释

ColumnNameTypeDescription
tid事务uuidtext事务(Transaction)的 UUID:表征一次简单的消息通信,如:增/删/改/查,云台控制等,可以是:
1. 数据上报请求+数据上报响应
2. 握手认证请求+响应+ack
3.报警事件单向通知等,解决事务多并发和消息匹配的问题
bid业务uuidtext业务(Business)的 UUID:有些功能不是一次通信就能完成的,包含持续一段时间内的所有交互。
业务通常由多个原子事务组成,且持续时间较长;
例如点播/下载/回放;解决业务多并发和重复请求的问题,便于所有模块的状态机管理。
timestamp毫秒时间戳int消息的发送时间
gateway网关设备的序列号text发送该消息的网关设备的序列号
data消息内容object消息内容

osd 结构示例

topic: thing/product/{device_sn}/osd

{ "tid": "65717bf1-aee7-4abb-8ea3-9b1908548d74", "bid": "cf5ad2e6-2f32-4b59-980e-d5c9ee412805", "timestamp": 1667220873846, "data": { "job_number": 492, "acc_time": 1859010, "activation_time": 0, "maintain_status": { "maintain_status_array": [ { "state": 0, "last_maintain_type": 17, "last_maintain_time": 0, "last_maintain_work_sorties": 0 } ] }, "electric_supply_voltage": 231, "working_voltage": 25440, "working_current": 1120, "backup_battery": { "voltage": 26631, "temperature": 27.9, "switch": 1 }, "drone_battery_maintenance_info": { "maintenance_state": 0, "maintenance_time_left": 0 } }, "gateway": "dock_sn" } 
{ "bid": "d6cfcea4-c6ca-439b-948f-b17d88fc308f", "data": { "flighttask_step_code": 255, "media_file_detail": { "remain_upload": 0 }, "wireless_link": { "4g_freq_band": 2.4, "4g_gnd_quality": 0, "4g_link_state": 0, "4g_quality": 0, "4g_uav_quality": 0, "dongle_number": 0, "link_workmode": 0, "sdr_freq_band": 2.4, "sdr_link_state": 0, "sdr_quality": 0 } }, "tid": "e4c15182-776b-4c13-9973-3fc76848ca15", "timestamp": 1667220881576, "gateway": "dock_sn" } 
{ "tid": "43d2e632-1558-4c4e-83d2-eeb51b7a377a", "bid": "7578f2ac-1f12-4d47-9ab6-5de146ed7b8a", "timestamp": 1667220916697, "data": { "network_state": { "type": 2, "quality": 0, "rate": 5.0970001220703125 }, "drone_charge_state": { "state": 0, "capacity_percent": 100 }, "drone_in_dock": 1, "rainfall": 0, "wind_speed": 0, "environment_temperature": 24, "temperature": 24.9, "humidity": 62, "latitude": 22.907809968, "longitude": 113.703482143, "height": 34.174125671386719, "alternate_land_point": { "latitude": 22.907898319908661, "longitude": 113.70347329676635, "safe_land_height": 0, "is_configured": 1 }, "first_power_on": 1631945855969, "position_state": { "is_calibration": 1, "is_fixed": 2, "quality": 5, "gps_number": 6, "rtk_number": 25 }, "storage": { "total": 82045336, "used": 51772 }, "mode_code": 1, "cover_state": 0, "supplement_light_state": 0, "emergency_stop_state": 0, "air_conditioner_mode": 0, "battery_store_mode": 1, "alarm_state": 0, "putter_state": 0, "sub_device": { "device_sn": "1581F5BKD225D00BP891", "device_model_key": "0-67-0", "device_online_status": 0, "device_paired": 1 } }, "gateway": "dock_sn" } 

#state 结构示例

topic: thing/product/{device_sn}/state

{ "tid":"6a7bfe89-c386-4043-b600-b518e10096cc", "bid":"42a19f36-5117-4520-bd13-fd61d818d52e", "timestamp": 1598411295123, "gateway":"sn", "data":{} } 

#services 结构示例

topic: thing/product/{gateway_sn}/services

{ "tid":"6a7bfe89-c386-4043-b600-b518e10096cc", "bid":"42a19f36-5117-4520-bd13-fd61d818d52e", "timestamp": 1598411295123, "gateway":"sn", "method": "some_method", "data": {} } 

#services_reply 结构示例

#data中必填字段解释

ColumnNameTypeconstraintDescription
result设备响应的结果码int非 0 代表错误
output设备消息内容struct设备响应服务端命令的消息内容
{ "tid":"6a7bfe89-c386-4043-b600-b518e10096cc", "bid":"42a19f36-5117-4520-bd13-fd61d818d52e", "timestamp": 1598411295123, "gateway":"sn", "method": "some_method", "data": { "result": 0, "output": {} } } 

#events 结构示例

topic: thing/product/{gateway_sn}/events

ColumnNameTypeconstraintDescription
need_reply服务端是否需要答复int服务端收到设备的events事件上报消息后,跟进need_reply来判断是否给予收到答复;0代表不需要,1代表需要
{ "tid":"6a7bfe89-c386-4043-b600-b518e10096cc", "bid":"42a19f36-5117-4520-bd13-fd61d818d52e", "timestamp": 1598411295123, "need_reply": 0, "gateway":"sn", "method": "some_method", "data": {} } 

#events_reply 结构示例

topic: thing/product/{gateway_sn}/events_reply

#data中必填字段解释

ColumnNameTypeconstraintDescription
result服务端响应的结果码int非 0 代表错误
{ "tid":"6a7bfe89-c386-4043-b600-b518e10096cc", "bid":"42a19f36-5117-4520-bd13-fd61d818d52e", "timestamp": 1598411295123, "gateway":"sn", "method": "some_method", "data": { "result": 0 } } 

#requests 结构示例

topic: thing/product/{gateway_sn}/requests

{ "tid":"6a7bfe89-c386-4043-b600-b518e10096cc", "bid":"42a19f36-5117-4520-bd13-fd61d818d52e", "timestamp": 1598411295123, "gateway":"sn", "method": "some_method", "data": {} } 

#requests_reply 结构示例

topic: thing/product/{gateway_sn}/requests_reply

#data中必填字段解释

ColumnNameTypeconstraintDescription
result服务端响应的结果码int非 0 代表错误
output服务消息内容struct服务端响应设备的消息内容
{ "tid":"6a7bfe89-c386-4043-b600-b518e10096cc", "bid":"42a19f36-5117-4520-bd13-fd61d818d52e", "timestamp": 1598411295123, "gateway":"sn", "method": "some_method", "data": { "result": 0, "output":{} } } 

#status 结构示例

topic: sys/product/{gateway_sn}/status

## 网关设备+子设备上线 { "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "method": "update_topo", "timestamp": 1234567890123, "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 } ] } } ## 子设备下线 { "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "method": "update_topo", "timestamp": 1234567890123, "data": { "type": 98, "sub_type": 0, "device_secret":"secret", "nonce":"nonce", "version": 1, "sub_devices":[] } } 

#status_reply 结构示例

topic: sys/product/{gateway_sn}/status_reply

#data中必填字段解释

ColumnNameTypeconstraintDescription
result结果码int非0代表错误
{ "tid":"6a7bfe89-c386-4043-b600-b518e10096cc", "bid":"42a19f36-5117-4520-bd13-fd61d818d52e", "timestamp": 1598411295123, "method": "update_topo", "data": { "result": 0 } } 

#property set 结构示例

topic: thing/product/{gateway_sn}/property/set

ColumnNameTypeconstraintDescription
some_property需要修改的属性keystring参考设备管理-设备属性设置
设备属性是否可以被修改,在设备属性章节通过“accessMode”标识符号判断,accessMode = rw 表示可被读写。
some_value需要修改的属性valuestring/int/float参考对应的设备属性
{ "tid":"6a7bfe89-c386-4043-b600-b518e10096cc", "bid":"42a19f36-5117-4520-bd13-fd61d818d52e", "timestamp": 1598411295123, "data": { "some_property": some_value } } 

#property set_reply 结构示例

topic: thing/product/{gateway_sn}/property/set_reply

#data中必填字段解释

ColumnNameTypeconstraintDescription
some_property需要修改的属性keystring参考设备管理-设备属性设置
设备属性是否可以被修改,在设备属性章节通过“accessMode”标识符号判断,accessMode = rw 表示可被读写。
result对应属性的设置结果int0: 成功,1:失败,2:超时,其他参考错误码解释
{ "tid":"6a7bfe89-c386-4043-b600-b518e10096cc", "bid":"42a19f36-5117-4520-bd13-fd61d818d52e", "timestamp": 1598411295123, "data": { "some_property": { "result": 0 // 0: 成功,1:失败,2:超时,其他参考错误码解释 } } } 

#drc up 结构示例

topic: thing/product/{gateway_sn}/drc/up

#data中必填字段解释

ColumnNameTypeconstraintDescription
result服务端响应的结果码int非 0 代表错误
output服务消息内容struct服务端响应设备的消息内容
{ "method": "drone_control", "data": { "result": 0, "output": { "seq": 1 } } } 

#drc down 结构示例

topic: thing/product/{gateway_sn}/drc/down

{ "method": "drone_control", "data": { "seq": 1, "x": 2.34, "y": -2.45, "h": 2.76, "w": 2.86 } }

Read more

【记录】Copilot|Github Copilot重新学生认证通过方法(2025年7月,包括2FA和认证材料、Why are you not on campus)

【记录】Copilot|Github Copilot重新学生认证通过方法(2025年7月,包括2FA和认证材料、Why are you not on campus)

文章目录 * 前言 * 步骤 * 最重要的一步 前言 事实上,Github Copilot马上就要开源了,我原本的认证过期了。但是在我体验了众多的代码补全工具实在是太难用了之后,我觉得一天也等不了了,就去再一次认证了学生认证。 这次严格了很多,要求巨无敌多,这里写一下新认证要干的事情。 一口气认证了八次的含金量谁懂,把要踩的坑全踩完了。。 步骤 (如果你是第一次认证还要额外添加一下自己的学校邮箱,这里我就略过不提了) 在所有的步骤之前,最好确保你的本人就在学校或者在学校附近。当你出现了报错You appear not to be near any campus location for the school you have selected.时,会非常难通过。 而其他的报错可以按我下文这种方式通过。 (对于部分学校,比如华科大)双重认证Two-factor authentication要打开:跳转这个网站https://github.com/settings/security,然后点下一步开启认证,

By Ne0inhk
remote: Invalid username or token. Password authentication is not supported for Git operations

remote: Invalid username or token. Password authentication is not supported for Git operations

remote: Invalid username or token. Password authentication is not supported for Git operations. fatal: Authentication failed for… 该文章解决在新系统中进行 git 操作时,第一次的登陆问题,由于Github不再支持使用账号密码进行 Git https 推送,可以采用 ssh 密钥的方式进行长期的推送 1.生成SSH key ssh-keygen -t ed25519 -C "[email protected]" 这里的-t 表示要生成的密钥类型,这里生成的类型为ed25519,是一种椭圆曲线算法,比传统的RSA更加安全、密钥更短,并且速度更快 2.将

By Ne0inhk
用 Rust 构建 Git 提交历史可视化工具

用 Rust 构建 Git 提交历史可视化工具

在软件开发中,版本控制系统的历史记录往往承载着项目的演进脉络。然而,当项目规模扩大、分支增多时,纯文本的 git log 输出很难直观地展现提交之间的复杂关系。今天,我想分享一个用 Rust 构建的轻量级工具 —— git-graph-rs,它能把 Git 仓库的提交历史转换为可视化的图结构,为代码审查、项目复盘和工程决策提供直观的支持。 目录 * 为什么需要可视化? * 技术方案的选择 * 1. 利用系统 Git 命令 * 2. 模块化的 Rust 架构 * 3. 双格式输出策略 * 核心实现解析 * Git 数据获取的艺术 * 图结构的一致性保证 * 合并提交的可视化区分 * 工程化思维体现 * 错误处理的前置化 * 参数设计的克制 * 输出格式的稳定性 * 实际应用场景 * 1. CI/CD 集成 * 2. 代码审查辅助 * 3. 项目文档化

By Ne0inhk

【无人机路径规划】基于深度强化学习的多无人机辅助边缘计算网络路径规划(Matlab代码实现)

💥💥💞💞欢迎来到本博客❤️❤️💥💥 🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。 ⛳️座右铭:行百里者,半于九十。 📋📋📋本文目录如下:🎁🎁🎁 目录 💥1 概述 摘要 一、研究背景与意义 1.1 边缘计算与无人机的融合需求 1.2 多无人机路径规划的挑战 二、多无人机辅助边缘计算网络架构 2.1 网络组成与功能 2.2 路径规划的协同需求 三、深度强化学习在路径规划中的适配性 3.1 技术优势 3.2 核心算法与多智能体协同 3.2.1 单无人机路径规划:DDPG算法 3.2.2 多无人机协同:MADDPG与IPPO 四、典型应用场景与性能优化 4.

By Ne0inhk