问题确认:版本限制导致 EEPROM 读取不支持
你的情况非常明确:hobot_stereonet 2.5.6 版本确实不支持 EEPROM 标定读取功能,这是 2.5.7+ 才加入的特性。
解决方案(按优先级)
方案 1:从 GitHub 获取 2.5.9 官方 Deb 包(推荐)
# 1. 访问 GitHub Releases 页面下载
# https://github.com/D-Robotics/hobot_stereonet/releases
# 2. 下载适用于 Jammy ARM64 的 deb 包
cd /tmp
wget https://github.com/D-Robotics/hobot_stereonet/releases/download/v2.5.9/tros-humble-hobot-stereonet_2.5.9-jammy.202xxxxx.arm64.deb
# 3. 安装(强制覆盖旧版本)
sudo apt install ./tros-humble-hobot-stereonet_2.5.9*.deb
# 4. 同时升级 mipi-cam(如果需要)
wget https://github.com/D-Robotics/hobot_mipi_cam/releases/download/v2.5.6/tros-humble-mipi-cam_2.5.6*.deb
sudo apt install ./tros-humble-mipi-cam_2.5.6*.deb
# 5. 验证版本
dpkg -l | grep -E "stereonet|mipi"
注意:如果 GitHub Releases 没有预编译的 deb 包,需要源码编译(方案 2)。
方案 2:源码编译 2.5.9(最可靠)
# 1. 准备编译环境
sudo apt install colcon-common-extensions python3-rosdep build-essential
# 2. 创建工作空间
mkdir -p ~/hobot_ws/src
cd ~/hobot_ws/src
# 3. 克隆仓库
git clone https://github.com/D-Robotics/hobot_stereonet.git
cd hobot_stereonet
git checkout v2.5.9
# 4. 安装依赖
cd ~/hobot_ws
rosdep init
rosdep update
rosdep install --from-paths src --ignore-src -r -y
# 5. 编译
source /opt/tros/humble/setup.bash
colcon build --packages-select hobot_stereonet --cmake-args -DCMAKE_BUILD_TYPE=Release
# 6. 安装
source install/setup.bash
sudo cp -r install/* /opt/tros/humble/
# 7. 验证版本
dpkg -l | grep stereonet
方案 3:获取匹配的出厂标定文件(临时方案)
如果无法升级,需要获取与你的相机模组一一匹配的标定文件:
# 1. 查看相机 EEPROM 中的标定参数(mipi_cam 2.5.6 可以读取)
dmesg | grep -A 50 "stetreo calibration" > /tmp/eeprom_calib.txt
# 2. 或使用以下命令导出
ros2 run mipi_cam mipi_cam_node \
--ros-args \
-p image_width:=1280 \
-p image_height:=1088 \
-p channel:=2 \
-p channel2:=0 \
-p gdc_enable:=true 2>&1 | grep -A 50 "stetreo calibration" > /tmp/eeprom_calib.txt
# 3. 根据日志中的参数手动创建标定文件
cat > /home/sunrise/sc132gs_matched_calib.yaml << EOF
%YAML:1.0
---
image_width: 1280
image_height: 1088
left_camera_matrix: !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [从日志中复制 Kl 数据]
left_distortion_coefficients: !!opencv-matrix
rows: 1
cols: 8
dt: d
data: [从日志中复制 Dl 数据]
right_camera_matrix: !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [从日志中复制 Kr 数据]
right_distortion_coefficients: !!opencv-matrix
rows: 1
cols: 8
dt: d
data: [从日志中复制 Dr 数据]
R: !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [从日志中复制 R_rl 数据]
T: !!opencv-matrix
rows: 3
cols: 1
dt: d
data: [从日志中复制 t_rl 数据]
EOF
# 4. 使用新标定文件启动
ros2 launch hobot_stereonet stereonet_model_web_visual_v2.5_int16_544_448_96.launch.py \
mipi_camera_calibration_file_path:=/home/sunrise/sc132gs_matched_calib.yaml \
mipi_image_width:=1280 \
mipi_image_height:=1088 \
mipi_channel:=2 \
mipi_channel2:=0 \
calib_method:=none
方案 4:联系官方获取标定文件
# 提供以下信息给地瓜机器人技术支持:
# 1. 相机 EEPROM FLAG: SZYGSJKJ
# 2. 相机型号:SC132GS 130W
# 3. 板卡:RDK X5
# 4. 系统版本:3.5.0
# 5. dmesg 中的完整相机初始化日志
# 联系方式:
# - 社区私信:@地瓜小助手_bot
# - 官方文档:https://developer.d-robotics.cc/
# - 技术支持邮箱:support@d-robotics.cc
EEPROM 读取参数确认(升级后)
升级到 2.5.7+ 后,正确的启动方式:
| 参数 | 值 | 说明 |
|---|---|---|
mipi_camera_calibration_file_path |
不指定(省略) | 让系统自动从 EEPROM 读取 |
calib_method |
none |
使用默认标定加载方式 |
mipi_gdc_enable |
True |
必须启用 GDC 校正 |
# 正确示例(升级后)
ros2 launch hobot_stereonet stereonet_model_web_visual_v2.5_int16_544_448_96.launch.py \
mipi_image_width:=1280 \
mipi_image_height:=1088 \
mipi_channel:=2 \
mipi_channel2:=0 \
mipi_gdc_enable:=True \
calib_method:=none
# 注意:不指定 mipi_camera_calibration_file_path
快速验证 EEPROM 是否有有效数据
# 运行此命令,查看输出
dmesg | grep -A 30 "EepromDrobotHead"
# 成功标志(有有效数据)
[INFO] [mipi_cap]: ====EepromDrobotHead====== bus: 6 flag: SZYGSJKJ camType: 1 cal_tpye: 0 ver_main: 1 ver_min: 1 ...
[INFO] [mipi_cap]: ===stetreo calibration=== ...
[INFO] [mipi_cap]: rectify [f, cx, cy, baseline]: [688.825, 687.746, 540.014, 0.0792385]
# 失败标志(无有效数据)
[WARN] [mipi_cap]: Target FOV 0.00° out of valid range [...]
建议
优先执行方案 1(下载官方 deb 包),如果 GitHub 没有预编译包,执行方案 2(源码编译)。
如果无法升级,执行方案 3(从日志提取 EEPROM 参数创建标定文件)。
参考资源
| 资源 | 链接 |
|---|---|
| hobot_stereonet Releases | GitHub |
| 源码编译文档 | 官方文档 |
| 社区标定教程 | [132GS MIPI 双目相机][RDK X5][如何自行标定相机] |
请先执行 dmesg \| grep -A 30 "EepromDrobotHead" 确认 EEPROM 有有效数据,再决定升级还是提取参数! 有进展请更新帖子。