12下一页
返回列表 发布新帖
查看: 1730|回复: 14

ROS 摄像头图像显示问题分析与解决

11

主题

17

回帖

231

积分

版主

积分
231
发表于 2024-7-4 10:10:22 | 查看全部 |阅读模式
故障描述

在启动自动赛程序时,发现摄像头无法正常工作。虽然使用 rqt_image_view 可以成功显示图像,但当将话题名称从 /camera/image 改为 /camera/color/image_raw 时,程序仍然无法正常显示摄像头图像,并报错提示 detect_ros 进程已终止。

错误信息

报错内容如下:

[detect_ros-12] process has died [pid 6894, exit code 1, cmd /home/spark/spark_noetic/src/3rd_app/auto_match_24/auto_match/nodes/detect_ros.py image:=/camera/color/image_raw __name:=detect_ros __log:=/home/spark/.ros/log/744b18d8-2944-11ef-8a0b-b7fe19ea1142/detect_ros-12.log].

log file: /home/spark/.ros/log/744b18d8-2944-11ef-8a0b-b7fe19ea1142/detect_ros-12*.log


该报错表明 detect_ros 进程因未知原因终止。


单独运行 detect_ros.py 文件的输出

当尝试单独运行 detect_ros.py 文件时,输出以下内容并直接终止:

2024-06-13 13:21:23.397117: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.

2024-06-13 13:21:23.440466: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.

2024-06-13 13:21:23.440871: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.

To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.

2024-06-13 13:21:24.102906: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT

Traceback (most recent call last):

  File "/home/spark/spark_noetic/src/3rd_app/auto_match_24/auto_match/nodes/detect_ros.py", line 28, in <module>

    from object_detection.utils import label_map_util # type: ignore

  File "/home/spark/spark_noetic/src/3rd_app/tensorflow_app/tensorflow_object_detector/src/object_detection/utils/label_map_util.py", line 22, in <module>

    from object_detection.protos import string_int_label_map_pb2

  File "/home/spark/spark_noetic/src/3rd_app/tensorflow_app/tensorflow_object_detector/src/object_detection/protos/string_int_label_map_pb2.py", line 35, in <module>

    _descriptor.FieldDescriptor(

  File "/usr/local/lib/python3.8/dist-packages/google/protobuf/descriptor.py", line 561, in __new__

    _message.Message._CheckCalledFromGeneratedFile()

TypeError: Descriptors cannot not be created directly.

If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.

If you cannot immediately regenerate your protos, some other possible workarounds are:

1. Downgrade the protobuf package to 3.20.x or lower.

2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/pr ... 5-06#python-updates

可能原因分析
  • TensorFlow 和 Protobuf 版本不匹配:报错信息中提示 Descriptors cannot not be created directly,这通常是由于 TensorFlow 和 Protobuf 版本不匹配导致的。建议检查 TensorFlow 和 Protobuf 的版本,并根据报错信息中的建议进行相应的升级或降级操作。
  • GPU 驱动问题:报错信息中提示 Could not find cuda drivers on your machine,这意味着系统中未安装或未正确配置 GPU 驱动。建议检查并安装正确的 GPU 驱动程序。
  • TensorRT 问题:报错信息中提示 TF-TRT Warning: Could not find TensorRT,这表明系统中未安装 TensorRT 库。如果程序需要使用 TensorRT 进行加速,则需要安装相应的库。

解决建议
  • 检查 TensorFlow 和 Protobuf 版本:确保 TensorFlow 和 Protobuf 的版本兼容,并根据报错信息中的建议进行升级或降级操作。
  • 安装 GPU 驱动:检查并安装正确的 GPU 驱动程序。
  • 安装 TensorRT:如果程序需要使用 TensorRT 进行加速,则需要安装相应的库。
  • 检查日志文件:查看 /home/spark/.ros/log/744b18d8-2944-11ef-8a0b-b7fe19ea1142/detect_ros-12*.log 日志文件,获取更多关于程序崩溃的信息。








本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

举报

2

主题

11

回帖

85

积分

管理员

积分
85
发表于 2024-7-4 14:01:34 | 查看全部
很好的分享~我来抢沙发啦~
回复

举报

11

主题

17

回帖

231

积分

版主

积分
231
 楼主| 发表于 2024-7-4 14:33:44 | 查看全部
NXROS小助理 发表于 2024-7-4 14:01
很好的分享~我来抢沙发啦~

谢谢
回复

举报

0

主题

10

回帖

36

积分

新手上路

积分
36
发表于 2024-7-4 15:37:52 | 查看全部
对我们有所帮组
回复

举报

11

主题

17

回帖

231

积分

版主

积分
231
 楼主| 发表于 2024-7-4 15:40:26 | 查看全部
sunny 发表于 2024-7-4 15:37
对我们有所帮组

很开心对你们有所帮助。
回复

举报

0

主题

5

回帖

14

积分

新手上路

积分
14
发表于 2024-7-4 19:31:02 | 查看全部
抢沙发
回复

举报

11

主题

17

回帖

231

积分

版主

积分
231
 楼主| 发表于 2024-7-4 19:38:37 | 查看全部
回复

举报

0

主题

11

回帖

36

积分

新手上路

积分
36
发表于 2024-7-4 20:04:49 | 查看全部
萌新上号,很有借鉴意义,值得学习借鉴
回复

举报

0

主题

12

回帖

40

积分

新手上路

积分
40
发表于 2024-7-4 20:15:39 | 查看全部
有问题现象,造成原因和解决的方案,很不错,思路清晰,每天都在进步一点点!!!
回复

举报

0

主题

10

回帖

34

积分

新手上路

积分
34
发表于 2024-7-4 20:21:03 | 查看全部
666666啊,很厉害啊
回复

举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关灯 在本版发帖
扫一扫添加微信客服
返回顶部
快速回复 返回顶部 返回列表