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

Message order with multiple publishers to same latched topic

asked 2018-09-22 14:17:52 -0500

knxa gravatar image

updated 2018-09-24 00:38:23 -0500


  • a node A publishes "hello" to a latched topic /x with queue size 1
  • then a node B publishes "world" to the same latched topic /x with queue size 1

Because of the latched topics, I assume a late subscriber will receive both "hello" and then "world", correct?

But is the order guaranteed, will he always receive "hello", then "world" ?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2018-09-24 01:12:22 -0500

Delb gravatar image

According to the wiki :

latch [optional]

Enables "latching" on a connection. When a connection is latched, the last message published is saved and automatically sent to any future subscribers that connect. This is useful for slow-changing to static data like a map. Note that if there are multiple publishers on the same topic, instantiated in the same node, then only the last published message from that node will be sent, as opposed to the last published message from each publisher on that single topic.

So with your scenario your assumption is correct. For the order, I tried your scenario and there wasn't any specific ordrer when subscribing to the topic so no the order isn't guaranteed.

edit flag offensive delete link more



I don't believe this answers @knxa's question: he asks about multiple nodes, while the wiki you quote discusses multiple publishers in the same node.

gvdhoorn gravatar image gvdhoorn  ( 2018-09-24 01:24:33 -0500 )edit

I understood the end of the quote as the case with multiples node but when reading it again I might have made a mistake. But anyway I tried his scenario using two different nodes and the messages weren't the same order each time.

Delb gravatar image Delb  ( 2018-09-24 01:30:48 -0500 )edit

Question Tools

1 follower


Asked: 2018-09-22 14:17:52 -0500

Seen: 2,714 times

Last updated: Sep 24 '18