下载源码,源码编译支持系统opencv
bash
git clone -b noetic https://github.com/ros-perception/vision_opencv.git
set(_opencv_version 4) #设置为系统opencv
find_package(OpenCV 4 QUIET)
if(NOT OpenCV_FOUND)
message(STATUS "Did not find OpenCV 4, trying OpenCV 3")
set(_opencv_version 3)
endif()
cd vision_opencv/cv_bridge
mkdir build
cd build
cmake ..
make
sudo make install
完成后:
将/usr/local/share/中的cv_bridge文件夹复制到/opt/ros/noetic/share/中