First time here? Check out the FAQ!


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

Message order with multiple publishers to same latched topic

asked Sep 22 '18

knxa gravatar image

updated Sep 24 '18

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

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
1

answered Sep 24 '18

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.

Preview: (hide)

Comments

1

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  ( Sep 24 '18 )edit
1

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  ( Sep 24 '18 )edit

Question Tools

1 follower

Stats

Asked: Sep 22 '18

Seen: 2,802 times

Last updated: Sep 24 '18