Skip to content

Commit

Permalink
Merge pull request #10 from rogy-AquaLab/mt
Browse files Browse the repository at this point in the history
Use `MultiThreadedExecutor`
  • Loading branch information
H1rono committed Jun 3, 2024
2 parents 2b2f315 + a5cd503 commit 514b5ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions device/nucleo_communicate_py/nucleo_communicate_py/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
import sys

import rclpy
from rclpy.executors import SingleThreadedExecutor, ExternalShutdownException
from rclpy.executors import MultiThreadedExecutor, ExternalShutdownException

from .mutex_serial import MutexSerial
from .receiver import Receiver
from .sender import Sender

from .mutex_serial import MutexSerial


def main(args=sys.argv):
rclpy.init(args=args)
Expand All @@ -20,7 +19,7 @@ def main(args=sys.argv):
sender = Sender(mutex_serial)
receiver = Receiver(mutex_serial)

executor = SingleThreadedExecutor()
executor = MultiThreadedExecutor()
executor.add_node(sender)
executor.add_node(receiver)
executor.spin()
Expand Down
4 changes: 2 additions & 2 deletions device/pi_i2c/pi_i2c/all.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys

import rclpy
from rclpy.executors import SingleThreadedExecutor, ExternalShutdownException
from rclpy.executors import MultiThreadedExecutor, ExternalShutdownException

from .depth import Depth
from .imu import Imu
Expand All @@ -13,7 +13,7 @@ def main(args=sys.argv):
depth = Depth()
imu = Imu()

executor = SingleThreadedExecutor()
executor = MultiThreadedExecutor()
executor.add_node(depth)
executor.add_node(imu)
executor.spin()
Expand Down

0 comments on commit 514b5ff

Please sign in to comment.