d506e01188
- camera_node (driver_pkg): Hikrobot MvCamera SDK image capture - vision_node (algorithm_pkg): Otsu threshold + contour detection + target tracking - web_node (application_pkg): HTTP server with MJPEG preview and mode switch API - gimbal_node (gimbal_control_pkg): UART serial communication per gimbal protocol - bringup_pkg: launch file for full pipeline - config: nginx reverse-proxy for MJPEG streaming and API routing
44 lines
1.2 KiB
Plaintext
44 lines
1.2 KiB
Plaintext
# Nginx configuration for Aimbot vision pipeline
|
|
# Deploy to: /etc/nginx/sites-available/aimbot
|
|
# Enable: ln -s /etc/nginx/sites-available/aimbot /etc/nginx/sites-enabled/
|
|
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
# 前端静态文件 (Vue3 构建产物)
|
|
root /var/www/aimbot;
|
|
index index.html;
|
|
|
|
# SPA 路由回退 — 所有非文件请求回 index.html
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# MJPEG 视频流反代 (web_video_server)
|
|
location /stream {
|
|
proxy_pass http://127.0.0.1:8081/stream;
|
|
proxy_http_version 1.1;
|
|
proxy_buffering off;
|
|
|
|
# MJPEG multipart 边界必须保持完整
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
# 长连接支持
|
|
proxy_set_header Connection "";
|
|
chunked_transfer_encoding off;
|
|
|
|
# 超时配置 — 视频流需要长连接
|
|
proxy_read_timeout 86400s;
|
|
proxy_send_timeout 86400s;
|
|
}
|
|
|
|
# 模式切换 API (HTTP → ROS2 web_node)
|
|
location /api/ {
|
|
proxy_pass http://127.0.0.1:8080/api/;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Content-Type application/json;
|
|
}
|
|
}
|