0
$\begingroup$

Rosanswers logo

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

Thanks,


Originally posted by madmage on ROS Answers with karma: 293 on 2014-02-13

Post score: 1


Original comments

Comment by dornhege on 2014-02-13:
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.

Comment by madmage on 2014-02-13:
Hi Christian, glad to see you here ;-) I see what you say http://wiki.ros.org/catkin/migrating_from_rosbuild#Prerequisites , 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?

Comment by dornhege on 2014-02-13:
The other way around works: rosbuild packages can depend on catkin packages.

Comment by madmage on 2014-02-13:
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.

Comment by dornhege on 2014-02-14:
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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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:

include_directories($ENV{G2O_FRONTEND_ROOT}/ros_packages/robot_eye_driver/msg_gen/cpp/include

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 :-).


Originally posted by madmage with karma: 293 on 2014-02-14

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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