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

Package external dependencies

asked 2016-03-18 13:32:46 -0600

arennuit gravatar image

updated 2016-03-20 06:54:25 -0600


I am building a ROS package (well actually I am building components for RTT_ROS) and these components depend on external code. This external code is not 3rd party code but code which is maintained outside of catkin_ws. The reason for this is that in my case ROS is only a communication tool part of a larger project.

That is my folders organization is something like:

   - catkin_ws
   - Core (math-related code)
   - System (platform-related code)
   - Renderer (3D rendering code)
   - App (my app which is a robot supervisor using ROS for communication)

My ROS_RTT components actually use the Core and System projects so my components are defined in the package's CMakeList.txt as


Where you see Core appearing in target_link_library for my component.

This all works fine except that when I change some code in Core and call catkin_make, the Core library is not recompiled automatically and I need to recompile it by hand, which is a pain.

UPDATE: Note that our system has a lot of code compiled outside the frame of catkin/ros (this is the bulk of our code actually). Though we rely on ROS for communication. And it turns out our ROS packages (i.e. RTT components among other ROS-related code) depend on Core and System code, which are projects defined outside of the catkin workspace and used throughout our whole codebase (within the ROS framework but also code outside ROS as in projects Renderer or App shown in the folders hierarchy).

I have read this and this, but it did not help much.

Any idea of what I am doing wrong?



edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-03-18 14:24:52 -0600

al-dev gravatar image

updated 2016-03-19 22:35:10 -0600

I may be wrong but I believe catkin cannot compile code that is either 1) located outside of your specified source directory, or 2) not located inside a catkin package.

Your best chance might be to create a minimal catkin package inside your catkin_ws/src/ and put your external code in there. Assuming that your external code uses cmake and already has a CMakeLists.txt, there should only be a few catkin-specific lines to add in there + a package.xml

Edit: A small comment : your question implies that you may want to use catkin as the common meta-build system for large projects containing a significant part of non-ROS code. An alternative may be to use another system (e.g pure cmake) instead as the common denominator, and call catkin build commands from cmake scripts for the ROS parts of your codebase.

edit flag offensive delete link more


Hello al-dev, I understand that the default way of using catkin is the one you describe. Though for large system I cannot see this is maintainable. I am pretty sure this is not how they use catkin at pal-robotics or in aldebaran... So any idea?

arennuit gravatar image arennuit  ( 2016-03-19 14:40:53 -0600 )edit

Thanks al-dev, I have just corrected the folders hierarchy bug ;)

arennuit gravatar image arennuit  ( 2016-03-19 14:41:21 -0600 )edit

@arennuit, I have upvoted your question to see if we can get an answer from more experienced users. I have also added a comment to my answer.

al-dev gravatar image al-dev  ( 2016-03-19 22:35:41 -0600 )edit

Thanks al-dev, I have made an update to make the problem description more clear.

arennuit gravatar image arennuit  ( 2016-03-20 06:54:54 -0600 )edit

Question Tools



Asked: 2016-03-18 13:32:46 -0600

Seen: 677 times

Last updated: Mar 20 '16