[ros-users] catkin_make convenience improvements

William Woodall wwoodall at willowgarage.com
Fri Feb 1 09:10:43 UTC 2013


Well its on us that you are having trouble finding documentation and
information about catkin (but we are working on that).

On Fri, Feb 1, 2013 at 12:29 AM, Claudio Carbone <cla_carbone at tiscali.it>wrote:

> Maybe an answer from a noob user could be of interest here.
>
> Context: started with fuerte, wrote some simple nodes, recently tried
> moving on to groovy.
>
> The whole catkin thing was a huge blow after the already inexplicable
> roscreatepkg+rosmake.
> I still don't understand why do I have to learn another series of build
> tools when there is cmake+make.
>

You're in luck, you don't have to learn anything new.  All of the caktin*
commands are just wrappers around cmake+make.  You can download any catkin
package and build it like you would any cmake package (mkdir build && cd
build && cmake .. && make).  An improvement on plain CMake, catkin can
build multiple packages together at once using a very light weight
workspace.  The workspace is just a folder with catkin packages in it and a
special catkin CMakeLists.txt file at the root.


> On fuerte I ended up using cmake most of the times (after one pass of
> rosmake to generate msgs or services) as I could not get rosmake to update
> the makefiles if I changed the configuration.
>

For rosbuild you can just invoke make in the root of any package to build
it, completely circumventing the rosmake tool. The drawback being that your
dependencies might not be built yet...


>
> Now with groovy I totally don't get the workspace thing and the new
> command.
>

A quick tutorial, without using any special catkin tools, on how to make a
catkin workspace:

$ mkdir -p catkin_ws
$ cd catkin_ws
... Checkout one or more catkin packages here
$ ln -s /path/to/catkin/cmake/toplevel.cmake ./CMakeLists.txt
... you can also use one of our "tools" to do this automagically:
`catkin_init_workspace`
$ mkdir build
$ cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=../install
$ make
$ make install

At this point the catkin_ws/install dir contains all of your installed
packages.


>
> Plus at least there are rosmake examples out there, while catkin ones are
> difficult to come by.
>

catkin is still new, we are working hard to get it documentation and
presence on par with rosmake, but as you can imagine that is not easy.


>
> And on top of this all, I can't see how to integrate catkin in IDEs which
> to me is a must if you really want to code for ROS.
>

You can use any CMake generator on a catkin workspace.  You could do
something like this (extending the previous section):

$ cd catkin_ws/build
$ cmake ../src -DCMAKE_INSTALL_PREFIX=../install -GXcode
$ open Project.xcodeproj

For instance.


>
> Now this is the perspective of a programmer just approaching ROS, not
> criticizing anyone. But I want to stress that, not being part of the inner
> circle, some things appear strange and unmotivated (new wheels every time).
>

After all of that, if you still don't want to use catkin then just write
your stuff in CMake and find_package us:

find_package(roscpp REQUIRED)

include_directories(${roscpp_INCLUDE_DIRS})
...
target_link_libraries(target ${roscpp_LIBRARIES})

Or use build system you want and find any ROS package with pkg-config:

$ pkg-config --libs roscpp
-L/Users/william/ros_catkin_ws/install_isolated/lib -lroscpp
-l:/usr/local/lib/libboost_signals-mt.dylib
-l:/usr/local/lib/libboost_filesystem-mt.dylib -lrosconsole
-l:/usr/local/lib/libboost_regex-mt.dylib
-l:/usr/local/lib/liblog4cxx.dylib -lxmlrpcpp -lroscpp_serialization
-lrostime -l:/usr/local/lib/libboost_date_time-mt.dylib
-l:/usr/local/lib/libboost_system-mt.dylib
-l:/usr/local/lib/libboost_thread-mt.dylib -lcpp_common

catkin has been our best effort to move all of our build systems to a
conventional CMake system, adding tools and custom conventions only where
CMake simply doesn't meet our needs.

I hope this clears up some of your concerns Claudio and gives everyone else
an idea of what processes we intended `catkin_make` simplify.


> Best regards
> Claudio
> -- Inviato dal mio cellulare Android con K-9 Mail.
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>


-- 
William Woodall
Willow Garage - Software Engineer
wwoodall at willowgarage.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20130201/b13d2c16/attachment-0004.html>


More information about the ros-users mailing list