This commit is contained in:
ywb
2026-06-05 09:11:40 +08:00
parent decfc44e89
commit 671351aa89
3 changed files with 16 additions and 4 deletions
+2 -2
View File
@@ -7,8 +7,8 @@ import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# ========== 网络配置(集中管理所有 IP 地址 — 修改此处即可全局生效)==========
AGV_HOST = "192.168.50.93"
ARM_HOST = "192.168.50.91"
AGV_HOST = "192.168.60.177"
ARM_HOST = "192.168.60.88"
# ========== AGV 参数 ==========
AGV_CONFIG = {
+12
View File
@@ -255,6 +255,18 @@ class AGVCommandServer:
self.roboflow = RoboFlowClient()
if self.roboflow.connect():
logger.info("RoboFlow 连接成功")
# 连接成功后自动上电并激活机械臂
time.sleep(1)
try:
resp = self.roboflow.send_recv("power_on()")
logger.info(f"机械臂上电: {resp}")
except Exception as e:
logger.warning(f"机械臂上电失败: {e}")
try:
resp = self.roboflow.send_recv("state_on()")
logger.info(f"机械臂激活: {resp}")
except Exception as e:
logger.warning(f"机械臂激活失败: {e}")
else:
logger.warning("RoboFlow 连接失败,服务将以 limited 模式运行")
+2 -2
View File
@@ -1,13 +1,13 @@
{
"agv": {
"ip": "192.168.50.93",
"ip": "192.168.60.177",
"ssh_user": "elephant",
"ssh_password": "Elephant",
"map_file": "map.yaml",
"map_dir": "/home/elephant"
},
"arm": {
"ip": "192.168.50.91",
"ip": "192.168.60.88",
"ssh_user": "pi",
"ssh_password": "elephant",
"socket_port": 5001,