0
$\begingroup$

Rosanswers logo

Scenario:

  • 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" ?


Originally posted by knxa on ROS Answers with karma: 811 on 2018-09-22

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Delb with karma: 3907 on 2018-09-24

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by gvdhoorn on 2018-09-24:
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.

Comment by Delb on 2018-09-24:
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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.