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

Revision history [back]

click to hide/show revision 1
initial version

answered 2012-08-16 04:38:58 -0500

joq gravatar image

Why do you need that information?

The usual ROS practice is to distinguish topics, but decouple subscribers from worrying about which node published each message.

To work around that: add a source field to your message (or wrap some standard message in a custom message containing one), and define constants for the message sources you wish to distinguish. Then clients can tell the source without needing to worry about other nodes coming, going and restarting.

click to hide/show revision 2
link to observation message

Why do you need that information?

The usual ROS practice is to distinguish topics, but decouple subscribers from worrying about which node published each message.

To work around that: add a source field to your message (or wrap some standard message in a custom message containing one), and define constants for the message sources you wish to distinguish. Then clients can tell the source without needing to worry about other nodes coming, going and restarting.

I did something similar in this custom message.