ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

use custom messages from another package

asked 2014-02-13 05:04:28 -0500

madmage gravatar image

Dear all, I am a newbie of ROS, and I am searching for the answer to this simple question since this morning. I have a rosbuild package, that generates some custom messages (headers are generated accordingly) and another, catkin-based, package that should use them. How should I do? In particular, I need to know: 1) how to make the catkin build system aware of the location of the message headers 2) how to be sure that the catkin build system will link the messages to my node


edit retag flag offensive close merge delete



As far as I know that's impossible as catkin packages can only depend on catkin packages and not rosbuild packages. If that is correct, the simplest solution would be to convert the message package to catkin.

dornhege gravatar image dornhege  ( 2014-02-13 05:11:33 -0500 )edit

Hi Christian, glad to see you here ;-) I see what you say , granted that the only solution is to convert the rosbuild package to catkin, how do I add this dependency to the first package, so that I can include/link to my nodes?

madmage gravatar image madmage  ( 2014-02-13 05:20:13 -0500 )edit

The other way around works: rosbuild packages can depend on catkin packages.

dornhege gravatar image dornhege  ( 2014-02-13 05:31:11 -0500 )edit

Ok, I finally have things working by hacking the CMakeLists.txt (with something similar to find_package). I just expected that catkin, newest, was back-compatible, instead of being the oldest forward-compatible :-D. Thanks.

madmage gravatar image madmage  ( 2014-02-13 22:52:17 -0500 )edit

It's somewhat the other way around :) If you can add what you did as an answer that might be helpful for others that stumble upon this.

dornhege gravatar image dornhege  ( 2014-02-13 23:57:45 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-02-14 01:55:47 -0500

madmage gravatar image

I found a hack, rather than a solution. I do not know anything about the dynamic linking of the unmarshalled objects at runtime, I only put this line:


in the CMakeLists.txt of the package, because I know that the environment variable for G2O_FRONTEND is set. Alternatively, any other way to find the correct package should work, so that you can replace $ENV{G2O_FRONTEND_ROOT}/ros_packages/robot_eye_driver with the root of the package you need.

I do not know how it can work without linking the object file that include the messages, but maybe this is the black magic of ROS internal marshalling/unmarshalling system :-).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-02-13 05:04:28 -0500

Seen: 1,831 times

Last updated: Feb 14 '14