这是在运行 ROS2 Dashing 的 Ubuntu 18.04 上。我从源代码构建了 OpenCV,并做了 ldconfig 的事情。但是 colcon 一直在尝试使用不同的版本。
错误是“缺少:opencv_cudaarithm opencv_cudafilters”:
整个错误信息:
robotos@jetson-agx:~/ros2_ws$ colcon build
Starting >>> opencv_demos
--- stderr: opencv_demos
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find OpenCV (missing: opencv_cudaarithm opencv_cudafilters)
(found suitable version "4.1.1", minimum required is "4")
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/lib/aarch64-linux-gnu/cmake/opencv4/OpenCVConfig.cmake:328 (find_package_handle_standard_args)
CMakeLists.txt:29 (find_package)
然而,他们在那里:
robotos@jetson-agx:~/ros2_ws$ ls /usr/local/lib
a.out libopencv_highgui.so.4.2.0
cmake libopencv_imgcodecs.so
...
...
libopencv_core.so libopencv_optflow.so
libopencv_core.so.4.2 libopencv_optflow.so.4.2
libopencv_core.so.4.2.0 libopencv_optflow.so.4.2.0
libopencv_cudaarithm.so libopencv_phase_unwrapping.so
libopencv_cudaarithm.so.4.2 libopencv_phase_unwrapping.so.4.2
libopencv_cudaarithm.so.4.2.0 libopencv_phase_unwrapping.so.4.2.0
...
...
libopencv_cudafilters.so libopencv_quality.so
libopencv_cudafilters.so.4.2 libopencv_quality.so.4.2
libopencv_cudafilters.so.4.2.0 libopencv_quality.so.4.2.0
4.1.1是我通过apt安装的版本。4.2 是从源代码构建的。
有趣的是,如果我只运行 cmake 而不是 colcon,那将运行完成,所以我猜 CMake 可以单独找到它。虽然我不确定如何处理生成的文件,但我想让 colcon 工作。
另一台机器(也带有 Dashing 的 18.04)可以毫无问题地找到 cudaarithm 和 cudafilters 模块。