Conflict with system library opencv 2.3 and ROS library opencv 2.2 in Diamondback?
Hello,
I developed a ball detection algorithm first outside ROS, using the opencv library I installed on my system (Ubuntu 10.4, opencv 2.3). I installed it as a shared object and I can use it without any problem outside ROS. As I included it into a ROS node, I could actually compile it, but it gave me some warnings:
Scanning dependencies of target BlobDetector
make[3]: Leaving directory `/home/ferraraf/Wazowski/mWazowski/ball_detection/build'
make[3]: Entering directory `/home/ferraraf/Wazowski/mWazowski/ball_detection/build'
[ 20%] Building CXX object CMakeFiles/BlobDetector.dir/src/BlobDetector.o
/home/ferraraf/Wazowski/mWazowski/ball_detection/src/BlobDetector.cpp: In member function ‘void BlobDetector::detectionCallback(const sensor_msgs::ImageConstPtr&)’:
/home/ferraraf/Wazowski/mWazowski/ball_detection/src/BlobDetector.cpp:182: warning: unused variable ‘r’
/home/ferraraf/Wazowski/mWazowski/ball_detection/src/BlobDetector.cpp:194: warning: ‘y_c’ may be used uninitialized in this function
/home/ferraraf/Wazowski/mWazowski/ball_detection/src/BlobDetector.cpp:208: warning: ‘x_c’ may be used uninitialized in this function
Linking CXX executable ../bin/BlobDetector
/usr/bin/ld: warning: libopencv_core.so.2.3, needed by /usr/local/share/opencv/../../lib/libblob_detection.so, may conflict with libopencv_core.so.2.2
/usr/bin/ld: warning: libopencv_imgproc.so.2.3, needed by /usr/local/share/opencv/../../lib/libblob_detection.so, may conflict with libopencv_imgproc.so.2.2
/usr/bin/ld: warning: libopencv_features2d.so.2.3, needed by /usr/local/share/opencv/../../lib/libblob_detection.so, may conflict with libopencv_features2d.so.2.2
/usr/bin/ld: warning: libopencv_calib3d.so.2.3, needed by /usr/local/share/opencv/../../lib/libblob_detection.so, may conflict with libopencv_calib3d.so.2.2
/usr/bin/ld: warning: libopencv_objdetect.so.2.3, needed by /usr/local/share/opencv/../../lib/libblob_detection.so, may conflict with libopencv_objdetect.so.2.2
/usr/bin/ld: warning: libopencv_video.so.2.3, needed by /usr/local/share/opencv/../../lib/libblob_detection.so, may conflict with libopencv_video.so.2.2
/usr/bin/ld: warning: libopencv_highgui.so.2.3, needed by /usr/local/share/opencv/../../lib/libblob_detection.so, may conflict with libopencv_highgui.so.2.2
/usr/bin/ld: warning: libopencv_ml.so.2.3, needed by /usr/local/share/opencv/../../lib/libblob_detection.so, may conflict with libopencv_ml.so.2.2
/usr/bin/ld: warning: libopencv_legacy.so.2.3, needed by /usr/local/share/opencv/../../lib/libblob_detection.so, may conflict with libopencv_legacy.so.2.2
/usr/bin/ld: warning: libopencv_contrib.so.2.3, needed by /usr/local/share/opencv/../../lib/libblob_detection.so, may conflict with libopencv_contrib.so.2.2
make[3]: Leaving directory `/home/ferraraf/Wazowski/mWazowski/ball_detection/build'
[ 20%] Built target BlobDetector
(The rest is not important, it is other nodes which are successfully compiled and run.)
When I run the ROS node, there is a segmentation fault before the program enters the main function. I ran the node using gdb and it gives me the following output when I do a backtrace:
Starting program: /home/ferraraf/Wazowski/mWazowski/ball_detection/bin/BlobDetector __name:=BlobDetector __log:=/home/ferraraf/.ros/log/5dbf29ea-2b2a-11e1-b4e2-001b21b8241e/BlobDetector-1.log
[Thread debugging using libthread_db enabled]
Program received signal SIGSEGV ...