Robotics StackExchange | Archived questions

Why does rosbag_storage add "topic" to the connection header?

rosbagstorage makes a copy of the connection header and adds the "topic" to it: https://github.com/ros/roscomm/blob/indigo-devel/tools/rosbag_storage/include/rosbag/bag.h#L502-L503

This was apparently added to mitigate an issue introduced by https://github.com/ros/ros_comm/commit/5362f2cf8a6282baf569974a3b13af3723ebb92d

However, as far as I can tell the topic should already be in the header (and experimentally, when I subscribe with a MessageEvent callback, event.getConnectionHeader()["topic"] does have the topic name): https://github.com/ros/ros_comm/blame/indigo-devel/clients/roscpp/src/libros/intraprocess_publisher_link.cpp#L72

Am I missing something? Why was it necessary to add the topic separately?

Unfortunately, the old relevant trac issues #3727 (motivation for this change) / #3755 (issue arising as a result of that change) are gone:
http://lists.ros.org/pipermail/ros-users/2011-December/065317.html
http://lists.ros.org/pipermail/ros-users/2011-October/065018.html

Asked by jtbandes on 2017-07-20 14:41:54 UTC

Comments

You might file a ticket on the repo in this situation.

Asked by allenh1 on 2017-07-20 16:50:25 UTC

@allenh1 Is a ticket appropriate for just a question? This isn't necessarily a bug, I just don't understand why it is written this way...

Asked by jtbandes on 2017-07-20 17:52:14 UTC

If you have a better solution, you should absolutely file a PR, and if it's just a question, you might just ask and then flag it as "question" in a tag. You might not get an answer immediately, but eventually the maintainer will get back to you.

Asked by allenh1 on 2017-07-20 18:11:21 UTC

Answers