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

Can I use ROS without the ROS build system

asked 2012-02-13 21:45:42 -0500

Sebastian Schneider gravatar image


I'm part of a team of researchers that are developing software for autonomous robots for nearly 5 years now. We have a pretty big software project with lots of our own libraries and our own homebrew IPC solution.

Now, since we want to collaborate with others we want to be able to use the message sending and receiving functionality of ROS, but we'd rather not migrate from our own build-system (which is also based on cmake) to the ROS build-system.

So, is there an easy way, such that we only have to include some headers (probably ros.h) and link against some libraries and we're done? What happens to the scripts that convert the msg-files and srv-files to C++ classes? Can I easily extract that functionality or even call it from within our own CMake build-system?

Thanks for your help!


edit retag flag offensive close merge delete


I solved it buy building an arch package based on the *.deb files for ubuntu. See more here:

Sebastian Schneider gravatar image Sebastian Schneider  ( 2012-03-20 00:02:13 -0500 )edit

5 Answers

Sort by ยป oldest newest most voted

answered 2012-02-14 03:34:23 -0500

joq gravatar image

As @seanarm said, the current answer is "no".

There are significant build changes in the upcoming Fuerte release, using a more generic cmake approach.

One of the main goals is to allow external libraries (like PCL) to depend on smaller ROS components, such as messages and message generation, without adopting the entire ROS build methodology.

edit flag offensive delete link more

answered 2012-02-14 05:25:59 -0500

kwc gravatar image

@joq's answer is correct, though I'll note that you can try Fuerte Alpha now for your development. Assuming that you are on Ubuntu, you can apt-get install ros-fuerte-ros-comm and ros-fuerte-common-msgs. Both will place files in /opt/ros/fuerte that include necessary CMake find_package() macros and pkg-config settings. You merely have to point your appropriate path variables (e.g. CMake's) to find those files.

edit flag offensive delete link more


That's awesome. I'll give it a try. Thank's for what you all are doing here!

Sebastian Schneider gravatar image Sebastian Schneider  ( 2012-02-19 21:58:32 -0500 )edit

answered 2012-03-20 00:38:42 -0500

Thomas gravatar image

updated 2012-03-20 00:39:55 -0500

Sorry, but I disagree with the previous answers. You can and it is even quite straight-forward.

Problem 1: I have a non ROS software and I want to depend on a ROS package.

I have written this piece of CMake to detect ROS packages:

It relies on rospack to retrieve the flags you need, it is a simple alternative to rosbuild which is independent from ROS itself. Just copy/paste this script in your code.

To use it, you must first look for the package using:

ADD_ROSPACK_DEPENDENCY(my_ros_package) # i.e roscpp, tf or whatever you want.

And then declare a dependency between your target (binary or library) and the particular ROS package you have detected before:

USE_ROSPACK_DEPENDENCY(my_target my_ros_package) # my_target is your binary or library which will be linked against my_ros_package.

The only thing you have to do is making sure that rospack is in your path before launching cmake in your project. This is the case if you have sourced your ROS file.

Problem 2: How to get custom messages/services for my non ROS software?

There is no way to generates files corresponding to messages and services from outside ROS for now.

However, a good practice is anyway to separate ROS interfaces from the code, so you can just write a simple ROS package with just your messages and services and make your software depend on it using the strategy described in (1). Of course, this one is a ROS package living inside ROS.


In term of architecture, you should probably end up with three packages:

  • mybiglib (the one you already developped / non ROS library)
  • mybiglib_interface (the ROS messages and services, no code, use the ROS build system for now)
  • mybiglib-ros (the ROS bridge / non ROS library, depending on ROS using the strategy describe in (1) and in particular depends on mybiglib_interface)

And that's it :)

I use this solution for my developments and I never ran in any kind of trouble.

edit flag offensive delete link more

answered 2012-02-14 03:03:40 -0500

seanarm gravatar image

The short answer is no. In order to make a ROS node, you need a ROS installation. In the past, I've also wanted a drop-in ROS library with development header files, so I understand what you're going for.

The prescribed way to do what you're trying to do, given you have a bunch of pre-existing code, is as follows: Form your code into libraries that can be used by a set of executable ROS nodes that all speak the ROS language. For example, if you have an image transform class that takes an image and spits out the transformed image, you'll include that as an external library to a ROS node that has the same interfaces.

Here's the ROS tutorial for wrapping external libraries: Wrapping External Libraries

edit flag offensive delete link more

answered 2012-03-20 00:03:20 -0500

Sebastian Schneider gravatar image

I solved it buy building an arch package based on the *.deb files for ubuntu. See more here:

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2012-02-13 21:45:42 -0500

Seen: 842 times

Last updated: Mar 20 '12