In ROS2 is there a way to determine the publisher's name in a subscription callback?
I believe in ROS1 there's an alternate callback form for subscriptions which provides the node name of the publisher via an additional object containing metadata about the message. Is such a mechanism available in ROS2? I've been looking through subscription options and IntraProcessManager (looks like it may be experimental class), but haven't really found something.
Asked by jeremya on 2022-03-31 13:24:32 UTC
Comments
It's at least using
message_filters
andMessageEvent
code: https://github.com/ros2/message_filters/blob/6915b38575e2965c02357308f25e73a5537e5210/include/message_filters/message_event.h#L70
Related question https://answers.ros.org/question/370732/getting-name-of-node-with-message-event/
Asked by jeremya on 2022-04-01 10:39:44 UTC