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

Identity of message publisher

asked 2015-08-19 06:44:51 -0500

Mehdi. gravatar image

How to find out who published a message (node name), especially for the topic tf, where many nodes are publishing different transforms.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-08-19 07:01:58 -0500

By using the MessageEvent callback signature you can use the getPublisher() function to retrieve the publisher name (in roscpp). The same appears to be possible in rospy by using Connection Information.

edit flag offensive delete link more

Comments

I see that this doesn't work when using Connection Information and bags as the callerid will always be the rosbag player, is it the same case for cpp?

Mehdi. gravatar image Mehdi.  ( 2015-08-19 07:48:01 -0500 )edit

If you play back bags, rosbag effectively is the publisher. I think the connection header approach will therefore not work with rosbag. I'm not sure there is a way to recover the publisher id when playing back bagfiles (I guess not).

Stefan Kohlbrecher gravatar image Stefan Kohlbrecher  ( 2015-08-19 08:59:19 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2015-08-19 06:44:51 -0500

Seen: 703 times

Last updated: Aug 19 '15