i had the same problem (jetson xavier + ubuntu 18.04 + ros melodic)
we fixed it like this:
change the file:
/opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake
change this line:
set(_include_dirs "include;/usr/include;/usr/include/opencv")
to
set(_include_dirs "include;/usr/include;/usr/include/opencv4")
运行时报如下错误:
from cv_bridge.boost.cv_bridge_boost import cvtColorForDisplay, getCvType
SystemError: initialization of cv_bridge_boost raised unreported exception
原因:导入顺序出错。
解决方案:
from cv_bridge import CvBridge # ROS与OpenCV图像转换类
import cv2 # Opencv图像处理库
修改成如下顺序:
import cv2 # Opencv图像处理库
from cv_bridge import CvBridge # ROS与OpenCV图像转换类
catkin_make
catkin_make install
install/lib/..../a.py
本文介绍了在Jetson Xavier上使用Ubuntu 18.04和ROS Melodic时遇到的cv_bridge导入错误,解决方法涉及修改cv_bridgeConfig.cmake文件中的OpenCV路径,并调整导入顺序。通过catkin_make和安装,确保了ROS与OpenCV的兼容性。
3111

被折叠的 条评论
为什么被折叠?



