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
+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 模式运行")