-
This commit is contained in:
+13
-4
@@ -1128,7 +1128,7 @@ def api_arm_camera_refresh():
|
||||
return resp
|
||||
return "", 404
|
||||
except Exception as ex:
|
||||
logger.error(f"arm_refresh 失败: {ex}")
|
||||
logger.info(f"arm_refresh 不可用: {ex}")
|
||||
return "", 404
|
||||
|
||||
|
||||
@@ -1160,7 +1160,7 @@ def api_arm_camera_preview():
|
||||
headers={"Cache-Control": "no-cache, no-store, must-revalidate, max-age=0"},
|
||||
)
|
||||
except Exception as ex:
|
||||
logger.error(f"arm_preview 失败: {ex}")
|
||||
logger.info(f"arm_preview 不可用: {ex}")
|
||||
return "", 404
|
||||
|
||||
|
||||
@@ -1271,8 +1271,14 @@ def api_mission_start():
|
||||
|
||||
try:
|
||||
conn = executor.connect_all()
|
||||
if not conn.get("agv") or not conn.get("arm"):
|
||||
gs.mission_report = {"error": "连接失败", "details": conn}
|
||||
# 当所有机械臂相关步骤都关闭时,机械臂连接为可选
|
||||
need_arm = options.get("qr_scan", True) or options.get("front_photo", True) or options.get("back_photo", True)
|
||||
if not conn.get("agv"):
|
||||
gs.mission_report = {"error": "AGV 连接失败", "details": conn}
|
||||
gs.state = State.IDLE
|
||||
return
|
||||
if need_arm and not conn.get("arm"):
|
||||
gs.mission_report = {"error": "机械臂连接失败,请先连接机械臂", "details": conn}
|
||||
gs.state = State.IDLE
|
||||
return
|
||||
|
||||
@@ -1409,6 +1415,9 @@ def api_mission_state():
|
||||
result["machine_status"] = {}
|
||||
result["tasks"] = []
|
||||
|
||||
# 机械臂摄像头状态
|
||||
result["arm_camera_opened"] = gs.arm_camera_opened
|
||||
|
||||
# 错误弹窗状态和实时网格状态
|
||||
if hasattr(MissionExecutorV3, "_instance") and MissionExecutorV3._instance:
|
||||
ex = MissionExecutorV3._instance
|
||||
|
||||
Reference in New Issue
Block a user