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