Skip to content

feat(calibration): 鱼眼标定双槽(协议 V2.11,固件 1.3.1) - #41

Merged
Vertax42 merged 4 commits into
mainfrom
feat/fisheye-dual-slot
Nov 20, 2026
Merged

Vertax42 merged 4 commits into
mainfrom
feat/fisheye-dual-slot

Conversation

@Vertax42

Copy link
Copy Markdown
Collaborator

背景

用户要求设备同时存 640x480 与 1920x1080 两套鱼眼内参(产线标定产出两套)。固件 tc-gu-01 #34(已合并 5e51a81,协议 V2.11,1.3.0-rc4 / 正式 1.3.1)改为两个固定槽,op=0x00/0x01/0x02 不变(VGA 槽),op=0x03 按尺寸路由,新增 op=0x04 按尺寸读槽、op=0x05 清槽,op=0x03 主点须在中心 ±0.15·w/h 以内。

改动

  • 新 API(C++ / Python):supports_fisheye_slots()、read_fisheye_slot(w, h)、clear_fisheye_slot(w, h)、resolve_fisheye_for(w, h),ResolvedFisheyeCal.mismatched_size;fisheye_cal_slot_plausible / is_fisheye_cal_slot_size。0.4.7 的 API 不变。
  • write_fisheye_sized:640x480 / 1920x1080 加主机侧 ±15% 检查;V2.11 上其他尺寸在主机侧拒绝,V2.10 单槽仍按旧规则。
  • 腕部去畸变按相机配置尺寸取标定:有对应尺寸的标定就用;整机没有标定才回退参考值(警告);设备有标定但只在另一分辨率时抛错,不再用参考值替换设备自己的标定。
  • 协议镜像与 check_protocol_drift.py 映射三个新常量(对照 5e51a81:41 结构体、11 常量一致)。
  • 假设备新增 V2.11 人格(两槽、0x04/0x05、±15%、rc1–rc3 非 640x480 单记录升级后报 0/0),保留 V2.10 与旧固件人格;文档与示例(fisheye_cal.py 列出两槽、clear-fisheye;read_intrinsics.py 分槽输出)。

验证

  • C++ 660 passed(新增 FisheyeDualSlotPty 31、WristFisheyeDecisionPty 4);pytest 173 passed / 2 skipped;ruff 通过。
  • 实机(0016s,固件 1.3.0-rc4,只读):slots 探测 True、VGA 槽自身参数 640x480、HD 槽空、resolve_fisheye_for 两种尺寸行为正确、0.4.7 接口正常、1280x720 主机侧拒绝。写入路径由固件验收(21/21)与 PTY 覆盖。

🤖 Generated with Claude Code

Vertax42 and others added 4 commits November 20, 2026 13:51
- 新增 supports_fisheye_slots() / read_fisheye_slot(w, h) /
  clear_fisheye_slot(w, h) / resolve_fisheye_for(w, h),C++ 与 Python 绑定
- 镜像 CAMERA_FISHEYE_CAL_OP_READ_SLOT (0x04) / _OP_CLEAR_SLOT (0x05) /
  _REQ_SLOT_SIZE (5),codec 增加 read/clear slot 编码与 slot 回复解码
- write_fisheye_sized() 对 640x480 / 1920x1080 主点做 ±15% 中心检查
  (fisheye_cal_slot_plausible);V2.11 上其他尺寸主机侧拒绝
- 腕部去畸变按相机配置尺寸解析标定(1080p 相机取 HD 槽)
- fake follower 增加 V2.11 人格;新增 test_fisheye_dual_slot_pty.cpp,
  Python 测试 fake 同步

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CALIBRATION.md / USAGE.md / USAGE-zh.md 说明双槽、0.4.7 调用读 VGA 槽、
  ±15% 规则与腕部去畸变按相机尺寸选槽
- fisheye_cal.py show 列出两个槽,新增 clear-fisheye;read_intrinsics.py
  输出 dual_slot_firmware 与按分辨率的 slots;wrist_camera.py 带
  --width/--height 时按该尺寸取标定

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- detail::resolve_wrist_fisheye():有相机尺寸的标定就用;整机无可用标定才回退
  参考值;只有另一分辨率的标定时抛 Error,指明两种尺寸和修法
- ResolvedFisheyeCal 新增 mismatched_size(Python 同名属性)
- V2.11 fake:VGA 槽仅在尺寸记录恰为 640x480 时报尺寸,否则 0/0
  (V2.10 rc 留下的 1080p 记录留在 VGA 槽,tc-gu-01 247671f)
- 测试:三种情形各在 V2.11 / V2.10 上覆盖;迁移记录;±15% 边界 320+96 / +97

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tc-gu-01 #34(5e51a81)合并后 hw_v1.1.0 有了 CAMERA_FISHEYE_CAL_OP_READ_SLOT /
OP_CLEAR_SLOT / REQ_SLOT_SIZE;对照该提交 41 个结构体、11 个线上常量全部一致。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Vertax42
Vertax42 merged commit dab1280 into main Nov 20, 2026
3 checks passed
@Vertax42
Vertax42 deleted the feat/fisheye-dual-slot branch November 20, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant