0
$\begingroup$

Rosanswers logo

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.


Originally posted by arennuit on ROS Answers with karma: 955 on 2016-03-18

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by al-dev with karma: 883 on 2016-03-18

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by arennuit on 2016-03-19:
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?

Comment by arennuit on 2016-03-19:
Thanks al-dev, I have just corrected the folders hierarchy bug ;)

Comment by al-dev on 2016-03-19:
@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.

Comment by arennuit on 2016-03-20:
Thanks al-dev, I have made an update to make the problem description more clear.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.