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

Workspace layout question: ros-agnostic parts in or out of the ros packages?

asked 2014-12-03 01:32:40 -0600

Wolf gravatar image

updated 2015-01-31 04:29:12 -0600

Hi all,

I have a question regarding ros-agnostic code parts in ROS packages. I have some parts of code I heavily use in my ROS nodes but they do not necessarily need the ROS components e. g. rosccp, rospy, msg srv or other ROS packages. By now I have them in separate libs in the catkin_packages and call into them from my ROS nodes (which handle the message etc. stuff) via their API.

Now i would like to use them ROS and plattform agnostic but having the code under a common version control (in the end ideally with automatic tests for all plattforms). I have cmake tool chain files for all target plattforms of the ros-agnostic code parts.

Now what would be the appropriate way to have this? I think I'd have 2 options!? :

  • Create a separate CMake project for ros-agnostic parts, compile using tool chain files, and for ROS include the CMake projects using find_package()##### Doubts: Would it still be possible to use rosinstall/wstool for checking out/updating these projects? Would it be possible to invoke the cmake only build of these projects when calling catkin_make, or would I have to do some own scripting for that?
  • Have even those ros-agnostic code parts in the catkin packages and call a catkin_make with a cmake tool chain file for the ros-agnostic catkin packages.##### Doubts: How ros agnostic is catkin? Is it possible to call catkin_make with a cmake tool chain file?

Thank you in advance

Edit 31.01.2015: Still an issue if anyone has thoughts about this;)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-01-31 16:11:16 -0600

ahendrix gravatar image

updated 2015-02-02 17:48:56 -0600

I think both of the options you propose are valid.

For 1): wstool is ros-agnostic; it just uses the rosinstall file to ensure that the repositories listed there are checked out and up to date. (rosinstall is similar, but it also invokes rosbuild after doing the checkout, which makes it unsuitable for what you're trying to do).

catkin_make isn't designed to build pure cmake packages (it requires that each package have a package.xml), but you can build a workspace containing both catkin and non-catkin cmake packages using catkin_make_isolated or catkin build.

For 2): catkin_make is ROS-agnostic; it's just a convenience wrapper around cmake, and it accepts all of the same flags that cmake does. I haven't tried it, but it should work fine with a cmake toolchain file. Note that since you would be building all of your packages in a single workspace, it won't be possible to pass different toolchain files to different packages.

edit flag offensive delete link more



catkin_make only requires projects to have a package.xml file to determine the build oder. The CMake files don't have to call any catkin related stuff and can be plain CMake.

Dirk Thomas gravatar image Dirk Thomas  ( 2015-02-02 12:20:04 -0600 )edit

It is possible to have non-catkin CMake packages in a workspace and then use catkin_make on it, you may need to take special care to make sure that the non-catkin CMake packages can be found with find_package(...) by other CMake packages during the cmake run, which catkin handles for you.

William gravatar image William  ( 2015-02-02 12:39:57 -0600 )edit

Question Tools

1 follower


Asked: 2014-12-03 01:32:40 -0600

Seen: 350 times

Last updated: Feb 02 '15