Skip to content

Commit

Permalink
fix: update new subs with dds from publisher (backport #940)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnikitop authored and sea-bass committed Oct 3, 2024
1 parent 9f45b8e commit f1a368b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ def subscribe(self, client_id, callback):
# In any case, the first message is handled using new_sub_callback,
# which adds the new callback to the subscriptions dictionary.
self.new_subscriptions.update({client_id: callback})
infos = self.node_handle.get_publishers_info_by_topic(self.topic)
if any(pub.qos_profile.durability == DurabilityPolicy.TRANSIENT_LOCAL for pub in infos):
self.qos.durability = DurabilityPolicy.TRANSIENT_LOCAL
if any(pub.qos_profile.reliability == ReliabilityPolicy.BEST_EFFORT for pub in infos):
self.qos.reliability = ReliabilityPolicy.BEST_EFFORT
if self.new_subscriber is None:
self.new_subscriber = self.node_handle.create_subscription(
self.msg_class,
Expand Down

0 comments on commit f1a368b

Please sign in to comment.