Ask Your Question
0

Conflict with system library opencv 2.3 and ROS library opencv 2.2 in Diamondback?

asked 2011-12-20 03:30:06 -0500

frferrara gravatar image

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 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2011-12-29 05:42:58 -0500

Kevin gravatar image

Why don't you just re-compile it in the ROS package you are developing? There are differences between OpenCV 2.2 and 2.3 so you are probably having some binary incompatibility issue. I also see references to flann to, so maybe there is an issue with your setup of OpenCV 2.3/flann and ROS's 2.2/flann.

I think the simplest answer is just re-compile using ROS libraries.

edit flag offensive delete link more

Comments

This worked! Thanks a lot!!
frferrara gravatar image frferrara  ( 2012-01-12 18:22:12 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-12-20 03:30:06 -0500

Seen: 1,549 times

Last updated: Dec 29 '11