Rosanswers logo


I have few publishers in my system, some of them publish at a pre-defined rate and other publish only when there is a change in their variable value. I was wondering if there is a way, when a new subscriber subscribes after the node has started and the subscriber should receive the last published message.

It's not related to loos of packet. It's just that the subscriber doesn't exists when the publisher published previous message.

Thank you

Originally posted by BhanuKiran.Chaluvadi on ROS Answers with karma: 241 on 2021-06-09

Post score: 0


1 Answer 1


Rosanswers logo

(With the preface that I haven't actually implemented this myself yet, so I can't guarantee that it works) it seems like setting the DDS Quality of Service setting of your publisher to transient local might do the trick. More on QoS options here

This tutorial may help with modifying the default QoS for a publisher.

Originally posted by shonigmann with karma: 1567 on 2021-06-09

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by BhanuKiran.Chaluvadi on 2021-06-10:
Thanks @shonigmann . I made a quick test and it is working.. But for the benefit of other people landing here: latch is the key word, Here is an example from other ros-answer

Comment by shonigmann on 2021-06-10:
Great to hear it worked out, thanks for the update

Comment by hacker1024 on 2023-02-26:
This will also only work correctly if a reliable reliability is selected.


Your Answer

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