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

Packages vs nodes

asked 2011-02-19 08:57:48 -0600

Yogi gravatar image

updated 2011-11-26 04:37:52 -0600

joq gravatar image

I am writing a bunch of different nodes for a robot. I am trying to understand the difference between writing different nodes , each in its own package, versus putting all the nodes in the same package.

What are the benefits/drawbacks for either approach.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
19

answered 2011-02-19 15:31:50 -0600

joq gravatar image

updated 2011-03-01 13:21:07 -0600

There are no hard and fast rules. Some suggestions:

  • Each ROS package is built as a unit:
    • Pay attention to package dependencies. Avoid combining nodes that pull in mutually unneeded dependencies.
    • Avoid combining nodes that are often used separately (to eliminate unnecessary build overhead).
  • The overhead of an extra ROS package is not very large. Define separate packages wherever they make sense.

  • If a group of nodes with similar dependencies are generally used together, consider combining them in a single package.

  • If some nodes have common dependencies on shared code that you do not wish to export publicly, they can be combined internally within a single package.

  • If the shared code should be exported, consider making it a separate package that the others depend on. (This is reasonable, but not required. A single package can export libraries and headers as well as nodes.)

  • Choose package names carefully:

    • Node names are local within their package, but package names are global to the entire ROS ecosystem.
    • They are messy to change later.
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2011-02-19 08:57:48 -0600

Seen: 6,794 times

Last updated: Mar 01 '11