Files
2026-09-01 11:14:56 +08:00

107 lines
3.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Sensor Bench
Sensor Bench 是一款用于触觉传感器**展示**的 Windows 桌面工具。它基于 Orisys SDK,可预览处理后的传感器图像、录制原始视频,并实时显示 FN / FX / FY 力曲线。
默认启动为展示端界面(参考 `qt_viewer_2` 布局)。
> 内部检测 / 流程引导界面不在本公开包中。实验室内部工具见仓库内私有目录 [`internal/`](internal/README.md)(请勿随客户包发布)。
## 界面示意
![Sensor Bench GUI](bench_snapshot.png)
应用默认使用简体中文界面,可在语言选择器中切换到英文。
## 功能
展示端:
- 菜单栏 **帮助 → 关于** 显示 Sensor Bench / Orisys 版本
- 顶部工具栏:传感器类型(Orisys 拼接 / DD06 ROI)、搜索摄像机、摄像机(视频文件)、配置、启动 / 暂停、重置(传感器追踪器)、录像
- 默认画面为光流箭头绘制在现有背景色(`#121316`)上;也可切换到采集图像箭头或原始画面
- 右侧三路力曲线:FN / FX / FY(与 qt_viewer_2 相同的滤波与 Y 轴最小量程)
- 底部日志区,支持 ESC 全屏、S/E 录像、R 重置追踪器
通用能力:
- Orisys / DDJX01:原始画面 `1920x1080 @ 30 FPS`,处理后输出约 `365x365`
- DD06:外置采集 + 多边形 ROI 矫正后送入 `Sensor.get_img(..., already_processed=True)`
- 配置下拉框优先使用程序旁 `config/` 中的传感器 JSON(构建前从 Orisys wheel 同步到仓库 `config/`)
- 展示端可用“搜索”探测本机摄像机,也可用“摄像机”选择视频文件;也可用“配置…”浏览自定义 JSON
- 录制原始相机帧到 `recordings/`
- 界面文案存放在 `config/locales/zh_CN.json` 与 `config/locales/en_US.json`
## 运行环境
推荐环境:
- Windows x64
- Python 3.10
- 从 PyPI 安装 `orisys`,或在开发时使用本地 `orisys-sdk` 源码
源码运行:
```powershell
cd D:\repo\sensor-bench
python -m pip install numpy opencv-python PyQt5 pyqtgraph
python -m pip install orisys
python run.py
```
使用本地 SDK 源码开发时:
```powershell
$env:PYTHONPATH = "D:\repo\orisys-sdk\src;$env:PYTHONPATH"
python run.py
```
运行冒烟测试:
```powershell
python tests/test_smoke.py
```
内部操作员界面(私有,勿发布):
```powershell
python internal/run_operator.py
```
## 打包 EXE
发布包使用 PyInstaller `onedir` 模式,并依赖 Python 3.10 的 conda 环境。构建时从 PyPI 安装 `orisys`。
1. 创建构建环境:
```bat
.\build\create_env.bat
```
2. 构建**公开**展示端:
```bat
.\build\build_exe.bat
```
输出:
```text
dist/SensorBench/SensorBench.exe
```
公开构建**仅**包含展示端,不包含 `internal/`、`steps/` 或操作员流程文案。
3. 构建**内部**操作员端(勿发给客户):
```bat
.\build\build_operator_exe.bat
```
输出:
```text
dist/SensorBenchOperator/SensorBenchOperator.exe
```
内部包会附带 `steps/`、`config/options.json` 与完整操作员文案,可直接编辑。