Skip to content

Commit

Permalink
Updated republisher callback groups
Browse files Browse the repository at this point in the history
  • Loading branch information
amalnanavati committed Sep 15, 2023
1 parent 564b83e commit 59ad4cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ada_feeding_perception/ada_feeding_perception/republisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# Third-party imports
from rcl_interfaces.msg import ParameterDescriptor, ParameterType
import rclpy
from rclpy.callback_groups import MutuallyExclusiveCallbackGroup
from rclpy.executors import MultiThreadedExecutor
from rclpy.node import Node

Expand Down Expand Up @@ -79,6 +80,7 @@ def __init__(self) -> None:
topic=self.from_topics[i],
callback=callback,
qos_profile=1, # TODO: we should get and mirror the QOS profile of the from_topic
callback_group=MutuallyExclusiveCallbackGroup(),
)
self.subs.append(subscriber)

Expand Down Expand Up @@ -183,7 +185,7 @@ def main(args=None):
republisher = Republisher()

# Use a MultiThreadedExecutor to enable processing goals concurrently
executor = MultiThreadedExecutor()
executor = MultiThreadedExecutor(num_threads=len(republisher.subs))

rclpy.spin(republisher, executor=executor)

Expand Down

0 comments on commit 59ad4cf

Please sign in to comment.