ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Installation from source fails because of cv_bridge include dir

asked 2014-12-10 20:07:40 -0600

I'm trying to install ROS from source on Fedora 20 as per http://wiki.ros.org/indigo/Installati... . It fails with:

    CMake Error at /home/jfstepha/ros_catkin_ws/install_isolated/share/cv_bridge/cmake/cv_bridgeConfig.cmake:106 (message):
  Project 'cv_bridge' specifies '//include/opencv' as an include dir, which
  is not found.  It does neither exist as an absolute directory nor in
  '/home/jfstepha/ros_catkin_ws/install_isolated///include/opencv'

The correct path should be "/usr/include/opencv", somehow it seems to be missing the "usr". Also, it successfully builds 153 packages before this, so it doesn't seem to be a general setup issue.

I'm having a hard time figuring out where this path comes from - can anyone help?

edit retag flag offensive close merge delete

Comments

Perhaps this is related: http://answers.ros.org/question/19805... ?

ahendrix gravatar image ahendrix  ( 2014-12-10 21:05:31 -0600 )edit

@ahendrix: It could possibly be somehow related in that it could be an opencv configuration bug, but the root cause of that one had to do with the Nvidia TK1 Jetson board, which I am not using. It could be the same environmental variable is missing or something.

Jon Stephan gravatar image Jon Stephan  ( 2014-12-11 10:42:44 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted
1

answered 2014-12-14 19:46:18 -0600

The problem was that OpenCV_INCLUDE_DIRS was not getting set properly. It gets set by this line in /usr/lib64/OpenCVConfig.cmake

set(OpenCV_INCLUDE_DIRS "${OpenCV_INSTALL_PATH}/include/opencv;${OpenCV_INSTALL_PATH}/include")

The root cause is probably that OpenCV_INSTALL_PATH is not set properly, but I just changed the line to this:

set(OpenCV_INCLUDE_DIRS "/usr/include/opencv;/usr/include")

This seemed to work.

edit flag offensive delete link more
10

answered 2021-04-29 07:29:03 -0600

eeppii gravatar image

I'm on a Nvidia Jetson platform.

As said above, cv_bridge expects /usr/include/opencv but on jetson systems it's under /usr/include/opencv4/opencv2

The quickest way to solve this, without rewriting config files is to symlink the directories:

sudo ln -s /usr/include/opencv4/opencv2/ /usr/include/opencv

edit flag offensive delete link more

Comments

I think this is the best way to go, as it will fix issues with other scripts trying to find opencv in the future.

kidargueta gravatar image kidargueta  ( 2021-05-09 21:17:03 -0600 )edit
1

Thanks, this solved my problem when running on NVida Xavier!

mysqo gravatar image mysqo  ( 2021-06-04 08:16:26 -0600 )edit
2

answered 2021-03-23 04:15:46 -0600

bigbellmercy gravatar image

In my case in Jetson Nano, the error happened when I ran catkin_make clean for the first time.

The actual path for OpenCV include files was /usr/include/opencv4/opencv2 though /usr/include/opencv was expected.

So, after this actual path is written correctly in the cv_bridgeConfig.cmake file, the error disappeared.

edit flag offensive delete link more

Comments

The same happened here. Thank you for the correction!

Marcus Forte gravatar image Marcus Forte  ( 2021-04-27 23:08:50 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-12-10 20:07:40 -0600

Seen: 11,456 times

Last updated: Apr 29 '21