Repository navigation
Conversation
腕部鱼眼默认分辨率由 640x480 改为 1920x1080;两者是传感器的不同取景范围(4:3 / 16:9),
内参不能互相缩放。主爪 1.2.8 / 从爪 1.2.18(命令集 V2.10)在 0x2B 上新增 op 0x02/0x03,
随参数读写标定分辨率;SDK 对应支持如下。
- 协议层:CAMERA_FISHEYE_CAL_OP_READ_SIZED/_OP_WRITE_SIZED/_SIZED_SIZE、CameraFisheyeCalSized、
encode_camera_fisheye_cal_{read,write}_sized()、decode_camera_fisheye_cal_sized()。
check_protocol_drift.py 新增 CONSTANT_MAP,对比 0x2B 的 op 与长度常量。
- Calibration:supports_fisheye_size()(以 0x02 探测,旧固件回 InvalidParam;结果按实例缓存,
传输失败不缓存)、read_fisheye_record()、write_fisheye_sized()(先做与固件相同的合理性检查;
旧固件只接受 640x480 并回退到 0x01,其它分辨率报错要求升级固件)。read_fisheye/write_fisheye 不变。
- FisheyeCalRecord、fisheye_cal_size_plausible()、infer_fisheye_cal_size()(候选仅 640x480 与
1920x1080,主点在各轴 10% 内且唯一匹配才返回;与 PC 工具共用此规则)。
- ResolvedFisheyeCal 新增 calibrated_size / size_inferred;resolve_fisheye() 用记录的分辨率,
未知时推断并告警,推断不出则回退参考值(640x480)。
- FisheyeUndistorter 新增 (cal, calibrated_size, frame_size, balance) 构造,两者必须相等;
原 (cal, size, balance) 构造不变(按 640x480)。install_wrist_undistorter 按标定分辨率构建。
- Python 绑定同名暴露;resolve_fisheye() 改为返回 ResolvedFisheyeCal,仍可按原三元组解包;
FisheyeUndistorter 增加 calibrated_size=(w, h) 关键字。
- 示例:fisheye_cal.py set-fisheye 需 --width/--height 并用 write_fisheye_sized,show 显示分辨率
及其来源;read_intrinsics.py、wrist_camera.py、rerun 查看器按标定分辨率工作。文档与 CHANGELOG 同步。
测试:假从爪固件支持 0x02/0x03 并可切换为旧固件行为;新增编解码、探测、读写回退、拒绝、推断、
resolve 与构造函数测试。C++ 609/609 通过;Python 161 通过、2 跳过、1 失败(
test_force_position_config_has_exactly_the_declared_fields,基线 fe7771b 即失败,与本修改无关)。
check_protocol_drift.py --firmware tc-gu-01@6a41bc3 通过。
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 19, 2026
Collaborator
Author
|
鱼眼标定这条提交已单独拆到 #34(基于 main,不带力位 / 高频 IMU 的 8 条提交),本 PR 关闭。分支 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
夹爪鱼眼默认分辨率改成 1920×1080 以后,SDK 仍写死 640×480(
FisheyeUndistorter只接受 640×480,注释里也写了正确做法是让固件记录分辨率)。配套固件改动见 XenseRobotics-AI/tc-gu-01fix/fisheye-cal-resolution(协议 V2.10,0x2B新增op=0x02/0x03)。改动
CAMERA_FISHEYE_CAL_OP_READ_SIZED(0x02) /OP_WRITE_SIZED(0x03) /SIZED_SIZE(37),对应的编解码函数。Calibration:supports_fisheye_size():用op=0x02探测固件是否支持;read_fisheye_record():返回参数和标定分辨率,0/0 表示未知;write_fisheye_sized():先在主机侧检查参数与分辨率是否自洽。旧固件上只允许 640×480(退回op=0x01),其他分辨率直接报错并提示升级固件。infer_fisheye_cal_size():设备没记分辨率时按主点推断(候选只有 640×480、1920×1080;|cx−W/2| ≤ 0.1W 且 |cy−H/2| ≤ 0.1H,恰好一个命中才用)。两个 PC 工具用同一条规则。ResolvedFisheyeCal新增calibrated_size、size_inferred;推断不出来就退回参考参数并给出原因。FisheyeUndistorter新增构造函数(cal, calibrated_size, frame_size, balance),两个尺寸不一致直接报错,不做缩放。原来的构造函数行为不变。resolve_fisheye()返回的对象仍可按(calibration, is_reference, reason)三元组拆开,老代码不用改。fisheye_cal.py、read_intrinsics.py、wrist_camera.py改为使用标定分辨率;check_protocol_drift.py增加新常量;文档与 CHANGELOG 同步。验证
test_force_position_config_has_exactly_the_declared_fields来自基线fe7771b新增的刹车字段,与本改动无关。hw_v1.1.0,上面还没有 V2.10。对着固件fix/fisheye-cal-resolution(6a41bc3)检查是通过的。本 PR 合进
main-0.4.6-fp-brake-imu-high-rate。鱼眼改动本身不依赖该分支上的力位 / 高频 IMU 提交,如果需要先单独发鱼眼修复,可以挪到main上。🤖 Generated with Claude Code