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

adding a python node that uses opencv - ROS Indigo

asked 2015-04-22 16:57:40 -0600

voladoddi gravatar image

I followed this guide for setting up OpenCV for ROS Indigo (since it doesn't come bundled anymore).

Now, the problem is I don't have an executable node that is produced from a CPP source file for target_link_libraries but I have a python node that uses OpenCV.

After adding 1)

all the dependencies in "package.xml" file,

and 2)

find_package(OpenCV REQUIRED)

in the CMakeLists.txt file, I get this error:

CMake Error at HELLO_WORLD/CMakeLists.txt:168 (target_link_libraries):
  Cannot specify link libraries for target "HELLO_WORLD" which is not built
  by this project.

How do I resolve this issue? Other nodes written in Python, I can just say "rosrun [PACKAGE_NAME]" But in this Python node that uses OpenCV, I need to make changes appropriately in the CMakeLists.txt file. Only, I'm not quite sure what it is. sources I've referred to talk about CPP nodes.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-04-22 20:07:26 -0600

If you're only using OpenCV with python, you don't need to add anything in your CMakeLists.txt. As long as the python module is on your PYTHONPATH, you're all set.

edit flag offensive delete link more


Thanks! Yes, I realised that "import cv2" already exists in the code. And it was pointed about by another gentleman on another post as well but this makes it clear :)

voladoddi gravatar image voladoddi  ( 2015-04-23 12:39:27 -0600 )edit

Question Tools

1 follower


Asked: 2015-04-22 16:57:40 -0600

Seen: 512 times

Last updated: Apr 22 '15