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 

 

[ROS] 6. ROS + OPENCV (cv_bridge) 실시간 스트리밍

☞ 메인보드 : Jetson Nano Developer Kit ☞ 커널 버전 : Ubuntu 18.04 - JetPack 4.3 ☞ ROS 버전 : Melodic ☞ 언어 : C++ <이전 포스트> ROS Melodic 언어 : C++ <이전 포스트> 4. 예제를 통한 ROS 실행 : 패..

95mkr.tistory.com

https://suho0515.tistory.com/36

 

[OpenCV] Ubuntu에서 local에 OpenCV를 설치하고 C++에서 사용하는 방법

Ubuntu에서 OpenCV를 설치하는 경우, 보통 시스템 폴더 안 (ex. usr/local/include) 에 설치되게 된다. 만약 다른 버전의 OpenCV를 설치하고자 하는 경우 시스템 폴더 안의 OpenCV를 삭제하고 다시 설치하게 되

suho0515.tistory.com

 

반응형