0 x 450 (15 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.000540834] [hobot_usb_cam]: YUYV 4:2:2: 800 x 450 (10 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.000578670] [hobot_usb_cam]: YUYV 4:2:2: 800 x 450 (5 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.000615381] [hobot_usb_cam]: YUYV 4:2:2: 800 x 450 (30 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.000652258] [hobot_usb_cam]: YUYV 4:2:2: 800 x 450 (25 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.000689386] [hobot_usb_cam]: YUYV 4:2:2: 800 x 450 (20 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.000726805] [hobot_usb_cam]: YUYV 4:2:2: 800 x 450 (15 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.000764265] [hobot_usb_cam]: YUYV 4:2:2: 800 x 450 (10 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.000801518] [hobot_usb_cam]: YUYV 4:2:2: 800 x 450 (5 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.000838562] [hobot_usb_cam]: YUYV 4:2:2: 1920 x 1080 (30 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.000876189] [hobot_usb_cam]: YUYV 4:2:2: 1920 x 1080 (25 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.000913733] [hobot_usb_cam]: YUYV 4:2:2: 1920 x 1080 (20 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.000951527] [hobot_usb_cam]: YUYV 4:2:2: 1920 x 1080 (15 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.000988238] [hobot_usb_cam]: YUYV 4:2:2: 1920 x 1080 (10 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.001026115] [hobot_usb_cam]: YUYV 4:2:2: 1920 x 1080 (5 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.001063409] [hobot_usb_cam]: YUYV 4:2:2: 1920 x 1080 (30 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.001100578] [hobot_usb_cam]: YUYV 4:2:2: 1920 x 1080 (25 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.001137997] [hobot_usb_cam]: YUYV 4:2:2: 1920 x 1080 (20 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.001175708] [hobot_usb_cam]: YUYV 4:2:2: 1920 x 1080 (15 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.001213418] [hobot_usb_cam]: YUYV 4:2:2: 1920 x 1080 (10 Hz)
[hobot_usb_cam-1] [WARN] [1774776388.001250546] [hobot_usb_cam]: YUYV 4:2:2: 1920 x 1080 (5 Hz)
[example-3] [WARN] [1774776388.104802888] [dnn_example_node]: Parameter:
[example-3] feed_type(0:local, 1:sub): 1
[example-3] image: config/test.jpg
[example-3] image_type: 0
[example-3] dump_render_img: 0
[example-3] is_shared_mem_sub: 1
[example-3] config_file: /home/sunrise/yiqiang_ws/src/origincar/models/yolo11workconfig.json
[example-3] msg_pub_topic_name: hobot_dnn_detection
[example-3] info_msg_pub_topic_name: hobot_dnn_detection_info
[example-3] ros_img_topic_name: /image
[example-3] sharedmem_img_topic_name: /hbmem_img
[example-3] [WARN] [1774776388.105910791] [dnn_example_node]: Load [1] class types from file [/home/sunrise/yiqiang_ws/src/origincar/models/obstacles.list]
[example-3] [WARN] [1774776388.106079718] [dnn_example_node]: Parameter:
[example-3] model_file_name: /home/sunrise/yiqiang_ws/src/origincar/models/obstacle.bin
[example-3] model_name:
[example-3] [WARN] [1774776388.106167099] [dnn_example_node]: model_file_name_: /home/sunrise/yiqiang_ws/src/origincar/models/obstacle.bin, task_num: 4
[example-3] [BPU_PLAT]BPU Platform Version(1.3.6)!
[example-3] [HBRT] set log level as 0. version = 3.15.54.0
[example-3] [DNN] Runtime version = 1.23.10_(3.15.54 HBRT)
[websocket-4] [WARN] [1774776388.137386311] [websocket]:
[websocket-4] Parameter:
[websocket-4] image_topic: /image
[websocket-4] image_type: mjpeg
[websocket-4] only_show_image: 0
[websocket-4] smart_topic: hobot_dnn_detection
[websocket-4] output_fps: 0
[image_transport_node-5] [INFO] [1774776388.138503964] [Nv122BGR]: Nv122BGR
[hobot_codec_republish-2] [WARN] [1774776388.147934599] [hobot_codec_decoder]: New subscription discovered on topic ‘/hbmem_img’, requesting incompatible QoS. No messages will be sent to it. Last incompatible policy: RELIABILITY_QOS_POLICY
[image_transport_node-5] [WARN] [1774776388.171257023] [Nv122BGR]: New publisher discovered on topic ‘/hbmem_img’, offering incompatible QoS. No messages will be sent to it. Last incompatible policy: RELIABILITY_QOS_POLICY
[example-3] [A][DNN][packed_model.cpp:247]Model [HorizonRT] The model builder version = 1.24.3
[example-3] [WARN] [1774776388.269662708] [dnn_example_node]: Get model name: obstacle from load model.
[example-3] [WARN] [1774776388.269833886] [dnn_example_node]: Create ai msg publisher with topic_name: hobot_dnn_detection
[example-3] [WARN] [1774776388.283553915] [dnn_example_node]: Create img hbmem_subscription with topic_name: /hbmem_img
[example-3] [WARN] [1774776388.924670295] [dnn_example_node]: Loaned messages are only safe with const ref subscription callbacks. If you are using any other kind of subscriptions, set the ROS_DISABLE_LOANED_MESSAGES environment variable to 1 (the default).
[example-3] [WARN] [1774776388.924954938] [dnn_example_node]: Recved img encoding: nv12, h: 480, w: 640, step: 640, index: 0, stamp: 1774776387_976345000, data size: 460800, comm delay [948.5890]ms
[ERROR] [example-3]: process has died [pid 10981, exit code -11, cmd ‘/opt/tros/humble/lib/dnn_node_example/example --ros-args --log-level warn --ros-args --params-file /tmp/launch_params_23fjj5h5 --params-file /tmp/launch_params_1e0r8mor --params-file /tmp/launch_params_msdaxsmq --params-file /tmp/launch_params_9d7xzjd3 --params-file /tmp/launch_params_718rmnce’].
[websocket-4] [ERROR] [1774776393.171874875] [websocket]: Websocket did not receive AI data! Please check whether the AI data publisher still exists by ‘ros2 topic info hobot_dnn_detection’!
[websocket-4] [ERROR] [1774776398.172222169] [websocket]: Websocket did not receive AI data! Please check whether the AI data publisher still exists by ‘ros2 topic info hobot_dnn_detection’!
[websocket-4] [ERROR] [1774776403.172480916] [websocket]: Websocket did not receive AI data! Please check whether the AI data publisher still exists by ‘ros2 topic info hobot_dnn_detection’!
还是崩溃了!再检查配置文件
从日志看到关键问题:
model_file_name_: .../obstacle.bin, task_num: 4 ← 还是有问题!
task_num 不应该在配置文件中手动设置! 这是系统自动识别的。
立即检查配置文件
步骤 1:查看当前配置文件内容
cat /home/sunrise/yiqiang_ws/src/origincar/models/yolo11workconfig.json
确保没有 task_num 这一行!
步骤 2:用这个正确配置覆盖
cat > /home/sunrise/yiqiang_ws/src/origincar/models/yolo11workconfig.json << 'EOF'
{
"model_file": "/home/sunrise/yiqiang_ws/src/origincar/models/obstacle.bin",
"dnn_Parser": "yolov8",
"model_output_count": 6,
"reg_max": 16,
"class_num": 1,
"cls_names_list": "/home/sunrise/yiqiang_ws/src/origincar/models/obstacles.list",
"strides": [8, 16, 32],
"score_threshold": 0.4,
"nms_threshold": 0.5,
"nms_top_k": 5000
}
EOF
步骤 3:验证 JSON 格式
python3 -c "import json; json.load(open('/home/sunrise/yiqiang_ws/src/origincar/models/yolo11workconfig.json')); print('JSON 格式正确 ✅')"
步骤 4:再次测试
ros2 launch origincar_bringup usb_websocket_display.launch.py \
dnn_example_config_file:=/home/sunrise/yiqiang_ws/src/origincar/models/yolo11workconfig.json
如果还是崩溃,根本原因是版本不兼容
从日志看:
| 组件 | 版本 |
|---|---|
| 模型编译 | 1.24.3 (3.15.55.0) |
| 板子运行时 | 1.23.10 (3.15.54.0) |
版本不匹配可能导致推理崩溃,即使模型能加载。
最终解决方案(二选一)
方案 A:重新量化模型(推荐)
用与板子匹配的工具链版本重新量化:
# 在 PC 上拉取匹配的 Docker 镜像
docker pull openexplorer/ai_toolchain:3.15.54
# 重新量化模型
# 参考教程:https://forum.d-robotics.cc/t/topic/34084
方案 B:继续升级系统
# 检查是否有更新的系统包
sudo apt update
sudo apt upgrade
# 重启
sudo reboot
先执行步骤 1-4
把步骤 1 的配置文件内容贴出来,我帮你检查是否有 task_num 或其他问题!
可以看这里