编译darknet_ros时遇到的问题
报错信息:
- Found OpenCV: /usr (found version "4.1.1") CMake Error at /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake:113 (message): Project 'cv_bridge' specifies '/usr/include/opencv' as an include dir, which is not found. It does neither exist as an absolute directory nor in '${{prefix}}//usr/include/opencv'. Check the issue tracker 'https://github.com/ros-perception/vision_opencv/issues' and consider creating a ticket if the problem has not been reported yet. Call Stack (most recent call first): /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:76 (find_package) darknet_ros/darknet_ros/CMakeLists.txt:52 (find_package) -- Configuring incomplete, errors occurred!
错误原因:
opencv版本较高,编译程序寻找/usr/include/opencv,但本机并没有 cd /usr/include ll opencv* 只能发现opencv4这个目录,因为本机安装的较高版本的opencv
解决办法:
cd /usr/include #你的本机目录对应你的opencv版本,设置链接后解决,不必再改CMakeList ln -s opencv4 opencv