Cross-compilation of samples including OpenCV and/or Ros

Hi,

the cross-compilation of the samples works fine (using nsight). But when I try to include OpenCV and/or Ros into the main.cpp I get the following errors:
fatal error: opencv2/opencv.hpp: No such file or directory
fatal error: ros/ros.h: No such file or directory

The files and directories exists and I can chose them using Ctrl+Space.

Thanks

Hello PGrs,

Could you please discribe your symptom in detail?
We need your step for reproducing & debugging.
Could you please file a bug this issue on NVONLINE? Thanks.

Hi mania91,

I did everything that is described in “Configuring Nsight Eclipse for DriveWorks” (Mar 2017).
So I created a new project calling “DriveNet” and compiled it. This works fine.
After that I tried to include OpenCV into the /src/drivenet/main.cpp:
#include <signal.h>

#include
#include

#include
#include

// SAMPLE COMMON
#include <common/SampleFramework.hpp>
#include <common/ConsoleColor.hpp>
#include <common/DataPath.hpp>
#include <common/ProgramArguments.hpp>

// CORE
#include <dw/core/Context.h>
#include <dw/core/Logger.h>

// HAL
#include <dw/sensors/Sensors.h>
#include <dw/sensors/camera/Camera.h>

// Renderer
#include <dw/renderer/Renderer.h>

// IMAGE
#include <dw/image/FormatConverter.h>
#include <dw/image/ImageStreamer.h>

// RCCB
#include <dw/raw/RawPipeline.h>

// DriveNet
#include <dw/object/DriveNet.h>
#include <dw/object/Tracker.h>
#include <dw/object/Clustering.h>

// OpenCV
#include <opencv2/opencv.hpp>
[…]

I did nothing else then adding the last path. But during cross-compiling the project I get the following:

sudo make -j all
– VIBRANTE_PDK = /home/grs/nvidia_beta2/VibrantePDK/vibrante-t186ref-linux
– Cross Compiling for Vibrante
– VIBRANTE_PDK_BRANCH = 4.1.4.0
– Vibrante >= 4.1.1.0 - append nv_extimgdev library
– Vibrante >= 4.1.1.0 - append nv_embstatsplugin library
– Found vibrante lib: /usr/local/driveworks-0.2.1/DriveNet/3rdparty/linux-aarch64/vibrante/lib/libXrandr.so
– Found vibrante lib: /usr/local/driveworks-0.2.1/DriveNet/3rdparty/linux-aarch64/vibrante/lib/libXinerama.so
– Found vibrante lib: /usr/local/driveworks-0.2.1/DriveNet/3rdparty/linux-aarch64/vibrante/lib/libXi.so
– Found vibrante lib: /usr/local/driveworks-0.2.1/DriveNet/3rdparty/linux-aarch64/vibrante/lib/libXcursor.so
– Driveworks Samples install dir: /usr/local/driveworks-0.2.1/DriveNet/build-target/install
– Cross Compiling for Vibrante
– Found Driveworks
– Configuring done
– Generating done
– Build files have been written to: /usr/local/driveworks-0.2.1/DriveNet/build-target
[ 60%] Built target dw_samples_common
[ 75%] Built target dw_samples_dnn_common
Scanning dependencies of target sample_drivenet
[ 80%] Building CXX object src/drivenet/CMakeFiles/sample_drivenet.dir/main.cpp.o
[ 85%] Built target sample_object_detector
[ 95%] Built target sample_object_tracker
[100%] Built target sample_object_dwdetector
/usr/local/driveworks-0.2.1/DriveNet/src/drivenet/main.cpp:80:30: fatal error: opencv2/opencv.hpp: No such file or directory
#include <opencv2/opencv.hpp>
^
compilation terminated.
make[2]: *** [src/drivenet/CMakeFiles/sample_drivenet.dir/main.cpp.o] Error 1
make[1]: *** [src/drivenet/CMakeFiles/sample_drivenet.dir/all] Error 2
make: *** [all] Error 2

I will report a bug on this issue.

Hello PGrs,

Thank you for your update. Yes please file a bug for this symptom on NVONLINE.

Hi PGrs,

I used find_package(OpenCV REQUIRED) in the CMakeLists.txt of the project.
It solved the include issue, but it still had some problems finding the right libraries (OpenCV-dependencies) during linking.
I solved it by writing every single library-path (e.g. libavformat-ffmpeg-54.so, libc.so.6, …) that the linker was complaining about into the target_link_library() cmake command.

Hope this helps.

Best,
Nico

Please, where can I find this guide “Configuring Nsight Eclipse for DriveWorks”?

Hi PGrs,

Did you have ever try to including “ros/ros.h”?
Have any problem with it ?

Thanks

Hi vincenttang,

I tried to get the frames from the gmsl cameras into ros using cv_bridge. So first I need the frames in opencv. Because this doesn’t work I haven’t tried the next step to include “ros/ros.h”.

Best regards

You can find it at https://partners.nvidia.com/

How do i get a partners.nvidia.com account so i can access “Configuring Nsight Eclipse for DriveWorks”?