ROS – Hacking for OpenCV on Nvidia Jetson TX1 & Jetson TK1

With the latest version of Nvidia Jetpack the conflicts between cv_bridge, image_geometry and opencv4tegra seems to have been solved… but a few issues still remain since ROS searches for OpenCV v2.4.8, but opencv4tegra is based on OpenCV v2.4.12.

Despite this mismatch of version cv_bridge and image_geometry packages work correctly, but if we try to compile a new node that uses OpenCV (for example the zed-ros-wrapper for Stereolabs ZED camera) the linker will fail trying to link “”.
On the official Nvidia developer forum, the user “kgregson” posted a solution to this problem and after a few tests I must confirm that the solution is good and it works as expected.

What we must “say” to cv_bridge and image_geometry is to not search for OpenCV in the default ARM path “/usr/lib/arm-linux-gnueabihf”, but in “/usr/lib” (I do not know why Nvidia chose this path) and that the current version of OpenCV is 2.4.12 and not 2.4.8… finally we must remove the references to the module OpenCL because Nvidia does not provide it.

Files to be modified

  •  /opt/ros/<ros-version>/lib/pkgconfig/cv_bridge.pc
  • /opt/ros/<ros-version>/lib/pkgconfig/image_geometry.pc
  • /opt/ros/<ros-version>/share/cv_bridge/cmake/cv_bridgeConfig.cmake
  • /opt/ros/<ros-version>/share/image_geometry/cmake/image_geometryConfig.cmake

You can backup and modify each file using the following commands (example for ROS Indigo):

Modifications for each file

  1. remove each instance “/usr/lib/arm-linux-gnueabihf/;
  2. replace each instance of “/usr/lib/arm-linux-gnueabihf/” with “/usr/lib
  3. replace each instance of “2.4.8” with “2.4.12” (or the current version of OpenCV in opencv4tegra package)

Finally you can compile your OpenCV based node without any error.

Modified files

Following the final configuration that each modified file should reflect:


Comments are closed.