# 手映智控服务器部署说明

部署日期：2026-06-25

服务器公网 IP：

```text
118.31.110.255
```

## 公开展示页

Nginx 站点目录：

```text
/var/www/shouying_zhikong
```

默认入口：

```text
/var/www/shouying_zhikong/showcase_v4.html
```

公网访问地址：

```text
https://shouying-zhikong.pages.dev/
https://shouying-zhikong.pages.dev/showcase_v4.html
http://118.31.110.255/
```

说明：公开目录只放展示网页、网页播放版视频和图片素材。网页内继续使用
`*_h264.mp4`，这是浏览器兼容性更好的播放版本。

## 项目源码与材料

完整项目同步目录：

```text
/opt/shouying_zhikong_project/lerobot
```

核心代码：

```text
/opt/shouying_zhikong_project/lerobot/examples/hand_camera_so101_mujoco/teleop.py
```

比赛展示材料：

```text
/opt/shouying_zhikong_project/lerobot/outputs/shuangbai_embodied_ai
```

申报材料目录：

```text
/opt/shouying_zhikong_project/lerobot/双百
```

这些目录不直接对公网开放。

## 服务器端运行环境

Python 虚拟环境：

```text
/opt/shouying_zhikong_project/runtime/venv
```

已验证依赖：

```text
mujoco
numpy
opencv-python-headless
mediapipe
fastapi
uvicorn
ffmpeg
```

SO-101 MuJoCo 模型缓存：

```text
/root/.cache/lerobot/so101_mujoco/SO101
```

服务器端 headless 仿真测试命令：

```bash
cd /opt/shouying_zhikong_project/lerobot
MUJOCO_GL=osmesa PYOPENGL_PLATFORM=osmesa \
  /opt/shouying_zhikong_project/runtime/venv/bin/python \
  examples/hand_camera_so101_mujoco/teleop.py \
  --no-camera \
  --headless \
  --steps 60 \
  --record-dir /opt/shouying_zhikong_project/runtime/test_recordings \
  --record-prefix server_headless_smoke \
  --record-sim \
  --no-record-camera \
  --no-record-composite \
  --record-width 640 \
  --record-height 360 \
  --fps 30
```

已生成的云端测试输出：

```text
/opt/shouying_zhikong_project/runtime/test_recordings/server_headless_smoke_sim.mp4
/opt/shouying_zhikong_project/runtime/test_recordings/server_headless_smoke_telemetry.csv
```

公开 H.264 版本：

```text
/opt/shouying_zhikong_project/public/server_runs/server_headless_smoke_sim_h264.mp4
```

公网访问地址：

```text
http://118.31.110.255/server_runs/server_headless_smoke_sim_h264.mp4
http://118.31.110.255/server_runs/server_headless_smoke_telemetry.csv
```

## 云端交互仿真

云端交互页：

```text
https://shouying-zhikong.pages.dev/cloud_sim.html
http://118.31.110.255/cloud_sim.html
```

后端服务脚本：

```text
/opt/shouying_zhikong_project/lerobot/examples/hand_camera_so101_mujoco/cloud_sim_server.py
```

systemd 服务：

```text
shouying-cloud-sim.service
```

服务端口：

```text
127.0.0.1:8010
```

健康检查：

```bash
curl http://127.0.0.1:8010/health
curl http://118.31.110.255/cloud/health
```

常用命令：

```bash
systemctl status shouying-cloud-sim --no-pager -l
systemctl restart shouying-cloud-sim
journalctl -u shouying-cloud-sim -n 120 --no-pager
```

说明：当前公网交互页通过 Cloudflare Pages 提供 HTTPS 访问，支持浏览器滑杆与
浏览器本机手势识别两种控制方式。页面只把五个归一化控制量通过 WebSocket
发送到服务器，服务器端运行 MuJoCo headless 仿真并回传实时渲染画面。

受限于 4 vCPU / 8 GiB 云服务器性能，实时交互页采用低分辨率、低帧率视频回传，
同一时间只保留一个活跃仿真页面。评审如需查看更完整效果，应以本地录制视频和
展示页中的 H.264 演示素材为准。

## 原始录制视频

原始录制视频目录：

```text
/opt/shouying_zhikong_project/original_outputs/hand_teleop_recordings
```

这里保留了归档中的原始 MP4、poster 和 telemetry 文件，例如：

```text
full_sequence_01_pair.mp4
full_sequence_01_camera.mp4
depth_control_01_pair.mp4
move_horizontal_01_pair.mp4
move_vertical_01_pair.mp4
wrist_control_01_pair.mp4
pinch_control_01_pair.mp4
```

这些原始视频比网页播放版大，适合作为答辩素材、后期剪辑和作品备份。

公开原始素材访问由 Nginx alias 提供：

```text
/original_recordings/ -> /opt/shouying_zhikong_project/original_outputs/hand_teleop_recordings/
```

完整功能入口：

```text
http://118.31.110.255/platform.html
```

## Nginx

站点配置：

```text
/etc/nginx/sites-available/shouying_zhikong
/etc/nginx/sites-enabled/shouying_zhikong
```

常用命令：

```bash
nginx -t
systemctl reload nginx
systemctl status nginx --no-pager -l
```

## 更新展示页

在本地仓库执行：

```bash
rsync -az --delete \
  -e 'ssh -i ~/.ssh/shouying_zhikong_ecs_ed25519' \
  outputs/shuangbai_embodied_ai/ \
  root@118.31.110.255:/var/www/shouying_zhikong/
```

更新服务器内部项目副本：

```bash
rsync -az --delete \
  -e 'ssh -i ~/.ssh/shouying_zhikong_ecs_ed25519' \
  --exclude '.git/' \
  --exclude '.venv/' \
  --exclude '__pycache__/' \
  --exclude '.pytest_cache/' \
  --exclude '.mypy_cache/' \
  --exclude '.ruff_cache/' \
  --exclude '.uv-cache/' \
  --exclude 'node_modules/' \
  ./ \
  root@118.31.110.255:/opt/shouying_zhikong_project/lerobot/
```

## 外网访问检查

如果服务器本机 `curl http://127.0.0.1/` 正常，但公网
`http://118.31.110.255/` 超时，需要在阿里云安全组入方向放行：

```text
TCP 80/80
授权对象 0.0.0.0/0
策略 允许
```
