ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

OpenCV2 under Groovy not compiling

asked 2014-10-26 11:58:18 -0500

Ruud gravatar image

updated 2014-10-26 15:07:30 -0500

Hi all,

I am trying to fix a compiling problem for a week now, without success. :(

Basically I am implementing this tutorial: http://wiki.ros.org/image_transport/T...

However, when I compile, I get the following errors:

In file included from /opt/ros/groovy/include/opencv2/opencv.hpp:47:0,
                 from /home/ruud/Dropbox/ros/catkin_workspace/src/test_package/include/node.h:14,
                 from /home/ruud/Dropbox/ros/catkin_workspace/src/test_package/src/node.cpp:1:
/opt/ros/groovy/include/opencv2/core/core.hpp:4126:9: error: expected identifier before ‘int’
/opt/ros/groovy/include/opencv2/core/core.hpp:4126:9: error: expected ‘}’ before ‘int’
/opt/ros/groovy/include/opencv2/core/core.hpp:4126:12: error: expected unqualified-id before ‘=’ token
/opt/ros/groovy/include/opencv2/core/core.hpp:4141:22: error: expected unqualified-id before ‘)’ token
/opt/ros/groovy/include/opencv2/core/core.hpp:4143:14: error: expected unqualified-id before ‘const’
/opt/ros/groovy/include/opencv2/core/core.hpp:4143:14: error: expected ‘)’ before ‘const’ ....

In the CMakeLists.txt I have added the following according to the tutorial:

find_package(OpenCV)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(node ${OpenCV_LIBRARIES})

In the package.xml I have added:

  <build_depend>cv_bridge</build_depend>
  <build_depend>image_transport</build_depend>
  <run_depend>cv_bridge</run_depend>
  <run_depend>image_transport</run_depend>

On the website here ( http://wiki.ros.org/opencv2 ) I read OpenCV is deprecated under groovy and you need to install it as a third party library? However, why are there OpenCV packages installed under /opt/ros/groovy/include/opencv and /opt/ros/groovy/include/opencv2.

Very confusing! :)

Thanks, Ruud

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2014-10-27 14:32:54 -0500

Ruud gravatar image

That worked! All I needed to do change the order of the includes in my source. I put the following includes before the other includes.

#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
#include <cv_bridge/cv_bridge.h>
edit flag offensive delete link more
1

answered 2014-10-27 14:03:12 -0500

Wolf gravatar image

YOu still need catkin_LIBRARIES / catkin_INCLUDE_DIRS in your CMakeLists.txt.... Is there anything included in your file before / after core.hpp taht may interfere with core.hpp?

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-10-26 11:58:18 -0500

Seen: 385 times

Last updated: Oct 26 '14