Casper 7 mesi fa
parent
commit
fb4d5432f0

+ 43 - 0
sri-server-bg02/test/SRI202409-湛江项目mqtt接口说明.md

@@ -0,0 +1,43 @@
+~~~
+mqtt服务地址:10.10.10.73(实验室mqtt服务器)
+mqtt服务端口:41883
+mqtt话题:bg/log
+mqtt消息(json字符串):{"1": "2024-12-12 01:01:21", "2": 6000, "3": 6000, "4": 6000}
+mqtt消息注释:
+{
+  "1": "2024-12-12 01:01:21",  # 发送时间
+  "2": 6000,  # 方向值
+  "3": 6000,  # 油门值
+  "4": 6000   # 刹车值
+}
+~~~
+
+~~~
+#车辆状态更新
+mqtt服务地址:192.168.131.23
+mqtt服务端口:41883
+mqtt话题:hs/vehicle/state
+mqtt消息说明:
+{
+    "address": "192.168.131.180",  # 车辆ip
+    "state": 1,  # 车辆状态 1 离线 2 在线空闲 3 人工驾驶中 4 远程驾驶中 5 自动驾驶中
+    "direction": 15,  # 车头方向(场地坐标偏转角度)
+    "coordinate_x": 15,  # 当前车辆坐标
+    "coordinate_y": 15,  # 当前车辆坐标
+    "weight": 15,  # 负载重量
+}
+~~~
+
+~~~
+#渣包位置更新
+mqtt服务地址:192.168.131.23
+mqtt服务端口:41883
+mqtt话题:hs/pot/data
+mqtt消息说明:
+{
+  "pot_name": "M.24",  # 渣罐编号
+  "pot_x": 40,  # 坐标值
+  "pot_y": 50,  # 坐标值
+  "mark_pot_pose": 0.3  # 渣罐姿态
+}
+~~~

+ 2 - 1
sri-server-bg02/test/test-mqtt-sender.py

@@ -4,7 +4,8 @@ import json
 
 client = mqtt.Client()
 # client.connect(host='10.10.61.229', port=41883)
-client.connect(host='127.0.0.1', port=41883)
+# client.connect(host='127.0.0.1', port=41883)
+client.connect(host='10.10.10.73', port=41883)
 
 
 def test_bg_log():