tiandytmd
This commit is contained in:
1 parent
f7a782dcef
commit
ddea6d0578
6 files changed
+389
-34
No files matched your search
+22
@@ -4,6 +4,7 @@ set -Eeuo pipefail
|
||||
ROOT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
||||
CONTAINER_NAME="${SCAN_CALIBRATOR_CONTAINER:-smart-cam}"
|
||||
SCAN_STATUS_URL="http://127.0.0.1:18080/api/v1/scan/status"
|
||||
CONTROL_STATUS_URL="http://127.0.0.1:18080/api/v1/control/status"
|
||||
HELPER_SOURCE="$ROOT_DIR/src/measure_overlap.cpp"
|
||||
HELPER_CONTAINER_SOURCE="/tmp/scan-calibrator-measure.cpp"
|
||||
HELPER_CONTAINER_BIN="/tmp/scan-calibrator-measure"
|
||||
@@ -127,6 +128,27 @@ if not isinstance(payload.get("scan"), dict):
|
||||
' <<<"$status" || fail "scan状态接口没有返回合法的scan JSON"
|
||||
ok "scan HTTP服务正常"
|
||||
|
||||
info "检查摄像头厂商适配层和标定所需PTZ能力"
|
||||
local control_status vendor
|
||||
control_status="$(docker exec "$CONTAINER_NAME" curl -fsS --max-time 15 \
|
||||
"$CONTROL_STATUS_URL")" ||
|
||||
fail "摄像头控制状态接口不可用:$CONTROL_STATUS_URL"
|
||||
vendor="$(python3 -c '
|
||||
import json
|
||||
import sys
|
||||
payload = json.load(sys.stdin)
|
||||
vendor = str(payload.get("vendor") or "unknown").strip().lower()
|
||||
if payload.get("driver_ready") is not True:
|
||||
detail = payload.get("driver_error") or "未返回具体原因"
|
||||
raise SystemExit(f"摄像头驱动未就绪(vendor={vendor}):{detail}")
|
||||
capabilities = {str(item).strip().lower() for item in payload.get("capabilities", [])}
|
||||
missing = sorted({"get_position", "move_absolute"} - capabilities)
|
||||
if missing:
|
||||
raise SystemExit("缺少PTZ能力:" + ", ".join(missing))
|
||||
print(vendor)
|
||||
' <<<"$control_status")" || fail "smart-cam摄像头适配层不满足标定要求"
|
||||
ok "摄像头适配层正常:vendor=$vendor,支持位置读取和绝对PTZ移动"
|
||||
|
||||
info "检查ImageMagick拼图命令"
|
||||
identify -version >/dev/null
|
||||
montage -version >/dev/null
|
||||
|
||||
Reference in new issue
Block a user