Robot Operating System/ROS
[ROS Melodic] CMake Error at /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake:113 (message):
jstar0525
2021. 7. 30. 18:48
반응형
Env.
Jetson AGX Xavier(with jetpack 4.5.1, ubuntu 18.04)
ROS Melodic
에러 현상
~/catkin_ws$ catkin_make clean
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)
realsense-ros/realsense2_camera/CMakeLists.txt:11 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/robotv/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/robotv/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
cv_bridge가 어디있는지 모르겠다는 에러이며,
opencv의 위치를 찾는다.
OpenCV 위치 찾기
$ pkg-config --cflags opencv
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
$ pkg-config --cflags opencv3
Package opencv3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv3' found
$ pkg-config --cflags opencv4
-I/usr/include/opencv4/opencv -I/usr/include/opencv4
설치된 버전은 opencv4이며, /usr/include 디렉토리에 있음을 알 수 있다.
cv_bridgeConfig.cmake 파일 수정
$ sudo gedit /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake
===============================origin=============================
if(NOT "include;/usr/include;/usr/include/opencv " STREQUAL " ")
set(cv_bridge_INCLUDE_DIRS "")
set(_include_dirs "include;/usr/include;/usr/include/opencv")
===============================revise=============================
if(NOT "include;/usr/include;/usr/include/opencv " STREQUAL " ")
set(cv_bridge_INCLUDE_DIRS "")
set(_include_dirs "include;/usr/include;/usr/include/opencv4")
96번째 줄의 /usr/include/opencv를 /usr/include/opencv4로 수정하여 문제를 해결한다.
ref.
https://95mkr.tistory.com/entry/ROS6
https://suho0515.tistory.com/36
반응형