# a way to use an arbitary stack

Hello. I'm new for ROS. I have a question about how to use and implement a stack.

I've already read all of the tutorials of ROS. But I couldn't find the way to implement an arbitrary stack.

For instance, I'd like to use an OpenCV with ROS.(My PC has NOT been installed OpenCV) In this case, first I install ROS(electric). Second, I get the stack, vision_opencv via internet. Next, what should I do?

Sorry for my beginner's question. Thanks in advance.

edit retag close delete

Sort by » oldest newest most voted

There's a vital, but subtle, distinction between a package and a stack. It goes like this: a stack is an installation-level construct, while a package is a user-level construct.

That is: a package never "uses" a stack: it only uses other packages. Groups of packages that "belong together" are distributed as stacks.

To have one package use another, you add the appropriate <depend> tag to your manifest.xml; you can then #include headers provided by the package you're using, link against libraries, and so on.

For the specific example of OpenCV, you want to add

<depend package="opencv2"/>

to your package's manifest.xml, and then you can use OpenCV just as if you'd installed the library and dealt with the various compile flags yourself.

more

Thank you for your kind answer ! I could #include <opencv2 opencv.hpp=""> !

In this case, I don't need to install OpenCV alone ?

Actually I've already installed OpenCV(OpenCV2.2) alone and I could not find how to uninstall it. If possible, I'd like to uninstall OpenCV I've installed before and I'd like to use OpenCV with only the package, opencv2.

But, I can not find any source codes under vision_opencv/opencv2. There are only Makefile, ROS_NOBUILD and manifest.xml.

Where are source codes? Can I uninstall OpenCV I've installed before? If possible, how do I uninstall it? (I could not "make uninstall" in the OpenCV-2.2 directory... and any info about how to uninstall OpenCV could not found.)

more

A complete answer to this is...complicated. You can use OpenCV via rosdep (installing it using your package manager), or using the package. Broadly speaking, rosdep is a better choice, but it's also more complicated.

( 2012-04-03 06:17:45 -0500 )edit