ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

CV bridge OpenCV4 error

asked 2021-09-20 07:59:23 -0500

Bender_From_Futurama gravatar image

ROS Noetic Ubuntu 20.04

When I include cv_bridge like this:

#include <cv_bridge/cv_bridge.h>

and then use:

catkin build <project_name>

I get this error:

/opt/ros/noetic/include/cv_bridge/cv_bridge.h:43:10: fatal error: opencv2/core/core.hpp: No such file or directory
   43 | #include <opencv2/core/core.hpp>

I installed the full version of Noetic.

Is there a way to fix this?

Am I missing any additional things in my CMake or xml file? All that I have added is the following:

  <build_depend>cv_bridge</build_depend>

target_link_libraries(Color ${catkin_LIBRARIES}
                        ${OpenCV_INCLUDE_DIRS})

As far asmy knowledge goed, Noetic comes with OpenCV4, while cv_bridge is trying to include Opencv2

edit retag flag offensive close merge delete

Comments

1

Did you include cv_bridge in your Cmake? 1. On find_package 2. On catkin_package

Ranjit Kathiriya gravatar image Ranjit Kathiriya  ( 2021-09-20 08:40:57 -0500 )edit
1

Yes you are correct. I was missing it in find_package. My bad. Although, im not sure if it should be added to catkin_package, as it gave me additional errors when added there.

Thanks Ranjit

Bender_From_Futurama gravatar image Bender_From_Futurama  ( 2021-09-20 09:04:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-09-20 09:08:53 -0500

Ranjit Kathiriya gravatar image

updated 2021-09-20 09:10:33 -0500

Did you include cv_bridge in your Cmake?

  1. On find_package
  2. On catkin_package
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-09-20 07:59:23 -0500

Seen: 98 times

Last updated: Sep 20 '21