CV bridge OpenCV4 error
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
Did you include cv_bridge in your Cmake? 1. On
find_package
2. Oncatkin_package
Yes you are correct. I was missing it in
find_package
. My bad. Although, im not sure if it should be added tocatkin_package
, as it gave me additional errors when added there.Thanks Ranjit