ros can't find OpenCV , the path /usr/local/

2019-09-16 15:10发布

问题:

I am working with ros and OpenCV. I installed OpenCV in the default path /usr/local, but when I build programs with catkin_make in my workstation, it shows Project cv_bridge specifies /usr/include/opencv as an include dir, which is not found.

Can you show me what can I do to solve the problem? Thank you.

回答1:

I recommend you use the opencv2_catkin package that automatically finds and links your package to OpenCV. As per the Readme, just add the following dependency to your own package:

<build_depend>opencv2_catkin</build_depend>

You would also need to download catkin_simple to use opencv2_catkin.



回答2:

I found you said you use catkin_make, so in new version of ROS, opencv and pcl are no longer integrate in ROS, so you need find you opencv yourself. For example, in your workspace, the CMakeLists.txt file, you should add something like find_package(OpenCV REQUIRED), and add include dir and libs to your project. If you also have problems, please paste your details of errors.