Skip to content

Commit

Permalink
Merge branch 'ros2' into fix-list-tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
EzraBrooks authored Aug 15, 2024
2 parents f4edfb6 + febe1c4 commit 9ada4a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
12 changes: 6 additions & 6 deletions ROSBRIDGE_PROTOCOL.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ ROS operations:
* **call_service** - a service call
* **service_response** - a service response
* Actions:
* **advertise_action** - advertise an external action server
* **unadvertise_action** - unadvertise an external action server
* **send_action_goal** - a goal sent to an action server
* **cancel_action_goal** - cancel an in-progress action goal
* **action_feedback** - feedback messages from an action server
* **action_result** - an action result
* **advertise_action** - advertise an external action server
* **unadvertise_action** - unadvertise an external action server
* **send_action_goal** - a goal sent to an action server
* **cancel_action_goal** - cancel an in-progress action goal
* **action_feedback** - feedback messages from an action server
* **action_result** - an action result

In general, actions or operations that the client takes (such as publishing and
subscribing) have opcodes which are verbs (subscribe, call_service, unadvertise
Expand Down
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 All @@ -196,7 +201,7 @@ def unsubscribe(self, client_id):
with self.rlock:
if client_id in self.new_subscriptions:
del self.new_subscriptions[client_id]
else:
if client_id in self.subscriptions:
del self.subscriptions[client_id]

def has_subscribers(self):
Expand Down

0 comments on commit 9ada4a0

Please sign in to comment.