luxonis / depthai-ros

Official ROS Driver for DepthAI Sensors.
MIT License
239 stars 173 forks source link

[BUG] {Failure} Failed to compile depthai-ros on Nvidia jetson xavier nx #419

Open ChengTszYin opened 9 months ago

ChengTszYin commented 9 months ago

I am install the package on ROS noetic with a Nvidia jetson xavier nx. The version of oepncv and cmake in my machine are over 4.0.0 and 3.10.2 respectively. The error code is:

[ 11%] Built target vision_msgs_generate_messages_lisp Scanning dependencies of target nodelet_generate_messages_nodejs [ 11%] Built target nodelet_generate_messages_nodejs Scanning dependencies of target depthai_filters [ 22%] Building CXX object CMakeFiles/depthai_filters.dir/src/detection2d_overlay.cpp.o [ 33%] Building CXX object CMakeFiles/depthai_filters.dir/src/segmentation_overlay.cpp.o [ 44%] Building CXX object CMakeFiles/depthai_filters.dir/src/wls_filter.cpp.o In file included from /home/dllm/dai_ws/src/depthai-ros/depthai_filters/src/wls_filter.cpp:1: /home/dllm/dai_ws/src/depthai-ros/depthai_filters/include/depthai_filters/wls_filter.hpp:11:10: fatal error: opencv2/ximgproc/disparity_filter.hpp: No such file or directory 11 | #include "opencv2/ximgproc/disparity_filter.hpp" | ^~~~~~~~~~~ compilation terminated. make[2]: [CMakeFiles/depthai_filters.dir/build.make:89: CMakeFiles/depthai_filters.dir/src/wls_filter.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:497: CMakeFiles/depthai_filters.dir/all] Error 2 make: *** [Makefile:141: all] Error 2 <== Failed to process package 'depthai_filters': Command '['/home/dllm/dai_ws/devel_isolated/depthai_examples/env.sh', 'make']' returned non-zero exit status 2.

Reproduce this error by running:

==> cd /home/dllm/dai_ws/build_isolated/depthai_filters && /home/dllm/dai_ws/devel_isolated/depthai_examples/env.sh make

Command failed, exiting.

Do u have any idea with this error. Thank you

Serafadam commented 9 months ago

Hi, could you provide more information according to the BUG template? This error is related to OpenCV libraries, if you built them from source, you should additionally build the ximgproc module from OpenCV. More information here

brianlmerritt commented 4 months ago

I had the same problem and did an update of nano_build_opencv for jetpack 6 (with a Xavier NX that may be unnecessary)

For Jetpack 5 try the original build opencv from source https://github.com/mdegans/nano_build_opencv)

For JetPack 6 - https://github.com/brianlmerritt/nano_build_opencv

Then create a separate workspace for depthai-ros depthai_ws/src and git clone there but copy the build script in the top ws folder and run from there. I was trying to build inside another workspace but had to run the depthai build.sh to get it to work.