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

Should C/C++ packages run_depend on *_msgs packages?

asked 2016-07-06 10:41:38 -0500

v4hn gravatar image

While cleaning up MoveIt!'s build structure ( https://github.com/ros-planning/movei... ), I noticed that the packages run_depend on all the *_msgs packages they use. (std_msgs, geometry_msgs, sensor_msgs, ...)

To the best of my knowledge all these _msgs packages w.r.t. C++-only projects only consist of header files that are not required at run-time. Should the run_depends be removed? Is it good/bad practice to have them in there?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2016-07-06 11:53:13 -0500

ahendrix gravatar image

In most cases, you should keep the run_depends on the message packages.

If you're building a ROS node in C++ that subscribes or publishes messages of a particular type, you should have a run_depend on that type so that it's available to debugging tools like rostopic that are written in python.

If you're building a C++ library that publishes or subscribes to messages, the same idea applies.

In either case, don't assume that another package will provide the dependency for you; that package may not need it.

edit flag offensive delete link more

Comments

There is no need to have "another package provide the dependency", because the binary/library itself simply does not have that dependency. However, it does make sense to require the run_depend for generic python tools like rostopic!

v4hn gravatar image v4hn  ( 2016-07-06 13:39:09 -0500 )edit
0

answered 2016-07-06 11:00:36 -0500

dornhege gravatar image

Good question. I'm not sure, if they're necessary in principle, but it sounds weird to me to run a binary on a system without the specific msg packages.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-07-06 10:41:38 -0500

Seen: 197 times

Last updated: Jul 06 '16