how to build cv_bridge with Jetson TX2?

asked 2019-10-10 22:01:44 -0500

Redhwan gravatar image

updated 2019-10-12 21:49:37 -0500

I am using the OpenCV4Tegra with Jetson TX2.

the system:

NVIDIA Jetson TX2

L4T 28.2.1 [ JetPack 3.3 or 3.2.1 ]

Board: t186ref

Ubuntu 16.04.6 LTS

Kernel Version: 4.4.38-tegra

CUDA 9.0.252

the error:

`-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- python
CMake Error at vision_opencv/cv_bridge/CMakeLists.txt:16 (find_package):
Could not find a package configuration file provided by "OpenCV" (requested
version 3) with any of the following names:

OpenCVConfig.cmake
opencv-config.cmake
Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"
provides a separate development package or SDK, be sure it has been
installed.

-- Configuring incomplete, errors occurred!
See also "/home/nvidia/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/nvidia/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:318: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
`

I used this method on my PC with GPU 1050 is very very nice here.

I get some solutions here but it seems that he built OpenCV not OpenCV4Tegra

CmakeLists.txt

cmake_minimum_required(VERSION 2.8)
project(cv_bridge)

find_package(catkin REQUIRED COMPONENTS rosconsole sensor_msgs)

if(NOT ANDROID)
  find_package(PythonLibs)
  if(PYTHONLIBS_VERSION_STRING VERSION_LESS 3)
    find_package(Boost REQUIRED python)
  else()
    find_package(Boost REQUIRED python3)
  endif()
else()
find_package(Boost REQUIRED)
endif()
find_package(OpenCV 3 REQUIRED
  COMPONENTS
    opencv_core
    opencv_imgproc
    opencv_imgcodecs
  PATHS /usr/local
  NO_DEFAULT_PATH
  CONFIG
)

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES ${PROJECT_NAME}
  CATKIN_DEPENDS rosconsole sensor_msgs
  DEPENDS OpenCV
  CFG_EXTRAS cv_bridge-extras.cmake
)

catkin_python_setup()

include_directories(include ${Boost_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})

if(NOT ANDROID)
add_subdirectory(python)
endif()
add_subdirectory(src)
if(CATKIN_ENABLE_TESTING)
  add_subdirectory(test)
endif()

# install the include folder
install(
  DIRECTORY include/${PROJECT_NAME}/
  DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)

Please. help me or any suggestion??

edit retag flag offensive close merge delete

Comments

This is the error I am seeing:

OpenCVConfig.cmake
opencv-config.cmake
Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"
provides a separate development package or SDK,

I would grep for the file it is asking for OpenCVConfig.cmake and then set the environment variable to the path it found

kscottz gravatar image kscottz  ( 2019-10-14 12:33:50 -0500 )edit

Thank you so much @kscottz for your helping, I fixed it this issue by changing the path from PATHS /usr/local to PATHS /usr it works now. sadly, I get another issue in the next step. you can see here

Redhwan gravatar image Redhwan  ( 2019-10-14 23:28:14 -0500 )edit