Ask Your Question
3

opencv2 and raspberry pi

asked 2014-05-15 21:28:48 -0500

Maya gravatar image

updated 2014-06-14 15:02:54 -0500

Hellow,

I'm trying to install cv_bridge on my raspberry Pi using Ros Hydro. I installed OpenCV following this link and when I try to compile ROS I have the following :

WARNING: package "opencv_tests" should not depend on metapackage "ros" but on its packages instead

And

/home/pi/tobot_ws/ros_mobile_ws/src/cv_bridge/cv_bridge/src/cv_bridge.cpp: In function ‘std::map<std::pair<cv_bridge::Format, cv_bridge::Format>, std::vector<int> > cv_bridge::getConversionCodes()’:
/home/pi/tobot_ws/ros_mobile_ws/src/cv_bridge/cv_bridge/src/cv_bridge.cpp:133:44: error: ‘CV_GRAY2RGB’ was not declared in this scope

I installed OpenCV into /usr/lib/include and everything. I guess some files are not found and I'm wondering how can I link it correctly ?

EDIT :

I did a source install of opencv2 this way :

Need to source install like this :

  • cd ros_mobile_ws/src
  • rosinstall_generator opencv2 --deps | rosws merge -
  • rosws update
  • cd ..
  • rosdep install --from-paths src --ignore-src --rosdistro hydro -y --os=debian:wheezy
  • ./src/catkin/bin/catkin_make_isolated --install

This install went fine and everything compile but now when I want to compile this I have this error :

Linking CXX executable /home/pi/tobot_ws/catkin_ws2/devel/lib/openni2_camera/openni2_camera_node
/usr/bin/ld: warning: libopencv_videostab.so.3.0, needed by /home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_video.so.3.0, needed by /home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_superres.so.3.0, needed by /home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_stitching.so.3.0, needed by /home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_softcascade.so.3.0, needed by /home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_shape.so.3.0, needed by /home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_photo.so.3.0, needed by /home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_optim.so.3.0, needed by /home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_objdetect.so.3.0, needed by /home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_nonfree.so.3.0, needed by /home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_ml.so.3.0, needed by /home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_legacy.so.3.0, needed by /home/pi/tobot_ws/ros_mobile_ws/install_isolated/lib/libcv_bridge.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_imgproc.so.3.0, needed by ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2014-05-22 23:19:16 -0500

130s gravatar image

updated 2014-06-15 02:31:04 -0500

In ROS Hydro cv_bridge expects OpenCV to be installed via opencv2 package, that installs OpenCV as "3rd party package" where it gets installed under /opt/ros/hydro instead of general directory as you mentioned (I asked here if this guess is correct, and confirmed by a OpenCV developer).

That said it's possible that linking might not work with the OpenCV that's installed differently.

edit flag offensive delete link more

Comments

You didn't found any way to link it ?

Maya gravatar imageMaya ( 2014-05-23 06:11:45 -0500 )edit

I haven't tried installing OpenCV by non-ROS way like you do. Isn't installing opencv2 an option for you?

130s gravatar image130s ( 2014-05-23 14:05:40 -0500 )edit

When I try to do it with rosdep it says that it can't find the package opencv2 for raspbian weezy. I can't reproduce the problem now but I'll do as soon as I can.

Maya gravatar imageMaya ( 2014-05-23 20:29:06 -0500 )edit

`rosdep` doesn't install ROS package. I'm not familliar with `raspbian` but you might want to source-install OpenCV2. You can generate `.rosintall` description by running `$ rosinstall_generator opencv2`.

130s gravatar image130s ( 2014-05-26 06:44:14 -0500 )edit
1

But now I have openCV installed as a thrid party AND from source :P... I'll have to find out what's wrong.. EDIT : found an OpenCV linker missing. It compile now !

Maya gravatar imageMaya ( 2014-06-14 14:58: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

2 followers

Stats

Asked: 2014-05-15 21:28:48 -0500

Seen: 1,279 times

Last updated: Jun 15 '14