Ask Your Question

How to use a sdk (non-ros header/lib/binaries) in ros package?

asked 2014-11-24 10:23:22 -0600

fromandto gravatar image

updated 2014-11-24 10:42:32 -0600

I am trying to use a camera sdk to write a camera stream publisher in ros.

It's not a uvc camera, so I cannot use usb_cam or other similar nodes to access the camera stream.

I've already had the camera sdk consisting of ASICamera.h/libASICamera.a/, and I've successfully got it running.

But now I don't know how to use it in a ros node.

After I add the header files into the package/include directory

and #include "ASICamera.h" into the publisher node,

I type catkin_make. it reports:

make[2]: * [asi_converter_real/CMakeFiles/asi_converter_real.dir/src/asi_converter_real.cpp.o] Error 1 make[1]: * [asi_converter_real/CMakeFiles/asi_converter_real.dir/all] Error 2

I think the reason is that I have not add the .a and .so into the publisher node.

But I don't know how to do this

In the package.xml, it seems that

build_depend and run_depend tags can only access ros-inbuilt static/dynamic libraries, how could I use my own .a and .so in a ros node ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-11-24 10:44:41 -0600

The package.xml file only describes what the node depends on, so that catkin can figure out what packages to add during compilation. The real heart of the compiling system is CMakeLists.txt. There you'll list both the catkin packages and the non-catkin (system) packages. Your ASICamera.h falls in the second category.

Say you're building a node called ros_asicamera, and the asicamera library is called Then your CMakeLists.txt will have something like:

add_executable( ros_asicamera src/ros_asicamera.cpp)
target_link_libraries(ros_asicamera asicamera)

Bare in mind that if asicamera header and libraries files are not installed in the default system paths (e.g. /usr/lib, /usr/local, /usr/include etc) then you have to tell CMake how to find them. This is done in several ways, depending on your asicamera package. The most portable ways are pkg-config or findAsicamera.cmake (the second is preferable). If these files are not provided then you can use:


for the header files. Finding libraries is more tricky, and you can find additional information at .

Last but not least, since the error message you posted is not very informative, try doing:

make VERBOSE=1

to get additional information on the error. That also helps when posting on the Q/A.

Hope this helps!

edit flag offensive delete link more



make VERBOSE=1 is very useful!!!!!! thx so much, Now I know that Makefile is in the ws/build, with VERBOSE I can find which header/library is missed and How the final -I/-l lines look like. thx again, lorenzo

fromandto gravatar image fromandto  ( 2014-11-25 00:43:19 -0600 )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



Asked: 2014-11-24 10:23:22 -0600

Seen: 643 times

Last updated: Nov 24 '14