测试双目深度算法,执行bash run_stereo.sh --stereonet_version v2.4 之后报错
root@ubuntu:/userdata/data/test# bash run_cam.sh --rotation 90.0 --log_level INFO
/opt/tros/humble
[WARN] [1774361113.547149450] [mipi_node]:
node params:
config_path: /opt/tros/humble/lib/mipi_cam/config/
video_device_name:
channel: 2
channel2: 0
camera_info_url:
camera_calibration_file_path:
out_format_name: nv12
gdc_bin_file:
image_width: 1280
image_height: 1088
sub_image_width: 960
sub_image_height: 540
framerate: 30
rotation: 90.000000
device_mode: dual
dual_combine: 1
lpwm_enable: true
gdc_enable: false
frame_ts_type: realtime
frame_id: default_cam
link_type: 0
link_port: 0
io_method_name: ros
cal_alpha: 0.000
[WARN] [1774361113.547376125] [mipi_factory]: This is’t support device type(), start defaule capture.
[INFO] [1774361113.547434575] [mipi_cap]: this board support mipi:
[INFO] [1774361113.547450450] [mipi_cap]: host 0
[INFO] [1774361113.547461050] [mipi_cap]: host 1
[INFO] [1774361113.547471500] [mipi_cap]: host 2
[INFO] [1774361113.547480700] [mipi_cap]: host 3
[INFO] [1774361113.547640500] [mipi_cam]: cal_file:
Searching camera sensor on device: /proc/device-tree/soc/vcon@0 i2c bus: 1 mipi rx phy: 0
WARN: Sensor Name: imx219-30fps, Expected Chip ID: 0x219, Actual Chip ID Read: 0x00
WARN: Sensor Name: sc132gs, Expected Chip ID: 0x132, Actual Chip ID Read: 0x00
WARN: Sensor Name: sc132gs, Expected Chip ID: 0x132, Actual Chip ID Read: 0x00
INFO: vp_sensor_detect_2 Support sensor index:0, sensor_name:sc132gs on mipi rx csi 0, i2c addr 0x33, config_file:linear_1088x1280_raw10_30fps_1lane.c
Searching camera sensor on device: /proc/device-tree/soc/vcon@1 i2c bus: 2 mipi rx phy: 1
WARN: Sensor Name: imx219-30fps, Expected Chip ID: 0x219, Actual Chip ID Read: 0x00
WARN: Sensor Name: sc132gs, Expected Chip ID: 0x132, Actual Chip ID Read: 0x00
INFO: vp_sensor_detect_2 Support sensor index:1, sensor_name:sc132gs on mipi rx csi 1, i2c addr 0x32, config_file:linear_1088x1280_raw10_30fps_1lane.c
Searching camera sensor on device: /proc/device-tree/soc/vcon@0 i2c bus: 1 mipi rx phy: 0
WARN: Sensor Name: sc132gs, Expected Chip ID: 0x132, Actual Chip ID Read: 0x00
WARN: Sensor Name: sc132gs, Expected Chip ID: 0x132, Actual Chip ID Read: 0x00
INFO: vp_sensor_fixed_mipi_host_1 Found sensor_name:sc132gs on mipi rx csi 0, i2c addr 0x33, config_file:linear_1088x1280_raw10_30fps_1lane.c
[INFO] [1774361113.596506150] [mipi_cap]: gen_gdc_bin_rotation—gdc_width:1088,gdc_height:1280,out_width:1280,out_height:1088,rotation:90
vin [hw:0]
isp [hw:1] [slot_id:4] [mode:1]
ynr [hw:1] [slot_id:4] [mode:1]
pym [hw:1] [slot_id:4] [mode:1]
vin ->offline-> isp ->online-> ynr ->online-> pym
[INFO] [1774361113.610666550] [mipi_cap]: creat_pym_node–roi_sel: 0, roi_layer: 0, bl_width: 1088, bl_height: 1280
[WARN] [1774361113.611447525] [mipi_cap]: X5 start gdc rotation.
Searching camera sensor on device: /proc/device-tree/soc/vcon@1 i2c bus: 2 mipi rx phy: 1
WARN: Sensor Name: sc132gs, Expected Chip ID: 0x132, Actual Chip ID Read: 0x00
INFO: vp_sensor_fixed_mipi_host_1 Found sensor_name:sc132gs on mipi rx csi 1, i2c addr 0x32, config_file:linear_1088x1280_raw10_30fps_1lane.c
vin [hw:1]
isp [hw:1] [slot_id:0] [mode:1]
ynr [hw:1] [slot_id:0] [mode:1]
pym [hw:1] [slot_id:0] [mode:1]
vin ->online-> isp ->online-> ynr ->online-> pym
[INFO] [1774361113.733923275] [mipi_cap]: creat_pym_node–roi_sel: 0, roi_layer: 0, bl_width: 1088, bl_height: 1280
[WARN] [1774361113.734622975] [mipi_cap]: X5 start gdc rotation.
[WARN] [1774361113.853724425] [mipi_cam]: [init]->cap sc132gs init success.
[INFO] [1774361113.853806500] [mipi_node]: [MipiCamNode::init]->Initing ‘/opt/tros/humble/lib/mipi_cam/config/’ at 1280x1088 via ros at 30 FPS
[INFO] [1774361113.853836650] [mipi_cam]: cal_file:
[WARN] [1774361113.853859200] [mipi_node]: get camera calibration parameters failed
[INFO] [1774361113.853874475] [mipi_cam]: cal_file:
[WARN] [1774361113.853890950] [mipi_node]: get camera calibration parameters failed
[INFO] [1774361113.867832775] [mipi_cam]: [start]->w:h=1280:1088.
[INFO] [1774361113.868092500] [mipi_node]: starting timer 33
=== Detected IIO Devices ===
你好!看到你在 RDK S100 上运行 run_stereo.sh --stereonet_version v2.4 时报错,但帖子中没有贴出具体的报错信息。
根据社区近期类似案例(特别是 132GS 模组相关),最常见的原因是 render_type 参数配置与 StereoNet 版本不匹配。
快速排查步骤
1. 查看并修改 run_stereo.sh 配置
v2.4.x 版本可能不支持 render_type=distance,请尝试改为 render_type=0(即原始视差模式):
# 编辑脚本
vim run_stereo.sh
# 找到 render_type 配置行(约在第 20-30 行)
# 将 render_type=1 或 render_type=distance 改为:
render_type=0
2. 确认相机节点是否正常启动
在运行深度算法前,先确保 MIPI 相机数据流正常:
# 查看相机节点状态
ros2 topic list | grep image
# 应该能看到 /camera/left/image_raw 和 /camera/right/image_raw
3. 检查标定文件
132GS 模组通常自带标定文件,确认路径是否正确:
# 检查标定文件是否存在
ls /data/camera_calib/*.yaml
请补充以下信息以便精准定位
如果上述方法无效,请回复提供:
- 完整的报错日志(截图或文字)
- 系统版本:
cat /etc/issue - StereoNet 实际版本:
pip show hobot-stereonet - 相机型号确认:是 SC132GS 还是 GS132?
相关参考
- 基于官方 132GS MIPI 双目相机运行双目 Demo 报错 - 同类问题解决方案
- 132GS MIPI 双目相机输出图像与深度结果的疑惑 - 版本升级指南
建议将完整报错信息补充到原帖,方便社区持续跟进!
我来帮你分析这个问题。从日志看有几个关键点:
- 传感器 Chip ID 读取失败 -
Expected Chip ID: 0x132, Actual Chip ID Read: 0x00 - 相机校准参数获取失败 -
get camera calibration parameters failed - IIO 设备检测无输出 - 程序卡在
=== Detected IIO Devices ===
让我先搜索社区中类似的问题:
从你的日志来看,相机已经成功识别并初始化(sc132gs init success),但日志在 # === Detected IIO Devices === 处截断,说明后续步骤可能卡住或报错。
问题诊断
你的日志显示:
传感器识别成功:两个 sc132gs 分别在 CSI 0 (addr 0x33) 和 CSI 1 (addr 0x32)
相机初始化成功:[init]->cap sc132gs init success
标定参数缺失:get camera calibration parameters failed(这个正常,不影响出图)
IIO Devices 之后无输出:日志在这里断了
排查步骤
检查 IIO 设备是否正常
# 查看 IIO 设备列表
ls /sys/bus/iio/devices/
# 查看是否有 iio:device0 和 iio:device1
ls -l /sys/bus/iio/devices/
正常应该看到类似:
iio:device0 iio:device1
检查相机话题是否正常发布
新开一个终端,运行:
# 查看相机话题
ros2 topic list | grep image
# 检查是否有图像数据
ros2 topic hz /image_raw
# 或者
ros2 topic hz /image_combine_raw
如果话题不存在或频率为 0,说明相机节点挂了。
查看完整报错日志
你的日志被截断了,查看完整日志:
# 查看最近 100 行日志
dmesg | tail -100
# 或者查看 ROS2 日志
ls ~/.ros/log/
# 找到最新的日志文件查看
检查 stereonet 版本兼容性
你使用的是 v2.4 版本,确认是否与你的镜像版本匹配:
# 查看当前 stereonet 版本
apt list | grep hobot_stereonet
# 查看镜像版本
cat /etc/hobot_version
常见解决方案
根据社区类似问题(参考 话题 34286),SC132GS 双目深度问题的常见原因:
| 问题 | 解决方案 |
|---|---|
| IIO 设备未识别 | 重启板子,检查 MIPI 连接是否牢固 |
| 标定参数缺失 | 使用离线标定文件(calib.yaml) |
| stereonet 节点崩溃 | 检查模型文件路径是否正确 |
| 图像格式不匹配 | 确保 out_format_name: nv12 |
建议操作
请先执行以下命令,把完整输出发出来:
# 1. 检查 IIO 设备
ls /sys/bus/iio/devices/
# 2. 检查相机话题
ros2 topic list | grep -E "image|stereo"
# 3. 运行立体深度算法时查看完整日志
bash run_stereo.sh --stereonet_version v2.4 2>&1 | tee stereo_log.txt
然后把 stereo_log.txt 的完整内容(特别是报错部分)贴出来,才能准确定位问题。
相关参考帖子:
根据你提供的日志,问题已经定位清楚了!
核心问题
日志显示两个关键错误:
-
Sensor Chip ID 读取失败(但传感器最终被识别):
WARN: Sensor Name: sc132gs, Expected Chip ID: 0x132, Actual Chip ID Read: 0x00 -
相机标定参数获取失败(这是导致双目深度算法报错的直接原因):
WARN: [mipi_node]: get camera calibration parameters failed cal_file: (空)
解决方案
方案 1:检查并配置标定文件(最可能)
# 1. 检查标定文件是否存在
ls -la /data/camera_calib/
# 或
ls -la /userdata/data/camera_calib/
# 2. 如果没有标定文件,需要从相机模组获取或重新标定
# 132GS 模组通常自带标定文件,检查模组包装或联系供应商
# 3. 运行双目算法时指定标定文件路径
bash run_stereo.sh --stereonet_version v2.4 --calib_file /data/camera_calib/your_calib.yaml
方案 2:更新系统版本(重要)
根据社区版本发布说明,V4.0.2 修复了 SC132GS Sensor 帧获取失败的问题,并将配置从 1-Lane 调整为 2-Lane。
# 检查当前系统版本
cat /etc/issue
# 如果版本低于 V4.0.2,建议升级
# 参考:https://developer.d-robotics.cc/rdk_doc/rdk_s/Release_Note/v4_0_2
方案 3:检查 MIPI 连接稳定性
Chip ID 读取为 0x00 可能表示 MIPI 通信不稳定:
# 1. 重新插拔相机模组,确保连接牢固
# 2. 检查 MIPI 线缆是否损坏
# 3. 重启系统后再次测试
sudo reboot
方案 4:手动指定相机配置
# 编辑 run_cam.sh 或相关配置文件
# 确保使用正确的 sensor 配置
# SC132GS 应使用:linear_1088x1280_raw10_30fps_1lane.c
# 但如果系统已更新到 V4.0.2+,可能需要 2-lane 配置
请补充以下信息
- 系统版本:
cat /etc/issue - 标定文件是否存在:
ls -la /data/camera_calib/ - 相机模组来源:是官方套件还是第三方?
相关参考
- RDK S100 V4.0.2 版本发布说明 - 修复 SC132GS 问题
- RDK S100 无法识别 Camera GS130W - 类似问题排查
建议优先检查标定文件和系统版本,这两个是最常见的根本原因。如果问题依旧,请把系统版本和标定文件检查结果补充到帖子中!
root@ubuntu:/userdata/data/test# bash run_stereo.sh --stereonet_version v2.4
/opt/tros/humble
/opt/tros/humble
[INFO] [launch]: All log files can be found below /root/.ros/log/2026-03-24-22-13-16-069540-ubuntu-8520
[INFO] [launch]: Default logging verbosity is set to INFO
config_file_path is /opt/tros/humble/lib/mipi_cam/config/
Hobot shm pkg enables zero-copy with fastrtps profiles file: /opt/tros/humble/lib/hobot_shm/config/shm_fastdds.xml
Hobot shm pkg sets RMW_FASTRTPS_USE_QOS_FROM_XML: 1
env of RMW_FASTRTPS_USE_QOS_FROM_XML is 1 , ignore env setting
webserver has launch
config_file_path is /opt/tros/humble/lib/mipi_cam/config/
env of RMW_FASTRTPS_USE_QOS_FROM_XML is 1 , ignore env setting
env of RMW_FASTRTPS_USE_QOS_FROM_XML is 1 , ignore env setting
webserver has launch
config_file_path is /opt/tros/humble/lib/mipi_cam/config/
env of RMW_FASTRTPS_USE_QOS_FROM_XML is 1 , ignore env setting
env of RMW_FASTRTPS_USE_QOS_FROM_XML is 1 , ignore env setting
env of RMW_FASTRTPS_USE_QOS_FROM_XML is 1 , ignore env setting
env of RMW_FASTRTPS_USE_QOS_FROM_XML is 1 , ignore env setting
webserver has launch
[INFO] [stereonet_model_node-1]: process started with pid [8524]
[INFO] [mipi_cam-2]: process started with pid [8526]
[INFO] [hobot_codec_republish-3]: process started with pid [8528]
[INFO] [websocket-4]: process started with pid [8530]
[hobot_codec_republish-3] [WARN] [1774361596.352322225] [hobot_codec_encoder_5895dd58]: Parameters:
[hobot_codec_republish-3] sub_topic: /StereoNetNode/stereonet_visual
[hobot_codec_republish-3] pub_topic: /image_jpeg
[hobot_codec_republish-3] channel: 1
[hobot_codec_republish-3] in_mode: ros
[hobot_codec_republish-3] out_mode: ros
[hobot_codec_republish-3] in_format: bgr8
[hobot_codec_republish-3] out_format: jpeg
[hobot_codec_republish-3] jpg_quality: 60.00
[hobot_codec_republish-3] input_framerate: 30
[hobot_codec_republish-3] output_framerate: -1
[hobot_codec_republish-3] dump_output: false
[hobot_codec_republish-3] dump_file_prefix: ./dump_codec_output
[hobot_codec_republish-3] dump_frame_count: -1 (unlimited)
[hobot_codec_republish-3] [WARN] [1774361596.357191775] [HobotCodecImpl]: platform s100
[mipi_cam-2] [WARN] [1774361596.434129000] [mipi_node]:
[mipi_cam-2] node params:
[mipi_cam-2] config_path: /opt/tros/humble/lib/mipi_cam/config/
[mipi_cam-2] video_device_name: default
[mipi_cam-2] channel: 2
[mipi_cam-2] channel2: 0
[mipi_cam-2] camera_info_url:
[mipi_cam-2] camera_calibration_file_path: /opt/tros/humble/lib/mipi_cam/config/calib_params.yaml
[mipi_cam-2] out_format_name: nv12
[mipi_cam-2] gdc_bin_file:
[mipi_cam-2] image_width: 640
[mipi_cam-2] image_height: 352
[mipi_cam-2] sub_image_width: 1280
[mipi_cam-2] sub_image_height: 1088
[mipi_cam-2] framerate: 30
[mipi_cam-2] rotation: 90.000000
[mipi_cam-2] device_mode: dual
[mipi_cam-2] dual_combine: 1
[mipi_cam-2] lpwm_enable: true
[mipi_cam-2] gdc_enable: true
[mipi_cam-2] frame_ts_type: realtime
[mipi_cam-2] frame_id: default_cam
[mipi_cam-2] link_type: 0
[mipi_cam-2] link_port: 0
[mipi_cam-2] io_method_name: ros
[mipi_cam-2] cal_alpha: 0.000
[mipi_cam-2] [WARN] [1774361596.438124675] [mipi_factory]: This is’t support device type(), start defaule capture.
[mipi_cam-2]
[mipi_cam-2] [ERROR] [1774361596.439185825] [mipi_cam]: There are no available host.
[mipi_cam-2]
[websocket-4] [WARN] [1774361596.455885125] [hobot_websocket_7ec33017]:
[websocket-4] Parameter:
[websocket-4] image_topic: /image_jpeg
[websocket-4] image_type: mjpeg
[websocket-4] only_show_image: 1
[websocket-4] output_fps: 0
[stereonet_model_node-1] [UCP]: log level = 3
[stereonet_model_node-1] [UCP]: UCP version = 3.13.6
[stereonet_model_node-1] [VP]: log level = 3
[stereonet_model_node-1] [DNN]: log level = 3
[stereonet_model_node-1] [HPL]: log level = 3
[stereonet_model_node-1] [UCPT]: log level = 6
[ERROR] [mipi_cam-2]: process has died [pid 8526, exit code -11, cmd ‘/opt/tros/humble/lib/mipi_cam/mipi_cam --ros-args --log-level warn --ros-args --params-file /tmp/launch_params_36diq1lw --params-file /tmp/launch_params__52gq2r4 --params-file /tmp/launch_params_2gtfvt6c --params-file /tmp/launch_params_swx7fcia --params-file /tmp/launch_params_jhrzqg1h --params-file /tmp/launch_params_ie_8h3a2 --params-file /tmp/launch_params_dx82hmr8 --params-file /tmp/launch_params_n30tx743 --params-file /tmp/launch_params_iz_2hpzf --params-file /tmp/launch_params_ka53_7cu --params-file /tmp/launch_params_imwexywt --params-file /tmp/launch_params_hwrngnl0 --params-file /tmp/launch_params_v65ounmf --params-file /tmp/launch_params_g01wp1bu --params-file /tmp/launch_params_kh4_88sk --params-file /tmp/launch_params_6mfyh17_ --params-file /tmp/launch_params_q8k08k3k --params-file /tmp/launch_params_ul8fnhyf --params-file /tmp/launch_params_tkgrdlum --params-file /tmp/launch_params_hbt58kjv --params-file /tmp/launch_params_w_8p1fwk --params-file /tmp/launch_params_tq2wjftq --params-file /tmp/launch_params_7ywrpwwy --params-file /tmp/launch_params_ybfww5v8’].
[stereonet_model_node-1] [WARN] [1774361596.949220725] [StereoNetNode]: => ===================== init StereoNetNode =====================
[stereonet_model_node-1]
[stereonet_model_node-1] terminate called after throwing an instance of ‘rclcpp::exceptions::InvalidParameterTypeException’
[stereonet_model_node-1] what(): parameter ‘render_type’ has invalid type: Wrong parameter type, parameter {render_type} is of type {string}, setting it to {integer} is not allowed.
[ERROR] [stereonet_model_node-1]: process has died [pid 8524, exit code -6, cmd ‘/opt/tros/humble/lib/hobot_stereonet/stereonet_model_node --ros-args --log-level info --ros-args -r __node:=StereoNetNode --params-file /tmp/launch_params_l_4o7co2’].
[hobot_codec_republish-3] [ERROR] [1774361601.357397675] [hobot_codec_encoder_5895dd58]: Hobot_Codec has not received image for more than 5 seconds! Please check whether the image publisher still exists by ‘ros2 topic info /StereoNetNode/stereonet_visual’!
[websocket-4] [ERROR] [1774361601.463273950] [hobot_websocket_7ec33017]: Websocket did not receive image data! Please check whether the image publisher still exists by ‘ros2 topic info /image_jpeg’!
[hobot_codec_republish-3] [ERROR] [1774361606.357382325] [hobot_codec_encoder_5895dd58]: Hobot_Codec has not received image for more than 5 seconds! Please check whether the image publisher still exists by ‘ros2 topic info /StereoNetNode/stereonet_visual’!
[websocket-4] [ERROR] [1774361606.463259275] [hobot_websocket_7ec33017]: Websocket did not receive image data! Please check whether the image publisher still exists by ‘ros2 topic info /image_jpeg’!
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[INFO] [hobot_codec_republish-3]: process has finished cleanly [pid 8528]
[INFO] [websocket-4]: process has finished cleanly [pid 8530]
好消息:相机节点工作正常!
从 ros2 topic list 输出看,MIPI 相机已经成功启动,三个图像话题都存在:
/image_combine_raw- 双目合成图像/image_left_raw- 左目图像/image_right_raw- 右目图像
这说明问题不在相机驱动层,而是 StereoNet 深度估计算法节点的问题。
下一步排查
检查标定文件(最关键)
双目深度算法必须有标定文件才能工作:
# 检查标定文件位置
ls -la /data/camera_calib/
# 或
ls -la /userdata/data/camera_calib/
# 或
find / -name "*.yaml" | grep -i calib
预期结果:应该能看到类似 calib.yaml 或 stereo_calib.yaml 的文件
2️ 运行 stereonet 并捕获完整报错
# 运行并保存完整日志
bash run_stereo.sh --stereonet_version v2.4 2>&1 | tee stereo_full_log.txt
# 等待 30 秒后按 Ctrl+C,然后查看日志
cat stereo_full_log.txt | grep -E "ERROR|WARN|Failed"
检查 stereonet 版本
# 查看已安装的 stereonet 版本
apt list --installed | grep hobot_stereonet
# 或
pip show hobot-stereonet
常见解决方案
根据社区案例 [话题 34286],v2.4 版本的常见问题:
| 问题 | 解决方案 |
|---|---|
| 标定文件缺失 | 官方套件应自带标定文件,联系供应商获取 |
| render_type 不兼容 | 编辑 run_stereo.sh,将 render_type=1 改为 render_type=0 |
| 模型文件路径错误 | 检查 /opt/tros/humble/share/hobot_stereonet/config/ 下是否有 .bin 模型文件 |
快速修复尝试
# 编辑 run_stereo.sh
vim run_stereo.sh
# 找到 render_type 配置行(约 20-30 行)
# 修改为:
render_type=0
# 保存后重新运行
bash run_stereo.sh --stereonet_version v2.4
请补充以下信息
- 标定文件检查结果:
ls -la /data/camera_calib/的输出 - 完整报错日志:
stereo_full_log.txt中的 ERROR 部分 - stereonet 版本:
apt list --installed | grep hobot_stereonet的输出
把这些信息补充到帖子中,可以更快定位问题!
相关参考
- 基于官方 132GS MIPI 双目相机运行双目 Demo 报错 - 同类问题完整解决方案
- RDK-X5 双目深度算法 hobot_stereonet 精度差 - 标定参数配置详解
问题已定位!两个核心错误
从日志中看到明确的报错信息:
错误 1:render_type 参数类型不匹配
parameter 'render_type' has invalid type:
Wrong parameter type, parameter {render_type} is of type {string},
setting it to {integer} is not allowed.
错误 2:MIPI 相机节点崩溃
[ERROR] [mipi_cam]: There are no available host.
解决方案
步骤 1:修改 run_stereo.sh 中的 render_type 参数
# 编辑脚本
vim run_stereo.sh
# 找到 render_type 配置行(大约在第 20-40 行)
# 将 render_type=0 或 render_type=1 改为字符串格式:
render_type="distance"
# 或者
render_type="raw"
原因:StereoNet v2.4 版本要求 render_type 是字符串类型,不是整数。
步骤 2:检查 MIPI 通道配置
日志显示你的相机配置:
channel: 2
channel2: 0
但之前 run_cam.sh 测试时使用的是:
channel: 2
channel2: 0
rotation: 90.0
确保 run_stereo.sh 中的 MIPI 配置与相机实际连接一致:
# 在 run_stereo.sh 中检查/修改
mipi_channel=2
mipi_channel2=0
mipi_rotation=90.0
步骤 3:检查标定文件路径
日志显示标定文件路径:
camera_calibration_file_path: /opt/tros/humble/lib/mipi_cam/config/calib_params.yaml
确认该文件是否存在:
ls -la /opt/tros/humble/lib/mipi_cam/config/calib_params.yaml
如果不存在,需要:
- 从官方套件中获取标定文件
- 或重新标定相机(参考社区标定教程)
完整修复命令
# 1. 备份原脚本
cp run_stereo.sh run_stereo.sh.bak
# 2. 修改 render_type 为字符串格式
sed -i 's/render_type=0/render_type="distance"/g' run_stereo.sh
sed -i 's/render_type=1/render_type="distance"/g' run_stereo.sh
# 3. 确认修改
grep render_type run_stereo.sh
# 4. 重新运行
bash run_stereo.sh --stereonet_version v2.4
如果问题依旧
请检查以下信息并补充到帖子:
# 1. 系统版本
cat /etc/issue
# 2. StereoNet 版本
apt list | grep hobot_stereonet
# 3. 标定文件是否存在
ls -la /opt/tros/humble/lib/mipi_cam/config/calib_params.yaml
# 4. MIPI 设备状态
ls /sys/bus/iio/devices/
相关参考
- 基于官方 132GS MIPI 双目相机运行双目 Demo 报错 - 同类问题解决方案
- 132GS MIPI 双目相机如何自行标定 - 标定文件配置指南
优先尝试步骤 1 修改 render_type 格式,这是最直接的报错原因!
root@ubuntu:/userdata/data/test# bash run_stereo.sh --stereonet_version v2.4
/opt/tros/humble
/opt/tros/humble
[INFO] [launch]: All log files can be found below /root/.ros/log/2026-03-24-23-54-16-690720-ubuntu-24662
[INFO] [launch]: Default logging verbosity is set to INFO
config_file_path is /opt/tros/humble/lib/mipi_cam/config/
Hobot shm pkg enables zero-copy with fastrtps profiles file: /opt/tros/humble/lib/hobot_shm/config/shm_fastdds.xml
Hobot shm pkg sets RMW_FASTRTPS_USE_QOS_FROM_XML: 1
env of RMW_FASTRTPS_USE_QOS_FROM_XML is 1 , ignore env setting
webserver has launch
config_file_path is /opt/tros/humble/lib/mipi_cam/config/
env of RMW_FASTRTPS_USE_QOS_FROM_XML is 1 , ignore env setting
env of RMW_FASTRTPS_USE_QOS_FROM_XML is 1 , ignore env setting
webserver has launch
config_file_path is /opt/tros/humble/lib/mipi_cam/config/
env of RMW_FASTRTPS_USE_QOS_FROM_XML is 1 , ignore env setting
env of RMW_FASTRTPS_USE_QOS_FROM_XML is 1 , ignore env setting
env of RMW_FASTRTPS_USE_QOS_FROM_XML is 1 , ignore env setting
env of RMW_FASTRTPS_USE_QOS_FROM_XML is 1 , ignore env setting
webserver has launch
[INFO] [stereonet_model_node-1]: process started with pid [24666]
[INFO] [mipi_cam-2]: process started with pid [24668]
[INFO] [hobot_codec_republish-3]: process started with pid [24670]
[INFO] [websocket-4]: process started with pid [24672]
[hobot_codec_republish-3] [WARN] [1774367656.973472350] [hobot_codec_encoder_cf32c09b]: Parameters:
[hobot_codec_republish-3] sub_topic: /StereoNetNode/stereonet_visual
[hobot_codec_republish-3] pub_topic: /image_jpeg
[hobot_codec_republish-3] channel: 1
[hobot_codec_republish-3] in_mode: ros
[hobot_codec_republish-3] out_mode: ros
[hobot_codec_republish-3] in_format: bgr8
[hobot_codec_republish-3] out_format: jpeg
[hobot_codec_republish-3] jpg_quality: 60.00
[hobot_codec_republish-3] input_framerate: 30
[hobot_codec_republish-3] output_framerate: -1
[hobot_codec_republish-3] dump_output: false
[hobot_codec_republish-3] dump_file_prefix: ./dump_codec_output
[hobot_codec_republish-3] dump_frame_count: -1 (unlimited)
[hobot_codec_republish-3] [WARN] [1774367656.975388200] [HobotCodecImpl]: platform s100
[mipi_cam-2] [WARN] [1774367657.067819575] [mipi_node]:
[mipi_cam-2] node params:
[mipi_cam-2] config_path: /opt/tros/humble/lib/mipi_cam/config/
[mipi_cam-2] video_device_name: default
[mipi_cam-2] channel: 2
[mipi_cam-2] channel2: 0
[mipi_cam-2] camera_info_url:
[mipi_cam-2] camera_calibration_file_path: /opt/tros/humble/lib/mipi_cam/config/calib_params.yaml
[mipi_cam-2] out_format_name: nv12
[mipi_cam-2] gdc_bin_file:
[mipi_cam-2] image_width: 640
[mipi_cam-2] image_height: 352
[mipi_cam-2] sub_image_width: 1280
[mipi_cam-2] sub_image_height: 1088
[mipi_cam-2] framerate: 30
[mipi_cam-2] rotation: 90.000000
[mipi_cam-2] device_mode: dual
[mipi_cam-2] dual_combine: 1
[mipi_cam-2] lpwm_enable: true
[mipi_cam-2] gdc_enable: true
[mipi_cam-2] frame_ts_type: realtime
[mipi_cam-2] frame_id: default_cam
[mipi_cam-2] link_type: 0
[mipi_cam-2] link_port: 0
[mipi_cam-2] io_method_name: ros
[mipi_cam-2] cal_alpha: 0.000
[mipi_cam-2] [WARN] [1774367657.068064600] [mipi_factory]: This is’t support device type(), start defaule capture.
[mipi_cam-2]
[mipi_cam-2] [ERROR] [1774367657.068312575] [mipi_cam]: There are no available host.
[mipi_cam-2]
[websocket-4] [WARN] [1774367657.077461175] [hobot_websocket_95d2ab80]:
[websocket-4] Parameter:
[websocket-4] image_topic: /image_jpeg
[websocket-4] image_type: mjpeg
[websocket-4] only_show_image: 1
[websocket-4] output_fps: 0
[stereonet_model_node-1] [UCP]: log level = 3
[stereonet_model_node-1] [UCP]: UCP version = 3.13.6
[stereonet_model_node-1] [VP]: log level = 3
[stereonet_model_node-1] [DNN]: log level = 3
[stereonet_model_node-1] [HPL]: log level = 3
[stereonet_model_node-1] [UCPT]: log level = 6
[ERROR] [mipi_cam-2]: process has died [pid 24668, exit code -11, cmd ‘/opt/tros/humble/lib/mipi_cam/mipi_cam --ros-args --log-level warn --ros-args --params-file /tmp/launch_params_snndhmq8 --params-file /tmp/launch_params_7je5bvlv --params-file /tmp/launch_params_9s85s7q7 --params-file /tmp/launch_params_45os39vt --params-file /tmp/launch_params__ua_0y0w --params-file /tmp/launch_params_gln3pkn6 --params-file /tmp/launch_params_arnb6ps5 --params-file /tmp/launch_params_viswzds4 --params-file /tmp/launch_params_z62jn5fi --params-file /tmp/launch_params_kmlsien5 --params-file /tmp/launch_params_55hu7vs6 --params-file /tmp/launch_params_4yc5wu6n --params-file /tmp/launch_params_tl7r27so --params-file /tmp/launch_params_q92yjh36 --params-file /tmp/launch_params_4ivclpbv --params-file /tmp/launch_params_1k4ntrzc --params-file /tmp/launch_params_jxkjil02 --params-file /tmp/launch_params_9oquy1jj --params-file /tmp/launch_params_gxcehhgg --params-file /tmp/launch_params_qksb3emc --params-file /tmp/launch_params_nhjc3g8a --params-file /tmp/launch_params_rzwbhjh6 --params-file /tmp/launch_params_lk4f3_b3 --params-file /tmp/launch_params_6ip0hxnk’].
[stereonet_model_node-1] [WARN] [1774367657.468005125] [StereoNetNode]: => ===================== init StereoNetNode =====================
[stereonet_model_node-1]
[stereonet_model_node-1] terminate called after throwing an instance of ‘rclcpp::exceptions::InvalidParameterTypeException’
[stereonet_model_node-1] what(): parameter ‘render_type’ has invalid type: Wrong parameter type, parameter {render_type} is of type {string}, setting it to {integer} is not allowed.
[ERROR] [stereonet_model_node-1]: process has died [pid 24666, exit code -6, cmd ‘/opt/tros/humble/lib/hobot_stereonet/stereonet_model_node --ros-args --log-level info --ros-args -r __node:=StereoNetNode --params-file /tmp/launch_params_fy6on13x’].
[hobot_codec_republish-3] [ERROR] [1774367661.975586275] [hobot_codec_encoder_cf32c09b]: Hobot_Codec has not received image for more than 5 seconds! Please check whether the image publisher still exists by ‘ros2 topic info /StereoNetNode/stereonet_visual’!
[websocket-4] [ERROR] [1774367662.084093375] [hobot_websocket_95d2ab80]: Websocket did not receive image data! Please check whether the image publisher still exists by ‘ros2 topic info /image_jpeg’!
[hobot_codec_republish-3] [ERROR] [1774367666.975571775] [hobot_codec_encoder_cf32c09b]: Hobot_Codec has not received image for more than 5 seconds! Please check whether the image publisher still exists by ‘ros2 topic info /StereoNetNode/stereonet_visual’!
[websocket-4] [ERROR] [1774367667.084082450] [hobot_websocket_95d2ab80]: Websocket did not receive image data! Please check whether the image publisher still exists by ‘ros2 topic info /image_jpeg’!
问题已明确定位!两个核心错误
从日志看到明确的报错:
错误 1:render_type 参数类型不匹配
parameter 'render_type' has invalid type:
Wrong parameter type, parameter {render_type} is of type {string},
setting it to {integer} is not allowed.
错误 2:MIPI 相机节点崩溃
[ERROR] [mipi_cam]: There are no available host.
(这通常是因为相机资源被占用或配置冲突)
完整解决方案
步骤 1:修改 render_type 为字符串格式
# 编辑 run_stereo.sh
vim run_stereo.sh
# 找到 render_type 配置行(大约在第 20-50 行之间)
# 将数字格式改为字符串格式:
# 错误写法(当前):
render_type=0
# 或
render_type=1
# ✅ 正确写法:
render_type="distance"
# 或
render_type="raw"
步骤 2:解决 MIPI Host 不可用问题
这个错误通常是因为相机资源被之前的进程占用。执行以下命令清理:
# 1. 杀掉所有可能占用相机的进程
killall mipi_cam
killall stereonet_model_node
killall hobot_codec_republish
# 2. 检查是否有残留进程
ps aux | grep -E "mipi|stereo|codec"
# 3. 如果有,强制杀掉
sudo kill -9 <PID>
# 4. 重启板子(最彻底的方法)
sudo reboot
步骤 3:检查标定文件
日志显示标定文件路径:
camera_calibration_file_path: /opt/tros/humble/lib/mipi_cam/config/calib_params.yaml
确认文件存在:
ls -la /opt/tros/humble/lib/mipi_cam/config/calib_params.yaml
如果文件不存在,需要从官方套件获取或重新标定。
完整修复命令(一键执行)
# 1. 备份原脚本
cp run_stereo.sh run_stereo.sh.bak
# 2. 修改 render_type 为字符串格式
sed -i 's/render_type=0/render_type="distance"/g' run_stereo.sh
sed -i 's/render_type=1/render_type="distance"/g' run_stereo.sh
sed -i 's/render_type=2/render_type="distance"/g' run_stereo.sh
# 3. 确认修改成功
grep "render_type" run_stereo.sh
# 4. 清理残留进程
killall mipi_cam 2>/dev/null
killall stereonet_model_node 2>/dev/null
killall hobot_codec_republish 2>/dev/null
# 5. 等待 3 秒后重新运行
sleep 3
bash run_stereo.sh --stereonet_version v2.4
如果问题依旧
请补充以下信息到帖子:
# 1. 确认 render_type 修改后的内容
grep -A2 -B2 "render_type" run_stereo.sh
# 2. 标定文件状态
ls -la /opt/tros/humble/lib/mipi_cam/config/calib_params.yaml
# 3. StereoNet 版本
apt list --installed | grep hobot_stereonet
# 4. 系统版本
cat /etc/issue
相关参考
- 基于官方 132GS MIPI 双目相机运行双目 Demo 报错 - 同类问题完整解决方案
- 132GS MIPI 双目相机如何自行标定 - 标定文件配置指南
优先执行步骤 1 + 步骤 2,render_type 类型错误是 StereoNet 节点崩溃的直接原因,MIPI host 问题通常是进程残留导致的。
[stereonet_model_node-1] [ERROR] [1774360945.664718325] [StereoNetNode]: => Haven’t received any camera info from topic /image_combine_raw/right/camera_info
[stereonet_model_node-1] [WARN] [1774360946.634962950] [StereoNetNode]: => receive stereo image, format: nv12, stamp: 1774360946.615449856, latency: 19.51 ms
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[stereonet_model_node-1] [INFO] [1774360948.176919775] [rclcpp]: signal_handler(SIGINT/SIGTERM)
[stereonet_model_node-1] [WARN] [1774360948.254085200] [StereoNetNode]: => release StereoNetNode
[stereonet_model_node-1] [WARN] [1774360948.258693650] [StereoNetNode]: => release StereonetProcess
[INFO] [hobot_codec_republish-3]: process has finished cleanly [pid 6177]
[INFO] [websocket-4]: process has finished cleanly [pid 6179]
[stereonet_model_node-1] sh: 1: �$��-b: not found
[INFO] [stereonet_model_node-1]: process has finished cleanly [pid 6173]
root@ubuntu:/userdata/data/test# ros2 topic list
/image_combine_raw
/image_left_raw
/image_right_raw
/parameter_events
/rosout
问题进展:StereoNet 已启动,但缺少相机标定信息
从最新日志看,问题已经解决了一大半!
已正常工作的部分
- StereoNet 节点成功启动
- 能够接收双目图像:
receive stereo image, format: nv12 - 图像话题正常:
/image_combine_raw,/image_left_raw,/image_right_raw
剩余问题
[ERROR] [StereoNetNode]: Haven't received any camera info from topic
/image_combine_raw/right/camera_info
缺少相机标定信息,导致无法计算深度。
解决方案
步骤 1:检查 camera_info 话题是否存在
# 查看是否有 camera_info 相关话题
ros2 topic list | grep camera_info
# 检查话题是否有数据
ros2 topic echo /image_combine_raw/right/camera_info --once
预期:应该能看到焦距、主点等标定参数
步骤 2:检查标定文件
# 查看标定文件是否存在
ls -la /opt/tros/humble/lib/mipi_cam/config/calib_params.yaml
# 如果不存在,查找其他位置
find /opt -name "*.yaml" | grep -i calib
步骤 3:修改 run_stereo.sh 使用正确的标定模式
编辑 run_stereo.sh,找到标定相关配置:
vim run_stereo.sh
# 找到 calib_method 配置,修改为:
calib_method="ros" # 使用 ROS 标准标定格式
# 或者指定标定文件路径:
stereo_calib_file_path="/data/camera_calib/your_calib.yaml"
步骤 4:官方套件的标定文件获取
如果是官方 SC132GS 套件,标定文件通常在:
# 检查以下位置
ls -la /data/camera_calib/
ls -la /userdata/data/camera_calib/
ls -la /opt/hobot/calib/
如果都没有,联系供应商获取标定文件,或使用以下命令重新标定:
# 使用官方标定工具(如果有)
bash run_calibration.sh
快速诊断命令
请执行以下命令,把输出补充到帖子:
# 1. 检查 camera_info 话题
ros2 topic list | grep camera_info
# 2. 尝试获取标定参数
ros2 topic echo /image_combine_raw/right/camera_info --once
# 3. 检查标定文件
ls -la /opt/tros/humble/lib/mipi_cam/config/calib_params.yaml
# 4. 查看 run_stereo.sh 中的标定配置
grep -E "calib|camera_info" run_stereo.sh
相关参考
- 132GS MIPI 双目相机如何自行标定 - 标定文件配置详解
- 基于官方 132GS MIPI 双目相机运行双目 Demo 报错 - 同类问题解决方案
临时测试方案
如果暂时没有标定文件,可以尝试离线模式测试:
# 使用离线标定文件运行
bash run_stereo.sh --stereonet_version v2.4 --calib_file /path/to/your/calib.yaml
请先执行上面的诊断命令,把输出贴出来,可以帮你更精准定位标定文件问题!
问题明确:缺少相机标定文件
从截图看,StereoNet 节点已启动并能接收图像,但没有相机标定参数导致无法计算深度。
解决方案
步骤 1:查找官方套件的标定文件
SC132GS 官方套件应该自带标定文件,请执行以下命令查找:
# 1. 检查常见标定文件位置
ls -la /data/camera_calib/
ls -la /userdata/data/camera_calib/
ls -la /opt/tros/humble/lib/mipi_cam/config/
# 2. 全局搜索 yaml 标定文件
find / -name "*.yaml" 2>/dev/null | grep -i calib
# 3. 查找包含 stereo 或 camera 的 yaml 文件
find /opt -name "*.yaml" 2>/dev/null | head -20
步骤 2:检查 camera_info 话题
# 查看是否有 camera_info 话题
ros2 topic list | grep camera_info
# 尝试读取标定参数
ros2 topic echo /image_combine_raw/right/camera_info --once
如果输出为空,说明相机节点没有发布标定信息。
步骤 3:修改 run_stereo.sh 标定配置
# 编辑脚本
vim run_stereo.sh
# 找到标定相关配置(约 30-60 行),修改为:
calib_method="ros"
# 或
calib_method="file"
stereo_calib_file_path="/data/camera_calib/sc132gs_calib.yaml"
# 确保 render_type 是字符串格式
render_type="distance"
步骤 4:如果没有标定文件,创建临时标定
临时测试用(精度不高,但能验证流程):
# 创建临时标定文件
cat > /tmp/temp_calib.yaml << 'EOF'
%YAML:1.0
camera_matrix_1:
rows: 3
cols: 3
data: [640.0, 0.0, 640.0, 0.0, 640.0, 544.0, 0.0, 0.0, 1.0]
distortion_1:
rows: 1
cols: 5
data: [0.0, 0.0, 0.0, 0.0, 0.0]
camera_matrix_2:
rows: 3
cols: 3
data: [640.0, 0.0, 640.0, 0.0, 640.0, 544.0, 0.0, 0.0, 1.0]
distortion_2:
rows: 1
cols: 5
data: [0.0, 0.0, 0.0, 0.0, 0.0]
rectification_1:
rows: 3
cols: 3
data: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
rectification_2:
rows: 3
cols: 3
data: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
projection_1:
rows: 3
cols: 4
data: [640.0, 0.0, 640.0, 0.0, 0.0, 640.0, 544.0, 0.0, 0.0, 0.0, 1.0, 0.0]
projection_2:
rows: 3
cols: 4
data: [640.0, 0.0, 640.0, 40.0, 0.0, 640.0, 544.0, 0.0, 0.0, 0.0, 1.0, 0.0]
baseline: 0.06
EOF
# 使用临时标定文件运行
bash run_stereo.sh --stereonet_version v2.4 --calib_file /tmp/temp_calib.yaml
请补充以下诊断信息
# 1. 标定文件搜索结果
find / -name "*.yaml" 2>/dev/null | grep -i calib
# 2. camera_info 话题状态
ros2 topic list | grep camera_info
# 3. run_stereo.sh 中的标定配置
grep -E "calib|camera_info|render_type" run_stereo.sh | head -20
相关参考
- 132GS MIPI 双目相机如何自行标定 - 标定文件详细格式
- 基于官方 132GS MIPI 双目相机运行双目 Demo 报错 - 同类问题完整解决过程
优先执行步骤 1 查找标定文件,官方套件应该自带标定文件,找到后指定正确路径即可解决!
root@ubuntu:/userdata/data/test# find / -name “*.yaml” 2>/dev/null | grep -i calib
/opt/tros/humble/lib/mipi_cam/config/F37_calibration.yaml
/opt/tros/humble/lib/mipi_cam/config/SC230ai_dual_calibration.yaml
/opt/tros/humble/lib/mipi_cam/config/GC4663_calibration.yaml
root@ubuntu:/userdata/data/test# ros2 topic list | grep camera_info
/StereoNetNode/rectify_left_image/camera_info
/StereoNetNode/rectify_right_image/camera_info
/StereoNetNode/stereonet_depth/camera_info
/image_combine_raw/left/camera_info
/image_combine_raw/right/camera_info
root@ubuntu:/userdata/data/test# grep -E “calib|camera_info|render_type” run_stereo.sh | head -20
camera_info_topic=/image_combine_raw/right/camera_info
left_camera_info_topic=/image_combine_raw/left/camera_info
depth_camera_info_topic=“~/stereonet_depth/camera_info”
rectify_left_camera_info_topic=“~/rectify_left_image/camera_info”
rectify_right_camera_info_topic=“~/rectify_right_image/camera_info”
calib
calib_method=none
stereo_calib_file_path=calib.yaml
render_type=“distance”
–camera_info_topic) camera_info_topic=$2; shift 2 ;;
–left_camera_info_topic) left_camera_info_topic=$2; shift 2 ;;
–rectify_left_camera_info_topic) rectify_left_camera_info_topic=$2; shift 2 ;;
–rectify_right_camera_info_topic) rectify_right_camera_info_topic=$2; shift 2 ;;
–depth_camera_info_topic) depth_camera_info_topic=$2; shift 2 ;;
calib
–calib_method) calib_method=$2; shift 2 ;;
–stereo_calib_file_path) stereo_calib_file_path=$2; shift 2 ;;
–render_type) render_type=$2; shift 2 ;;
stereo_image_topic:=$stereo_image_topic camera_info_topic:=$camera_info_topic left_camera_info_topic:=$left_camera_info_topic
depth_image_topic:=$depth_image_topic depth_camera_info_topic:=$depth_camera_info_topic
root@ubuntu:/userdata/data/test#
问题已定位!标定配置错误
从你的诊断信息看,关键问题找到了:
当前配置问题
calib_method=none # 标定方法设为 none,不读取标定
stereo_calib_file_path=calib.yaml # 相对路径,文件不存在
可用资源
camera_info话题正常发布(5 个相关话题)- 有 SC230ai 的标定文件参考:
/opt/tros/humble/lib/mipi_cam/config/SC230ai_dual_calibration.yaml - 但没有 SC132GS 的专用标定文件
解决方案(二选一)
方案 A:使用 ROS 话题中的 camera_info(推荐)
# 1. 编辑 run_stereo.sh
vim run_stereo.sh
# 2. 修改标定配置(约第 35-40 行)
# 将:
calib_method=none
stereo_calib_file_path=calib.yaml
# 改为:
calib_method="ros"
stereo_calib_file_path=""
# 3. 保存后重新运行
bash run_stereo.sh --stereonet_version v2.4
方案 B:使用命令行参数指定标定文件
如果方案 A 不行,尝试直接传参:
# 先检查 camera_info 话题是否有数据
ros2 topic echo /image_combine_raw/right/camera_info --once
# 如果有数据,直接用 ros 模式运行
bash run_stereo.sh --stereonet_version v2.4 --calib_method ros
如果方案 A 无效:创建 SC132GS 标定文件
参考 SC230ai 的格式创建 SC132GS 标定文件:
# 1. 查看 SC230ai 标定文件格式
cat /opt/tros/humble/lib/mipi_cam/config/SC230ai_dual_calibration.yaml
# 2. 复制并修改为 SC132GS 使用
cp /opt/tros/humble/lib/mipi_cam/config/SC230ai_dual_calibration.yaml \
/opt/tros/humble/lib/mipi_cam/config/SC132GS_calibration.yaml
# 3. 修改 run_stereo.sh 使用新文件
vim run_stereo.sh
# 修改为:
calib_method="file"
stereo_calib_file_path="/opt/tros/humble/lib/mipi_cam/config/SC132GS_calibration.yaml"
验证步骤
# 1. 先验证 camera_info 话题有数据
ros2 topic echo /image_combine_raw/right/camera_info --once
# 2. 修改配置后运行
bash run_stereo.sh --stereonet_version v2.4 --calib_method ros
# 3. 观察是否还有 "Haven't received any camera info" 错误
相关参考
- 132GS MIPI 双目相机如何自行标定 - 标定文件格式详解
- 基于官方 132GS MIPI 双目相机运行双目 Demo 报错 - 同类问题完整解决
优先尝试方案 A,把 calib_method 改为 ros,让 StereoNet 直接从 ROS 话题读取标定参数。如果还有问题,把 ros2 topic echo /image_combine_raw/right/camera_info --once 的输出贴出来!
好消息:StereoNet 已成功运行!
从最新日志看,核心问题已解决!
已正常工作的部分
- StereoNet 节点成功启动并运行
- 能接收双目图像:
receive stereo image, format: nv12 - 图像话题正常发布:
/image_combine_raw/image_left_raw/image_right_raw/image_jpeg/StereoNetNode/stereonet_visual
剩余警告(不影响深度计算)
Hobot_Codec has not received image for more than 5 seconds
Websocket did not receive image data
这是可视化编码节点的问题,不影响深度算法本身,通常是:
- 浏览器未访问
http://<IP>:8000查看画面 - 或 codec 节点配置问题
验证深度结果是否正常
# 1. 检查深度话题是否有数据
ros2 topic list | grep depth
# 2. 查看深度图像发布频率
ros2 topic hz /StereoNetNode/stereonet_depth
# 3. 查看点云话题(如果启用)
ros2 topic list | grep pointcloud
# 4. 测试深度数据
ros2 topic echo /StereoNetNode/stereonet_depth --once
️ 如果要看可视化画面
# 1. 确保 codec 节点正常工作
ros2 topic info /image_jpeg
# 2. 浏览器访问
http://<你的板子IP>:8000
# 3. 如果画面不显示,检查 codec 配置
grep -E "codec|websocket|jpeg" run_stereo.sh
后续优化建议
| 问题 | 解决方案 |
|---|---|
| 深度精度不够 | 使用专用标定文件重新标定 |
| 帧率低 | 降低分辨率或关闭可视化 (publish_visual_enabled=0) |
| 点云噪点多 | 启用后处理滤波 (pcl_filter_enable=1) |
问题总结
| 阶段 | 问题 | 状态 |
|---|---|---|
| 相机驱动 | Chip ID 读取警告 | |
| render_type | 参数类型错误 | |
| 标定配置 | calib_method=none | |
| 深度计算 | 缺少 camera_info | |
| 可视化 | codec 警告 |
相关参考
- 132GS MIPI 双目相机如何自行标定 - 精度优化
- 基于官方 132GS MIPI 双目相机运行双目 Demo 报错 - 完整案例
问题已基本解决! 建议执行上面的验证命令确认深度数据正常,然后把标定文件位置记录下来方便后续使用。如果深度精度有问题,可以考虑重新标定相机~




