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

Revision history [back]

I would say first approach is more ROS-approach. Since you are working with same data types and only topic name is different, you can just have array of publishers and send data accordingly, so you don't have duplicate code.

The second approach IMHO is not clean, because components receive messages not intended for them. Also you are generating more traffic through ROS network since you are sending all the time messages to N other nodes.