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

Possibility of importing and using an external library in ROS nodes

asked 2015-01-15 11:19:30 -0600

A.M Dynamics gravatar image

Dear all,

I wonder whether it is possible to import & use other external libraries in my ROS's node. In my case, I need to know if I can use this OpenCV library in my kinect node or not. If it is,

What changes do I apply to installation path of this library or Cmakelist file of my ros package or else?.

What is the difference between this library and that of available in ROS?

Thanks for helping me out.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-01-15 13:25:00 -0600

Yes, it is definitely possible (and very common) to use external libraries in ROS nodes. Depending on the language and library you want to use, the required steps will change somewhat, but in general ROS tries to follow the typical usage patterns of the language (e.g., CMake for C++, etc.).

However, for libraries that extremely popular to use with ROS, such as OpenCV, pre-baked distributions are already built for several platforms. This is done so that you don't have to build (and continually update) it yourself, and to guarantee a consistent library version for other packages in the ROS build farm that also require OpenCV.

For example, if you're using ROS Indigo on Ubuntu, you can just do this:

sudo apt-get install ros-indigo-vision-opencv

And then you can follow the documentation and tutorials on the ROS vision_opencv page for examples on how to use it.

edit flag offensive delete link more


Many Thanks for your clear answer.

A.M Dynamics gravatar image A.M Dynamics  ( 2015-01-15 14:40:39 -0600 )edit

@Alireza_m please accept the answer from @Morgan using the checkmark button at the left of his answer so others know your problem is solved when they search.

tfoote gravatar image tfoote  ( 2015-01-15 15:16:51 -0600 )edit

Question Tools

1 follower


Asked: 2015-01-15 11:19:30 -0600

Seen: 347 times

Last updated: Jan 15 '15