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

Separate Package for Messages?

asked 2013-09-24 05:21:43 -0500

pnyholm gravatar image

I have recently begun migrating from ROS fuerte to hydro which means I am making the leap from rosbuild to catkin. With rosbuild, I never experienced any issues where during the build process message .h files could not be located. (similar to an issue posted here http://answers.ros.org/question/62092/catkin_make-started-failing-to-generate-h-from-msg/). While searching the web for solutions to this problem I have run into a few comments that suggest making a separate package containing your messages is a good idea (which I never really heard of while using fuerte and rosbuild). I was wondering what the pros and cons are of making a message package. Is it considered good practice? Should I make one package containing all the messages for my system, or several small message packages to make the code more modular?

Thanks for any help and insight you might be able to offer.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2013-09-24 05:33:24 -0500

dornhege gravatar image

updated 2013-09-24 23:18:36 -0500

This is independent from the build system. The main reason for that suggestion is dependencies.

Cons:

  • Extra package

Pros:

  • Extra package makes it clear where your ROS interface lies (named ..._msgs)
  • Any package can depend on this msgs package! Otherwise you'd need to decide, where the messages are. This easily leads to trouble, due to interpackage dependencies, e.g. a library used by another one.
  • A message-only package can be built independently of any other code. Any external package can depend easily on this.
edit flag offensive delete link more

Comments

2

You are forgetting one essential interest: you can make compile messages only packages very easily and once this is done you can use the introspection tool (`rostopic`, `rosservice`) with these types automagically! You don't always want to to build the whole stack in these cases...

Thomas gravatar image Thomas  ( 2013-09-24 21:28:23 -0500 )edit

My third point was supposed to mean that. I'll reformulate it to be more clear.

dornhege gravatar image dornhege  ( 2013-09-24 23:17:26 -0500 )edit

Question Tools

Stats

Asked: 2013-09-24 05:21:43 -0500

Seen: 1,121 times

Last updated: Sep 24 '13