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

Package external dependencies

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

arennuit gravatar image

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

Hello,

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:

devRoot
   - catkin_ws
        src
             my_ROS_RTT_package
                  my_ROS_RTT_component1
                  my_ROS_RTT_component2
                  ...
   - 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

orocos_component(MecanumIK
    src/MecanumIK.h
    src/MecanumIK.cpp)
target_link_libraries(MecanumIK
    ${catkin_LIBRARIES}
    ${OROCOS-RTT_RTT-MARSHALLING_LIBRARY}
    Core)

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?

Thanks,

Antoine.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

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

al-dev gravatar image

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

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

Comments

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 -0500 )edit

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

arennuit gravatar image arennuit  ( 2016-03-19 14:41:21 -0500 )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 -0500 )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 -0500 )edit

Question Tools

3 followers

Stats

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

Seen: 691 times

Last updated: Mar 20 '16