Getting couldn't find package errors for open_cv with ROS

asked 2020-02-27 10:39:48 -0500

So I had a repository that compiled before but couldn't find an executable. I uploaded this to my Drive and have now re-downloaded and it granted permissions so it still has the right dependencies and such.

In CMakeLists.txt :

find_package(catkin REQUIRED COMPONENTS   roscpp   rospy   std_msgs   sensor_msgs> ``  
image_transport   cv_bridge )  find_package(OpenCV) 
target_link_libraries(my_awesome_library ${OpenCV_LIBRARIES})

And in package.xml:




I then ran:


Followed by:

rosdep install --from-paths /home/phil/catkin_ws/src --ignore-src

This worked fine but then I still get the errors:

-- +++ processing catkin package: 'camera'
-- ==> add_subdirectory(camera)
-- Could NOT find vision_opencv (missing: vision_opencv_DIR)
-- Could not find the required component 'vision_opencv'. The following CMake error indicates that you either need to install 
the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "vision_opencv"
with any of the following names:


Add the installation prefix of "vision_opencv" to CMAKE_PREFIX_PATH or set
"vision_opencv_DIR" to a directory containing one of the above files.  If
"vision_opencv" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
camera/CMakeLists.txt:10 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/phil/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/phil/catkin_ws/build/CMakeFiles/CMakeError.log".
Base path: /home/phil/catkin_ws

Source space: /home/phil/catkin_ws/src
Build space: /home/phil/catkin_ws/build
Devel space: /home/phil/catkin_ws/devel 
Install space: /home/phil/catkin_ws/install
#### Running command: "cmake /home/phil/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/phil/catkin_ws/devel- 
DCMAKE_INSTALL_PREFIX=/home/phil/catkin_ws/install -G Unix Makefiles" in "/home/phil/catkin_ws/build"
Invoking "cmake" failed
This is my repository:

It sort of seems like I've not installed OpenCV correctly but it compiled completely fine with the same repository before I uploaded it :(

I'm using Apache NetBeans, OpenCV 2 and Ubuntu 18.04.4 LTS. It seems strange that it can't find opencv_vision.

edit retag flag offensive close merge delete